org.exoplatform.ecms.xcmis.sp
Class DocumentVersion

java.lang.Object
  extended by org.exoplatform.ecms.xcmis.sp.DocumentVersion
All Implemented Interfaces:
org.xcmis.spi.DocumentData, org.xcmis.spi.ObjectData

public class DocumentVersion
extends java.lang.Object

Version:
$Id$
Author:
Andrey Parfonov

Field Summary
protected static java.util.Set<java.lang.String> CHECKOUT_SKIP
           
protected  org.exoplatform.ecms.xcmis.sp.JcrNodeEntry entry
           
 
Constructor Summary
DocumentVersion(org.exoplatform.ecms.xcmis.sp.JcrNodeEntry jcrEntry)
           
 
Method Summary
 void accept(org.xcmis.spi.ObjectDataVisitor visitor)
          
 void applyPolicy(org.xcmis.spi.PolicyData policy)
          
 void cancelCheckout()
          
 org.xcmis.spi.DocumentData checkin(boolean major, java.lang.String checkinComment, java.util.Map<java.lang.String,org.xcmis.spi.model.Property<?>> properties, org.xcmis.spi.ContentStream content, java.util.List<org.xcmis.spi.model.AccessControlEntry> acl, java.util.Collection<org.xcmis.spi.PolicyData> policies)
          
 org.xcmis.spi.DocumentData checkout()
          
 void delete()
          Delete current object.
protected  org.xcmis.spi.model.Property<?> doGetProperty(org.xcmis.spi.model.PropertyDefinition<?> definition)
           
protected  void doSetProperty(org.xcmis.spi.model.Property<?> property)
          Update properties, skip on-create and read-only properties
 boolean equals(java.lang.Object obj)
           
 java.util.List<org.xcmis.spi.model.AccessControlEntry> getACL(boolean onlyBasicPermissions)
          
 org.xcmis.spi.model.BaseType getBaseType()
          
 java.lang.String getChangeToken()
          
 org.xcmis.spi.ContentStream getContentStream()
          
 org.xcmis.spi.ContentStream getContentStream(java.lang.String streamId)
          
 java.lang.String getContentStreamFileName()
           
protected  java.lang.String getContentStreamId()
           
protected  long getContentStreamLength()
           
 java.lang.String getContentStreamMimeType()
          
 java.lang.String getCreatedBy()
          
 java.util.Calendar getCreationDate()
          
 java.util.Calendar getLastModificationDate()
          
 java.lang.String getLastModifiedBy()
          
 java.lang.String getName()
          
 java.lang.String getObjectId()
          
 org.xcmis.spi.FolderData getParent()
          
 java.util.Collection<org.xcmis.spi.FolderData> getParents()
          
 java.util.Collection<org.xcmis.spi.PolicyData> getPolicies()
          
 java.util.Map<java.lang.String,org.xcmis.spi.model.Property<?>> getProperties()
          
 java.util.Map<java.lang.String,org.xcmis.spi.model.Property<?>> getProperties(org.xcmis.spi.PropertyFilter filter)
          
 org.xcmis.spi.model.Property<?> getProperty(java.lang.String id)
          
 org.xcmis.spi.ItemsIterator<org.xcmis.spi.RelationshipData> getRelationships(org.xcmis.spi.model.RelationshipDirection direction, org.xcmis.spi.model.TypeDefinition type, boolean includeSubRelationshipTypes)
          
 org.xcmis.spi.model.TypeDefinition getTypeDefinition()
          
 java.lang.String getTypeId()
          
 java.lang.String getVersionLabel()
          
 java.lang.String getVersionSeriesCheckedOutBy()
          
 java.lang.String getVersionSeriesCheckedOutId()
          
 java.lang.String getVersionSeriesId()
          
 boolean hasContent()
          
 int hashCode()
           
 boolean isLatestMajorVersion()
          
 boolean isLatestVersion()
          
 boolean isMajorVersion()
          
 boolean isPWC()
          
 boolean isVersionSeriesCheckedOut()
          
 void removePolicy(org.xcmis.spi.PolicyData policy)
          
protected  void save()
          
 void setACL(java.util.List<org.xcmis.spi.model.AccessControlEntry> aces)
          
 void setContentStream(org.xcmis.spi.ContentStream contentStream)
          
 void setProperties(java.util.Map<java.lang.String,org.xcmis.spi.model.Property<?>> properties)
          
 void setProperty(org.xcmis.spi.model.Property<?> property)
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xcmis.spi.ObjectData
accept, getBaseType, getChangeToken, getCreatedBy, getLastModifiedBy, getProperties, getProperties, getProperty, getTypeDefinition, getTypeId
 

Field Detail

CHECKOUT_SKIP

protected static final java.util.Set<java.lang.String> CHECKOUT_SKIP

entry

protected org.exoplatform.ecms.xcmis.sp.JcrNodeEntry entry
Constructor Detail

DocumentVersion

public DocumentVersion(org.exoplatform.ecms.xcmis.sp.JcrNodeEntry jcrEntry)
Method Detail

applyPolicy

public void applyPolicy(org.xcmis.spi.PolicyData policy)

Specified by:
applyPolicy in interface org.xcmis.spi.ObjectData

cancelCheckout

public void cancelCheckout()
                    throws org.xcmis.spi.VersioningException,
                           org.xcmis.spi.StorageException

Specified by:
cancelCheckout in interface org.xcmis.spi.DocumentData
Throws:
org.xcmis.spi.VersioningException
org.xcmis.spi.StorageException

checkin

public org.xcmis.spi.DocumentData checkin(boolean major,
                                          java.lang.String checkinComment,
                                          java.util.Map<java.lang.String,org.xcmis.spi.model.Property<?>> properties,
                                          org.xcmis.spi.ContentStream content,
                                          java.util.List<org.xcmis.spi.model.AccessControlEntry> acl,
                                          java.util.Collection<org.xcmis.spi.PolicyData> policies)
                                   throws org.xcmis.spi.StorageException

Specified by:
checkin in interface org.xcmis.spi.DocumentData
Throws:
org.xcmis.spi.StorageException

checkout

public org.xcmis.spi.DocumentData checkout()
                                    throws org.xcmis.spi.VersioningException,
                                           org.xcmis.spi.StorageException

Specified by:
checkout in interface org.xcmis.spi.DocumentData
Throws:
org.xcmis.spi.VersioningException
org.xcmis.spi.StorageException

getACL

public java.util.List<org.xcmis.spi.model.AccessControlEntry> getACL(boolean onlyBasicPermissions)

Specified by:
getACL in interface org.xcmis.spi.ObjectData

getName

public java.lang.String getName()

Specified by:
getName in interface org.xcmis.spi.ObjectData

getParent

public org.xcmis.spi.FolderData getParent()
                                   throws org.xcmis.spi.ConstraintException

Specified by:
getParent in interface org.xcmis.spi.ObjectData
Throws:
org.xcmis.spi.ConstraintException

getParents

public java.util.Collection<org.xcmis.spi.FolderData> getParents()

Specified by:
getParents in interface org.xcmis.spi.ObjectData

getPolicies

public java.util.Collection<org.xcmis.spi.PolicyData> getPolicies()

Specified by:
getPolicies in interface org.xcmis.spi.ObjectData

getRelationships

public org.xcmis.spi.ItemsIterator<org.xcmis.spi.RelationshipData> getRelationships(org.xcmis.spi.model.RelationshipDirection direction,
                                                                                    org.xcmis.spi.model.TypeDefinition type,
                                                                                    boolean includeSubRelationshipTypes)

Specified by:
getRelationships in interface org.xcmis.spi.ObjectData

getVersionLabel

public java.lang.String getVersionLabel()

Specified by:
getVersionLabel in interface org.xcmis.spi.DocumentData

getVersionSeriesCheckedOutBy

public java.lang.String getVersionSeriesCheckedOutBy()

Specified by:
getVersionSeriesCheckedOutBy in interface org.xcmis.spi.DocumentData

getVersionSeriesCheckedOutId

public java.lang.String getVersionSeriesCheckedOutId()

Specified by:
getVersionSeriesCheckedOutId in interface org.xcmis.spi.DocumentData

isLatestVersion

public boolean isLatestVersion()

Specified by:
isLatestVersion in interface org.xcmis.spi.DocumentData

removePolicy

public void removePolicy(org.xcmis.spi.PolicyData policy)

Specified by:
removePolicy in interface org.xcmis.spi.ObjectData

setACL

public void setACL(java.util.List<org.xcmis.spi.model.AccessControlEntry> aces)

Specified by:
setACL in interface org.xcmis.spi.ObjectData

setContentStream

public void setContentStream(org.xcmis.spi.ContentStream contentStream)
                      throws java.io.IOException,
                             org.xcmis.spi.VersioningException,
                             org.xcmis.spi.StorageException

Specified by:
setContentStream in interface org.xcmis.spi.DocumentData
Throws:
java.io.IOException
org.xcmis.spi.VersioningException
org.xcmis.spi.StorageException

setProperties

public void setProperties(java.util.Map<java.lang.String,org.xcmis.spi.model.Property<?>> properties)
                   throws org.xcmis.spi.NameConstraintViolationException,
                          org.xcmis.spi.VersioningException

Specified by:
setProperties in interface org.xcmis.spi.ObjectData
Throws:
org.xcmis.spi.NameConstraintViolationException
org.xcmis.spi.VersioningException

setProperty

public void setProperty(org.xcmis.spi.model.Property<?> property)
                 throws org.xcmis.spi.VersioningException

Specified by:
setProperty in interface org.xcmis.spi.ObjectData
Throws:
org.xcmis.spi.VersioningException

delete

public void delete()
            throws org.xcmis.spi.StorageException
Delete current object.

Throws:
org.xcmis.spi.StorageException - if operation can't be persisted in back-end

save

protected void save()


getContentStream

public org.xcmis.spi.ContentStream getContentStream()
                                             throws java.io.IOException

Specified by:
getContentStream in interface org.xcmis.spi.DocumentData
Throws:
java.io.IOException

getContentStream

public org.xcmis.spi.ContentStream getContentStream(java.lang.String streamId)
                                             throws java.io.IOException

Specified by:
getContentStream in interface org.xcmis.spi.ObjectData
Throws:
java.io.IOException

getContentStreamMimeType

public java.lang.String getContentStreamMimeType()

Specified by:
getContentStreamMimeType in interface org.xcmis.spi.DocumentData

getCreationDate

public java.util.Calendar getCreationDate()

Specified by:
getCreationDate in interface org.xcmis.spi.ObjectData

getLastModificationDate

public java.util.Calendar getLastModificationDate()

Specified by:
getLastModificationDate in interface org.xcmis.spi.ObjectData

getVersionSeriesId

public java.lang.String getVersionSeriesId()

Specified by:
getVersionSeriesId in interface org.xcmis.spi.DocumentData

hasContent

public boolean hasContent()

Specified by:
hasContent in interface org.xcmis.spi.DocumentData

isLatestMajorVersion

public boolean isLatestMajorVersion()

Specified by:
isLatestMajorVersion in interface org.xcmis.spi.DocumentData

isMajorVersion

public boolean isMajorVersion()

Specified by:
isMajorVersion in interface org.xcmis.spi.DocumentData

isPWC

public boolean isPWC()

Specified by:
isPWC in interface org.xcmis.spi.DocumentData

isVersionSeriesCheckedOut

public boolean isVersionSeriesCheckedOut()

Specified by:
isVersionSeriesCheckedOut in interface org.xcmis.spi.DocumentData

getContentStreamLength

protected long getContentStreamLength()
Returns:
length of content in bytes

getContentStreamId

protected java.lang.String getContentStreamId()
Returns:
id of content stream if document has content and null otherwise

getContentStreamFileName

public java.lang.String getContentStreamFileName()
Returns:
content stream file name if document has content and null otherwise

getObjectId

public java.lang.String getObjectId()

Specified by:
getObjectId in interface org.xcmis.spi.ObjectData

accept

public void accept(org.xcmis.spi.ObjectDataVisitor visitor)

Specified by:
accept in interface org.xcmis.spi.ObjectData

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

getBaseType

public org.xcmis.spi.model.BaseType getBaseType()

Specified by:
getBaseType in interface org.xcmis.spi.ObjectData

getChangeToken

public java.lang.String getChangeToken()

Specified by:
getChangeToken in interface org.xcmis.spi.ObjectData

getCreatedBy

public java.lang.String getCreatedBy()

Specified by:
getCreatedBy in interface org.xcmis.spi.ObjectData

getLastModifiedBy

public java.lang.String getLastModifiedBy()

Specified by:
getLastModifiedBy in interface org.xcmis.spi.ObjectData

getProperties

public java.util.Map<java.lang.String,org.xcmis.spi.model.Property<?>> getProperties()

Specified by:
getProperties in interface org.xcmis.spi.ObjectData

getProperties

public java.util.Map<java.lang.String,org.xcmis.spi.model.Property<?>> getProperties(org.xcmis.spi.PropertyFilter filter)

Specified by:
getProperties in interface org.xcmis.spi.ObjectData

getProperty

public org.xcmis.spi.model.Property<?> getProperty(java.lang.String id)

Specified by:
getProperty in interface org.xcmis.spi.ObjectData

getTypeDefinition

public org.xcmis.spi.model.TypeDefinition getTypeDefinition()

Specified by:
getTypeDefinition in interface org.xcmis.spi.ObjectData

getTypeId

public java.lang.String getTypeId()

Specified by:
getTypeId in interface org.xcmis.spi.ObjectData

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

doGetProperty

protected org.xcmis.spi.model.Property<?> doGetProperty(org.xcmis.spi.model.PropertyDefinition<?> definition)

doSetProperty

protected void doSetProperty(org.xcmis.spi.model.Property<?> property)
                      throws org.xcmis.spi.NameConstraintViolationException
Update properties, skip on-create and read-only properties

Parameters:
property - property to be updated
Throws:
org.xcmis.spi.NameConstraintViolationException


Copyright © 2012 eXo Platform SAS. All Rights Reserved.