|
||||||||||
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 info.magnolia.templating.inheritance.DefaultInheritanceContentDecorator
public class DefaultInheritanceContentDecorator
Provides an inheritance model that can be customized with configuration on the nodes. Inheritance can be completely turned off or inheritance of nodes or properties can be turned off separately.
The inheritance sources are found by looking at the node hierarchy, each node that qualifies as an anchor (node type is mgnl:content) and has a node that with the same sub-path as the destination node has to its nearest parent is used. That is, for a destination node /page1/page2/main, the nearest anchor node is /page1/page2, therefor if there is a node /page1/main then that is used as a source.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class info.magnolia.jcr.inheritance.InheritanceContentDecorator |
---|
InheritanceContentDecorator.DestinationNodeInheritanceNodeWrapper |
Constructor Summary | |
---|---|
DefaultInheritanceContentDecorator(javax.jcr.Node destination,
InheritanceConfiguration configuration)
|
Method Summary | |
---|---|
protected javax.jcr.Node |
findFirstAnchor()
|
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. |
protected boolean |
isAnchor(javax.jcr.Node node)
True if this node is an anchor. |
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. |
Methods inherited from class info.magnolia.jcr.inheritance.InheritanceContentDecorator |
---|
addSource, combinePropertyIterators, getDestination, isMultipleWrapEnabled, wrapNode |
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 DefaultInheritanceContentDecorator(javax.jcr.Node destination, InheritanceConfiguration configuration) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
Method Detail |
---|
protected javax.jcr.Node findFirstAnchor() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected boolean isAnchor(javax.jcr.Node node) throws javax.jcr.RepositoryException
MgnlNodeType.NT_CONTENT
.
node
- the node to evaluate
javax.jcr.RepositoryException
- if a problem occurs accessing the nodeprotected boolean inheritsNodes(javax.jcr.Node node) throws javax.jcr.RepositoryException
InheritanceContentDecorator
inheritsNodes
in class InheritanceContentDecorator
node
- the destination node or a source node
javax.jcr.RepositoryException
protected boolean inheritsProperties(javax.jcr.Node node) throws javax.jcr.RepositoryException
InheritanceContentDecorator
inheritsProperties
in class InheritanceContentDecorator
node
- the destination node or a source node
javax.jcr.RepositoryException
protected boolean isSourceChildInherited(javax.jcr.Node node) throws javax.jcr.RepositoryException
InheritanceContentDecorator
isSourceChildInherited
in class InheritanceContentDecorator
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
InheritanceContentDecorator
NodeIterator
representing that order. By default orders nodes
from the top-most source first and nodes from the destination last.
sortInheritedNodes
in class InheritanceContentDecorator
destinationChildren
- children of the destination nodesourceChildren
- children of each of the source nodes in bottom-up order
javax.jcr.RepositoryException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |