public abstract class JcrNode extends Object
Nodes to be represented as CMIS objects. Instances of this class
are responsible for mapping from CMIS to JCR and vice versa.| Modifier and Type | Class and Description |
|---|---|
protected static class |
JcrNode.PropertyUpdater
|
| Modifier and Type | Field and Description |
|---|---|
static GregorianCalendar |
DATE_UNKNOWN
Default value for cmis:createdBy and cmis:lastModifiedDate
(Thu Jan 01 01:00:00 CET 1970)
|
protected PathManager |
pathManager |
protected JcrTypeHandlerManager |
typeHandlerManager |
protected JcrTypeManager |
typeManager |
static String |
USER_UNKNOWN
Default value for last cmis:createdBy and cmis:modifiedBy
|
| Modifier | Constructor and Description |
|---|---|
protected |
JcrNode(javax.jcr.Node node,
JcrTypeManager typeManager,
PathManager pathManager,
JcrTypeHandlerManager typeHandlerManager)
Create a new instance wrapping a JCR
node. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addPropertyBoolean(PropertiesImpl props,
String typeId,
Set<String> filter,
String id,
boolean value)
Add boolean property to the CMIS object represented by this instance
|
protected void |
addPropertyDateTime(PropertiesImpl props,
String typeId,
Set<String> filter,
String id,
GregorianCalendar value)
Add date-time property to the CMIS object represented by this instance
|
protected void |
addPropertyId(PropertiesImpl props,
String typeId,
Set<String> filter,
String id,
String value)
Add Id property to the CMIS object represented by this instance
|
protected void |
addPropertyInteger(PropertiesImpl props,
String typeId,
Set<String> filter,
String id,
long value)
Add integer property to the CMIS object represented by this instance
|
protected void |
addPropertyString(PropertiesImpl props,
String typeId,
Set<String> filter,
String id,
String value)
Add string property to the CMIS object represented by this instance
|
JcrDocument |
asDocument() |
JcrFolder |
asFolder() |
JcrVersionBase |
asVersion() |
protected boolean |
checkAddProperty(Properties properties,
String typeId,
Set<String> filter,
String id)
Validate a set of properties against a filter and its definitions
|
protected Set<Action> |
compileAllowableActions(Set<Action> aas)
Compile the allowed actions on the CMIS object represented by this instance
See CMIS 1.0 section 2.2.4.6 getAllowableActions
|
ObjectData |
compileObjectType(Set<String> filter,
Boolean includeAllowableActions,
ObjectInfoHandler objectInfos,
boolean requiresObjectInfo)
Compile the
ObjectData for this node |
protected void |
compileProperties(PropertiesImpl properties,
Set<String> filter,
ObjectInfoImpl objectInfo)
Compile the properties of the CMIS object represented by this instance.
|
protected JcrNode |
create(javax.jcr.Node node)
Factory method for creating a new
JcrNode instance from a JCR Node |
void |
delete(boolean allVersions,
boolean isPwc)
See CMIS 1.0 section 2.2.4.14 deleteObject
|
AllowableActions |
getAllowableActions()
See CMIS 1.0 section 2.2.4.6 getAllowableActions
|
protected abstract BaseTypeId |
getBaseTypeId() |
protected static javax.jcr.version.Version |
getBaseVersion(javax.jcr.Node node)
Utility function for retrieving the base version of a JCR
Node. |
protected String |
getChangeToken() |
protected abstract javax.jcr.Node |
getContextNode()
Retrieve the context node of the CMIS object represented by this instance.
|
protected GregorianCalendar |
getCreated() |
protected String |
getCreatedBy() |
String |
getId() |
protected GregorianCalendar |
getLastModified() |
protected String |
getLastModifiedBy() |
String |
getName() |
javax.jcr.Node |
getNode() |
JcrNode |
getNode(String path)
Factory method creating a new
JcrNode from a node at a given JCR path. |
protected String |
getNodeName() |
protected String |
getObjectId() |
JcrFolder |
getParent()
See CMIS 1.0 section 2.2.3.5 getObjectParents
|
protected static long |
getPropertyLength(javax.jcr.Node node,
String propertyName)
Utility function to retrieve the length of a property of a JCR
Node. |
protected static GregorianCalendar |
getPropertyOrElse(javax.jcr.Node node,
String propertyName,
GregorianCalendar defaultValue)
Utility function for retrieving a date property from a JCR
Node or a default
value in case of an error. |
protected static String |
getPropertyOrElse(javax.jcr.Node node,
String propertyName,
String defaultValue)
Utility function for retrieving a string property from a JCR
Node or a default
value in case of an error. |
String |
getTypeId() |
protected abstract String |
getTypeIdInternal() |
protected static javax.jcr.version.VersionHistory |
getVersionHistory(javax.jcr.Node node)
Utility function for retrieving the version history of a JCR
Node. |
protected static javax.jcr.version.VersionManager |
getVersionManager(javax.jcr.Node node)
Utility function for retrieving the version manager from a JCR
Node. |
protected String |
getVersionSeriesId() |
boolean |
isDocument() |
boolean |
isFolder() |
boolean |
isRoot() |
boolean |
isVersionable() |
JcrNode |
move(JcrFolder parent)
See CMIS 1.0 section 2.2.4.13 moveObject
|
protected static void |
setAction(Set<Action> actions,
Action action,
boolean condition)
Add
action to actions iff condition is true. |
String |
toString() |
protected void |
updateProperties(javax.jcr.Node node,
String typeId,
Properties properties)
Update the properties of the CMIS object represented by this instance
|
JcrNode |
updateProperties(Properties properties)
See CMIS 1.0 section 2.2.4.12 updateProperties
|
public static final String USER_UNKNOWN
public static final GregorianCalendar DATE_UNKNOWN
protected final JcrTypeManager typeManager
protected final PathManager pathManager
protected final JcrTypeHandlerManager typeHandlerManager
protected JcrNode(javax.jcr.Node node,
JcrTypeManager typeManager,
PathManager pathManager,
JcrTypeHandlerManager typeHandlerManager)
node.node - the JCR node to representtypeManager - pathManager - typeHandlerManager - public javax.jcr.Node getNode()
node represented by this instancepublic String getName()
CmisRuntimeExceptionpublic String getId()
CmisRuntimeExceptionpublic String getTypeId()
public boolean isRoot()
true iff this instance represent the root of the CMIS folder hierarchy.public boolean isDocument()
true iff this instance represents a cmis:document typepublic boolean isFolder()
true iff this instance represents a cmis:folder typepublic boolean isVersionable()
true iff this instance represents a versionable CMIS objectpublic JcrDocument asDocument()
JcrDocumentCmisConstraintException - if this.isDocument() == falsepublic JcrFolder asFolder()
JcrFolderCmisConstraintException - if this.isFolder() == falsepublic JcrVersionBase asVersion()
JcrVersionBaseCmisConstraintException - if this.isVersionable() == falsepublic JcrNode getNode(String path)
JcrNode from a node at a given JCR path.path - JCR path of the nodepathCmisObjectNotFoundException - if path does not identify a JCR nodeCmisRuntimeExceptionpublic ObjectData compileObjectType(Set<String> filter, Boolean includeAllowableActions, ObjectInfoHandler objectInfos, boolean requiresObjectInfo)
ObjectData for this nodepublic AllowableActions getAllowableActions()
public JcrFolder getParent()
CmisObjectNotFoundException - if this is the root folderCmisRuntimeExceptionpublic JcrNode updateProperties(Properties properties)
CmisStorageExceptionpublic void delete(boolean allVersions,
boolean isPwc)
CmisRuntimeExceptionpublic JcrNode move(JcrFolder parent)
CmisStorageExceptionprotected abstract javax.jcr.Node getContextNode()
throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected abstract BaseTypeId getBaseTypeId()
cmis:baseTypeId propertyprotected abstract String getTypeIdInternal()
cmis:objectTypeId propertyprotected void compileProperties(PropertiesImpl properties, Set<String> filter, ObjectInfoImpl objectInfo) throws javax.jcr.RepositoryException
properties - compilation of propertiesfilter - objectInfo - javax.jcr.RepositoryExceptionprotected Set<Action> compileAllowableActions(Set<Action> aas)
aas - compilation of allowed actionsprotected String getChangeToken() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected String getLastModifiedBy() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected GregorianCalendar getLastModified() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected GregorianCalendar getCreated() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected String getCreatedBy() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected String getNodeName() throws javax.jcr.RepositoryException
node.javax.jcr.RepositoryExceptionprotected String getObjectId() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected String getVersionSeriesId() throws javax.jcr.RepositoryException
javax.jcr.RepositoryExceptionprotected final JcrNode create(javax.jcr.Node node)
JcrNode instance from a JCR Nodenode - the JCR NodeJcrNodeprotected final void addPropertyId(PropertiesImpl props, String typeId, Set<String> filter, String id, String value)
protected final void addPropertyString(PropertiesImpl props, String typeId, Set<String> filter, String id, String value)
protected final void addPropertyInteger(PropertiesImpl props, String typeId, Set<String> filter, String id, long value)
protected final void addPropertyBoolean(PropertiesImpl props, String typeId, Set<String> filter, String id, boolean value)
protected final void addPropertyDateTime(PropertiesImpl props, String typeId, Set<String> filter, String id, GregorianCalendar value)
protected final boolean checkAddProperty(Properties properties, String typeId, Set<String> filter, String id)
protected final void updateProperties(javax.jcr.Node node,
String typeId,
Properties properties)
protected static javax.jcr.version.VersionHistory getVersionHistory(javax.jcr.Node node)
throws javax.jcr.RepositoryException
Node.node - the node for which to retrieve the version historynodejavax.jcr.RepositoryException - if node is not versionableprotected static javax.jcr.version.VersionManager getVersionManager(javax.jcr.Node node)
throws javax.jcr.RepositoryException
Node.node - javax.jcr.RepositoryExceptionprotected static javax.jcr.version.Version getBaseVersion(javax.jcr.Node node)
throws javax.jcr.RepositoryException
Node.node - the node for which to retrieve the base versionnodejavax.jcr.RepositoryException - if node is not versionableprotected static long getPropertyLength(javax.jcr.Node node,
String propertyName)
throws javax.jcr.RepositoryException
Node.node - propertyName - javax.jcr.RepositoryExceptionprotected static String getPropertyOrElse(javax.jcr.Node node, String propertyName, String defaultValue) throws javax.jcr.RepositoryException
Node or a default
value in case of an error.node - propertyName - defaultValue - javax.jcr.RepositoryExceptionprotected static GregorianCalendar getPropertyOrElse(javax.jcr.Node node, String propertyName, GregorianCalendar defaultValue) throws javax.jcr.RepositoryException
Node or a default
value in case of an error.node - propertyName - defaultValue - javax.jcr.RepositoryExceptionCopyright © 2009-2012 The Apache Software Foundation. All Rights Reserved.