|
||||||||||
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(String name)
Creates a Content node under the current node with the specified name. |
Content |
createContent(String name,
ItemType contentType)
Creates a Content node under the current node with the specified name. |
NodeData |
createNodeData(String name)
Creates a node data of type STRING with an empty String as default value. |
NodeData |
createNodeData(String name,
int type)
Deprecated. |
NodeData |
createNodeData(String name,
Object valueObj)
Deprecated. |
NodeData |
createNodeData(String name,
javax.jcr.Value value)
Creates a node data setting the value. |
NodeData |
createNodeData(String name,
javax.jcr.Value[] value)
Deprecated. |
void |
delete(String path)
Remove specified path. |
void |
deleteNodeData(String name)
Delete NodeData with the specified name. |
protected Collection<NodeData> |
getBinaryNodeDatas(String namePattern)
|
Content |
getChildByName(String namePattern)
Deprecated. |
Collection<Content> |
getChildren()
Gets a Collection containing all child nodes of the same NodeType as "this" object. |
Collection<Content> |
getChildren(Content.ContentFilter filter)
Get a collection containing child nodes which satisfies the given filter. |
Collection<Content> |
getChildren(Content.ContentFilter filter,
Comparator<Content> orderCriteria)
Get a collection containing child nodes which satisfies the given filter. |
abstract Collection<Content> |
getChildren(Content.ContentFilter filter,
String namePattern,
Comparator<Content> orderCriteria)
|
Collection<Content> |
getChildren(ItemType itemType)
Get collection of specified content type. |
Collection<Content> |
getChildren(String contentType)
Get collection of specified content type and its subtypes. |
Collection<Content> |
getChildren(String contentType,
String namePattern)
Get collection of specified content type. |
NodeData |
getNodeData(String name)
Returns a NodeData object. |
Collection<NodeData> |
getNodeDataCollection()
Gets all properties bind in NodeData object excluding JCR system properties. |
String |
getTemplate()
Returns the template name which is assigned to this content. |
String |
getTitle()
|
javax.jcr.Workspace |
getWorkspace()
get workspace to which this node attached to. |
boolean |
hasChildren()
|
boolean |
hasChildren(String contentType)
|
boolean |
hasNodeData(String name)
Delegates to NodeData.isExist() . |
boolean |
isGranted(long permissions)
checks for the allowed access rights. |
boolean |
isNodeData(String path)
checks if the requested resource is an NodeData (Property). |
abstract NodeData |
newNodeDataInstance(String name,
int type,
boolean createIfNotExisting)
As defined in Content.getNodeData(String) this method always returns a node data object. |
NodeData |
setNodeData(String name,
boolean value)
Sets the node data. |
NodeData |
setNodeData(String name,
Calendar value)
Sets the node data. |
NodeData |
setNodeData(String name,
Content value)
Sets the node data. |
NodeData |
setNodeData(String name,
double value)
Sets the node data. |
NodeData |
setNodeData(String name,
InputStream value)
Sets the node data. |
NodeData |
setNodeData(String name,
long value)
Sets the node data. |
NodeData |
setNodeData(String name,
Object value)
Uses the NodeDataUtil to create and set the node data based on the object type. |
NodeData |
setNodeData(String name,
String value)
Sets the node data. |
NodeData |
setNodeData(String name,
javax.jcr.Value value)
Sets the node data. |
NodeData |
setNodeData(String name,
javax.jcr.Value[] value)
Sets the node data. |
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(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(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(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(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(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(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(String name, Object valueObj) throws javax.jcr.RepositoryException
Content
createNodeData
in interface Content
javax.jcr.RepositoryException
public NodeData getNodeData(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(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(String name) throws javax.jcr.RepositoryException
NodeData.isExist()
.
hasNodeData
in interface Content
javax.jcr.RepositoryException
- if an error occurspublic NodeData setNodeData(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(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(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(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(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(String name, 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(String name, 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(String name, 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(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(String name, 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(String name) throws javax.jcr.PathNotFoundException, javax.jcr.RepositoryException
Content
deleteNodeData
in interface Content
javax.jcr.PathNotFoundException
javax.jcr.RepositoryException
- if an error occurspublic Collection<Content> getChildren()
getChildren(ItemType)
passing the current node's type.
getChildren
in interface Content
public Collection<Content> getChildren(Content.ContentFilter filter)
getChildren
in interface Content
public Collection<Content> getChildren(ItemType itemType)
getChildren
in interface Content
itemType
- ItemType
public Collection<Content> getChildren(String contentType)
getChildren
in interface Content
contentType
- JCR node type as configured
public Collection<Content> getChildren(String contentType, String namePattern)
getChildren(info.magnolia.cms.core.Content.ContentFilter, String, java.util.Comparator)
.
getChildren
in interface Content
contentType
- JCR node type as configured
public Collection<Content> getChildren(Content.ContentFilter filter, 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 Collection<Content> getChildren(Content.ContentFilter filter, String namePattern, Comparator<Content> orderCriteria)
namePattern
- ignored if null.@Deprecated public Content getChildByName(String namePattern)
Content
getChildByName
in interface Content
namePattern
- child node name
null
if not foundpublic Collection<NodeData> getNodeDataCollection()
Content
getNodeDataCollection
in interface Content
protected Collection<NodeData> getBinaryNodeDatas(String namePattern) throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
public boolean hasChildren()
hasChildren
in interface Content
public boolean hasChildren(String contentType)
hasChildren
in interface Content
contentType
- JCR node type as configured
collectionType
existspublic void delete(String path) throws javax.jcr.RepositoryException
Content
delete
in interface Content
javax.jcr.RepositoryException
- if an error occurspublic boolean isNodeData(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 String getTemplate()
Content
getTemplate
in interface Content
public 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 String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |