org.apache.chemistry.opencmis.jcr
Class JcrVersionBase

java.lang.Object
  extended by org.apache.chemistry.opencmis.jcr.JcrNode
      extended by org.apache.chemistry.opencmis.jcr.JcrDocument
          extended by org.apache.chemistry.opencmis.jcr.JcrVersionBase
Direct Known Subclasses:
JcrPrivateWorkingCopy, JcrVersion

public abstract class JcrVersionBase
extends JcrDocument

Instances of this class represent a versionable cmis:document and its versions backed by an underlying JCR Node.


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.chemistry.opencmis.jcr.JcrNode
JcrNode.PropertyUpdater
 
Field Summary
 
Fields inherited from class org.apache.chemistry.opencmis.jcr.JcrDocument
MIME_UNKNOWN
 
Fields inherited from class org.apache.chemistry.opencmis.jcr.JcrNode
DATE_UNKNOWN, pathManager, typeManager, USER_UNKNOWN
 
Constructor Summary
JcrVersionBase(javax.jcr.Node node, JcrTypeManager typeManager, PathManager pathManager, JcrNodeFactory nodeFactory)
           
 
Method Summary
 void cancelCheckout()
          See CMIS 1.0 section 2.2.7.2 cancelCheckout
 JcrVersion checkin(Properties properties, ContentStream contentStream, java.lang.String checkinComment)
          See CMIS 1.0 section 2.2.7.3 checkedIn
 JcrPrivateWorkingCopy checkout()
          See CMIS 1.0 section 2.2.7.1 checkOut
protected  java.util.Set<Action> compileAllowableActions(java.util.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
protected  void compileProperties(PropertiesImpl properties, java.util.Set<java.lang.String> filter, ObjectInfoImpl objectInfo)
          Compile the properties of the CMIS object represented by this instance.
 void delete(boolean allVersions, boolean isPwc)
          See CMIS 1.0 section 2.2.4.14 deleteObject
protected  java.lang.String getBaseNodeId()
           
protected  java.lang.String getCheckedOutBy()
           
protected  java.lang.String getCheckedOutId()
           
 JcrPrivateWorkingCopy getPwc()
          Get the private working copy of the versions series or throw an exception if not checked out.
protected  java.lang.String getPwcId()
           
protected  java.lang.String getTypeIdInternal()
           
 JcrVersion getVersion(java.lang.String name)
          Get a specific version by name
 java.util.Iterator<JcrVersion> getVersions()
          See CMIS 1.0 section 2.2.7.6 getAllVersions
protected  boolean isCheckedOut()
           
 
Methods inherited from class org.apache.chemistry.opencmis.jcr.JcrDocument
getBaseTypeId, getCheckInComment, getContentStream, getIsImmutable, getVersionLabel, isDocumentCheckedOut, isLatestMajorVersion, isLatestVersion, isMajorVersion, setContentStream
 
Methods inherited from class org.apache.chemistry.opencmis.jcr.JcrNode
addPropertyBoolean, addPropertyDateTime, addPropertyId, addPropertyInteger, addPropertyString, asDocument, asFolder, asVersion, checkAddProperty, compileObjectType, create, getAllowableActions, getBaseVersion, getChangeToken, getContextNode, getCreated, getCreatedBy, getId, getLastModified, getLastModifiedBy, getName, getNode, getNode, getNodeName, getObjectId, getParent, getPropertyLength, getPropertyOrElse, getPropertyOrElse, getTypeId, getVersionHistory, getVersionManager, getVersionSeriesId, isDocument, isFolder, isRoot, isVersionable, move, setAction, toString, updateProperties, updateProperties
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JcrVersionBase

public JcrVersionBase(javax.jcr.Node node,
                      JcrTypeManager typeManager,
                      PathManager pathManager,
                      JcrNodeFactory nodeFactory)
Method Detail

getVersions

public java.util.Iterator<JcrVersion> getVersions()
See CMIS 1.0 section 2.2.7.6 getAllVersions


delete

public void delete(boolean allVersions,
                   boolean isPwc)
Description copied from class: JcrNode
See CMIS 1.0 section 2.2.4.14 deleteObject

Overrides:
delete in class JcrNode

checkout

public JcrPrivateWorkingCopy checkout()
See CMIS 1.0 section 2.2.7.1 checkOut

Throws:
CmisRuntimeException

checkin

public JcrVersion checkin(Properties properties,
                          ContentStream contentStream,
                          java.lang.String checkinComment)
See CMIS 1.0 section 2.2.7.3 checkedIn

Throws:
CmisRuntimeException

cancelCheckout

public void cancelCheckout()
See CMIS 1.0 section 2.2.7.2 cancelCheckout

Throws:
CmisRuntimeException

getPwc

public JcrPrivateWorkingCopy getPwc()
Get the private working copy of the versions series or throw an exception if not checked out.

Returns:
a JcrPrivateWorkingCopy instance
Throws:
CmisObjectNotFoundException - if not checked out
CmisRuntimeException

getVersion

public JcrVersion getVersion(java.lang.String name)
Get a specific version by name

Parameters:
name - name of the version to get
Returns:
a JcrVersion instance for name
Throws:
CmisObjectNotFoundException - if a version name does not exist
CmisRuntimeException

getBaseNodeId

protected java.lang.String getBaseNodeId()
                                  throws javax.jcr.RepositoryException
Returns:
Id of the version representing the base of this verions series
Throws:
javax.jcr.RepositoryException

getPwcId

protected java.lang.String getPwcId()
                             throws javax.jcr.RepositoryException
Returns:
Id of the private working copy of this version series
Throws:
javax.jcr.RepositoryException

compileProperties

protected void compileProperties(PropertiesImpl properties,
                                 java.util.Set<java.lang.String> filter,
                                 ObjectInfoImpl objectInfo)
                          throws javax.jcr.RepositoryException
Description copied from class: JcrNode
Compile the properties of the CMIS object represented by this instance. See CMIS 1.0 section 2.2.4.7 getObject

Overrides:
compileProperties in class JcrDocument
Parameters:
properties - compilation of properties
Throws:
javax.jcr.RepositoryException

compileAllowableActions

protected java.util.Set<Action> compileAllowableActions(java.util.Set<Action> aas)
Description copied from class: JcrNode
Compile the allowed actions on the CMIS object represented by this instance See CMIS 1.0 section 2.2.4.6 getAllowableActions

Overrides:
compileAllowableActions in class JcrDocument
Parameters:
aas - compilation of allowed actions
Returns:

getTypeIdInternal

protected java.lang.String getTypeIdInternal()
Specified by:
getTypeIdInternal in class JcrNode
Returns:
the value of the cmis:objectTypeId property

isCheckedOut

protected boolean isCheckedOut()
                        throws javax.jcr.RepositoryException
Specified by:
isCheckedOut in class JcrDocument
Returns:
the value of the cmis:isVersionSeriesCheckedOut property
Throws:
javax.jcr.RepositoryException

getCheckedOutId

protected java.lang.String getCheckedOutId()
                                    throws javax.jcr.RepositoryException
Specified by:
getCheckedOutId in class JcrDocument
Returns:
the value of the cmis:versionSeriesCheckedOutId property
Throws:
javax.jcr.RepositoryException

getCheckedOutBy

protected java.lang.String getCheckedOutBy()
                                    throws javax.jcr.RepositoryException
Specified by:
getCheckedOutBy in class JcrDocument
Returns:
the value of the cmis:versionSeriesCheckedOutBy property
Throws:
javax.jcr.RepositoryException


Copyright © 2009-2011 The Apache Software Foundation. All Rights Reserved.