|
||||||||||
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
public abstract class AbstractContent
A base class by implementing some default behavior.
A subclass must carefully implement newNodeDataInstance(String, int, boolean)
,
getChildren(info.magnolia.cms.core.Content.ContentFilter, String, java.util.Comparator)
and
Content.getNodeDataCollection(String)
.
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 | |
---|---|
AbstractContent()
|
Method Summary | |
---|---|
Content |
createContent(java.lang.String name)
Creates a Content node under the current node with the specified name. |
Content |
createContent(java.lang.String name,
ItemType contentType)
Creates a Content node under the current node with the specified name. |
NodeData |
createNodeData(java.lang.String name)
Creates a node data of type STRING with an empty String as default value. |
NodeData |
createNodeData(java.lang.String name,
int type)
Deprecated. |
NodeData |
createNodeData(java.lang.String name,
java.lang.Object valueObj)
Deprecated. |
NodeData |
createNodeData(java.lang.String name,
javax.jcr.Value value)
Creates a node data setting the value. |
NodeData |
createNodeData(java.lang.String name,
javax.jcr.Value[] value)
Deprecated. |
void |
delete(java.lang.String path)
Remove specified path. |
void |
deleteNodeData(java.lang.String name)
Delete NodeData with the specified name. |
protected java.util.Collection<NodeData> |
getBinaryNodeDatas(java.lang.String namePattern)
|
Content |
getChildByName(java.lang.String namePattern)
Deprecated. |
java.util.Collection<Content> |
getChildren()
Gets a Collection containing all child nodes of the same NodeType as "this" object. |
java.util.Collection<Content> |
getChildren(Content.ContentFilter filter)
Get a collection containing child nodes which satisfies the given filter. |
java.util.Collection<Content> |
getChildren(Content.ContentFilter filter,
java.util.Comparator<Content> orderCriteria)
Get a collection containing child nodes which satisfies the given filter. |
abstract java.util.Collection<Content> |
getChildren(Content.ContentFilter filter,
java.lang.String namePattern,
java.util.Comparator<Content> orderCriteria)
|
java.util.Collection<Content> |
getChildren(ItemType itemType)
Get collection of specified content type. |
java.util.Collection<Content> |
getChildren(java.lang.String contentType)
Get collection of specified content type and its subtypes. |
java.util.Collection<Content> |
getChildren(java.lang.String contentType,
java.lang.String namePattern)
Get collection of specified content type. |
NodeData |
getNodeData(java.lang.String name)
Returns a NodeData object. |
java.util.Collection<NodeData> |
getNodeDataCollection()
Gets all properties bind in NodeData object excluding JCR system properties. |
java.lang.String |
getTemplate()
Returns the template name which is assigned to this content. |
java.lang.String |
getTitle()
|
javax.jcr.Workspace |
getWorkspace()
get workspace to which this node attached to. |
boolean |
hasChildren()
|
boolean |
hasChildren(java.lang.String contentType)
|
boolean |
hasNodeData(java.lang.String name)
Delegates to NodeData.isExist() . |
boolean |
isGranted(long permissions)
checks for the allowed access rights. |
boolean |
isNodeData(java.lang.String path)
checks if the requested resource is an NodeData (Property). |
abstract NodeData |
newNodeDataInstance(java.lang.String name,
int type,
boolean createIfNotExisting)
As defined in Content.getNodeData(String) this method always returns a node data object. |
NodeData |
setNodeData(java.lang.String name,
boolean value)
Sets the node data. |
NodeData |
setNodeData(java.lang.String name,
java.util.Calendar value)
Sets the node data. |
NodeData |
setNodeData(java.lang.String name,
Content value)
Sets the node data. |
NodeData |
setNodeData(java.lang.String name,
double value)
Sets the node data. |
NodeData |
setNodeData(java.lang.String name,
java.io.InputStream value)
Sets the node data. |
NodeData |
setNodeData(java.lang.String name,
long value)
Sets the node data. |
NodeData |
setNodeData(java.lang.String name,
java.lang.Object value)
Uses the NodeDataUtil to create and set the node data based on the object type. |
NodeData |
setNodeData(java.lang.String name,
java.lang.String value)
Sets the node data. |
NodeData |
setNodeData(java.lang.String name,
javax.jcr.Value value)
Sets the node data. |
NodeData |
setNodeData(java.lang.String name,
javax.jcr.Value[] value)
Sets the node data. |
java.lang.String |
toString()
|
void |
updateMetaData()
You could call this method anytime to update working page properties - Modification date & Author ID. |
Methods inherited from class info.magnolia.cms.core.ContentHandler |
---|
clone, getAccessManager, getHierarchyManager, 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 |
---|
addMixin, addVersion, addVersion, createContent, delete, getAccessManager, getAllVersions, getAncestor, getAncestors, getBaseVersion, getContent, getHandle, getHierarchyManager, getIndex, getItemType, getJCRNode, getLevel, getLock, getMetaData, getMixinNodeTypes, getName, getNodeDataCollection, getNodeType, getNodeTypeName, getParent, getUUID, getVersionedContent, getVersionedContent, getVersionHistory, hasContent, hasMetaData, hasMixin, holdsLock, isLocked, isModified, isNodeType, lock, lock, orderBefore, refresh, removeMixin, removeVersionHistory, restore, restore, restore, restoreByLabel, save, unlock |
Constructor Detail |
---|
public AbstractContent()
Method Detail |
---|
public Content createContent(java.lang.String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
ItemType.CONTENT
will be use as the contents primary type.
createContent
in interface Content
name
- of the node to be created as Content
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 Content createContent(java.lang.String name, ItemType contentType) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
createContent
in interface Content
name
- of the node to be created as Content
contentType
- ItemType
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 NodeData createNodeData(java.lang.String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
createNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public NodeData createNodeData(java.lang.String name, javax.jcr.Value value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
createNodeData
in interface Content
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operation
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
@Deprecated public NodeData createNodeData(java.lang.String name, javax.jcr.Value[] value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
createNodeData
in interface Content
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operation
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
@Deprecated public NodeData createNodeData(java.lang.String name, int type) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
createNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
@Deprecated public NodeData createNodeData(java.lang.String name, java.lang.Object valueObj) throws javax.jcr.RepositoryException
Content
createNodeData
in interface Content
javax.jcr.RepositoryException
public NodeData getNodeData(java.lang.String name)
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 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
NodeData
objectpublic abstract NodeData newNodeDataInstance(java.lang.String name, int type, boolean createIfNotExisting) throws AccessDeniedException, javax.jcr.RepositoryException
Content.getNodeData(String)
this method always returns a node data object. If the type is PropertyType.UNDEFINED
the implementation should check if the node data exists and determine the type to use.
createIfNotExisting
- if false an empty non-mutable node data will be returned if the node data doesn't exist otherwise a mutable nodedata object is returned (depending on the type)
AccessDeniedException
javax.jcr.RepositoryException
public boolean hasNodeData(java.lang.String name) throws javax.jcr.RepositoryException
NodeData.isExist()
.
hasNodeData
in interface Content
javax.jcr.RepositoryException
- if an error occurspublic NodeData setNodeData(java.lang.String name, javax.jcr.Value value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
setNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public NodeData setNodeData(java.lang.String name, javax.jcr.Value[] value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
setNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public NodeData setNodeData(java.lang.String name, boolean value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
setNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public NodeData setNodeData(java.lang.String name, long value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
setNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public NodeData setNodeData(java.lang.String name, double value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
setNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public NodeData setNodeData(java.lang.String name, java.lang.String value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
setNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public NodeData setNodeData(java.lang.String name, java.io.InputStream value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
setNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public NodeData setNodeData(java.lang.String name, java.util.Calendar value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
setNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public NodeData setNodeData(java.lang.String name, Content value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
Content
setNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public NodeData setNodeData(java.lang.String name, java.lang.Object value) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException, AccessDeniedException
NodeDataUtil
to create and set the node data based on the object type.
setNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
AccessDeniedException
public void deleteNodeData(java.lang.String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
Content
deleteNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
- if an error occurspublic java.util.Collection<Content> getChildren()
getChildren(ItemType)
passing the current node's type.
getChildren
in interface Content
public java.util.Collection<Content> getChildren(Content.ContentFilter filter)
getChildren
in interface Content
public java.util.Collection<Content> getChildren(ItemType itemType)
getChildren
in interface Content
itemType
- ItemType
public java.util.Collection<Content> getChildren(java.lang.String contentType)
getChildren
in interface Content
contentType
- JCR node type as configured
public java.util.Collection<Content> getChildren(java.lang.String contentType, java.lang.String namePattern)
getChildren(info.magnolia.cms.core.Content.ContentFilter, String, java.util.Comparator)
.
getChildren
in interface Content
contentType
- JCR node type as configured
public java.util.Collection<Content> getChildren(Content.ContentFilter filter, java.util.Comparator<Content> orderCriteria)
getChildren(info.magnolia.cms.core.Content.ContentFilter, String, java.util.Comparator)
.
getChildren
in interface Content
filter
- filter for the child nodesorderCriteria
- ordering for the selected child nodes; if null than no
particular order of the child nodes
public abstract java.util.Collection<Content> getChildren(Content.ContentFilter filter, java.lang.String namePattern, java.util.Comparator<Content> orderCriteria)
namePattern
- ignored if null.@Deprecated public Content getChildByName(java.lang.String namePattern)
Content
getChildByName
in interface Content
namePattern
- child node name
null
if not foundpublic java.util.Collection<NodeData> getNodeDataCollection()
Content
getNodeDataCollection
in interface Content
protected java.util.Collection<NodeData> getBinaryNodeDatas(java.lang.String namePattern) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public boolean hasChildren()
hasChildren
in interface Content
public boolean hasChildren(java.lang.String contentType)
hasChildren
in interface Content
contentType
- JCR node type as configured
collectionType
existspublic void delete(java.lang.String path) throws javax.jcr.RepositoryException
Content
delete
in interface Content
javax.jcr.RepositoryException
- if an error occurspublic boolean isNodeData(java.lang.String path) throws AccessDeniedException, javax.jcr.RepositoryException
Content
isNodeData
in interface Content
path
- of the requested NodeData
AccessDeniedException
javax.jcr.RepositoryException
- if an error occurspublic java.lang.String getTemplate()
Content
getTemplate
in interface Content
public java.lang.String getTitle()
getTitle
in interface Content
public void updateMetaData() throws javax.jcr.RepositoryException, AccessDeniedException
Content
updateMetaData
in interface Content
AccessDeniedException
- if the current session does not have sufficient access rights
to complete the operation
javax.jcr.RepositoryException
- if an error occurspublic boolean isGranted(long permissions)
Content
isGranted
in interface Content
permissions
- as defined in javax.jcr.Permission
public javax.jcr.Workspace getWorkspace() throws javax.jcr.RepositoryException
Content
getWorkspace
in interface Content
javax.jcr.RepositoryException
- if unable to get this node sessionpublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |