org.xcmis.spi
Interface DocumentData

All Superinterfaces:
ObjectData

public interface DocumentData
extends ObjectData

Version:
$Id: $
Author:
Andrey Parfonov

Method Summary
 void cancelCheckout()
          Discard checkout operation.
 DocumentData checkin(boolean major, String checkinComment, Map<String,Property<?>> properties, ContentStream content, List<AccessControlEntry> acl, Collection<PolicyData> policies)
          Set private working copy as latest (current) version of document.
 DocumentData checkout()
          Create PWC from this document.
 ContentStream getContentStream()
          Get document content stream.
 String getContentStreamMimeType()
          Shortcut to 'cmis:contentStreamMimeType' property.
 String getVersionLabel()
          Shortcut to 'cmis:versionLabel' property.
 String getVersionSeriesCheckedOutBy()
          Shortcut to 'cmis:versionSeriesCheckedOutBy' property.
 String getVersionSeriesCheckedOutId()
          Shortcut to 'cmis:versionSeriesCheckedOutId' property.
 String getVersionSeriesId()
          Shortcut to 'cmis:versionSeriesId' property.
 boolean hasContent()
          Check does current document has content or not.
 boolean isLatestMajorVersion()
          Shortcut to 'cmis:isLatestMajorVersion' property.
 boolean isLatestVersion()
          Shortcut to 'cmis:isLatestVersion' property.
 boolean isMajorVersion()
          Shortcut to 'cmis:isMajorVersion' property.
 boolean isPWC()
          Implementation Compatibility: Optional.
 boolean isVersionSeriesCheckedOut()
          Shortcut to 'cmis:isVersionSeriesCheckedOut' property.
 void setContentStream(ContentStream contentStream)
          Set content stream to document.
 
Methods inherited from interface org.xcmis.spi.ObjectData
accept, applyPolicy, getACL, getBaseType, getChangeToken, getContentStream, getCreatedBy, getCreationDate, getLastModificationDate, getLastModifiedBy, getName, getObjectId, getParent, getParents, getPolicies, getProperties, getProperties, getProperty, getRelationships, getTypeDefinition, getTypeId, removePolicy, setACL, setProperties, setProperty
 

Method Detail

getVersionLabel

String getVersionLabel()
Shortcut to 'cmis:versionLabel' property. Implementation Compatibility: Optional. Repository versioning specific. Otherwise "Version Property Values are repository-specific when a document is defined as non-versionable."

Returns:
'cmis:versionLabel' property

getVersionSeriesCheckedOutBy

String getVersionSeriesCheckedOutBy()
Shortcut to 'cmis:versionSeriesCheckedOutBy' property. Implementation Compatibility: Optional. Repository versioning specific. Otherwise "Version Property Values are repository-specific when a document is defined as non-versionable."

Returns:
'cmis:versionSeriesCheckedOutBy' property

getVersionSeriesCheckedOutId

String getVersionSeriesCheckedOutId()
Shortcut to 'cmis:versionSeriesCheckedOutId' property. Implementation Compatibility: Optional. Repository versioning specific. Otherwise "Version Property Values are repository-specific when a document is defined as non-versionable."

Returns:
'cmis:versionSeriesCheckedOutId' property

getVersionSeriesId

String getVersionSeriesId()
Shortcut to 'cmis:versionSeriesId' property. Implementation Compatibility: Optional. Repository versioning specific. Otherwise "Version Property Values are repository-specific when a document is defined as non-versionable."

Returns:
'cmis:versionSeriesId' property

isLatestMajorVersion

boolean isLatestMajorVersion()
Shortcut to 'cmis:isLatestMajorVersion' property. Implementation Compatibility: Optional. Repository versioning specific. Otherwise "Version Property Values are repository-specific when a document is defined as non-versionable."

Returns:
'cmis:isLatestMajorVersion' property

isLatestVersion

boolean isLatestVersion()
Shortcut to 'cmis:isLatestVersion' property. Implementation Compatibility: Optional. Repository versioning specific. Otherwise "Version Property Values are repository-specific when a document is defined as non-versionable."

Returns:
'cmis:isLatestVersion' property

isMajorVersion

boolean isMajorVersion()
Shortcut to 'cmis:isMajorVersion' property. Implementation Compatibility: Optional. Repository versioning specific. Otherwise "Version Property Values are repository-specific when a document is defined as non-versionable."

Returns:
'cmis:isMajorVersion' property

isVersionSeriesCheckedOut

boolean isVersionSeriesCheckedOut()
Shortcut to 'cmis:isVersionSeriesCheckedOut' property. Implementation Compatibility: Optional. Repository versioning specific. Otherwise "Version Property Values are repository-specific when a document is defined as non-versionable."

Returns:
'cmis:isVersionSeriesCheckedOut' property

getContentStreamMimeType

String getContentStreamMimeType()
Shortcut to 'cmis:contentStreamMimeType' property.

Returns:
'cmis:contentStreamMimeType' property or null if document has not content

getContentStream

ContentStream getContentStream()
                               throws IOException
Get document content stream.

Returns:
content stream or null if document has not content
Throws:
IOException - if an I/O error occurs

setContentStream

void setContentStream(ContentStream contentStream)
                      throws IOException,
                             UpdateConflictException,
                             VersioningException,
                             StorageException
Set content stream to document. If contentStream is null then existed content of this document will be removed. Implementation Compatibility: SHOULD be implemented if capabilityContentStreamUpdatability = anytime or capabilityContentStreamUpdatability = pwconly and isPWC() = true

Parameters:
contentStream - ContentStream or null
Throws:
IOException - if any i/o error occurs
VersioningException - if object is not current version and storage do not support update other then latest version
UpdateConflictException - if object that is no longer current (as determined by the storage)
StorageException - if object's content stream can not be updated (save changes) cause to storage internal problem

hasContent

boolean hasContent()
Check does current document has content or not.

Returns:
true if has content and false if not

cancelCheckout

void cancelCheckout()
                    throws VersioningException,
                           UpdateConflictException,
                           StorageException
Discard checkout operation. See Connection.cancelCheckout(String). Implementation Compatibility: Optional. Repository versioning specific.

Throws:
VersioningException - if object is non-current document version and 'cancel checkout' action and not supported for non-current version of document
UpdateConflictException - if object that is no longer current (as determined by the storage)
StorageException - if changes can't be saved cause to storage internal problem

checkin

DocumentData checkin(boolean major,
                     String checkinComment,
                     Map<String,Property<?>> properties,
                     ContentStream content,
                     List<AccessControlEntry> acl,
                     Collection<PolicyData> policies)
                     throws NameConstraintViolationException,
                            UpdateConflictException,
                            StorageException
Set private working copy as latest (current) version of document. Implementation Compatibility: Optional. Repository versioning specific.

Parameters:
major - is major
checkinComment - check-in comment
properties - the document properties. May be null if properties are not changed
content - the document content stream. May be null if content is not changed
acl - the list of ACEs to be applied to new version of document. May be null or empty list
policies - the list of policies. May be null or empty collection
Returns:
new version of document
Throws:
NameConstraintViolationException - if cmis:name specified in properties throws conflict
UpdateConflictException - if object that is no longer current (as determined by the storage)
StorageException - if newly version of Document can't be saved in storage cause to its internal problem

checkout

DocumentData checkout()
                      throws VersioningException,
                             UpdateConflictException,
                             StorageException
Create PWC from this document. Properties and content (optionally) of this document copied to PWC. Implementation Compatibility: Optional. Repository versioning specific.

Returns:
PWC
Throws:
VersioningException - if one of the following conditions are met:
  • object is not latest version of document version and it is not supported to checked-out other then latest version
  • version series already have one checked-out document. It is not possible to have more then one PWC at time
UpdateConflictException - if object that is no longer current (as determined by the storage)
StorageException - if newly created PWC was not saved in storage cause to storage internal problem

isPWC

boolean isPWC()
Implementation Compatibility: Optional. Repository versioning specific. Otherwise "Version Property Values are repository-specific when a document is defined as non-versionable."

Returns:
true if current Document is private working copy and false otherwise


Copyright © 2010 eXo Platform SAS. All Rights Reserved.