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

Site Service Implementation. Also bootstraps the site DM stores.
Author:
Roy Wetherall
  • Field Details

    • logger

      protected static org.apache.commons.logging.Log logger
      Logger
    • SITE_STORE

      public static final StoreRef SITE_STORE
      The DM store where site's are kept
  • Constructor Details

    • SiteServiceImpl

      public SiteServiceImpl()
  • Method Details

    • setSitesXPath

      public void setSitesXPath(String sitesXPath)
      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 public void setPreferenceService(PreferenceService preferenceService)
      Deprecated.
    • setNodeService

      public void setNodeService(NodeService nodeService)
      Set node service
    • setDirectNodeService

      public void setDirectNodeService(NodeService directNodeService)
      Set the unprotected node service
    • setFileFolderService

      public void setFileFolderService(FileFolderService fileFolderService)
      Set file folder service
    • setSearchService

      public void setSearchService(SearchService searchService)
      Set search service
    • setNamespaceService

      public void setNamespaceService(NamespaceService namespaceService)
      Set Namespace service
    • setPermissionService

      public void setPermissionService(PermissionService permissionService)
      Set permission service
    • setActivityService

      public void setActivityService(ActivityService activityService)
      Set activity service
    • setPersonService

      public void setPersonService(PersonService personService)
      Set person service
    • setAuthenticationContext

      public void setAuthenticationContext(AuthenticationContext authenticationContext)
      Set authentication component
    • setTaggingService

      public void setTaggingService(TaggingService taggingService)
      Set the tagging service
    • setAuthorityService

      public void setAuthorityService(AuthorityService authorityService)
      Set the authority service
    • setDictionaryService

      public void setDictionaryService(DictionaryService dictionaryService)
      Set the dictionary service
      Parameters:
      dictionaryService - dictionary service
    • setTenantService

      public void setTenantService(TenantService tenantService)
      Set the tenant service
      Parameters:
      tenantService - tenant service
    • setSingletonCache

      public void setSingletonCache(SimpleCache<String,Object> singletonCache)
    • setSiteNodeRefCache

      public void setSiteNodeRefCache(SimpleCache<String,NodeRef> siteNodeRefCache)
    • setTransactionHelper

      public void setTransactionHelper(RetryingTransactionHelper retryingTransactionHelper)
      Sets helper that provides transaction callbacks
    • setPolicyComponent

      public void setPolicyComponent(PolicyComponent policyComponent)
    • setRoleComparator

      public void setRoleComparator(Comparator<String> roleComparator)
    • setSysAdminParams

      public void setSysAdminParams(SysAdminParams sysAdminParams)
    • setBehaviourFilter

      public void setBehaviourFilter(BehaviourFilter behaviourFilter)
    • setSitesPermissionsCleaner

      public void setSitesPermissionsCleaner(SitesPermissionCleaner sitesPermissionsCleaner)
    • setPublicServiceAccessService

      public void setPublicServiceAccessService(PublicServiceAccessService publicServiceAccessService)
    • setNodeDAO

      public void setNodeDAO(NodeDAO nodeDAO)
    • setCannedQueryRegistry

      public void setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends Object>> cannedQueryRegistry)
      Set the registry of canned queries
    • getRoleComparator

      public Comparator<String> 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:
      onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean
    • onShutdown

      protected void onShutdown(org.springframework.context.ApplicationEvent event)
      Specified by:
      onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean
    • hasCreateSitePermissions

      public boolean hasCreateSitePermissions()
      Description copied from interface: SiteService
      This method checks if the currently authenticated user has permission to create sites.
      Specified by:
      hasCreateSitePermissions in interface SiteService
      Returns:
      true if current user can create sites, else false.
    • createSite

      public SiteInfo createSite(String sitePreset, String passedShortName, String title, String description, boolean isPublic)
      Description copied from interface: SiteService
      Create a new site.
      Specified by:
      createSite in interface SiteService
      Parameters:
      sitePreset - site preset name
      passedShortName - site short name, must be unique
      title - site title
      description - site description
      isPublic - 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: SiteService
      Create a new site.
      Specified by:
      createSite in interface SiteService
      Parameters:
      sitePreset - site preset name
      passedShortName - site short name, must be unique
      title - site title
      description - site description
      visibility - 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: SiteService
      Create a new site.
      Specified by:
      createSite in interface SiteService
      Parameters:
      sitePreset - site preset name
      passedShortName - site short name, must be unique
      title - site title
      description - site description
      visibility - 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

      public String getSiteGroup(String shortName)
      Description copied from interface: SiteService
      Gets the sites group. All members of the site are contained within this group.
      Specified by:
      getSiteGroup in interface SiteService
      Parameters:
      shortName - site short name
      Returns:
      String group name
      See Also:
    • getSiteRoleGroup

      public String getSiteRoleGroup(String shortName, String role)
      Description copied from interface: SiteService
      Gets the sites role group. All members assigned the given role will be members of the returned group.
      Specified by:
      getSiteRoleGroup in interface SiteService
      Parameters:
      shortName - site short name
      role - membership role
      Returns:
      String group name
      See Also:
    • getSiteGroup

      public String getSiteGroup(String shortName, boolean withGroupPrefix)
      Helper method to get the name of the site group
      Parameters:
      shortName - site short name
      Returns:
      String site group name
    • getSiteRoleGroup

      public String getSiteRoleGroup(String shortName, String permission, boolean withGroupPrefix)
      Helper method to get the name of the site permission group
      Parameters:
      shortName - site short name
      permission - permission name
      withGroupPrefix - - should the name have the GROUP_ prefix?
      Returns:
      String site permission group name
    • getSiteRoot

      public NodeRef getSiteRoot()
      Get the node reference that is the site root
      Specified by:
      getSiteRoot in interface SiteService
      Specified by:
      getSiteRoot in interface SiteServiceInternal
      Returns:
      NodeRef node reference
    • findSites

      public List<SiteInfo> findSites(String filter, int size)
      Description copied from interface: SiteService
      This method will find all 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.

      Specified by:
      findSites in interface SiteService
      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

      public List<SiteInfo> findSites(String filter, String sitePresetFilter, int size)
      Description copied from interface: SiteService
      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. 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.

      Specified by:
      findSites in interface SiteService
      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

      public List<SiteInfo> listSites(String nameFilter, String sitePresetFilter)
      Description copied from interface: SiteService
      List 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 whose 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, SiteService.findSites(String, String, int) should be used instead.

      Specified by:
      listSites in interface SiteService
      Parameters:
      nameFilter - filter
      sitePresetFilter - site preset filter
      Returns:
      list of site information
      See Also:
    • listSites

      public List<SiteInfo> listSites(String filter, String sitePresetFilter, int size)
      Description copied from interface: SiteService
      List 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 whose 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, 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:
      listSites in interface SiteService
      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

      public List<SiteInfo> listSites(String userName)
      Description copied from interface: SiteService
      List all the sites that the specified user has a explicit membership to.
      Specified by:
      listSites in interface SiteService
      Parameters:
      userName - user name
      Returns:
      list of site information
    • listSites

      public List<SiteInfo> listSites(String userName, int size)
      Description copied from interface: SiteService
      List all the sites that the specified user has a explicit membership to.
      Specified by:
      listSites in interface SiteService
      Parameters:
      userName - user name
      size - 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)
      This method uses canned queries to retrieve st:site NodeRefs with support for result paging.
      Specified by:
      listSites in interface SiteService
      Parameters:
      filterProps - property filters
      sortProps - sorting options
      pagingRequest - paging options
      Returns:
      a page of SiteInfo objects.
    • resolveSite

      public String resolveSite(String group)
      Specified by:
      resolveSite in interface SiteService
    • getSite

      public SiteInfo getSite(String shortName)
      Description copied from interface: SiteService
      Gets site information based on the short name of a site.

      Returns null if the site can not be found.

      Specified by:
      getSite in interface SiteService
      Parameters:
      shortName - the site short name
      Returns:
      SiteInfo the site information
      See Also:
    • getSite

      public SiteInfo getSite(NodeRef nodeRef)
      Description copied from interface: SiteService
      This method gets the 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.
      Specified by:
      getSite in interface SiteService
      Parameters:
      nodeRef - the node whose containing site's info is to be found.
      Returns:
      SiteInfo site information for the containing site or null if node is not in a site.
      See Also:
    • getSiteShortName

      public String getSiteShortName(NodeRef nodeRef)
      Description copied from interface: SiteService
      This method gets the shortName for the Share Site which contains the given NodeRef. If the given NodeRef is not contained within a Share Site, then null is returned.
      Specified by:
      getSiteShortName in interface SiteService
      Parameters:
      nodeRef - the node whose containing site's info is to be found.
      Returns:
      String site short name for the containing site or null if node is not in a site.
      See Also:
    • hasSite

      public boolean hasSite(String shortName)
      Description copied from interface: SiteService
      Returns 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:
      hasSite in interface SiteService
      Parameters:
      shortName - the site short name
      Returns:
      true if the site exists, false otherwise
      See Also:
    • updateSite

      public void updateSite(SiteInfo siteInfo)
      Description copied from interface: SiteService
      Update 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:
      updateSite in interface SiteService
      Parameters:
      siteInfo - site information
      See Also:
    • deleteSite

      public void deleteSite(String shortName)
      Description copied from interface: SiteService
      Delete the site.
      Specified by:
      deleteSite in interface SiteService
      Parameters:
      shortName - site short name
      See Also:
    • deleteSiteImpl

      protected void deleteSiteImpl(String shortName)
    • beforePurgeNode

      public void beforePurgeNode(NodeRef nodeRef)
      Description copied from interface: NodeArchiveServicePolicies.BeforePurgeNodePolicy
      Called before a node is purged (deleted from archive).
      Specified by:
      beforePurgeNode in interface NodeArchiveServicePolicies.BeforePurgeNodePolicy
      Parameters:
      nodeRef - the node reference
    • listMembers

      public void listMembers(String shortName, String nameFilter, String roleFilter, boolean collapseGroups, SiteService.SiteMembersCallback callback)
      Specified by:
      listMembers in interface SiteService
      Parameters:
      shortName - site short name
      nameFilter - name filter
      roleFilter - role filter
      collapseGroups - true if includes group member into user list, false otherwise
      callback - 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: SiteService
      Gets 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:
      listMembersPaged in interface SiteService
      Parameters:
      shortName - site short name
      collapseGroups - true if collapse member groups into user list, false otherwise
      pagingRequest - the paging request
      Returns:
      the authority name and their role
    • onRestoreNode

      public void onRestoreNode(ChildAssociationRef childAssocRef)
      Description copied from interface: NodeServicePolicies.OnRestoreNodePolicy
      Called after an archived node is restored.
      Specified by:
      onRestoreNode in interface NodeServicePolicies.OnRestoreNodePolicy
      Parameters:
      childAssocRef - the newly created child association reference
      See Also:
    • beforeRestoreArchivedNode

      public void beforeRestoreArchivedNode(NodeRef nodeRef)
      Called before an archived node is restored.
      Specified by:
      beforeRestoreArchivedNode in interface NodeArchiveServicePolicies.BeforeRestoreArchivedNodePolicy
      Parameters:
      nodeRef - the node reference
      See Also:
    • onRestoreArchivedNode

      public void onRestoreArchivedNode(NodeRef nodeRef)
      Description copied from interface: NodeArchiveServicePolicies.OnRestoreArchivedNodePolicy
      Called after an archived node is restored.
      Specified by:
      onRestoreArchivedNode in interface NodeArchiveServicePolicies.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: SiteService
      List 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:
      listMembers in interface SiteService
      Parameters:
      shortName - site short name
      nameFilter - name filter
      roleFilter - role filter
      size - 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: SiteService
      List 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:
      listMembers in interface SiteService
      Parameters:
      shortName - site short name
      nameFilter - name filter
      roleFilter - role filter
      size - max results size crop if >0
      expandGroups - 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: SiteService
      List 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:
      listMembersInfo in interface SiteService
      Parameters:
      shortName - site short name
      nameFilter - name filter
      roleFilter - role filter
      size - max results size crop if >0
      expandGroups - true if includes group member into user list, false otherwise
      Returns:
      List of site authorities’ information objects
      See Also:
    • listMembersImpl

      protected Map<String,String> listMembersImpl(String shortName, String nameFilter, String roleFilter, int size, boolean expandGroups)
    • listMembersInfoImpl

      protected List<SiteMemberInfo> listMembersInfoImpl(String shortName, String nameFilter, String roleFilter, int size, boolean expandGroups)
    • getMembersRoleInfo

      public SiteMemberInfo getMembersRoleInfo(String shortName, String authorityName)
      Description copied from interface: SiteService
      Gets the extended role information of the specified user.
      Specified by:
      getMembersRoleInfo in interface SiteService
      Parameters:
      shortName - site short name
      authorityName - 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

      public String getMembersRole(String shortName, String authorityName)
      Specified by:
      getMembersRole in interface SiteService
      See Also:
    • getMembersRoles

      public List<String> getMembersRoles(String shortName, String authorityName)
    • getSiteRoles

      public List<String> getSiteRoles()
      Description copied from interface: SiteService
      Gets a list of all the currently available roles that a user can perform on all sites
      Specified by:
      getSiteRoles in interface SiteService
      Returns:
      list of available roles
      See Also:
    • getSiteRoles

      public List<String> getSiteRoles(String shortName)
      Description copied from interface: SiteService
      Gets a list of all the currently available roles that a user can perform on a specific site. This will generally only differ from SiteService.getSiteRoles() if your site is of a custom type.
      Specified by:
      getSiteRoles in interface SiteService
      Returns:
      list of available roles
      See Also:
    • getSiteRoles

      public List<String> getSiteRoles(QName type)
      See Also:
    • isMember

      public boolean isMember(String shortName, String authorityName)
      Description copied from interface: SiteService
      Indicates whether an authority is a member of a site or not
      Specified by:
      isMember in interface SiteService
      Parameters:
      shortName - site short name
      authorityName - 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

      public void removeMembership(String shortName, String authorityName)
      Description copied from interface: SiteService
      Clears an authorities role within a site
      Specified by:
      removeMembership in interface SiteService
      Parameters:
      shortName - site short name
      authorityName - authority name (so if it's a group then its prefixed with 'GROUP_')
      See Also:
    • canAddMember

      public boolean canAddMember(String shortName, String authorityName, String role)
      Description copied from interface: SiteService
      Can the current user add the authority "authorityName" to the site "shortName" with role "role"?
      Specified by:
      canAddMember in interface SiteService
      Parameters:
      shortName - site short name, must be unique
      authorityName - authority to add
      role - site role
      Returns:
      true if the current user can add the authority to the site, false otherwise
      See Also:
    • setMembership

      public void setMembership(String shortName, String authorityName, String role)
      Description copied from interface: SiteService
      Sets the role of an authority within a site
      Specified by:
      setMembership in interface SiteService
      Parameters:
      shortName - site short name
      authorityName - 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: SiteService
      Creates 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:
      createContainer in interface SiteService
      Parameters:
      shortName - site short name
      componentId - component id
      containerType - 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

      public void cleanSitePermissions(NodeRef targetNode, SiteInfo containingSite)
      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
      If the containingSite is null then the targetNode's current containing site is used.
      Specified by:
      cleanSitePermissions in interface SiteService
      Parameters:
      targetNode - NodeRef
      containingSite - the site which the site is a member of. If null, it will be calculated.
    • getContainer

      public NodeRef getContainer(String shortName, String componentId)
      Description copied from interface: SiteService
      Gets the "container" folder for the specified component.
      Specified by:
      getContainer in interface SiteService
      Parameters:
      shortName - short name of site
      componentId - 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: SiteService
      Returns a paged list of top level containers for the site
      Specified by:
      listContainers in interface SiteService
      Parameters:
      shortName - short name of site
      pagingRequest - paging request
      Returns:
      paged list of top level containers
    • hasContainer

      public boolean hasContainer(String shortName, String componentId)
      Description copied from interface: SiteService
      Determines if a "container" folder for the specified component exists.
      Specified by:
      hasContainer in interface SiteService
      Parameters:
      shortName - short name of site
      componentId - 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

      public int countAuthoritiesWithRole(String shortName, String role)
      Specified by:
      countAuthoritiesWithRole in interface SiteService
    • listSites

      public List<SiteInfo> listSites(Set<String> siteNames)
    • listSiteMemberships

      public List<SiteMembership> listSiteMemberships(String userName, int size)
      Description copied from interface: SiteService
      Lists all the memberships in sites that the specified user is in.
      Specified by:
      listSiteMemberships in interface SiteService
      Parameters:
      userName - String
      size - 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: SiteService
      List all the sites that the specified user has a explicit membership to.
      Specified by:
      listSitesPaged in interface SiteService
      Parameters:
      userName - user name
      Returns:
      paged list of site information
    • isSiteAdmin

      public boolean isSiteAdmin(String userName)
      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:
      isSiteAdmin in interface SiteService
      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: SiteService
      List the members of the site. This includes both users and groups. Users and groups can be controlled by passing params

      Name and role filters are optional and if not specified all the members of the site are returned.

      Specified by:
      listMembers in interface SiteService
      Parameters:
      shortName - site short name
      nameFilter - name filter
      roleFilter - role filter
      includeUsers - includes the users
      includeGroups - include the groups
      expandGroups - true if expand group member into user list, false otherwise
      callback - 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: SiteService
      Returns a paged list of the groups for the site.
      Specified by:
      listGroupMembersPaged in interface SiteService
      Parameters:
      shortName - site short name
      sortProps - sorting options
      pagingRequest - the paging request
      Returns:
      the authority name and their role