Package org.alfresco.repo.site
Class SiteServiceImpl
java.lang.Object
org.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.repo.site.SiteServiceImpl
- All Implemented Interfaces:
EventListener,NodeArchiveServicePolicies.BeforePurgeNodePolicy,NodeArchiveServicePolicies.BeforeRestoreArchivedNodePolicy,NodeArchiveServicePolicies.OnRestoreArchivedNodePolicy,NodeServicePolicies.OnRestoreNodePolicy,ClassPolicy,Policy,SiteModel,SiteServiceInternal,SiteService,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware,org.springframework.context.ApplicationListener
public class SiteServiceImpl
extends org.springframework.extensions.surf.util.AbstractLifecycleBean
implements SiteServiceInternal, SiteModel, NodeArchiveServicePolicies.BeforePurgeNodePolicy, NodeServicePolicies.OnRestoreNodePolicy, NodeArchiveServicePolicies.BeforeRestoreArchivedNodePolicy, NodeArchiveServicePolicies.OnRestoreArchivedNodePolicy
Site Service Implementation. Also bootstraps the site DM stores.
- Author:
- Roy Wetherall
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy
Policy.ArgNested classes/interfaces inherited from interface org.alfresco.service.cmr.site.SiteService
SiteService.SiteMembersCallback, SiteService.SortFields -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static org.apache.commons.logging.LogLoggerstatic final StoreRefThe DM store where site's are keptFields inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
logFields inherited from interface org.alfresco.repo.node.NodeArchiveServicePolicies.BeforePurgeNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeArchiveServicePolicies.BeforeRestoreArchivedNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeArchiveServicePolicies.OnRestoreArchivedNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnRestoreNodePolicy
QNAMEFields inherited from interface org.alfresco.repo.site.SiteModel
ASPECT_SITE_CONTAINER, PROP_COMPONENT_ID, PROP_SITE_PRESET, PROP_SITE_VISIBILITY, SITE_COLLABORATOR, SITE_CONSUMER, SITE_CONTRIBUTOR, SITE_CUSTOM_PROPERTY_PREFIX, SITE_CUSTOM_PROPERTY_URL, SITE_MANAGER, SITE_MODEL_PREFIX, SITE_MODEL_URL, STANDARD_PERMISSIONS, TYPE_SITE, TYPE_SITESFields inherited from interface org.alfresco.service.cmr.site.SiteService
DOCUMENT_LIBRARY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforePurgeNode(NodeRef nodeRef) Called before a node is purged (deleted from archive).voidbeforeRestoreArchivedNode(NodeRef nodeRef) Called before an archived node is restored.booleancanAddMember(String shortName, String authorityName, String role) Can the current user add the authority "authorityName" to the site "shortName" with role "role"?voidcleanSitePermissions(NodeRef targetNode, SiteInfo containingSite) This method recursively cleans the site permissions on the specified NodeRef and all its primary descendants.intcountAuthoritiesWithRole(String shortName, String role) createContainer(String shortName, String componentId, QName containerType, Map<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)createSite(String sitePreset, String passedShortName, String title, String description, boolean isPublic) Create a new site.createSite(String sitePreset, String passedShortName, String title, String description, SiteVisibility visibility) Create a new site.createSite(String sitePreset, String passedShortName, String title, String description, SiteVisibility visibility, QName siteType) Create a new site.voiddeleteSite(String shortName) Delete the site.protected voiddeleteSiteImpl(String shortName) This method will find allsitesavailable to the currently authenticated user based on the specified site filter and result set size.This method will find allsitesavailable to the currently authenticated user based on the specified site filter, site preset filter and result set size.getContainer(String shortName, String componentId) Gets the "container" folder for the specified component.getMembersRole(String shortName, String authorityName) getMembersRoleInfo(String shortName, String authorityName) Gets the extended role information of the specified user.getMembersRoles(String shortName, String authorityName) Gets site information based on the short name of a site.This method gets theSiteInfofor the Share Site which contains the given NodeRef.static NodeRefgetSiteContainer(String siteShortName, String componentName, boolean create, SiteService siteService, TransactionService transactionService, TaggingService taggingService) Helper method to create a container if missing, and mark it as a tag scope if it isn't already onegetSiteGroup(String shortName) Gets the sites group.getSiteGroup(String shortName, boolean withGroupPrefix) Helper method to get the name of the site groupgetSiteRoleGroup(String shortName, String role) Gets the sites role group.getSiteRoleGroup(String shortName, String permission, boolean withGroupPrefix) Helper method to get the name of the site permission groupGets a list of all the currently available roles that a user can perform on all sitesgetSiteRoles(String shortName) Gets a list of all the currently available roles that a user can perform on a specific site.getSiteRoles(QName type) Get the node reference that is the site rootgetSiteShortName(NodeRef nodeRef) This method gets the shortName for the Share Site which contains the given NodeRef.booleanhasContainer(String shortName, String componentId) Determines if a "container" folder for the specified component exists.booleanThis method checks if the currently authenticated user has permission to create sites.booleanReturns true if the site exists.voidinit()Checks that all necessary properties and services have been provided.booleanIndicates whether an authority is a member of a site or notbooleanisSiteAdmin(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 siteorg.alfresco.query.PagingResults<SiteGroupMembership>listGroupMembersPaged(String shortName, List<Pair<SiteService.SortFields, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) Returns a paged list of the groups for the site.voidlistMembers(String shortName, String nameFilter, String roleFilter, boolean includeUsers, boolean includeGroups, boolean expandGroups, SiteService.SiteMembersCallback callback) List the members of the site.voidlistMembers(String shortName, String nameFilter, String roleFilter, boolean collapseGroups, SiteService.SiteMembersCallback callback) listMembers(String shortName, String nameFilter, String roleFilter, int size) List the members of the site.listMembers(String shortName, String nameFilter, String roleFilter, int size, boolean expandGroups) List the members of the site.protected voidlistMembersImpl(String shortName, String nameFilter, String roleFilter, boolean expandGroups, SiteService.SiteMembersCallback callback, boolean includeUsers, boolean includeGroups) listMembersImpl(String shortName, String nameFilter, String roleFilter, int size, boolean expandGroups) listMembersInfo(String shortName, String nameFilter, String roleFilter, int size, boolean expandGroups) List the members of the site.protected List<SiteMemberInfo>listMembersInfoImpl(String shortName, String nameFilter, String roleFilter, int size, boolean expandGroups) org.alfresco.query.PagingResults<SiteMembership>listMembersPaged(String shortName, boolean collapseGroups, List<Pair<SiteService.SortFields, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) Gets the role of the specified user.listSiteMemberships(String userName, int size) Lists all the memberships in sites that the specified user is in.List all the sites that the specified user has a explicit membership to.List all the sites that the specified user has a explicit membership to.List the available sites.List the available sites.org.alfresco.query.PagingResults<SiteInfo>listSites(List<FilterProp> filterProps, List<Pair<QName, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) org.alfresco.query.PagingResults<SiteMembership>listSitesPaged(String userName, List<Pair<SiteService.SortFields, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) List all the sites that the specified user has a explicit membership to.protected voidonBootstrap(org.springframework.context.ApplicationEvent event) voidonRestoreArchivedNode(NodeRef nodeRef) Called after an archived node is restored.voidonRestoreNode(ChildAssociationRef childAssocRef) Called after an archived node is restored.protected voidonShutdown(org.springframework.context.ApplicationEvent event) voidremoveMembership(String shortName, String authorityName) Clears an authorities role within a siteresolveSite(String group) voidsetActivityService(ActivityService activityService) Set activity servicevoidsetAuthenticationContext(AuthenticationContext authenticationContext) Set authentication componentvoidsetAuthorityService(AuthorityService authorityService) Set the authority servicevoidsetBehaviourFilter(BehaviourFilter behaviourFilter) voidsetCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends Object>> cannedQueryRegistry) Set the registry ofcanned queriesvoidsetDictionaryService(DictionaryService dictionaryService) Set the dictionary servicevoidsetDirectNodeService(NodeService directNodeService) Set the unprotected node servicevoidsetEventPublisher(org.alfresco.sync.repo.events.EventPublisher eventPublisher) voidsetFileFolderService(FileFolderService fileFolderService) Set file folder servicevoidsetMembership(String shortName, String authorityName, String role) Sets the role of an authority within a sitevoidsetNamespaceService(NamespaceService namespaceService) Set Namespace servicevoidsetNodeDAO(NodeDAO nodeDAO) voidsetNodeService(NodeService nodeService) Set node servicevoidsetPermissionService(PermissionService permissionService) Set permission servicevoidsetPersonService(PersonService personService) Set person servicevoidsetPolicyComponent(PolicyComponent policyComponent) voidsetPreferenceService(PreferenceService preferenceService) Deprecated.voidsetPublicServiceAccessService(PublicServiceAccessService publicServiceAccessService) voidsetRoleComparator(Comparator<String> roleComparator) voidsetSearchService(SearchService searchService) Set search servicevoidsetSingletonCache(SimpleCache<String, Object> singletonCache) voidsetSiteNodeRefCache(SimpleCache<String, NodeRef> siteNodeRefCache) voidsetSitesPermissionsCleaner(SitesPermissionCleaner sitesPermissionsCleaner) voidsetSitesXPath(String sitesXPath) Set the path to the location of the sites root folder.voidsetSysAdminParams(SysAdminParams sysAdminParams) voidsetTaggingService(TaggingService taggingService) Set the tagging servicevoidsetTenantService(TenantService tenantService) Set the tenant servicevoidsetTransactionHelper(RetryingTransactionHelper retryingTransactionHelper) Sets helper that provides transaction callbacksvoidupdateSite(SiteInfo siteInfo) Update the site information.Methods inherited from class org.springframework.extensions.surf.util.AbstractLifecycleBean
getApplicationContext, onApplicationEvent, setApplicationContextMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
logger
protected static org.apache.commons.logging.Log loggerLogger -
SITE_STORE
The DM store where site's are kept
-
-
Constructor Details
-
SiteServiceImpl
public SiteServiceImpl()
-
-
Method Details
-
setSitesXPath
Set the path to the location of the sites root folder. For example:./app:company_home/st:sites
- Parameters:
sitesXPath- a valid XPath
-
setPreferenceService
Deprecated. -
setNodeService
Set node service -
setDirectNodeService
Set the unprotected node service -
setFileFolderService
Set file folder service -
setSearchService
Set search service -
setNamespaceService
Set Namespace service -
setPermissionService
Set permission service -
setActivityService
Set activity service -
setPersonService
Set person service -
setAuthenticationContext
Set authentication component -
setTaggingService
Set the tagging service -
setAuthorityService
Set the authority service -
setDictionaryService
Set the dictionary service- Parameters:
dictionaryService- dictionary service
-
setTenantService
Set the tenant service- Parameters:
tenantService- tenant service
-
setSingletonCache
-
setSiteNodeRefCache
-
setTransactionHelper
Sets helper that provides transaction callbacks -
setPolicyComponent
-
setRoleComparator
-
setSysAdminParams
-
setBehaviourFilter
-
setSitesPermissionsCleaner
-
setPublicServiceAccessService
-
setNodeDAO
-
setCannedQueryRegistry
public void setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends Object>> cannedQueryRegistry) Set the registry ofcanned queries -
getRoleComparator
-
init
public void init()Checks that all necessary properties and services have been provided. -
onBootstrap
protected void onBootstrap(org.springframework.context.ApplicationEvent event) - Specified by:
onBootstrapin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
onShutdown
protected void onShutdown(org.springframework.context.ApplicationEvent event) - Specified by:
onShutdownin classorg.springframework.extensions.surf.util.AbstractLifecycleBean
-
hasCreateSitePermissions
public boolean hasCreateSitePermissions()Description copied from interface:SiteServiceThis method checks if the currently authenticated user has permission to create sites.- Specified by:
hasCreateSitePermissionsin interfaceSiteService- Returns:
trueif current user can create sites, elsefalse.
-
createSite
public SiteInfo createSite(String sitePreset, String passedShortName, String title, String description, boolean isPublic) Description copied from interface:SiteServiceCreate a new site.- Specified by:
createSitein interfaceSiteService- Parameters:
sitePreset- site preset namepassedShortName- site short name, must be uniquetitle- site titledescription- site descriptionisPublic- whether the site is public or not (true = public, false = private)- Returns:
- SiteInfo information about the created site
- See Also:
-
createSite
public SiteInfo createSite(String sitePreset, String passedShortName, String title, String description, SiteVisibility visibility) Description copied from interface:SiteServiceCreate a new site.- Specified by:
createSitein interfaceSiteService- Parameters:
sitePreset- site preset namepassedShortName- site short name, must be uniquetitle- site titledescription- site descriptionvisibility- site visibility (public|moderated|private)- Returns:
- SiteInfo information about the created site
- See Also:
-
createSite
public SiteInfo createSite(String sitePreset, String passedShortName, String title, String description, SiteVisibility visibility, QName siteType) Description copied from interface:SiteServiceCreate a new site.- Specified by:
createSitein interfaceSiteService- Parameters:
sitePreset- site preset namepassedShortName- 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- Returns:
- SiteInfo information about the created site
-
getSiteGroup
Description copied from interface:SiteServiceGets the sites group. All members of the site are contained within this group.- Specified by:
getSiteGroupin interfaceSiteService- Parameters:
shortName- site short name- Returns:
- String group name
- See Also:
-
getSiteRoleGroup
Description copied from interface:SiteServiceGets the sites role group. All members assigned the given role will be members of the returned group.- Specified by:
getSiteRoleGroupin interfaceSiteService- Parameters:
shortName- site short namerole- membership role- Returns:
- String group name
- See Also:
-
getSiteGroup
Helper method to get the name of the site group- Parameters:
shortName- site short name- Returns:
- String site group name
-
getSiteRoleGroup
Helper method to get the name of the site permission group- Parameters:
shortName- site short namepermission- permission namewithGroupPrefix- - should the name have the GROUP_ prefix?- Returns:
- String site permission group name
-
getSiteRoot
Get the node reference that is the site root- Specified by:
getSiteRootin interfaceSiteService- Specified by:
getSiteRootin interfaceSiteServiceInternal- Returns:
- NodeRef node reference
-
findSites
Description copied from interface:SiteServiceThis method will find allsitesavailable to the currently authenticated user based on the specified site filter and result set size. The filter parameter will match any sites whosecm:name,cm:titleorcm:descriptioncontain 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.- Specified by:
findSitesin interfaceSiteService- Parameters:
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.- Returns:
- Site objects for all matching sites up to the maximum result size.
-
findSites
Description copied from interface:SiteServiceThis method will find allsitesavailable 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 whosecm:name,cm:titleorcm:descriptioncontain 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.- Specified by:
findSitesin interfaceSiteService- Parameters:
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.- Returns:
- Site objects for all matching sites up to the maximum result size.
-
listSites
Description copied from interface:SiteServiceList the available sites. This list can optionally be filtered by site name/title/description and/or site preset. Note: Starting with Alfresco 4.0, the filter parameter will only match sites whosecm:nameorcm:titleorcm:descriptionstart 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,SiteService.findSites(String, String, int)should be used instead.- Specified by:
listSitesin interfaceSiteService- Parameters:
nameFilter- filtersitePresetFilter- site preset filter- Returns:
- list of site information
- See Also:
-
listSites
Description copied from interface:SiteServiceList the available sites. This list can optionally be filtered by site name/title/description and/or site preset. Note: Starting with Alfresco 4.0, the filter parameter will only match sites whosecm:nameorcm:titleorcm:descriptionstart 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,SiteService.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).- Specified by:
listSitesin interfaceSiteService- Parameters:
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- Returns:
- list of site information
- See Also:
-
listSites
Description copied from interface:SiteServiceList all the sites that the specified user has a explicit membership to.- Specified by:
listSitesin interfaceSiteService- Parameters:
userName- user name- Returns:
- list of site information
-
listSites
Description copied from interface:SiteServiceList all the sites that the specified user has a explicit membership to.- Specified by:
listSitesin interfaceSiteService- Parameters:
userName- user namesize- list maximum size or zero for all- Returns:
- list of site information
- See Also:
-
listSites
public org.alfresco.query.PagingResults<SiteInfo> listSites(List<FilterProp> filterProps, List<Pair<QName, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) - Specified by:
listSitesin interfaceSiteService- Parameters:
filterProps- property filterssortProps- sorting optionspagingRequest- paging options- Returns:
- a page of SiteInfo objects.
-
resolveSite
- Specified by:
resolveSitein interfaceSiteService
-
getSite
Description copied from interface:SiteServiceGets site information based on the short name of a site.Returns null if the site can not be found.
- Specified by:
getSitein interfaceSiteService- Parameters:
shortName- the site short name- Returns:
- SiteInfo the site information
- See Also:
-
getSite
Description copied from interface:SiteServiceThis method gets theSiteInfofor the Share Site which contains the given NodeRef. If the given NodeRef is not contained within a Share Site, thennullis returned.- Specified by:
getSitein interfaceSiteService- Parameters:
nodeRef- the node whose containing site's info is to be found.- Returns:
- SiteInfo site information for the containing site or
nullif node is not in a site. - See Also:
-
getSiteShortName
Description copied from interface:SiteServiceThis method gets the shortName for the Share Site which contains the given NodeRef. If the given NodeRef is not contained within a Share Site, thennullis returned.- Specified by:
getSiteShortNamein interfaceSiteService- Parameters:
nodeRef- the node whose containing site's info is to be found.- Returns:
- String site short name for the containing site or
nullif node is not in a site. - See Also:
-
hasSite
Description copied from interface:SiteServiceReturns true if the site exists. This allows create scripts to confirm the existence of private sites - they would not normally be returned from getSite() if the user does not have permission on the site noderef.- Specified by:
hasSitein interfaceSiteService- Parameters:
shortName- the site short name- Returns:
- true if the site exists, false otherwise
- See Also:
-
updateSite
Description copied from interface:SiteServiceUpdate the site information.Note that the short name and site preset of a site can not be updated once the site has been created.
- Specified by:
updateSitein interfaceSiteService- Parameters:
siteInfo- site information- See Also:
-
deleteSite
Description copied from interface:SiteServiceDelete the site.- Specified by:
deleteSitein interfaceSiteService- Parameters:
shortName- site short name- See Also:
-
deleteSiteImpl
-
beforePurgeNode
Description copied from interface:NodeArchiveServicePolicies.BeforePurgeNodePolicyCalled before a node is purged (deleted from archive).- Specified by:
beforePurgeNodein interfaceNodeArchiveServicePolicies.BeforePurgeNodePolicy- Parameters:
nodeRef- the node reference
-
listMembers
public void listMembers(String shortName, String nameFilter, String roleFilter, boolean collapseGroups, SiteService.SiteMembersCallback callback) - Specified by:
listMembersin interfaceSiteService- Parameters:
shortName- site short namenameFilter- name filterroleFilter- role filtercollapseGroups- true if includes group member into user list, false otherwisecallback- callback
-
listMembersImpl
protected void listMembersImpl(String shortName, String nameFilter, String roleFilter, boolean expandGroups, SiteService.SiteMembersCallback callback, boolean includeUsers, boolean includeGroups) -
listMembersPaged
public org.alfresco.query.PagingResults<SiteMembership> listMembersPaged(String shortName, boolean collapseGroups, List<Pair<SiteService.SortFields, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) Description copied from interface:SiteServiceGets the role of the specified user. Returns a paged list of the members of the site. This includes both users and groups if collapseGroups is set to false, otherwise all groups that are members are collapsed into their component users and listed.- Specified by:
listMembersPagedin interfaceSiteService- Parameters:
shortName- site short namecollapseGroups- true if collapse member groups into user list, false otherwisepagingRequest- the paging request- Returns:
- the authority name and their role
-
onRestoreNode
Description copied from interface:NodeServicePolicies.OnRestoreNodePolicyCalled after an archived node is restored.- Specified by:
onRestoreNodein interfaceNodeServicePolicies.OnRestoreNodePolicy- Parameters:
childAssocRef- the newly created child association reference- See Also:
-
beforeRestoreArchivedNode
Description copied from interface:NodeArchiveServicePolicies.BeforeRestoreArchivedNodePolicyCalled before an archived node is restored.- Specified by:
beforeRestoreArchivedNodein interfaceNodeArchiveServicePolicies.BeforeRestoreArchivedNodePolicy- Parameters:
nodeRef- the node reference- See Also:
-
onRestoreArchivedNode
Description copied from interface:NodeArchiveServicePolicies.OnRestoreArchivedNodePolicyCalled after an archived node is restored.- Specified by:
onRestoreArchivedNodein interfaceNodeArchiveServicePolicies.OnRestoreArchivedNodePolicy- Parameters:
nodeRef- the node reference- See Also:
-
listMembers
public Map<String,String> listMembers(String shortName, String nameFilter, String roleFilter, int size) Description copied from interface:SiteServiceList the members of the site. This includes both users and groups.Name and role filters are optional and if not specified all the members of the site are returned.
- Specified by:
listMembersin interfaceSiteService- Parameters:
shortName- site short namenameFilter- name filterroleFilter- role filtersize- max results size crop if >0- Returns:
- the authority name and their role
- See Also:
-
listMembers
public Map<String,String> listMembers(String shortName, String nameFilter, String roleFilter, int size, boolean expandGroups) Description copied from interface:SiteServiceList the members of the site. This includes both users and groups if collapseGroups is set to false, otherwise all groups that are members are collapsed into their component users and listed.- Specified by:
listMembersin interfaceSiteService- Parameters:
shortName- site short namenameFilter- name filterroleFilter- role filtersize- max results size crop if >0expandGroups- true if includes group member into user list, false otherwise- Returns:
- the authority name and their role
-
listMembersInfo
public List<SiteMemberInfo> listMembersInfo(String shortName, String nameFilter, String roleFilter, int size, boolean expandGroups) Description copied from interface:SiteServiceList the members of the site. This includes both users and groups if collapseGroups is set to false, otherwise all groups that are members are collapsed into their component users and listed.- Specified by:
listMembersInfoin interfaceSiteService- Parameters:
shortName- site short namenameFilter- name filterroleFilter- role filtersize- max results size crop if >0expandGroups- true if includes group member into user list, false otherwise- Returns:
- List of site authorities’ information objects
- See Also:
-
listMembersImpl
-
listMembersInfoImpl
protected List<SiteMemberInfo> listMembersInfoImpl(String shortName, String nameFilter, String roleFilter, int size, boolean expandGroups) -
getMembersRoleInfo
Description copied from interface:SiteServiceGets the extended role information of the specified user.- Specified by:
getMembersRoleInfoin interfaceSiteService- Parameters:
shortName- site short nameauthorityName- full authority name (so if it's a group then its prefixed with 'GROUP_')- Returns:
- SiteMemberInfo site role information, null if none
- See Also:
-
getMembersRole
- Specified by:
getMembersRolein interfaceSiteService- See Also:
-
getMembersRoles
-
getSiteRoles
Description copied from interface:SiteServiceGets a list of all the currently available roles that a user can perform on all sites- Specified by:
getSiteRolesin interfaceSiteService- Returns:
- list of available roles
- See Also:
-
getSiteRoles
Description copied from interface:SiteServiceGets a list of all the currently available roles that a user can perform on a specific site. This will generally only differ fromSiteService.getSiteRoles()if your site is of a custom type.- Specified by:
getSiteRolesin interfaceSiteService- Returns:
- list of available roles
- See Also:
-
getSiteRoles
-
isMember
Description copied from interface:SiteServiceIndicates whether an authority is a member of a site or not- Specified by:
isMemberin interfaceSiteService- Parameters:
shortName- site short nameauthorityName- authority name (so if it's a group then its prefixed with 'GROUP_')- Returns:
- boolean true if the authority is a member of the site, false otherwise
- See Also:
-
removeMembership
Description copied from interface:SiteServiceClears an authorities role within a site- Specified by:
removeMembershipin interfaceSiteService- Parameters:
shortName- site short nameauthorityName- authority name (so if it's a group then its prefixed with 'GROUP_')- See Also:
-
canAddMember
Description copied from interface:SiteServiceCan the current user add the authority "authorityName" to the site "shortName" with role "role"?- Specified by:
canAddMemberin interfaceSiteService- Parameters:
shortName- site short name, must be uniqueauthorityName- authority to addrole- site role- Returns:
- true if the current user can add the authority to the site, false otherwise
- See Also:
-
setMembership
Description copied from interface:SiteServiceSets the role of an authority within a site- Specified by:
setMembershipin interfaceSiteService- Parameters:
shortName- site short nameauthorityName- authority name (so if it's a group then its prefixed with 'GROUP_')role- site role- See Also:
-
createContainer
public NodeRef createContainer(String shortName, String componentId, QName containerType, Map<QName, Serializable> containerProperties) Description copied from interface:SiteServiceCreates a container for a component is a site of the given container type (must be a sub-type of st:siteContainer)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.
- Specified by:
createContainerin interfaceSiteService- Parameters:
shortName- site short namecomponentId- component idcontainerType- container type to create (can be null)containerProperties- container property values (can be null)- Returns:
- noderef of container or null if a container can't be created.
- See Also:
-
cleanSitePermissions
This method recursively cleans the site permissions on the specified NodeRef and all its primary descendants. This consists of- the removal of all site permissions pertaining to a site other than the containingSite
nullthen the targetNode's current containing site is used.- Specified by:
cleanSitePermissionsin interfaceSiteService- Parameters:
targetNode- NodeRefcontainingSite- the site which the site is a member of. Ifnull, it will be calculated.
-
getContainer
Description copied from interface:SiteServiceGets the "container" folder for the specified component.- Specified by:
getContainerin interfaceSiteService- Parameters:
shortName- short name of sitecomponentId- component id- Returns:
- noderef of container
- See Also:
-
listContainers
public org.alfresco.query.PagingResults<FileInfo> listContainers(String shortName, org.alfresco.query.PagingRequest pagingRequest) Description copied from interface:SiteServiceReturns a paged list of top level containers for the site- Specified by:
listContainersin interfaceSiteService- Parameters:
shortName- short name of sitepagingRequest- paging request- Returns:
- paged list of top level containers
-
hasContainer
Description copied from interface:SiteServiceDetermines if a "container" folder for the specified component exists.- Specified by:
hasContainerin interfaceSiteService- Parameters:
shortName- short name of sitecomponentId- component id- Returns:
- true => "container" folder exists for component
- See Also:
-
getSiteContainer
public static NodeRef getSiteContainer(String siteShortName, String componentName, boolean create, SiteService siteService, TransactionService transactionService, TaggingService taggingService) Helper method to create a container if missing, and mark it as a tag scope if it isn't already one -
countAuthoritiesWithRole
- Specified by:
countAuthoritiesWithRolein interfaceSiteService
-
listSites
-
listSiteMemberships
Description copied from interface:SiteServiceLists all the memberships in sites that the specified user is in.- Specified by:
listSiteMembershipsin interfaceSiteService- Parameters:
userName- Stringsize- list maximum size or zero for all- Returns:
- a list of SiteMembership objects
-
listSitesPaged
public org.alfresco.query.PagingResults<SiteMembership> listSitesPaged(String userName, List<Pair<SiteService.SortFields, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) Description copied from interface:SiteServiceList all the sites that the specified user has a explicit membership to.- Specified by:
listSitesPagedin interfaceSiteService- Parameters:
userName- user name- Returns:
- paged list of site information
-
isSiteAdmin
Indicates whether the specified user is a site administrator or not.Note: The super/repo admin is considered to be a site administrator too.
- Specified by:
isSiteAdminin interfaceSiteService- Parameters:
userName- The user name- Returns:
- true if the specified user is a 'site administrator', false otherwise
-
setEventPublisher
public void setEventPublisher(org.alfresco.sync.repo.events.EventPublisher eventPublisher) -
listMembers
public void listMembers(String shortName, String nameFilter, String roleFilter, boolean includeUsers, boolean includeGroups, boolean expandGroups, SiteService.SiteMembersCallback callback) Description copied from interface:SiteServiceList the members of the site. This includes both users and groups. Users and groups can be controlled by passing paramsName and role filters are optional and if not specified all the members of the site are returned.
- Specified by:
listMembersin interfaceSiteService- Parameters:
shortName- site short namenameFilter- name filterroleFilter- role filterincludeUsers- includes the usersincludeGroups- include the groupsexpandGroups- true if expand group member into user list, false otherwisecallback- callback
-
listGroupMembersPaged
public org.alfresco.query.PagingResults<SiteGroupMembership> listGroupMembersPaged(String shortName, List<Pair<SiteService.SortFields, Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest) Description copied from interface:SiteServiceReturns a paged list of the groups for the site.- Specified by:
listGroupMembersPagedin interfaceSiteService- Parameters:
shortName- site short namesortProps- sorting optionspagingRequest- the paging request- Returns:
- the authority name and their role
-