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

java.lang.Object
  extended by it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.StoredObjectImpl
      extended by it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.AbstractMultiFilingImpl
          extended by it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.VersionedDocumentImpl
All Implemented Interfaces:
Content, Document, Filing, MultiFiling, StoredObject, VersionedDocument

public class VersionedDocumentImpl
extends AbstractMultiFilingImpl
implements VersionedDocument, Document


Field Summary
(package private)  Document originalNativeDocument
           
 
Fields inherited from class it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.AbstractMultiFilingImpl
fParents
 
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
VersionedDocumentImpl(ObjectStoreImpl objStore, File file)
           
 
Method Summary
 DocumentVersion addVersion(java.lang.String name, org.apache.chemistry.opencmis.commons.data.ContentStream content, org.apache.chemistry.opencmis.commons.enums.VersioningState verState, java.lang.String user)
           
 void appendContent(org.apache.chemistry.opencmis.commons.data.ContentStream content)
          Append content to an existing content stream.
 void cancelCheckOut(java.lang.String user)
           
 void checkIn(boolean isMajor, org.apache.chemistry.opencmis.commons.data.Properties properties, org.apache.chemistry.opencmis.commons.data.ContentStream content, java.lang.String checkinComment, java.util.List<java.lang.String> policyIds, java.lang.String user)
           
 DocumentVersion checkOut(org.apache.chemistry.opencmis.commons.data.ContentStream content, java.lang.String user)
           
 boolean deleteVersion(DocumentVersion version)
          delete a version from this object, throw exception if document is checked out or document does not contain this 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.util.List<DocumentVersion> getAllVersions()
           
 java.lang.String getCheckedOutBy()
           
 org.apache.chemistry.opencmis.commons.data.ContentStream getContent(long offset, long length)
          retrieve the content of a document
 DocumentVersion getLatestVersion(boolean major)
           
 DocumentVersion getPwc()
           
 boolean hasContent()
          return true if this object has content or false if there is no content attached.
 boolean isCheckedOut()
           
 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.AbstractMultiFilingImpl
addParent, getParents, getParents, getPathSegment, hasParent, move, removeParent, rename
 
Methods inherited from class it.sistematica.isharedoc.opencmis.indatabase.storedobj.impl.StoredObjectImpl
addAcl, addAppliedPolicy, createSystemBasePropertiesWhenCreated, getAcl, getAllowableActions, getAppliedPolicies, getChangeToken, getConfidentialityLevel, getCreatedAt, getCreatedBy, getDeleted, getDescription, getHidden, getIconFromResourceDir, getId, getModifiedAt, getModifiedBy, getName, 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, getCreatedAt, getCreatedBy, getDescription, getId, getModifiedAt, getModifiedBy, getName, getNativeObject, getObjectRelationships, getProperties, getRenditionContent, getRenditions, getRepositoryId, getSecondaryTypeIds, getTypeId, hasRendition, persist, removeAcl, removePolicy, rename, setCreatedAt, setCreatedBy, setCustomProperties, setDescription, setModifiedAtNow, setModifiedBy, setName, setNativeObject, setProperties, setRepositoryId, setTypeId, updateSystemBasePropertiesWhenModified
 
Methods inherited from interface it.sistematica.isharedoc.opencmis.indatabase.storedobj.api.MultiFiling
addParent, getPathSegment, removeParent
 
Methods inherited from interface it.sistematica.isharedoc.opencmis.indatabase.storedobj.api.Filing
getParents, hasParent, move
 

Field Detail

originalNativeDocument

Document originalNativeDocument
Constructor Detail

VersionedDocumentImpl

public VersionedDocumentImpl(ObjectStoreImpl objStore,
                             File file)
Method Detail

addVersion

public DocumentVersion addVersion(java.lang.String name,
                                  org.apache.chemistry.opencmis.commons.data.ContentStream content,
                                  org.apache.chemistry.opencmis.commons.enums.VersioningState verState,
                                  java.lang.String user)
Specified by:
addVersion in interface VersionedDocument

deleteVersion

public boolean deleteVersion(DocumentVersion version)
Description copied from interface: VersionedDocument
delete a version from this object, throw exception if document is checked out or document does not contain this version

Specified by:
deleteVersion in interface VersionedDocument
Parameters:
version - version to be removed
Returns:
true if version could be removed, and other versions exist, false if the deleted version was the last version in this document

cancelCheckOut

public void cancelCheckOut(java.lang.String user)
Specified by:
cancelCheckOut in interface VersionedDocument

checkIn

public void checkIn(boolean isMajor,
                    org.apache.chemistry.opencmis.commons.data.Properties properties,
                    org.apache.chemistry.opencmis.commons.data.ContentStream content,
                    java.lang.String checkinComment,
                    java.util.List<java.lang.String> policyIds,
                    java.lang.String user)
Specified by:
checkIn in interface VersionedDocument

checkOut

public DocumentVersion checkOut(org.apache.chemistry.opencmis.commons.data.ContentStream content,
                                java.lang.String user)
Specified by:
checkOut in interface VersionedDocument

getAllVersions

public java.util.List<DocumentVersion> getAllVersions()
Specified by:
getAllVersions in interface VersionedDocument

getLatestVersion

public DocumentVersion getLatestVersion(boolean major)
Specified by:
getLatestVersion in interface VersionedDocument

isCheckedOut

public boolean isCheckedOut()
Specified by:
isCheckedOut in interface VersionedDocument

getCheckedOutBy

public java.lang.String getCheckedOutBy()
Specified by:
getCheckedOutBy in interface VersionedDocument

getPwc

public DocumentVersion getPwc()
Specified by:
getPwc in interface VersionedDocument

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

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:

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

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.