@AlfrescoPublicApi
public interface SiteService
This service API is designed to support the public facing Site APIs
Modifier and Type | Interface and Description |
---|---|
static interface |
SiteService.SiteMembersCallback |
static class |
SiteService.SortFields |
Modifier and Type | Field and Description |
---|---|
static String |
DOCUMENT_LIBRARY |
Modifier and Type | Method and Description |
---|---|
boolean |
canAddMember(String shortName,
String authorityName,
String role)
Can the current user add the authority "authorityName" to the site "shortName" with role "role"?
|
void |
cleanSitePermissions(org.alfresco.service.cmr.repository.NodeRef relocatedNode,
SiteInfo containingSite)
This method cleans the permissions on the specified node.
|
int |
countAuthoritiesWithRole(String shortName,
String role) |
org.alfresco.service.cmr.repository.NodeRef |
createContainer(String shortName,
String componentId,
org.alfresco.service.namespace.QName containerType,
Map<org.alfresco.service.namespace.QName,Serializable> containerProperties)
Creates a container for a component is a site of the given container type (must be a sub-type of st:siteContainer)
|
SiteInfo |
createSite(String sitePreset,
String shortName,
String title,
String description,
boolean isPublic)
Deprecated.
since version 3.2, replaced by
createSite(String, String, String, String, SiteVisibility) |
SiteInfo |
createSite(String sitePreset,
String shortName,
String title,
String description,
SiteVisibility visibility)
Create a new site.
|
SiteInfo |
createSite(String sitePreset,
String shortName,
String title,
String description,
SiteVisibility visibility,
org.alfresco.service.namespace.QName siteType)
Create a new site.
|
void |
deleteSite(String shortName)
Delete the site.
|
List<SiteInfo> |
findSites(String filter,
int size)
This method will find all
sites available to the currently authenticated user based on
the specified site filter and result set size. |
List<SiteInfo> |
findSites(String filter,
String sitePresetFilter,
int size)
This method will find all
sites available to the currently authenticated user based on
the specified site filter, site preset filter and result set size. |
org.alfresco.service.cmr.repository.NodeRef |
getContainer(String shortName,
String componentId)
Gets the "container" folder for the specified
component.
|
String |
getMembersRole(String shortName,
String authorityName) |
SiteMemberInfo |
getMembersRoleInfo(String shortName,
String authorityName)
Gets the extended role information of the specified user.
|
SiteInfo |
getSite(org.alfresco.service.cmr.repository.NodeRef nodeRef)
This method gets the
SiteInfo for the Share Site which contains the given NodeRef. |
SiteInfo |
getSite(String shortName)
Gets site information based on the short name of a site.
|
String |
getSiteGroup(String shortName)
Gets the sites group.
|
String |
getSiteRoleGroup(String shortName,
String role)
Gets the sites role group.
|
List<String> |
getSiteRoles()
Gets a list of all the currently available roles that a user can perform on
all sites
|
List<String> |
getSiteRoles(String shortName)
Gets a list of all the currently available roles that a user can perform on
a specific site.
|
org.alfresco.service.cmr.repository.NodeRef |
getSiteRoot()
Gets the reference to the folder that is the Site root node.
|
String |
getSiteShortName(org.alfresco.service.cmr.repository.NodeRef nodeRef)
This method gets the shortName for the Share Site which contains the given NodeRef.
|
boolean |
hasContainer(String shortName,
String componentId)
Determines if a "container" folder for the specified component exists.
|
boolean |
hasCreateSitePermissions()
This method checks if the currently authenticated user has permission to create sites.
|
boolean |
hasSite(String shortName)
Returns true if the site exists.
|
boolean |
isMember(String shortName,
String authorityName)
Indicates whether an authority is a member of a site or not
|
boolean |
isSiteAdmin(String userName)
Indicates whether the specified user is a site administrator or not.
|
org.alfresco.query.PagingResults<FileInfo> |
listContainers(String shortName,
org.alfresco.query.PagingRequest pagingRequest)
Returns a paged list of top level containers for the site
|
void |
listMembers(String shortName,
String nameFilter,
String roleFilter,
boolean collapseGroups,
SiteService.SiteMembersCallback callback)
List the members of the site.
|
Map<String,String> |
listMembers(String shortName,
String nameFilter,
String roleFilter,
int size)
List the members of the site.
|
Map<String,String> |
listMembers(String shortName,
String nameFilter,
String roleFilter,
int size,
boolean collapseGroups)
List the members of the site.
|
List<SiteMemberInfo> |
listMembersInfo(String shortName,
String nameFilter,
String roleFilter,
int size,
boolean collapseGroups)
List the members of the site.
|
org.alfresco.query.PagingResults<SiteMembership> |
listMembersPaged(String shortName,
boolean collapseGroups,
List<org.alfresco.util.Pair<SiteService.SortFields,Boolean>> sortProps,
org.alfresco.query.PagingRequest pagingRequest)
Gets the role of the specified user.
|
List<SiteMembership> |
listSiteMemberships(String userName,
int size)
Lists all the memberships in sites that the specified user is in.
|
org.alfresco.query.PagingResults<SiteInfo> |
listSites(List<FilterProp> filterProps,
List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> sortProps,
org.alfresco.query.PagingRequest pagingRequest)
This method returns
paged result sets of SiteInfo objects, which should be
more efficient than the unpaged methods also available on this interface. |
List<SiteInfo> |
listSites(String userName)
List all the sites that the specified user has a explicit membership to.
|
List<SiteInfo> |
listSites(String userName,
int size)
List all the sites that the specified user has a explicit membership to.
|
List<SiteInfo> |
listSites(String filter,
String sitePresetFilter)
List the available sites.
|
List<SiteInfo> |
listSites(String filter,
String sitePresetFilter,
int size)
List the available sites.
|
org.alfresco.query.PagingResults<SiteMembership> |
listSitesPaged(String userName,
List<org.alfresco.util.Pair<SiteService.SortFields,Boolean>> sortProps,
org.alfresco.query.PagingRequest pagingRequest)
List all the sites that the specified user has a explicit membership to.
|
void |
removeMembership(String shortName,
String authorityName)
Clears an authorities role within a site
|
String |
resolveSite(String group) |
void |
setMembership(String shortName,
String authorityName,
String role)
Sets the role of an authority within a site
|
void |
updateSite(SiteInfo siteInfo)
Update the site information.
|
static final String DOCUMENT_LIBRARY
@Auditable(parameters={"sitePreset","shortName"}) SiteInfo createSite(String sitePreset, String shortName, String title, String description, boolean isPublic)
createSite(String, String, String, String, SiteVisibility)
sitePreset
- site preset nameshortName
- site short name, must be uniquetitle
- site titledescription
- site descriptionisPublic
- whether the site is public or not (true = public, false = private)@NotAuditable boolean canAddMember(String shortName, String authorityName, String role)
shortName
- site short name, must be uniqueauthorityName
- authority to addrole
- site role@Auditable(parameters={"sitePreset","shortName"}) SiteInfo createSite(String sitePreset, String shortName, String title, String description, SiteVisibility visibility)
sitePreset
- site preset nameshortName
- site short name, must be uniquetitle
- site titledescription
- site descriptionvisibility
- site visibility (public|moderated|private)@Auditable(parameters={"sitePreset","shortName"}) SiteInfo createSite(String sitePreset, String shortName, String title, String description, SiteVisibility visibility, org.alfresco.service.namespace.QName siteType)
sitePreset
- site preset nameshortName
- site short name, must be uniquetitle
- site titledescription
- site descriptionvisibility
- site visibility (public|moderated|private)siteType
- type of site to create, must be a sub-type of st:site@NotAuditable boolean hasCreateSitePermissions()
true
if current user can create sites, else false
.@NotAuditable List<SiteInfo> findSites(String filter, String sitePresetFilter, int size)
sites
available to the currently authenticated user based on
the specified site filter, site preset filter and result set size.
The filter parameter will match any sites whose cm:name
, cm:title
or cm:description
contain the specified string (ignoring case).
Note that this method uses Alfresco Full Text Search to retrieve results
and depending on server Lucene, SOLR configuration may only offer eventually consistent results.filter
- Any supplied filter will be wrapped in asterisks (e.g. '*foo*') and used to match the sites' cm:name, cm:title or cm:description.sitePresetFilter
- a site preset filter name to match against.size
- this parameter specifies a maximum result set size.@NotAuditable List<SiteInfo> findSites(String filter, int size)
sites
available to the currently authenticated user based on
the specified site filter and result set size.
The filter parameter will match any sites whose cm:name
, cm:title
or cm:description
contain the specified string (ignoring case).
Note that this method uses Alfresco Full Text Search to retrieve results
and depending on server Lucene, SOLR configuration may only offer eventually consistent results.filter
- Any supplied filter will be wrapped in asterisks (e.g. 'foo*') and used to match the sites' cm:name, cm:title or cm:description.size
- this parameter specifies a maximum result set size.@NotAuditable List<SiteInfo> listSites(String filter, String sitePresetFilter, int size)
cm:name
or
cm:title
or cm:description
start with
the specified string (ignoring case). The listing of sites whose cm:names (or titles or descriptions) contain the
specified string is no longer supported. To retrieve sites whose cm:names etc contain a substring, findSites(String, String, int)
should be used instead.
THIS METHOD CAN RETURN INCOMPLETE RESULTS WHILE CACHES CATCH UP WITH REALITY
(BM-0012: Run v420b1494_01: (CMIS) GetSites is Slow).filter
- filter (sites whose cm:name, cm:title or cm:description START WITH filter)sitePresetFilter
- site preset filter (sites whose preset EQUALS sitePresetFilter)size
- list maximum size or zero for all@NotAuditable List<SiteInfo> listSites(String filter, String sitePresetFilter)
cm:name
or
cm:title
or cm:description
start with
the specified string (ignoring case). The listing of sites whose cm:names (or titles or descriptions) contain the
specified string is no longer supported. To retrieve sites whose cm:names etc contain a substring, findSites(String, String, int)
should be used instead.filter
- filtersitePresetFilter
- site preset filter@NotAuditable List<SiteInfo> listSites(String userName)
userName
- user name@NotAuditable org.alfresco.query.PagingResults<SiteInfo> listSites(List<FilterProp> filterProps, List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
paged result sets
of SiteInfo
objects, which should be
more efficient than the unpaged methods also available on this interface. It is also guaranteed to return
fully consistent results.filterProps
- property filterssortProps
- sorting optionspagingRequest
- paging options@NotAuditable List<SiteMembership> listSiteMemberships(String userName, int size)
userName
- Stringsize
- list maximum size or zero for all@NotAuditable List<SiteInfo> listSites(String userName, int size)
userName
- user namesize
- list maximum size or zero for all@NotAuditable SiteInfo getSite(String shortName)
Returns null if the site can not be found.
shortName
- the site short name@NotAuditable SiteInfo getSite(org.alfresco.service.cmr.repository.NodeRef nodeRef)
SiteInfo
for the Share Site which contains the given NodeRef.
If the given NodeRef is not contained within a Share Site, then null
is returned.nodeRef
- the node whose containing site's info is to be found.null
if node is not in a site.@NotAuditable String getSiteShortName(org.alfresco.service.cmr.repository.NodeRef nodeRef)
null
is returned.nodeRef
- the node whose containing site's info is to be found.null
if node is not in a site.@NotAuditable boolean hasSite(String shortName)
shortName
- the site short name@Auditable void updateSite(SiteInfo siteInfo)
Note that the short name and site preset of a site can not be updated once the site has been created.
siteInfo
- site information@Auditable(parameters="shortName") void deleteSite(String shortName)
shortName
- site short name@NotAuditable void listMembers(String shortName, String nameFilter, String roleFilter, boolean collapseGroups, SiteService.SiteMembersCallback callback)
Name and role filters are optional and if not specified all the members of the site are returned.
shortName
- site short namenameFilter
- name filterroleFilter
- role filtercollapseGroups
- true if collapse member groups into user list, false otherwisecallback
- callback@NotAuditable Map<String,String> listMembers(String shortName, String nameFilter, String roleFilter, int size)
Name and role filters are optional and if not specified all the members of the site are returned.
shortName
- site short namenameFilter
- name filterroleFilter
- role filtersize
- max results size crop if >0@NotAuditable Map<String,String> listMembers(String shortName, String nameFilter, String roleFilter, int size, boolean collapseGroups)
shortName
- site short namenameFilter
- name filterroleFilter
- role filtersize
- max results size crop if >0collapseGroups
- true if collapse member groups into user list, false otherwise@NotAuditable List<SiteMemberInfo> listMembersInfo(String shortName, String nameFilter, String roleFilter, int size, boolean collapseGroups)
shortName
- site short namenameFilter
- name filterroleFilter
- role filtersize
- max results size crop if >0collapseGroups
- true if collapse member groups into user list, false otherwise@NotAuditable org.alfresco.query.PagingResults<SiteMembership> listMembersPaged(String shortName, boolean collapseGroups, List<org.alfresco.util.Pair<SiteService.SortFields,Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
shortName
- site short namecollapseGroups
- true if collapse member groups into user list, false otherwisepagingRequest
- the paging request@NotAuditable SiteMemberInfo getMembersRoleInfo(String shortName, String authorityName)
shortName
- site short nameauthorityName
- full authority name (so if it's a group then its prefixed with 'GROUP_')@NotAuditable boolean isMember(String shortName, String authorityName)
shortName
- site short nameauthorityName
- authority name (so if it's a group then its prefixed with 'GROUP_')@Auditable(parameters={"shortName","authorityName","role"}) void setMembership(String shortName, String authorityName, String role)
shortName
- site short nameauthorityName
- authority name (so if it's a group then its prefixed with 'GROUP_')role
- site roleUnknownAuthorityException
- if the site role is not supported.@Auditable(parameters={"shortName","authorityName"}) void removeMembership(String shortName, String authorityName)
shortName
- site short nameauthorityName
- authority name (so if it's a group then its prefixed with 'GROUP_')@NotAuditable org.alfresco.service.cmr.repository.NodeRef createContainer(String shortName, String componentId, org.alfresco.service.namespace.QName containerType, Map<org.alfresco.service.namespace.QName,Serializable> containerProperties)
If no container type is specified then a node of type st:siteContainer is created.
The map of container properties are set on the created container node. Null can be provided when no properties need to be set.
shortName
- site short namecomponentId
- component idcontainerType
- container type to create (can be null)containerProperties
- container property values (can be null)@NotAuditable org.alfresco.service.cmr.repository.NodeRef getContainer(String shortName, String componentId)
shortName
- short name of sitecomponentId
- component id@NotAuditable org.alfresco.query.PagingResults<FileInfo> listContainers(String shortName, org.alfresco.query.PagingRequest pagingRequest)
shortName
- short name of sitepagingRequest
- paging request@NotAuditable boolean hasContainer(String shortName, String componentId)
shortName
- short name of sitecomponentId
- component id@NotAuditable List<String> getSiteRoles()
@NotAuditable List<String> getSiteRoles(String shortName)
getSiteRoles()
if your site is of a custom type.@NotAuditable String getSiteGroup(String shortName)
shortName
- site short name@NotAuditable String getSiteRoleGroup(String shortName, String role)
shortName
- site short namerole
- membership role@NotAuditable org.alfresco.service.cmr.repository.NodeRef getSiteRoot()
void cleanSitePermissions(org.alfresco.service.cmr.repository.NodeRef relocatedNode, SiteInfo containingSite)
relocatedNode
- NodeRefcontainingSite
- SiteInfo@NotAuditable org.alfresco.query.PagingResults<SiteMembership> listSitesPaged(String userName, List<org.alfresco.util.Pair<SiteService.SortFields,Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
userName
- user name@NotAuditable boolean isSiteAdmin(String userName)
Note: The super/repo admin is considered to be a site administrator too.
userName
- The user nameCopyright © 2005–2017 Alfresco Software. All rights reserved.