public class RegexHomeFolderProvider extends UsernameHomeFolderProvider
For example, given the value "adavis" and the regular expression "^(..)" the
resulting home folder path would be "/ad/adavis"
. However with the regular expression
"^(.)(.?)" the home folder path would be "/a/d/adavis"
. If any group matches a zero
length string, it is just ignored.
Note: In order to choose an efficient distribution scheme, be aware that, when m users are distributed into n leaf folders, when m >> n log n the statistical maximum load is m/n + O( sqrt((m log n)/n)), w.h.p
Constructor and Description |
---|
RegexHomeFolderProvider() |
Modifier and Type | Method and Description |
---|---|
List<String> |
getHomeFolderPath(org.alfresco.service.cmr.repository.NodeRef person)
Returns a preferred path (a list of folder names) for the home folder relative to
the root path.
|
void |
setGroupOrder(String groupOrderString) |
void |
setPattern(String patternString) |
void |
setPropertyName(String propertyName) |
getHomeFolder, getTemplateNodeRef, setTemplatePath
afterPropertiesSet, getHomeFolderManager, getName, getOnCreatePermissionsManager, getOnReferencePermissionsManager, getOwner, getRootPath, getStoreUrl, setBeanName, setHomeFolderManager, setOnCreatePermissionsManager, setOnReferencePermissionsManager, setOwner, setRootPath, setStoreUrl
public void setPropertyName(String propertyName)
propertyName
- String the cm:person property used as the key, such as userName
or organizationId.public void setPattern(String patternString)
patternString
- the regex pattern against the cm:person property value. Regex
groups define the parent folder structure.public void setGroupOrder(String groupOrderString)
groupOrderString
- String the order (as a comma separated list) in which the
regex pattern groups should be assembled into folders (such as 2,1
).
The default ordering is as they appear.public List<String> getHomeFolderPath(org.alfresco.service.cmr.repository.NodeRef person)
HomeFolderProvider2
null
. When all users have their own folder under the root
there should be just one element in the List. Multiple elements should be returned
when a nested folder structure is preferred.getHomeFolderPath
in interface HomeFolderProvider2
getHomeFolderPath
in class UsernameHomeFolderProvider
person
- NodeRef from which a property (normally the userName) is used as a
hash key to create a nested directory structure.Copyright © 2005–2017 Alfresco Software. All rights reserved.