|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object info.magnolia.cms.core.ContentHandler info.magnolia.cms.core.AbstractContent info.magnolia.cms.util.ContentWrapper info.magnolia.cms.util.InheritanceContentWrapper
public class InheritanceContentWrapper
This wrapper inherits content from the parent hierarchy. The method 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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface info.magnolia.cms.core.Content |
---|
Content.ContentFilter |
Field Summary |
---|
Fields inherited from class info.magnolia.cms.core.ContentHandler |
---|
hierarchyManager |
Constructor Summary | |
---|---|
InheritanceContentWrapper(Content node)
Starts the inheritance. |
|
InheritanceContentWrapper(Content wrappedContent,
Content start)
Used if in the wrap(Content) method. |
Method Summary | |
---|---|
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)
|
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. |
Methods inherited from class info.magnolia.cms.util.ContentWrapper |
---|
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 |
Methods inherited from class info.magnolia.cms.core.AbstractContent |
---|
createContent, createContent, createNodeData, createNodeData, createNodeData, createNodeData, createNodeData, delete, getBinaryNodeDatas, getChildren, getChildren, getChildren, getChildren, getChildren, getChildren, getNodeDataCollection, hasChildren, hasChildren, hasNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData, setNodeData |
Methods inherited from class info.magnolia.cms.core.ContentHandler |
---|
clone, getAccessManager, setAccessManager, setHierarchyManager |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface info.magnolia.cms.core.Content |
---|
getAccessManager |
Constructor Detail |
---|
public InheritanceContentWrapper(Content wrappedContent, Content start)
wrap(Content)
method.
public InheritanceContentWrapper(Content node)
Method Detail |
---|
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.PathNotFoundException
javax.jcr.RepositoryException
- if an error occurs
AccessDeniedException
- 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 type
getNodeData
in interface Content
getNodeData
in class AbstractContent
NodeData
objectprotected Content wrap(Content node)
wrap
in class ContentWrapper
public boolean isInherited()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |