@AlfrescoPublicApi
public interface PersonService
People and groups may be managed entirely in the repository or entirely in some other implementation such as LDAP or via NTLM. Some properties may in the repository and some in another store. Individual properties may or may not be mutable.
Modifier and Type | Interface and Description |
---|---|
static class |
PersonService.PersonInfo
Data pojo to carry common person information
|
Modifier and Type | Method and Description |
---|---|
int |
countPeople()
Counts the number of persons registered with the system.
|
boolean |
createMissingPeople()
Does this service create people on demand if they are missing.
|
org.alfresco.service.cmr.repository.NodeRef |
createPerson(Map<org.alfresco.service.namespace.QName,Serializable> properties)
Create a new person with the given properties.
|
org.alfresco.service.cmr.repository.NodeRef |
createPerson(Map<org.alfresco.service.namespace.QName,Serializable> properties,
Set<String> zones)
Create a new person with the given properties, recording them against the given zone name (usually identifying an
external user registry from which the details were obtained).
|
void |
deletePerson(org.alfresco.service.cmr.repository.NodeRef personRef)
Delete the person identified by the given ref.
|
void |
deletePerson(org.alfresco.service.cmr.repository.NodeRef personRef,
boolean deleteAuthentication)
Delete the person identified by the given ref, and optionally delete
the associated authentication, if one.
|
void |
deletePerson(String userName)
Delete the person identified by the given user name.
|
Set<org.alfresco.service.cmr.repository.NodeRef> |
getAllPeople()
Deprecated.
|
Set<org.alfresco.service.namespace.QName> |
getMutableProperties()
Get the list of properties that are mutable.
|
org.alfresco.query.PagingResults<PersonService.PersonInfo> |
getPeople(List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,String>> stringPropFilters,
boolean filterIgnoreCase,
List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> sortProps,
org.alfresco.query.PagingRequest pagingRequest)
Deprecated.
see getPeople(String pattern, List
|
org.alfresco.query.PagingResults<PersonService.PersonInfo> |
getPeople(String pattern,
List<org.alfresco.service.namespace.QName> filterProps,
List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> sortProps,
org.alfresco.query.PagingRequest pagingRequest)
Get paged list of people optionally filtered and/or sorted
Note: the pattern is applied to filter props (0 to 3) as startsWithIgnoreCase, which are OR'ed together, for example: cm:userName or cm:firstName or cm:lastName
|
org.alfresco.query.PagingResults<PersonService.PersonInfo> |
getPeople(String pattern,
List<org.alfresco.service.namespace.QName> filterStringProps,
Set<org.alfresco.service.namespace.QName> inclusiveAspects,
Set<org.alfresco.service.namespace.QName> exclusiveAspects,
boolean includeAdministraotrs,
List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> sortProps,
org.alfresco.query.PagingRequest pagingRequest)
Get paged list of people optionally filtered and/or sorted
|
org.alfresco.service.cmr.repository.NodeRef |
getPeopleContainer()
Return the container that stores people.
|
Set<org.alfresco.service.cmr.repository.NodeRef> |
getPeopleFilteredByProperty(org.alfresco.service.namespace.QName propertyKey,
Serializable propertyValue,
int count)
Get people filtered by the given property name/value pair.
|
PersonService.PersonInfo |
getPerson(org.alfresco.service.cmr.repository.NodeRef personRef)
Retrieve the person info for an existing
person NodeRef |
org.alfresco.service.cmr.repository.NodeRef |
getPerson(String userName)
Get a person by userName.
|
org.alfresco.service.cmr.repository.NodeRef |
getPerson(String userName,
boolean autoCreateHomeFolderAndMissingPersonIfAllowed)
Retrieve the person NodeRef for a
username , optionally creating
the home folder if it does not exist and optionally creating the person
if they don't exist AND the PersonService is configured to allow the
creation of missing persons setCreateMissingPeople(boolean) . |
org.alfresco.service.cmr.repository.NodeRef |
getPersonOrNull(String userName)
Get a person by userName.
|
String |
getUserIdentifier(String caseSensitiveUserName)
Given the case sensitive user name find the approriate identifier from the person service.
|
boolean |
getUserNamesAreCaseSensitive()
Are user names case sensitive?
|
boolean |
isEnabled(String userName)
Is the specified user, enabled
|
boolean |
isMutable()
Can this service create, delete and update person information?
|
void |
notifyPerson(String userName,
String password)
Notifies a user by email that their account has been created, and the details of it.
|
boolean |
personExists(String userName)
Check if a person exists.
|
void |
setCreateMissingPeople(boolean createMissing)
Set if missing people should be created.
|
void |
setPersonProperties(String userName,
Map<org.alfresco.service.namespace.QName,Serializable> properties)
Set the properties on a person - some of these may be persisted in
different locations - the home folder is created if it doesn't exist
|
void |
setPersonProperties(String userName,
Map<org.alfresco.service.namespace.QName,Serializable> properties,
boolean autoCreateHomeFolder)
Set the properties on a person - some of these may be persisted in different locations.
|
@Auditable(parameters="userName") org.alfresco.service.cmr.repository.NodeRef getPerson(String userName)
to create missing people or not
.
The home folder will also be created as a side effect if it does not exist.userName
- -
the userName key to find the personNoSuchPersonException
- if the user doesn't exist and could not be created
automaticallysetCreateMissingPeople(boolean)
,
createMissingPeople()
@Auditable(parameters="userName") org.alfresco.service.cmr.repository.NodeRef getPersonOrNull(String userName)
userName
- -
the userName key to find the personcreateMissingPeople()
@Auditable(parameters={"userName","autoCreate"}) org.alfresco.service.cmr.repository.NodeRef getPerson(String userName, boolean autoCreateHomeFolderAndMissingPersonIfAllowed)
username
, optionally creating
the home folder if it does not exist and optionally creating the person
if they don't exist AND the PersonService is configured to allow the
creation of missing persons setCreateMissingPeople(boolean)
.
If not allowed to create missing persons and the person does not exist
a NoSuchPersonException
exception will be thrown.userName
- of the person NodeRef to retrieveautoCreateHomeFolderAndMissingPersonIfAllowed
- If the person exits:
should we create the home folder if it does not exist?
If the person exists AND the creation of missing persons is allowed
should we create both the person and home folder.NoSuchPersonException
- if the person doesn't exist and can't be created@Auditable(parameters="personRef") PersonService.PersonInfo getPerson(org.alfresco.service.cmr.repository.NodeRef personRef) throws NoSuchPersonException
person NodeRef
personRef
- NodeRefNoSuchPersonException
- if the person doesn't exist@Auditable(parameters="userName") boolean personExists(String userName)
userName
- the user name@Auditable boolean createMissingPeople()
@Auditable(parameters="createMissing") void setCreateMissingPeople(boolean createMissing)
createMissing
- set to true to create peoplegetPerson(String)
@Auditable Set<org.alfresco.service.namespace.QName> getMutableProperties()
@Auditable(parameters={"userName","properties"}) void setPersonProperties(String userName, Map<org.alfresco.service.namespace.QName,Serializable> properties)
userName
- -
the user for which the properties should be set.properties
- -
the map of properties to set (as the NodeService)@Auditable(parameters={"userName","properties","autoCreate"}) void setPersonProperties(String userName, Map<org.alfresco.service.namespace.QName,Serializable> properties, boolean autoCreateHomeFolder)
userName
- - the user for which the properties should be set.properties
- - the map of properties to set (as the NodeService)autoCreateHomeFolder
- should we auto-create the home folder if it doesn't exist.@Auditable boolean isMutable()
@Auditable(parameters="properties") org.alfresco.service.cmr.repository.NodeRef createPerson(Map<org.alfresco.service.namespace.QName,Serializable> properties)
@Auditable(parameters={"properties","zones"}) org.alfresco.service.cmr.repository.NodeRef createPerson(Map<org.alfresco.service.namespace.QName,Serializable> properties, Set<String> zones)
properties
- the propertieszones
- a set if zones including the identifier for the external user registry owning the person information, or null
or an empty set@Auditable(parameters="userName") void notifyPerson(String userName, String password)
createPerson(Map)
or createPerson(Map, Set)
where email notifications are required.userName
- of the person to notifypassword
- of the person to notifyNoSuchPersonException
- if the person doesn't exist@Auditable(parameters="userName") void deletePerson(String userName)
userName
- String@Auditable(parameters="personRef") void deletePerson(org.alfresco.service.cmr.repository.NodeRef personRef)
personRef
- NodeRef@Auditable(parameters={"personRef","deleteAuthentication"}) void deletePerson(org.alfresco.service.cmr.repository.NodeRef personRef, boolean deleteAuthentication)
personRef
- NodeRefdeleteAuthentication
- boolean@Auditable Set<org.alfresco.service.cmr.repository.NodeRef> getAllPeople()
getPeople(List, boolean, List, PagingRequest)
@Auditable(parameters={"pattern","filterProps","sortProps","pagingRequest"}) org.alfresco.query.PagingResults<PersonService.PersonInfo> getPeople(String pattern, List<org.alfresco.service.namespace.QName> filterProps, List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
pattern
- pattern to apply to filter props - "startsWith" and "ignoreCase"filterProps
- list of filter properties (these are OR'ed)sortProps
- sort property, eg. cm:username ascendingpagingRequest
- skip, max + optional query execution id
@Auditable(parameters={"stringPropFilters","filterIgnoreCase","sortProps","pagingRequest"}) org.alfresco.query.PagingResults<PersonService.PersonInfo> getPeople(List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,String>> stringPropFilters, boolean filterIgnoreCase, List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
stringPropFilters
- list of filter properties (with "startsWith" values), eg. cm:username "al" might match "alex", "alice", ...filterIgnoreCase
- true to ignore case when filtering, false to be case-sensitive when filteringsortProps
- sort property, eg. cm:username ascendingpagingRequest
- skip, max + optional query execution id
@Auditable(parameters={"stringPropFilters","filterIgnoreCase","inclusiveAspect","exclusiveAspects","sortProps","pagingRequest"}) org.alfresco.query.PagingResults<PersonService.PersonInfo> getPeople(String pattern, List<org.alfresco.service.namespace.QName> filterStringProps, Set<org.alfresco.service.namespace.QName> inclusiveAspects, Set<org.alfresco.service.namespace.QName> exclusiveAspects, boolean includeAdministraotrs, List<org.alfresco.util.Pair<org.alfresco.service.namespace.QName,Boolean>> sortProps, org.alfresco.query.PagingRequest pagingRequest)
pattern
- StringfilterStringProps
- list of filter properties (with "startsWith" values), eg. cm:username "al" might match "alex", "alice", ...inclusiveAspects
- if set, filter out any people that don't have one of these aspectsexclusiveAspects
- if set, filter out any people that do have one of these aspectsincludeAdministraotrs
- true to include administrators in the results.sortProps
- sort property, eg. cm:username ascendingpagingRequest
- skip, max + optional query execution id@Auditable Set<org.alfresco.service.cmr.repository.NodeRef> getPeopleFilteredByProperty(org.alfresco.service.namespace.QName propertyKey, Serializable propertyValue, int count)
getPeople(List, boolean, List, PagingRequest)
propertyKey
- property key of property to filter people bypropertyValue
- property value of property to filter people bycount
- the number of results to retrieve, up to a maximum of 1000getPeople(List, boolean, List, PagingRequest)
@Auditable org.alfresco.service.cmr.repository.NodeRef getPeopleContainer()
@Auditable boolean getUserNamesAreCaseSensitive()
@NotAuditable String getUserIdentifier(String caseSensitiveUserName)
caseSensitiveUserName
- String@NotAuditable int countPeople()
@NotAuditable boolean isEnabled(String userName)
NoSuchPersonException
- if the user doesn't existCopyright © 2005–2017 Alfresco Software. All rights reserved.