Class DataDistributionByName
- java.lang.Object
-
- org.exoplatform.services.jcr.ext.distribution.impl.AbstractDataDistributionType
-
- org.exoplatform.services.jcr.ext.distribution.impl.DataDistributionByName
-
- All Implemented Interfaces:
DataDistributionType
public class DataDistributionByName extends AbstractDataDistributionType
This data distribution will distribute the data in a understandable way for a human being. The expected data id is for example a login of a user. It will generate a hierarchy of sub-nodes withnlevels of depth for example withn = 4:- Usename: john.smith (size >= 4) it will generate a path of type "j___/jo___/joh___/john.smith"
- Usename: bob (size < 4) it will generate a path of type "b___/bo___/bob"
- Version:
- $Id$
- Author:
- Nicolas Filotto
-
-
Constructor Summary
Constructors Constructor Description DataDistributionByName()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>getAncestors(String dataId)Gives the list of all the name of the ancestorsvoidmigrate(javax.jcr.Node rootNode)Migrate from old structure to new one.voidmigrate(javax.jcr.Node rootNode, String nodeType, List<String> mixinTypes, Map<String,String[]> permissions)Migrate from old structure to new one.protected booleanuseParametersOnLeafOnly()Indicates whether or not the node type, the mixin types and the permissions have to be used on leaf node only.-
Methods inherited from class org.exoplatform.services.jcr.ext.distribution.impl.AbstractDataDistributionType
createNode, getDataNode, getOrCreateDataNode, getOrCreateDataNode, getOrCreateDataNode, getOrCreateDataNode, getRelativePath, removeDataNode
-
-
-
-
Method Detail
-
getAncestors
protected List<String> getAncestors(String dataId)
Gives the list of all the name of the ancestors- Specified by:
getAncestorsin classAbstractDataDistributionType- Parameters:
dataId- the id of the data to find/create- Returns:
- the list of the ancestor names
-
useParametersOnLeafOnly
protected boolean useParametersOnLeafOnly()
Indicates whether or not the node type, the mixin types and the permissions have to be used on leaf node only.- Specified by:
useParametersOnLeafOnlyin classAbstractDataDistributionType- Returns:
trueif only the leaf node has to be created with the parametersfalseotherwise.
-
migrate
public void migrate(javax.jcr.Node rootNode) throws javax.jcr.RepositoryExceptionMigrate from old structure to new one.- Specified by:
migratein interfaceDataDistributionType- Overrides:
migratein classAbstractDataDistributionType- Parameters:
rootNode- the root node under which the data to migrate is stored- Throws:
javax.jcr.RepositoryException- if an error occurred during migration
-
migrate
public void migrate(javax.jcr.Node rootNode, String nodeType, List<String> mixinTypes, Map<String,String[]> permissions) throws javax.jcr.RepositoryExceptionMigrate from old structure to new one.- Specified by:
migratein interfaceDataDistributionType- Overrides:
migratein classAbstractDataDistributionType- Parameters:
rootNode- the root node under which the data to migrate is storednodeType- the node type to use in case we need to create the nodemixinTypes- the mixin types to use in case we need to create the nodepermissions- the permissions to use in case we need to create the node- Throws:
javax.jcr.RepositoryException- if an error occurred during migration
-
-