|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.jcr.decoration.AbstractContentDecorator info.magnolia.jcr.inheritance.InheritanceContentDecorator
public class InheritanceContentDecorator
Provides inheritance on JCR level by applying wrapper objects. The inheritance destination node gets nodes and properties from a list of source nodes. Subclasses can customize which nodes are inherited and how the inherited nodes are ordered.
Nested Class Summary | |
---|---|
class |
InheritanceContentDecorator.DestinationNodeInheritanceNodeWrapper
Wrapper applied to the destination node. |
Constructor Summary | |
---|---|
InheritanceContentDecorator(javax.jcr.Node destination)
|
Method Summary | |
---|---|
void |
addSource(javax.jcr.Node source)
|
protected javax.jcr.PropertyIterator |
combinePropertyIterators(javax.jcr.PropertyIterator destinationProperties,
List<javax.jcr.PropertyIterator> sourceProperties)
Combines the inherited properties and provides them as a PropertyIterator . |
javax.jcr.Node |
getDestination()
|
protected boolean |
inheritsNodes(javax.jcr.Node node)
Decides if a node inherits child nodes. |
protected boolean |
inheritsProperties(javax.jcr.Node node)
Decides if a node inherits properties. |
boolean |
isMultipleWrapEnabled()
Tells if multiple wrapping with this content decorator is enabled. |
protected boolean |
isSourceChildInherited(javax.jcr.Node node)
Decides if a specific child node of one of the source should be inherited. |
protected javax.jcr.NodeIterator |
sortInheritedNodes(javax.jcr.NodeIterator destinationChildren,
List<javax.jcr.NodeIterator> sourceChildren)
Sorts the inherited nodes and provides a NodeIterator representing that order. |
javax.jcr.Node |
wrapNode(javax.jcr.Node node)
|
Methods inherited from class info.magnolia.jcr.decoration.AbstractContentDecorator |
---|
evaluateNode, evaluateProperty, wrapNodeIterator, wrapProperty, wrapPropertyIterator, wrapSession, wrapWorkspace |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public InheritanceContentDecorator(javax.jcr.Node destination) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
Method Detail |
---|
public javax.jcr.Node wrapNode(javax.jcr.Node node)
wrapNode
in interface ContentDecorator
wrapNode
in class AbstractContentDecorator
public javax.jcr.Node getDestination()
public void addSource(javax.jcr.Node source)
protected boolean inheritsNodes(javax.jcr.Node node) throws javax.jcr.RepositoryException
node
- the destination node or a source node
javax.jcr.RepositoryException
protected boolean inheritsProperties(javax.jcr.Node node) throws javax.jcr.RepositoryException
node
- the destination node or a source node
javax.jcr.RepositoryException
protected boolean isSourceChildInherited(javax.jcr.Node node) throws javax.jcr.RepositoryException
node
- a child of one of the source nodes
javax.jcr.RepositoryException
protected javax.jcr.NodeIterator sortInheritedNodes(javax.jcr.NodeIterator destinationChildren, List<javax.jcr.NodeIterator> sourceChildren) throws javax.jcr.RepositoryException
NodeIterator
representing that order. By default orders nodes
from the top-most source first and nodes from the destination last.
destinationChildren
- children of the destination nodesourceChildren
- children of each of the source nodes in bottom-up order
javax.jcr.RepositoryException
protected javax.jcr.PropertyIterator combinePropertyIterators(javax.jcr.PropertyIterator destinationProperties, List<javax.jcr.PropertyIterator> sourceProperties) throws javax.jcr.RepositoryException
PropertyIterator
. By default properties in the
destination node overrides properties from source nodes. Properties on source node have preference in a bottom to
top order.
destinationProperties
- properties of the destination nodesourceProperties
- properties of the source nodes in bottom-up order
javax.jcr.RepositoryException
public boolean isMultipleWrapEnabled()
ContentDecorator
isMultipleWrapEnabled
in interface ContentDecorator
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |