public abstract class JcrNode extends Object
Node
s 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 |
addPropertyList(PropertiesImpl props,
String typeId,
Set<String> filter,
String id,
List<String> values) |
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()
CmisRuntimeException
public String getId()
CmisRuntimeException
public 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()
JcrDocument
CmisConstraintException
- if this.isDocument() == false
public JcrFolder asFolder()
JcrFolder
CmisConstraintException
- if this.isFolder() == false
public JcrVersionBase asVersion()
JcrVersionBase
CmisConstraintException
- if this.isVersionable() == false
public JcrNode getNode(String path)
JcrNode
from a node at a given
JCR path.path
- JCR path of the nodepath
CmisObjectNotFoundException
- if path
does not identify a JCR nodeCmisRuntimeException
public 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 folderCmisRuntimeException
public JcrNode updateProperties(Properties properties)
CmisStorageException
public void delete(boolean allVersions, boolean isPwc)
CmisRuntimeException
public JcrNode move(JcrFolder parent)
CmisStorageException
protected abstract javax.jcr.Node getContextNode() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected 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.RepositoryException
protected Set<Action> compileAllowableActions(Set<Action> aas)
aas
- compilation of allowed actionsprotected String getChangeToken() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected String getLastModifiedBy() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected GregorianCalendar getLastModified() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected GregorianCalendar getCreated() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected String getCreatedBy() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected String getNodeName() throws javax.jcr.RepositoryException
node
.javax.jcr.RepositoryException
protected String getObjectId() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected String getVersionSeriesId() throws javax.jcr.RepositoryException
javax.jcr.RepositoryException
protected final JcrNode create(javax.jcr.Node node)
JcrNode
instance from a
JCR Node
node
- the JCR Node
JcrNode
protected 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 void addPropertyList(PropertiesImpl props, String typeId, Set<String> filter, String id, List<String> values)
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 historynode
javax.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.RepositoryException
protected static javax.jcr.version.Version getBaseVersion(javax.jcr.Node node) throws javax.jcr.RepositoryException
Node
.node
- the node for which to retrieve the base versionnode
javax.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.RepositoryException
protected 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.RepositoryException
protected 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.RepositoryException
Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.