org.alfresco.repo.template
Class People

java.lang.Object
  extended by org.alfresco.repo.processor.BaseProcessorExtension
      extended by org.alfresco.repo.template.BaseTemplateProcessorExtension
          extended by org.alfresco.repo.template.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.


Constructor Summary
People()
           
 
Method Summary
 void afterPropertiesSet()
           
 java.util.Map getCapabilities(TemplateNode person)
          Gets a map of capabilities (boolean assertions) for the given person.
 java.util.List getContainerGroups(TemplateNode person)
          Gets the groups that contain the specified authority
 TemplateNode getGroup(java.lang.String groupName)
          Gets the Group given the group name
 java.util.List getMembers(TemplateNode group)
          Gets the members (people) of a group (including all sub-groups)
 java.util.List getMembers(TemplateNode group, boolean recurse)
          Gets the members (people) of a group
 TemplateNode getPerson(java.lang.String username)
          Gets the Person given the username
 boolean isAccountEnabled(TemplateNode person)
          Return true if the specified user account is enabled.
 boolean isAdmin(TemplateNode person)
          Return true if the specified user is an Administrator authority.
 boolean isGuest(TemplateNode person)
          Return true if the specified user is an Guest authority.
 void setAuthenticationService(MutableAuthenticationService authenticationService)
          Sets the authentication service.
 void setAuthorityDAO(AuthorityDAO authorityDAO)
          Set the authority DAO
 void setAuthorityService(AuthorityService authorityService)
          Set the authority service
 void setPersonService(PersonService personService)
          Set the person service
 void setServiceRegistry(ServiceRegistry serviceRegistry)
          Set the service registry
 void setStoreUrl(java.lang.String storeRef)
          Set the default store reference
 
Methods inherited from class org.alfresco.repo.template.BaseTemplateProcessorExtension
getTemplateImageResolver, setTemplateImageResolver
 
Methods inherited from class org.alfresco.repo.processor.BaseProcessorExtension
getExtensionName, register, setExtensionName, setProcessor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.alfresco.processor.ProcessorExtension
getExtensionName
 

Constructor Detail

People

public People()
Method Detail

afterPropertiesSet

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

setStoreUrl

public void setStoreUrl(java.lang.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(java.lang.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(java.lang.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 java.util.List 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 java.util.List 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 java.util.List 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 java.util.Map 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


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.