info.magnolia.jcr.wrapper
Class ExtendingNodeWrapper
java.lang.Object
info.magnolia.jcr.wrapper.DelegateNodeWrapper
info.magnolia.jcr.wrapper.ChildWrappingNodeWrapper
info.magnolia.jcr.wrapper.ExtendingNodeWrapper
- All Implemented Interfaces:
- NodeWrapperFactory, Cloneable, javax.jcr.Item, javax.jcr.Node
public class ExtendingNodeWrapper
- extends ChildWrappingNodeWrapper
This wrapper allows extending other nodes (mainly useful to extend configurations). A node can define
a property with the name 'extends'. Its value is either an absolute or relative path. The merge is then performed as follows:
- properties are merged and values are overwritten
- sub nodes are merged, the original order is guaranteed, new nodes are added at the end of the list
The mechanism supports multiple inheritances as such:
- the node the current node inherits from can again extend a node
- nodes laying deeper in the hierarchy can extend an other node
- See Also:
InheritanceNodeWrapper} a class supporting content inheritance.
Fields inherited from interface javax.jcr.Node |
JCR_CHILD_NODE_DEFINITION, JCR_CONTENT, JCR_FROZEN_NODE, JCR_PROPERTY_DEFINITION, JCR_ROOT_VERSION, JCR_VERSION_LABELS |
Constructor Summary |
|
ExtendingNodeWrapper(javax.jcr.Node wrappedNode)
Default constructor. |
|
ExtendingNodeWrapper(javax.jcr.Node wrappedNode,
boolean failOnError)
Call directly for test purposes only. |
protected |
ExtendingNodeWrapper(javax.jcr.Node wrappedNode,
javax.jcr.Node extendedNode)
Does not support the extends property but chains the two nodes directly. |
Methods inherited from class info.magnolia.jcr.wrapper.DelegateNodeWrapper |
accept, addMixin, canAddMixin, cancelMerge, checkin, checkout, clone, deepUnwrap, doneMerge, followLifecycleTransition, getAllowedLifecycleTransistions, getAncestor, getBaseVersion, getCorrespondingNodePath, getDefinition, getDepth, getIdentifier, getIndex, getLock, getMixinNodeTypes, getName, getParent, getPath, getPrimaryItem, getPrimaryNodeType, getReferences, getReferences, getSession, getSharedSet, getUUID, getVersionHistory, getWeakReferences, getWeakReferences, hasNodes, hasProperties, holdsLock, initClone, isCheckedOut, isLocked, isModified, isNew, isNode, isNodeType, isSame, lock, merge, orderBefore, refresh, remove, removeMixin, removeShare, removeSharedSet, restore, restore, restore, restoreByLabel, save, setPrimaryType, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, toString, unlock, update |
EXTENDING_NODE_PROPERTY
protected static final String EXTENDING_NODE_PROPERTY
- See Also:
- Constant Field Values
EXTENDING_NODE_PROPERTY_OVERRIDE
protected static final String EXTENDING_NODE_PROPERTY_OVERRIDE
- See Also:
- Constant Field Values
ExtendingNodeWrapper
public ExtendingNodeWrapper(javax.jcr.Node wrappedNode)
- Default constructor.
ExtendingNodeWrapper
public ExtendingNodeWrapper(javax.jcr.Node wrappedNode,
boolean failOnError)
- Call directly for test purposes only.
ExtendingNodeWrapper
protected ExtendingNodeWrapper(javax.jcr.Node wrappedNode,
javax.jcr.Node extendedNode)
- Does not support the extends property but chains the two nodes directly. Each node is
wrapped internally to ensure that each of them support the extends property for themselves.
hasNode
public boolean hasNode(String relPath)
throws javax.jcr.RepositoryException
- Specified by:
hasNode
in interface javax.jcr.Node
- Overrides:
hasNode
in class DelegateNodeWrapper
- Throws:
javax.jcr.RepositoryException
getNode
public javax.jcr.Node getNode(String relPath)
throws javax.jcr.PathNotFoundException,
javax.jcr.RepositoryException
- Specified by:
getNode
in interface javax.jcr.Node
- Overrides:
getNode
in class ChildWrappingNodeWrapper
- Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
getNodes
public javax.jcr.NodeIterator getNodes()
throws javax.jcr.RepositoryException
- Specified by:
getNodes
in interface javax.jcr.Node
- Overrides:
getNodes
in class ChildWrappingNodeWrapper
- Throws:
javax.jcr.RepositoryException
getNodes
public javax.jcr.NodeIterator getNodes(String[] nameGlobs)
throws javax.jcr.RepositoryException
- Specified by:
getNodes
in interface javax.jcr.Node
- Overrides:
getNodes
in class ChildWrappingNodeWrapper
- Throws:
javax.jcr.RepositoryException
getNodes
public javax.jcr.NodeIterator getNodes(String namePattern)
throws javax.jcr.RepositoryException
- Specified by:
getNodes
in interface javax.jcr.Node
- Overrides:
getNodes
in class ChildWrappingNodeWrapper
- Throws:
javax.jcr.RepositoryException
hasProperty
public boolean hasProperty(String relPath)
throws javax.jcr.RepositoryException
- Specified by:
hasProperty
in interface javax.jcr.Node
- Overrides:
hasProperty
in class DelegateNodeWrapper
- Throws:
javax.jcr.RepositoryException
getProperty
public javax.jcr.Property getProperty(String relPath)
throws javax.jcr.PathNotFoundException,
javax.jcr.RepositoryException
- Specified by:
getProperty
in interface javax.jcr.Node
- Overrides:
getProperty
in class DelegateNodeWrapper
- Throws:
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
getProperties
public javax.jcr.PropertyIterator getProperties()
throws javax.jcr.RepositoryException
- Specified by:
getProperties
in interface javax.jcr.Node
- Overrides:
getProperties
in class DelegateNodeWrapper
- Throws:
javax.jcr.RepositoryException
getProperties
public javax.jcr.PropertyIterator getProperties(String[] nameGlobs)
throws javax.jcr.RepositoryException
- Specified by:
getProperties
in interface javax.jcr.Node
- Overrides:
getProperties
in class DelegateNodeWrapper
- Throws:
javax.jcr.RepositoryException
getProperties
public javax.jcr.PropertyIterator getProperties(String namePattern)
throws javax.jcr.RepositoryException
- Specified by:
getProperties
in interface javax.jcr.Node
- Overrides:
getProperties
in class DelegateNodeWrapper
- Throws:
javax.jcr.RepositoryException
wrapNode
public javax.jcr.Node wrapNode(javax.jcr.Node node)
- Specified by:
wrapNode
in interface NodeWrapperFactory
- Overrides:
wrapNode
in class ChildWrappingNodeWrapper
getWrappedNode
public javax.jcr.Node getWrappedNode()
- Overrides:
getWrappedNode
in class DelegateNodeWrapper
setWrappedNode
public void setWrappedNode(javax.jcr.Node node)
- Overrides:
setWrappedNode
in class DelegateNodeWrapper
isExtending
public boolean isExtending()
- Check if node extends another.
Copyright © 2003-2013 Magnolia International Ltd.. All Rights Reserved.