it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl
Class DocumentVersionImpl

java.lang.Object
  extended by it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.StoredObjectImpl
      extended by it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.DocumentVersionImpl
All Implemented Interfaces:
Content, DocumentVersion, Filing, MultiFiling, StoredObject, Version

public class DocumentVersionImpl
extends StoredObjectImpl
implements DocumentVersion

A class representing a single version of a document

Author:
Jens

Field Summary
protected  DocumentContent fNativeVerObject
           
(package private)  java.lang.String label
           
 
Fields inherited from class it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.StoredObjectImpl
fNativeObject, fObjStore, fProperties, fRepositoryId, fTypeId, ICON_SIZE, policyIds, RENDITION_MIME_TYPE_JPEG, RENDITION_MIME_TYPE_PNG, RENDITION_SUFFIX, secondaryTypeIds
 
Fields inherited from interface it.sistematica.isharedoc.opencmis.indatabase.storedobj.api.Filing
PATH_SEPARATOR
 
Constructor Summary
DocumentVersionImpl(java.lang.String repositoryId, VersionedDocument container, DocumentContent nativeVerObject, ObjectStoreImpl objStore)
           
 
Method Summary
 void addParent(Folder parent)
          Add this document to a new parent folder as child object
 void appendContent(org.apache.chemistry.opencmis.commons.data.ContentStream content)
          Append content to an existing content stream.
 void commit(boolean isMajor)
          make the private working copy an official version.
 void fillProperties(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties, org.apache.chemistry.opencmis.commons.spi.BindingsObjectFactory objFactory, java.util.List<java.lang.String> requestedIds)
           
 java.lang.String getCheckinComment()
           
 org.apache.chemistry.opencmis.commons.data.ContentStream getContent(long offset, long length)
          retrieve the content of a document
 java.util.GregorianCalendar getCreatedAt()
           
 java.lang.String getCreatedBy()
          Retrieve the user who created the document
 DocumentContent getfNativeVerObject()
           
 java.lang.String getId()
          Retrieve the id of this object.
 java.lang.String getName()
          Retrieve the name of this object
 VersionedDocument getParentDocument()
           
 java.util.List<Folder> getParents(java.lang.String user)
          return a list of parents the principal has access to. for single parent object this list must contain only one element. returns an empty list if this is an unfiled document.
 java.lang.String getPathSegment()
          retrieve the path segment of this folder
 java.lang.String getVersionLabel()
           
 boolean hasContent()
          return true if this object has content or false if there is no content attached.
 boolean hasParent()
          usually true except for the root folder, optimized call that just tests existence to provide information for AtomPub links (much cheaper than calling getParents() and test for empty result.
 boolean isMajor()
           
 boolean isPwc()
           
 void move(Folder oldParent, Folder newParent)
          Move an object to a different folder.
 void removeParent(Folder parent)
          Remove this object from the children of parent
 void rename(java.lang.String newName)
          Rename an object
 void setCheckinComment(java.lang.String comment)
           
 void setContent(org.apache.chemistry.opencmis.commons.data.ContentStream content, boolean mustPersist)
          Assign content to a document.
 
Methods inherited from class it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.StoredObjectImpl
addAcl, addAppliedPolicy, createSystemBasePropertiesWhenCreated, getAcl, getAllowableActions, getAppliedPolicies, getChangeToken, getConfidentialityLevel, getDeleted, getDescription, getHidden, getIconFromResourceDir, getModifiedAt, getModifiedBy, getNativeObject, getObjectRelationships, getObjectTemplate, getOrganization, getOriginalNativeObject, getProperties, getRenditionContent, getRenditions, getRepositoryId, getSecondaryTypeIds, getSignatureExpireDate, getSignatureStatus, getSignatureValidationDate, getSignatureValidationNote, getSignatureValidationStatus, getSigned, getType, getTypeId, hasRendition, persist, removeAcl, removePolicy, setAppliedPolicies, setConfidentialityLevel, setConfidentialityLevelId, setCreatedAt, setCreatedBy, setCustomProperties, setDeleted, setDescription, setHidden, setId, setModifiedAtNow, setModifiedBy, setName, setNativeObject, setNote, setObjectTemplate, setObjectTemplateId, setOrganization, setOrganizationId, setOriginalFileId, setProperties, setRemoteURL, setRepositoryId, setSecondaryTypeIds, setSignatureValidationNote, setSignatureValidationStatus, setStatus, setSystemBasePropertiesWhenCreatedDirect, setTypeId, testRenditionFilterForImage, updateSystemBasePropertiesWhenModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface it.sistematica.isharedoc.opencmis.indatabase.storedobj.api.StoredObject
addAcl, addAppliedPolicy, createSystemBasePropertiesWhenCreated, getAcl, getAllowableActions, getAppliedPolicies, getChangeToken, getDescription, getModifiedAt, getModifiedBy, getNativeObject, getObjectRelationships, getProperties, getRenditionContent, getRenditions, getRepositoryId, getSecondaryTypeIds, getTypeId, hasRendition, persist, removeAcl, removePolicy, setCreatedAt, setCreatedBy, setCustomProperties, setDescription, setModifiedAtNow, setModifiedBy, setName, setNativeObject, setProperties, setRepositoryId, setTypeId, updateSystemBasePropertiesWhenModified
 

Field Detail

fNativeVerObject

protected DocumentContent fNativeVerObject

label

java.lang.String label
Constructor Detail

DocumentVersionImpl

public DocumentVersionImpl(java.lang.String repositoryId,
                           VersionedDocument container,
                           DocumentContent nativeVerObject,
                           ObjectStoreImpl objStore)
Method Detail

getId

public java.lang.String getId()
Description copied from interface: StoredObject
Retrieve the id of this object.

Specified by:
getId in interface StoredObject
Overrides:
getId in class StoredObjectImpl
Returns:
id of this object

getName

public java.lang.String getName()
Description copied from interface: StoredObject
Retrieve the name of this object

Specified by:
getName in interface StoredObject
Overrides:
getName in class StoredObjectImpl
Returns:
name of this object

getCreatedBy

public java.lang.String getCreatedBy()
Description copied from interface: StoredObject
Retrieve the user who created the document

Specified by:
getCreatedBy in interface StoredObject
Overrides:
getCreatedBy in class StoredObjectImpl
Returns:
user who created the document.

getCreatedAt

public java.util.GregorianCalendar getCreatedAt()
Specified by:
getCreatedAt in interface StoredObject
Overrides:
getCreatedAt in class StoredObjectImpl

getfNativeVerObject

public DocumentContent getfNativeVerObject()

setContent

public void setContent(org.apache.chemistry.opencmis.commons.data.ContentStream content,
                       boolean mustPersist)
Description copied from interface: Content
Assign content to a document. Existing content gets overwritten. The document is not yet persisted in the new state.

Specified by:
setContent in interface Content
Parameters:
content - content to be assigned to the document.
mustPersist - persist document (set to false if content is set during creation of a document)

appendContent

public void appendContent(org.apache.chemistry.opencmis.commons.data.ContentStream content)
Description copied from interface: Content
Append content to an existing content stream. The document is persisted in the new state.

Specified by:
appendContent in interface Content
Parameters:
content - content to be assigned to the document.

setCheckinComment

public void setCheckinComment(java.lang.String comment)
Specified by:
setCheckinComment in interface Version

getCheckinComment

public java.lang.String getCheckinComment()
Specified by:
getCheckinComment in interface Version

isMajor

public boolean isMajor()
Specified by:
isMajor in interface Version

isPwc

public boolean isPwc()
Specified by:
isPwc in interface Version

commit

public void commit(boolean isMajor)
Description copied from interface: Version
make the private working copy an official version.

Specified by:
commit in interface Version

getContent

public org.apache.chemistry.opencmis.commons.data.ContentStream getContent(long offset,
                                                                           long length)
Description copied from interface: Content
retrieve the content of a document

Specified by:
getContent in interface Content
Returns:
object containing mime-type, length and a stream with content

getParentDocument

public VersionedDocument getParentDocument()
Specified by:
getParentDocument in interface Version

fillProperties

public void fillProperties(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties,
                           org.apache.chemistry.opencmis.commons.spi.BindingsObjectFactory objFactory,
                           java.util.List<java.lang.String> requestedIds)
Specified by:
fillProperties in interface StoredObject
Overrides:
fillProperties in class StoredObjectImpl

getParents

public java.util.List<Folder> getParents(java.lang.String user)
Description copied from interface: Filing
return a list of parents the principal has access to. for single parent object this list must contain only one element. returns an empty list if this is an unfiled document.

Specified by:
getParents in interface Filing
Parameters:
user - user id
Returns:
list of parent folders

getPathSegment

public java.lang.String getPathSegment()
Description copied from interface: MultiFiling
retrieve the path segment of this folder

Specified by:
getPathSegment in interface MultiFiling
Returns:

move

public void move(Folder oldParent,
                 Folder newParent)
Description copied from interface: Filing
Move an object to a different folder. Source and target object are persisted in this call as part of a transactional step.

Specified by:
move in interface Filing
newParent - new parent folder for the object

addParent

public void addParent(Folder parent)
Description copied from interface: MultiFiling
Add this document to a new parent folder as child object

Specified by:
addParent in interface MultiFiling
Parameters:
parent - new parent folder of the document.

removeParent

public void removeParent(Folder parent)
Description copied from interface: MultiFiling
Remove this object from the children of parent

Specified by:
removeParent in interface MultiFiling
Parameters:
parent - parent folder of the document

hasContent

public boolean hasContent()
Description copied from interface: Content
return true if this object has content or false if there is no content attached.

Specified by:
hasContent in interface Content
Returns:

hasParent

public boolean hasParent()
Description copied from interface: Filing
usually true except for the root folder, optimized call that just tests existence to provide information for AtomPub links (much cheaper than calling getParents() and test for empty result.

Specified by:
hasParent in interface Filing
Returns:
true if object has a parent, false if it is a root object

rename

public void rename(java.lang.String newName)
Description copied from interface: StoredObject
Rename an object

Specified by:
rename in interface StoredObject
Overrides:
rename in class StoredObjectImpl
Parameters:
newName - the new name of the object

getVersionLabel

public java.lang.String getVersionLabel()
Specified by:
getVersionLabel in interface Version