public class DocumentImpl extends AbstractFilableCmisObject implements Document
Constructor and Description |
---|
DocumentImpl(SessionImpl session,
ObjectType objectType,
ObjectData objectData,
OperationContext context)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
Document |
appendContentStream(ContentStream contentStream,
boolean isLastChunk)
Appends a content stream to the content stream of the document and
refreshes this object afterwards.
|
ObjectId |
appendContentStream(ContentStream contentStream,
boolean isLastChunk,
boolean refresh)
Appends a content stream to the content stream of the document.
|
void |
cancelCheckOut()
If this is a PWC (private working copy) the check out will be reversed.
|
ObjectId |
checkIn(boolean major,
Map<String,?> properties,
ContentStream contentStream,
String checkinComment)
If this is a PWC (private working copy) it performs a check in.
|
ObjectId |
checkIn(boolean major,
Map<String,?> properties,
ContentStream contentStream,
String checkinComment,
List<Policy> policies,
List<Ace> addAces,
List<Ace> removeAces)
If this is a PWC (private working copy) it performs a check in.
|
ObjectId |
checkOut()
Checks out the document and returns the object ID of the PWC (private
working copy).
|
Document |
copy(ObjectId targetFolderId)
Creates a copy of this document, including content.
|
Document |
copy(ObjectId targetFolderId,
Map<String,?> properties,
VersioningState versioningState,
List<Policy> policies,
List<Ace> addAces,
List<Ace> removeAces,
OperationContext context)
Creates a copy of this document, including content.
|
protected ObjectId |
copyViaClient(ObjectId targetFolderId,
Map<String,?> properties,
VersioningState versioningState,
List<Policy> policies,
List<Ace> addAces,
List<Ace> removeAces)
Copies the document manually.
|
void |
deleteAllVersions()
Deletes this document and all its versions.
|
Document |
deleteContentStream()
Removes the current content stream from the document and refreshes this
object afterwards.
|
ObjectId |
deleteContentStream(boolean refresh)
Removes the current content stream from the document.
|
List<Document> |
getAllVersions()
Fetches all versions of this document.
|
List<Document> |
getAllVersions(OperationContext context)
Fetches all versions of this document using the given
OperationContext . |
String |
getCheckinComment()
Returns the checkin comment (CMIS property
cmis:checkinComment ). |
ContentStream |
getContentStream()
Retrieves the content stream of this document.
|
ContentStream |
getContentStream(BigInteger offset,
BigInteger length)
Retrieves the content stream of this document.
|
ContentStream |
getContentStream(String streamId)
Retrieves the content stream that is associated with the given stream ID.
|
ContentStream |
getContentStream(String streamId,
BigInteger offset,
BigInteger length)
Retrieves the content stream that is associated with the given stream ID.
|
String |
getContentStreamFileName()
Returns the content stream filename or
null if the document has
no content (CMIS property cmis:contentStreamFileName ). |
List<ContentStreamHash> |
getContentStreamHashes()
Returns the content hashes or
null if the document has no content
(CMIS property cmis:contentStreamHash ). |
String |
getContentStreamId()
Returns the content stream ID or
null if the document has no
content (CMIS property cmis:contentStreamId ). |
long |
getContentStreamLength()
Returns the content stream length or -1 if the document has no content
(CMIS property
cmis:contentStreamLength ). |
String |
getContentStreamMimeType()
Returns the content stream MIME type or
null if the document has
no content (CMIS property cmis:contentStreamMimeType ). |
Document |
getObjectOfLatestVersion(boolean major)
Fetches the latest major or minor version of this document.
|
Document |
getObjectOfLatestVersion(boolean major,
OperationContext context)
Fetches the latest major or minor version of this document using the
given
OperationContext . |
String |
getVersionLabel()
Returns the version label (CMIS property
cmis:versionLabel ). |
String |
getVersionSeriesCheckedOutBy()
Returns the user who checked out this version series (CMIS property
cmis:versionSeriesCheckedOutBy ). |
String |
getVersionSeriesCheckedOutId()
Returns the PWC ID of this version series (CMIS property
cmis:versionSeriesCheckedOutId ). |
String |
getVersionSeriesId()
Returns the version series ID (CMIS property
cmis:versionSeriesId
). |
Boolean |
isImmutable()
Returns
true if this document is immutable (CMIS property
cmis:isImmutable ). |
Boolean |
isLatestMajorVersion()
Returns
true if this document is the latest major version (CMIS
property cmis:isLatestMajorVersion ). |
Boolean |
isLatestVersion()
Returns
true if this document is the latest version (CMIS
property cmis:isLatestVersion ). |
Boolean |
isMajorVersion()
Returns
true if this document is a major version (CMIS property
cmis:isMajorVersion ). |
Boolean |
isPrivateWorkingCopy()
Returns
true if this document is the PWC (CMIS property
cmis:isPrivateWorkingCopy ). |
Boolean |
isVersionSeriesCheckedOut()
Returns
true if this version series is checked out (CMIS property
cmis:isVersionSeriesCheckedOut ). |
Document |
setContentStream(ContentStream contentStream,
boolean overwrite)
Sets a new content stream for the document and refreshes this object
afterwards.
|
ObjectId |
setContentStream(ContentStream contentStream,
boolean overwrite,
boolean refresh)
Sets a new content stream for the document.
|
addToFolder, getParents, getParents, getPaths, move, move, removeFromFolder
addAcl, applyAcl, applyPolicy, delete, delete, findObjectType, getAcl, getAcl, getAdapter, getAllowableActions, getBaseType, getBaseTypeId, getBinding, getChangeToken, getCreatedBy, getCreationContext, getCreationDate, getDescription, getExtensions, getId, getLastModificationDate, getLastModifiedBy, getName, getObjectFactory, getObjectId, getObjectType, getPolicies, getProperties, getProperty, getPropertyQueryName, getPropertyValue, getRefreshTimestamp, getRelationships, getRenditions, getRepositoryId, getSecondaryTypes, getSession, getType, initialize, readLock, readUnlock, refresh, refreshIfOld, removeAcl, removePolicy, rename, rename, setAcl, toString, updateProperties, updateProperties, writeLock, writeUnlock
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addToFolder, getParents, getParents, getPaths, move, move, removeFromFolder
addAcl, applyAcl, applyPolicy, delete, delete, getAcl, getAdapter, getAllowableActions, getExtensions, getPolicies, getRefreshTimestamp, getRelationships, getRenditions, refresh, refreshIfOld, removeAcl, removePolicy, rename, rename, setAcl, updateProperties, updateProperties
findObjectType, getBaseType, getBaseTypeId, getChangeToken, getCreatedBy, getCreationDate, getDescription, getLastModificationDate, getLastModifiedBy, getName, getProperties, getProperty, getPropertyValue, getSecondaryTypes, getType
public DocumentImpl(SessionImpl session, ObjectType objectType, ObjectData objectData, OperationContext context)
public String getCheckinComment()
DocumentProperties
cmis:checkinComment
).getCheckinComment
in interface DocumentProperties
null
if the
property hasn't been requested, hasn't been provided by the
repository, or the property value isn't setpublic String getVersionLabel()
DocumentProperties
cmis:versionLabel
).getVersionLabel
in interface DocumentProperties
null
if the property
hasn't been requested, hasn't been provided by the repository, or
the property value isn't setpublic String getVersionSeriesId()
DocumentProperties
cmis:versionSeriesId
).getVersionSeriesId
in interface DocumentProperties
null
if the
property hasn't been requested, hasn't been provided by the
repository, or the property value isn't setpublic String getVersionSeriesCheckedOutId()
DocumentProperties
cmis:versionSeriesCheckedOutId
).
Some repositories provided this value only to the user who checked out the version series.
getVersionSeriesCheckedOutId
in interface DocumentProperties
null
if the property
hasn't been requested, hasn't been provided by the repository, or
the property value isn't setpublic String getVersionSeriesCheckedOutBy()
DocumentProperties
cmis:versionSeriesCheckedOutBy
).getVersionSeriesCheckedOutBy
in interface DocumentProperties
null
if
the property hasn't been requested, hasn't been provided by the
repository, or the property value isn't setpublic Boolean isImmutable()
DocumentProperties
true
if this document is immutable (CMIS property
cmis:isImmutable
).isImmutable
in interface DocumentProperties
null
if the
property hasn't been requested, hasn't been provided by the
repository, or the property value isn't setpublic Boolean isLatestMajorVersion()
DocumentProperties
true
if this document is the latest major version (CMIS
property cmis:isLatestMajorVersion
).isLatestMajorVersion
in interface DocumentProperties
null
if
the property hasn't been requested, hasn't been provided by the
repository, or the property value isn't setpublic Boolean isLatestVersion()
DocumentProperties
true
if this document is the latest version (CMIS
property cmis:isLatestVersion
).isLatestVersion
in interface DocumentProperties
null
if the
property hasn't been requested, hasn't been provided by the
repository, or the property value isn't setpublic Boolean isMajorVersion()
DocumentProperties
true
if this document is a major version (CMIS property
cmis:isMajorVersion
).isMajorVersion
in interface DocumentProperties
null
if the
property hasn't been requested, hasn't been provided by the
repository, or the property value isn't setpublic Boolean isPrivateWorkingCopy()
DocumentProperties
true
if this document is the PWC (CMIS property
cmis:isPrivateWorkingCopy
).isPrivateWorkingCopy
in interface DocumentProperties
null
if the property
hasn't been requested, hasn't been provided by the repository, or
the property value isn't setpublic Boolean isVersionSeriesCheckedOut()
DocumentProperties
true
if this version series is checked out (CMIS property
cmis:isVersionSeriesCheckedOut
).isVersionSeriesCheckedOut
in interface DocumentProperties
null
if the property hasn't been requested, hasn't been
provided by the repository, or the property value isn't setpublic long getContentStreamLength()
DocumentProperties
cmis:contentStreamLength
).getContentStreamLength
in interface DocumentProperties
public String getContentStreamMimeType()
DocumentProperties
null
if the document has
no content (CMIS property cmis:contentStreamMimeType
).getContentStreamMimeType
in interface DocumentProperties
null
if
the property hasn't been requested, hasn't been provided by the
repository, or the document has no contentpublic String getContentStreamFileName()
DocumentProperties
null
if the document has
no content (CMIS property cmis:contentStreamFileName
).getContentStreamFileName
in interface DocumentProperties
null
if
the property hasn't been requested, hasn't been provided by the
repository, or the document has no contentpublic String getContentStreamId()
DocumentProperties
null
if the document has no
content (CMIS property cmis:contentStreamId
).getContentStreamId
in interface DocumentProperties
null
if the
property hasn't been requested, hasn't been provided by the
repository, or the document has no contentpublic List<ContentStreamHash> getContentStreamHashes()
DocumentProperties
null
if the document has no content
(CMIS property cmis:contentStreamHash
).getContentStreamHashes
in interface DocumentProperties
null
if the property hasn't
been requested, hasn't been provided by the repository, or the
document has no contentpublic Document copy(ObjectId targetFolderId, Map<String,?> properties, VersioningState versioningState, List<Policy> policies, List<Ace> addAces, List<Ace> removeAces, OperationContext context)
Document
public Document copy(ObjectId targetFolderId)
Document
protected ObjectId copyViaClient(ObjectId targetFolderId, Map<String,?> properties, VersioningState versioningState, List<Policy> policies, List<Ace> addAces, List<Ace> removeAces)
public void deleteAllVersions()
Document
deleteAllVersions
in interface Document
public ObjectId checkOut()
Document
public void cancelCheckOut()
Document
cancelCheckOut
in interface Document
public ObjectId checkIn(boolean major, Map<String,?> properties, ContentStream contentStream, String checkinComment, List<Policy> policies, List<Ace> addAces, List<Ace> removeAces)
Document
contentStream
is consumed but not closed by this
method.public List<Document> getAllVersions()
Document
The behavior of this method is undefined if the document is not versionable and can be different for each repository.
getAllVersions
in interface Document
cmis:creationDate
descending and preceded by the PWC, if
one exists, not null
public List<Document> getAllVersions(OperationContext context)
Document
OperationContext
.
The behavior of this method is undefined if the document is not versionable and can be different for each repository.
getAllVersions
in interface Document
cmis:creationDate
descending and preceded by the PWC, if
one exists, not null
public Document getObjectOfLatestVersion(boolean major)
Document
getObjectOfLatestVersion
in interface Document
major
- if true
the latest major version will be returned,
otherwise the very last version will be returnedpublic Document getObjectOfLatestVersion(boolean major, OperationContext context)
Document
OperationContext
.getObjectOfLatestVersion
in interface Document
major
- if true
the latest major version will be returned,
otherwise the very last version will be returnedpublic ContentStream getContentStream()
Document
getContentStream
in interface Document
null
if the document has no
contentpublic ContentStream getContentStream(BigInteger offset, BigInteger length)
Document
getContentStream
in interface Document
offset
- the offset of the stream or null
to read the stream
from the beginninglength
- the maximum length of the stream or null
to read to
the end of the streamnull
if the document has no
contentpublic ContentStream getContentStream(String streamId)
Document
getContentStream
in interface Document
streamId
- the stream IDnull
if no content is associated
with this stream IDpublic ContentStream getContentStream(String streamId, BigInteger offset, BigInteger length)
Document
getContentStream
in interface Document
streamId
- the stream IDoffset
- the offset of the stream or null
to read the stream
from the beginninglength
- the maximum length of the stream or null
to read to
the end of the streamnull
if no content is associated
with this stream IDpublic Document setContentStream(ContentStream contentStream, boolean overwrite)
Document
The stream in contentStream
is consumed but not closed by this
method.
setContentStream
in interface Document
contentStream
- the content streamoverwrite
- if this parameter is set to false
and the document
already has content, the repository throws a
CmisContentAlreadyExistsException
null
if the repository did not
return an object IDObjectFactory.createContentStream(String, long, String,
java.io.InputStream)
public ObjectId setContentStream(ContentStream contentStream, boolean overwrite, boolean refresh)
Document
The stream in contentStream
is consumed but not closed by this
method.
setContentStream
in interface Document
contentStream
- the content streamoverwrite
- if this parameter is set to false
and the document
already has content, the repository throws a
CmisContentAlreadyExistsException
refresh
- if this parameter is set to true
, this object will be
refreshed after the new content has been setnull
if the repository did not
return an object IDObjectFactory.createContentStream(String, long, String,
java.io.InputStream)
public Document appendContentStream(ContentStream contentStream, boolean isLastChunk)
Document
The stream in contentStream
is consumed but not closed by this
method.
appendContentStream
in interface Document
contentStream
- the content streamisLastChunk
- indicates if this stream is the last chunk of the contentnull
if the repository did not
return an object IDObjectFactory.createContentStream(String, long, String,
java.io.InputStream)
public ObjectId appendContentStream(ContentStream contentStream, boolean isLastChunk, boolean refresh)
Document
The stream in contentStream
is consumed but not closed by this
method.
appendContentStream
in interface Document
contentStream
- the content streamisLastChunk
- indicates if this stream is the last chunk of the contentrefresh
- if this parameter is set to true
, this object will be
refreshed after the content stream has been appendednull
if the repository did not
return an object IDpublic Document deleteContentStream()
Document
deleteContentStream
in interface Document
null
if the repository did not
return an object IDpublic ObjectId deleteContentStream(boolean refresh)
Document
deleteContentStream
in interface Document
refresh
- if this parameter is set to true
, this object will be
refreshed after the content stream has been deletednull
if the repository did not
return an object IDpublic ObjectId checkIn(boolean major, Map<String,?> properties, ContentStream contentStream, String checkinComment)
Document
contentStream
is consumed but not closed by this
method.Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.