public class InheritanceContentWrapper extends ContentWrapper
isAnchor()
defines
the anchor to which the inheritance is performed relative to. By default the anchor is a page
(mgnl:content).
The inheritance is then performed as follows:
The AbstractContent.getChildren()
methods merge the direct and inherited children by first adding the
inherited children to the collection and then the direct children.
Content.ContentFilter
Constructor and Description |
---|
InheritanceContentWrapper(Content node)
Starts the inheritance.
|
InheritanceContentWrapper(Content wrappedContent,
Content start)
Used if in the
wrap(Content) method. |
Modifier and Type | Method and Description |
---|---|
protected InheritanceContentWrapper |
findAnchor()
Find the anchor for this node.
|
protected InheritanceContentWrapper |
findNextAnchor()
Find next anchor.
|
Collection<Content> |
getChildren(Content.ContentFilter filter,
String namePattern,
Comparator<Content> orderCriteria) |
Content |
getContent(String name)
Gets the Content node of the current node with the specified name.
|
protected Content |
getContentSafely(InheritanceContentWrapper anchor,
String path)
This method returns null if no content has been found.
|
protected Content |
getContentSafely(String name)
This method returns null if no content has been found.
|
NodeData |
getNodeData(String name)
Returns a
NodeData object. |
boolean |
hasContent(String name) |
boolean |
hasNodeData(String name)
Delegates to
NodeData.isExist() . |
protected boolean |
isAnchor()
True if this node is an anchor.
|
boolean |
isInherited()
True if this is not a sub node of the starting point.
|
protected String |
resolveInnerPath()
Returns the inner path of the this node up to the anchor.
|
protected Content |
wrap(Content node)
Wrap returned nodes.
|
addMixin, addVersion, addVersion, createContent, delete, deleteNodeData, getAllVersions, getAncestor, getAncestors, getBaseVersion, getChildByName, getHandle, getHierarchyManager, getIndex, getItemType, getJCRNode, getLevel, getLock, getMetaData, getMixinNodeTypes, getName, getNodeDataCollection, getNodeType, getNodeTypeName, getParent, getTemplate, getTitle, getUUID, getVersionedContent, getVersionedContent, getVersionHistory, getWorkspace, getWrappedContent, hasMetaData, hasMixin, holdsLock, isGranted, isLocked, isModified, isNodeData, isNodeType, lock, lock, newNodeDataInstance, orderBefore, refresh, removeMixin, removeVersionHistory, restore, restore, restore, restoreByLabel, save, setWrappedContent, toString, unlock, updateMetaData, wrap, wrapContentNodes, wrapNodeDatas
createContent, createContent, createNodeData, createNodeData, createNodeData, createNodeData, createNodeData, delete, getBinaryNodeDatas, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getNodeDataCollection, hasChildren, hasChildren, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData
clone, getAccessManager, setAccessManager
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAccessManager
public InheritanceContentWrapper(Content wrappedContent, Content start)
wrap(Content)
method.public InheritanceContentWrapper(Content node)
public boolean hasContent(String name) throws javax.jcr.RepositoryException
hasContent
in interface Content
hasContent
in class ContentWrapper
javax.jcr.RepositoryException
- if an error occurspublic Content getContent(String name) throws javax.jcr.RepositoryException
Content
getContent
in interface Content
getContent
in class ContentWrapper
name
- of the node acting as Content
javax.jcr.RepositoryException
- if an error occursAccessDeniedException
- if the current session does not have sufficient access rights
to complete the operationpublic Collection<Content> getChildren(Content.ContentFilter filter, String namePattern, Comparator<Content> orderCriteria)
getChildren
in class ContentWrapper
namePattern
- ignored if null.protected String resolveInnerPath() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected Content getContentSafely(String name) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected Content getContentSafely(InheritanceContentWrapper anchor, String path) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected InheritanceContentWrapper findAnchor() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected InheritanceContentWrapper findNextAnchor() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected boolean isAnchor()
public NodeData getNodeData(String name)
AbstractContent
NodeData
object. If the node data does not exist (respectively if it has no
value) an empty representation is returned whose NodeData.isExist()
will return
false.
Delegates to AbstractContent.newNodeDataInstance(String, int, boolean)
by setting the type to PropertyType.UNDEFINED. A subclass has to handle this by trying to determine the type if the node data exists. The reason for this is that implementations want to instantiate different node data classes per typegetNodeData
in interface Content
getNodeData
in class AbstractContent
NodeData
objectpublic boolean hasNodeData(String name) throws javax.jcr.RepositoryException
AbstractContent
NodeData.isExist()
.hasNodeData
in interface Content
hasNodeData
in class AbstractContent
javax.jcr.RepositoryException
- if an error occursprotected Content wrap(Content node)
wrap
in class ContentWrapper
public boolean isInherited()
Copyright © 2003–2015 Magnolia International Ltd.. All rights reserved.