eXo JCR :: Component :: Extension Service 1.15.0-CR2

org.exoplatform.services.jcr.ext.distribution.impl
Class DataDistributionByName

java.lang.Object
  extended by org.exoplatform.services.jcr.ext.distribution.impl.AbstractDataDistributionType
      extended by 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 with n levels of depth for example with n = 4:

Version:
$Id$
Author:
Nicolas Filotto

Constructor Summary
DataDistributionByName()
           
 
Method Summary
protected  List<String> getAncestors(String dataId)
          Gives the list of all the name of the ancestors
 void migrate(javax.jcr.Node rootNode)
          Migrate from old structure to new one.
 void migrate(javax.jcr.Node rootNode, String nodeType, List<String> mixinTypes, Map<String,String[]> permissions)
          Migrate from old structure to new one.
protected  boolean useParametersOnLeafOnly()
          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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataDistributionByName

public DataDistributionByName()
Method Detail

getAncestors

protected List<String> getAncestors(String dataId)
Gives the list of all the name of the ancestors

Specified by:
getAncestors in class AbstractDataDistributionType
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:
useParametersOnLeafOnly in class AbstractDataDistributionType
Returns:
true if only the leaf node has to be created with the parameters false otherwise.

migrate

public void migrate(javax.jcr.Node rootNode)
             throws javax.jcr.RepositoryException
Migrate from old structure to new one.

Specified by:
migrate in interface DataDistributionType
Overrides:
migrate in class AbstractDataDistributionType
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.RepositoryException
Migrate from old structure to new one.

Specified by:
migrate in interface DataDistributionType
Overrides:
migrate in class AbstractDataDistributionType
Parameters:
rootNode - the root node under which the data to migrate is stored
nodeType - the node type to use in case we need to create the node
mixinTypes - the mixin types to use in case we need to create the node
permissions - the permissions to use in case we need to create the node
Throws:
javax.jcr.RepositoryException - if an error occurred during migration

eXo JCR :: Component :: Extension Service 1.15.0-CR2

Copyright © 2012 eXo Platform SAS. All Rights Reserved.