Class People

All Implemented Interfaces:
org.alfresco.processor.ProcessorExtension, TemplateProcessorExtension, org.springframework.beans.factory.InitializingBean

public class People extends BaseTemplateProcessorExtension implements org.springframework.beans.factory.InitializingBean
People and users support in FreeMarker templates.
Author:
Kevin Roast
  • Constructor Details

    • People

      public People()
  • Method Details

    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Throws:
      Exception
    • setStoreUrl

      public void setStoreUrl(String storeRef)
      Set the default store reference
      Parameters:
      storeRef - the default store reference
    • setServiceRegistry

      public void setServiceRegistry(ServiceRegistry serviceRegistry)
      Set the service registry
      Parameters:
      serviceRegistry - the service registry
    • setAuthorityDAO

      public void setAuthorityDAO(AuthorityDAO authorityDAO)
      Set the authority DAO
      Parameters:
      authorityDAO - authority dao
    • setAuthorityService

      public void setAuthorityService(AuthorityService authorityService)
      Set the authority service
      Parameters:
      authorityService - The authorityService to set.
    • setPersonService

      public void setPersonService(PersonService personService)
      Set the person service
      Parameters:
      personService - The personService to set.
    • setAuthenticationService

      public void setAuthenticationService(MutableAuthenticationService authenticationService)
      Sets the authentication service.
      Parameters:
      authenticationService - the new authentication service
    • getPerson

      public TemplateNode getPerson(String username)
      Gets the Person given the username
      Parameters:
      username - the username of the person to get
      Returns:
      the person node (type cm:person) or null if no such person exists
    • getGroup

      public TemplateNode getGroup(String groupName)
      Gets the Group given the group name
      Parameters:
      groupName - name of group to get
      Returns:
      the group node (type usr:authorityContainer) or null if no such group exists
    • getMembers

      public List<TemplateNode> getMembers(TemplateNode group)
      Gets the members (people) of a group (including all sub-groups)
      Parameters:
      group - the group to retrieve members for
      Returns:
      list of nodes representing the group members
    • getMembers

      public List<TemplateNode> getMembers(TemplateNode group, boolean recurse)
      Gets the members (people) of a group
      Parameters:
      group - the group to retrieve members for
      recurse - recurse into sub-groups
      Returns:
      list of nodes representing the group members
    • getContainerGroups

      public List<TemplateNode> getContainerGroups(TemplateNode person)
      Gets the groups that contain the specified authority
      Parameters:
      person - the user (cm:person) to get the containing groups for
      Returns:
      the containing groups as a List of TemplateNode objects, can be null
    • isAdmin

      public boolean isAdmin(TemplateNode person)
      Return true if the specified user is an Administrator authority.
      Parameters:
      person - to test
      Returns:
      true if an admin, false otherwise
    • isGuest

      public boolean isGuest(TemplateNode person)
      Return true if the specified user is an Guest authority.
      Parameters:
      person - to test
      Returns:
      true if a guest user, false otherwise
    • getCapabilities

      public Map<String,Boolean> getCapabilities(TemplateNode person)
      Gets a map of capabilities (boolean assertions) for the given person.
      Parameters:
      person - the person
      Returns:
      the capability map
    • isAccountEnabled

      public boolean isAccountEnabled(TemplateNode person)
      Return true if the specified user account is enabled.
      Parameters:
      person - to test
      Returns:
      true if account enabled, false if disabled