|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.chemistry.opencmis.jcr.JcrNode
public abstract class JcrNode
Common base class for all JCR Node
s to be represented as CMIS objects. Instances of this class
are responsible for mapping from CMIS to JCR and vice versa.
Field Summary | |
---|---|
static GregorianCalendar |
DATE_UNKNOWN
Default value for cmis:createdBy and cmis:lastModifiedDate (Thu Jan 01 01:11:59 CET 1970) |
protected PathManager |
pathManager
|
protected TypeManager |
typeManager
|
static String |
USER_UNKNOWN
Default value for last cmis:createdBy and cmis:modifiedBy |
Constructor Summary | |
---|---|
JcrNode(javax.jcr.Node node,
TypeManager typeManager,
PathManager pathManager,
JcrNodeFactory nodeFactory)
Create a new instance wrapping a JCR node . |
Method Summary | |
---|---|
protected void |
addPropertyBoolean(org.apache.chemistry.opencmis.commons.impl.dataobjects.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(org.apache.chemistry.opencmis.commons.impl.dataobjects.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(org.apache.chemistry.opencmis.commons.impl.dataobjects.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(org.apache.chemistry.opencmis.commons.impl.dataobjects.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(org.apache.chemistry.opencmis.commons.impl.dataobjects.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(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl properties,
Set<String> filter,
org.apache.chemistry.opencmis.commons.impl.server.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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String USER_UNKNOWN
public static final GregorianCalendar DATE_UNKNOWN
protected final TypeManager typeManager
protected final PathManager pathManager
Constructor Detail |
---|
public JcrNode(javax.jcr.Node node, TypeManager typeManager, PathManager pathManager, JcrNodeFactory nodeFactory)
node
.
node
- the JCR node
to representtypeManager
- pathManager
- nodeFactory
- Method Detail |
---|
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 node
path
CmisObjectNotFoundException
- if path
does not identify a JCR node
CmisRuntimeException
public ObjectData compileObjectType(Set<String> filter, Boolean includeAllowableActions, ObjectInfoHandler objectInfos, boolean requiresObjectInfo)
ObjectData
for this node
public AllowableActions getAllowableActions()
public JcrFolder getParent()
CmisObjectNotFoundException
- if this is the root folder
CmisRuntimeException
public JcrNode updateProperties(Properties properties)
CmisStorageException
public void delete(boolean allVersions, boolean isPwc)
CmisRuntimeException
public JcrNode move(JcrFolder parent)
CmisStorageException
public String toString()
toString
in class Object
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(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl properties, Set<String> filter, org.apache.chemistry.opencmis.commons.impl.server.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 actions
protected 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(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, String typeId, Set<String> filter, String id, String value)
protected final void addPropertyString(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, String typeId, Set<String> filter, String id, String value)
protected final void addPropertyInteger(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, String typeId, Set<String> filter, String id, long value)
protected final void addPropertyBoolean(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, String typeId, Set<String> filter, String id, boolean value)
protected final void addPropertyDateTime(org.apache.chemistry.opencmis.commons.impl.dataobjects.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 history
node
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 version
node
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
protected static void setAction(Set<Action> actions, Action action, boolean condition)
action
to actions
iff condition
is true.
actions
- action
- condition
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |