|
FileNet Content Services Java Connector v3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Document
object represents a document stored in a Content Services object store.
Documents are versionable and containable. To create a Document
object, call the
createObject
method on an ObjectStore
object. This method returns a reference to a Document
object that is initially a reservation object with permissions and properties
but without content. After you create the document using createObject
,
you can optionally set its content, check it in, and file it into a folder.
You can instantiate a persisted Document
object in the following ways (note that,
in some instances, the returned Document
is the document that represents a reservation object):
checkout
method on an object that implements the VersionableObject
interface,
which checks out a document and returns a reservation
object.
getReservation
method on an object that implements the VersionableObject
interface or
by retrieving the object's Reservation property,
which returns a reservation object (or null
).
Document
object's CurrentVersion property, which returns
the current document version in the version series.
getCurrentVersion
method on a VersionSeries
object or by retrieving the object's CurrentVersion
property, which returns the current document version in the version series.
getObject
method on an ObjectStore
object, which returns a document stored in
the object store.
ReadableMetadataObjects
interface's
findByProperty
methods, which returns a BaseObject
for a given property, relational operator, and value.
You can also instantiate a Document
object by instantiating
a Documents
collection, then returning a Document
object from the collection. For ways to instantiate a Documents
collection, see the Documents
interface.
Field Summary | |
static int |
LIFECYCLE_CLEAR_EXCEPTION
Not Implemented in CS Java Connector v3.0. |
static int |
LIFECYCLE_DEMOTE
Not Implemented in CS Java Connector v3.0. |
static int |
LIFECYCLE_NO_CHANGE
Not Implemented in CS Java Connector v3.0. |
static int |
LIFECYCLE_PROMOTE
Not Implemented in CS Java Connector v3.0. |
static int |
LIFECYCLE_RESET
Not Implemented in CS Java Connector v3.0. |
static int |
LIFECYCLE_SET_EXCEPTION
Not Implemented in CS Java Connector v3.0. |
static long |
UNKNOWN_CONTENT_LENGTH
Not Implemented in CS Java Connector v3.0. |
Fields inherited from interface com.filenet.wcm.api.ContainableObject |
INVALID_CONTAINMENT_NAME_CHARACTERS |
Method Summary | |
void |
applySecurityTemplate()
Not Implemented in CS Java Connector v3.0. |
void |
applySecurityTemplate(java.lang.String applyStateId)
Not Implemented in CS Java Connector v3.0. |
boolean |
canDemoteLifeCycleState()
Not Implemented in CS Java Connector v3.0. |
void |
changeClass(java.lang.String classId,
Properties props,
Permissions perms)
Changes the class with which this Document object is
associated in the object store. |
void |
changeLifeCycleState(int state)
Not Implemented in CS Java Connector v3.0. |
void |
delete()
Not Implemented in CS Java Connector v3.0. |
void |
delete(boolean allVersions)
Not Implemented in CS Java Connector v3.0. |
int |
getAccessMask()
Not Implemented in CS Java Connector v3.0. |
TransportInputStream |
getContent()
Provides a stream retrieving the first content element of this Document object. |
TransportInputStream |
getContentElement(int contentElement)
Provides a stream retrieving the specified content transfer element of this Document object.
|
int[] |
getContentElementObjectTypes()
Returns an array that contains the object types for the content elements associated with this Document object. |
java.lang.String |
getContentReferenceLocation()
Not Implemented in CS Java Connector v3.0. |
java.lang.String |
getContentReferenceLocation(int contentElement)
Not Implemented in CS Java Connector v3.0. |
java.lang.String |
getContentReferenceMimeType()
Returns the MIME content type for the first content element in this Document object. |
java.lang.String |
getContentReferenceMimeType(int contentElement)
Returns the MIME content type for the specified content reference element in this Document object.
|
java.lang.String |
getFilename()
Returns the file name (but no path information) for the first content element in this Document object. |
java.lang.String |
getFilename(int contentElement)
Returns the file name (but no path information) for the specified content transfer element in this Document object.
|
Links |
getHeadLinks(java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0. |
java.lang.String |
getHeadLinksXML(java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0. |
java.lang.String[] |
getLifeCycleStates()
Not Implemented in CS Java Connector v3.0. |
java.lang.String |
getPermissionsXML()
Retrieves a string in XML that represents a collection of all the Permission elements for this Document object.
|
Documents |
getPublications(PublicationFilter filter,
MimeTypes mimeTypes,
java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0. |
java.lang.String |
getPublicationsXML(PublicationFilter filter,
MimeTypes mimeTypes,
java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0. |
PublishTemplates |
getPublishTemplates(MimeTypes mimeTypes,
java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0. |
java.lang.String |
getPublishTemplatesXML(MimeTypes mimeTypes,
java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0. |
java.lang.String |
getSecurityPolicyXML()
Not Implemented in CS Java Connector v3.0. |
Subscriptions |
getSubscriptions(java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0. |
Links |
getTailLinks(java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0. |
java.lang.String |
getTailLinksXML(java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0. |
Permissions |
getUserAccess()
Not Implemented in CS Java Connector v3.0. |
Permissions |
getUserAccess(java.lang.String collectionType)
Not Implemented in CS Java Connector v3.0. |
Permissions |
getUserAccess(java.lang.String collectionType,
java.lang.String userId)
Not Implemented in CS Java Connector v3.0. |
Permissions |
getUserAccess(java.lang.String collectionType,
java.lang.String userId,
java.lang.String domain)
Deprecated. Use (collectionType, userId) form of this method. |
java.lang.String |
getUserAccessXML()
Deprecated. Use method getUserAccess. |
VersionSeries |
getVersionSeries()
Returns a VersionSeries object representing the collection
of versions of this Document object. |
java.lang.String |
getVersionsXML(java.lang.String[] propNames)
Returns a string in XML that represents a collection of all versions (and their requested properties) of this Document object that the user has permission to view.
|
boolean |
isDependent()
Not Implemented in CS Java Connector v3.0. |
boolean |
isPublication()
Not Implemented in CS Java Connector v3.0. |
PublishRequest |
publish(PublishTemplate publishTemplate,
java.lang.String publishOptions)
Not Implemented in CS Java Connector v3.0. |
Event |
raiseEvent(java.lang.String classId,
Properties props)
Not Implemented in CS Java Connector v3.0. |
PublishRequest |
republish(Document publishedDocument,
java.lang.String publishOptions)
Not Implemented in CS Java Connector v3.0. |
void |
setContent(TransportInputStream content,
boolean doCheckin,
boolean doAutoClassify)
Sets the content for this Document object and persists it to the
Content Services object store. |
void |
setContentReference(java.lang.String location,
java.lang.String mimeType,
int contentElement)
Not Implemented in CS Java Connector v3.0. |
Methods inherited from interface com.filenet.wcm.api.BaseObject |
equals, exportObject, getClassId, getId, getName, getObjectStoreId, getObjectType, getSession, hashCode, thisBaseObject |
Methods inherited from interface com.filenet.wcm.api.ContainableObject |
file, file, getContainers, getContainersXML, getContainmentNames, getContainmentPaths, getSecurityParent, setContainmentName, setContainmentName, setSecurityParent, unfile, unfile |
Methods inherited from interface com.filenet.wcm.api.VersionableObject |
cancelCheckout, checkin, checkin, checkout, checkout, demoteVersion, freeze, getReservation, getVersions, getVersions, promoteVersion |
Methods inherited from interface com.filenet.wcm.api.WorkflowTarget |
getWorkflowSubscriptions, getWorkflowSubscriptionsXML, getWorkflowSubscriptionsXML |
Methods inherited from interface com.filenet.wcm.api.WriteableSecurityObject |
setPermissions, setPermissions |
Methods inherited from interface com.filenet.wcm.api.WriteableMetadataObject |
setProperties |
Methods inherited from interface com.filenet.wcm.api.ReadableMetadataObject |
getProperties, getProperties, getPropertiesXML, getPropertyBinaryValue, getPropertyBooleanValue, getPropertyDateValue, getPropertyDoubleValue, getPropertyIntValue, getPropertyStringValue, getPropertyValue, getPropertyValuesValue, refresh, refresh |
Methods inherited from interface com.filenet.wcm.api.ReadableSecurityObject |
getPermissions, getPermissions |
Methods inherited from interface com.filenet.wcm.api.LockableObject |
extendLock, extendLock, isLocked, lock, unlock, unlock |
Field Detail |
public static final long UNKNOWN_CONTENT_LENGTH
Not Implemented in CS Java Connector v3.0.
Value of -1; the content length is not known.
public static final int LIFECYCLE_NO_CHANGE
Not Implemented in CS Java Connector v3.0.
Value of 0; no change in document lifecycle.
public static final int LIFECYCLE_PROMOTE
Not Implemented in CS Java Connector v3.0.
Value of 1048576; promote document lifecycle to next state.
public static final int LIFECYCLE_DEMOTE
Not Implemented in CS Java Connector v3.0.
Value of 2097152; demote document lifecycle to previous state.
public static final int LIFECYCLE_SET_EXCEPTION
Not Implemented in CS Java Connector v3.0.
Value of 3145728; set document lifecycle exception state (when a document is in an exception state, the document can neither be promoted nor demoted).
public static final int LIFECYCLE_CLEAR_EXCEPTION
Not Implemented in CS Java Connector v3.0.
Value of 4194304; clear document lifecycle exception state.
public static final int LIFECYCLE_RESET
Not Implemented in CS Java Connector v3.0.
Value of 5242880; reset a new version of the document to the initial state.
Method Detail |
public void changeLifeCycleState(int state)
Not Implemented in CS Java Connector v3.0.
Changes the state of the lifecycle associated with thisDocument
object.
Note that you cannot change the state of a document that is the reservation
object. Use one of the lifecycle state constants for the state
parameter.
Valid values are:
After a successful call to changeLifeCycleState
, all
properties are considered stale and are removed from cache for this
Document
object. A subsequent request for any of these properties
causes the Content Services Java Connector
to retrieve fresh data from the Content Services server.
state
- Specifies the lifecycle state for this Document
object.public java.lang.String[] getLifeCycleStates()
Not Implemented in CS Java Connector v3.0.
Returns the state names that are defined for the lifecycle policy associated with thisDocument
object.
Document
object.public boolean canDemoteLifeCycleState()
Not Implemented in CS Java Connector v3.0.
Specifies whether the current lifecycle state of thisDocument
object
can be demoted to its previous state. (The Content Services system administrator
configures whether a state can be demoted.)
If this Document
object does not have a lifecycle policy associated
with it, this method returns false.
true
if the current lifecycle state of this
Document
object can be demoted, otherwise false
.public TransportInputStream getContent()
Document
object. The first content element must be a content transfer
element. Use the accessor methods on the returned
TransportInputStream
object to determine the filename, MIME type,
and content size of the content element (if known). If you call getContent
on a reservation object that does not yet have content associated with it,
this method throws an exception. This method also throws an exception if you
call it on a checked-in document that has no content or its first content
element is a content reference element.
If a document has more than one content transfer element associated with it, use
getContentElement
to specify which element to return. Use
getContentReferenceLocation
and
getContentReferenceMimeType
to return the location and MIME type, respectively, for a content reference
element.
TransportInputStream
object that contains the input
stream of this Document
object's first content element.public TransportInputStream getContentElement(int contentElement)
Document
object.
Note: The CS Java Connector v3.0. only supports the first content transfer element.
Use the accessor methods on the returnedTransportInputStream
object to
determine the filename, MIME type, and content size of the content element (if known).
To return the MIME type of a specified content reference
element, call
getContentReferenceMimeType(contentElement)
.
contentElement
- The number of the content transfer element to be retrieved.
Content element numbering begins at 1.
TransportInputStream
object that contains the content for
the specified content element.
public void setContent(TransportInputStream content, boolean doCheckin, boolean doAutoClassify)
Document
object and persists it to the
Content Services object store. The content element must be a content transfer element
(content stored in a Content Services object store), and not content stored externally.
Note:You can only set one content transfer element.
Note that the document is not versioned until it is checked in, either by setting thedoCheckin
parameter to true
or by calling
the checkin(autoClassify)
method.
You call the setContent
method on the Document
object that represents the reservation object. Before you call
setContent
, use the accessor methods on the
TransportInputStream
object to supply content size, MIME type, and
filename.
Note that if you are calling setContent
from a client and you
construct the TransportInputStream
object from any type of input stream other than
a ByteArrayInputStream
, you must set the content size using
the setContentSize
method on the TransportInputStream
object.
(The ByteArrayInputStream
implicitly tells its own content size;
for other types of input streams--such as FileInputStream
--the
stream's length cannot be easily determined.) This restriction does not
apply to setContent
calls done from a server.
Also note that if you do not supply a filename in the TransportInputStream
object
and the document does not have a document title, the filename associated with the content
is set to the GUID of the document.
After a successful call to setContent
with the doCheckin
parameter to true
, the following
properties are considered stale and are removed from the cache for this
Document
object:
content
- A TransportInputStream
object that specifies the
stream for the content as well as the content's
size, MIME type, and filename.
doCheckin
- If true
, the document will be checked in
as a released version after the content is stored.
doAutoClassify
- Requires a boolean
value; however, the
value is ignored by the CS Java Connector v3.0..public void delete()
Not Implemented in CS Java Connector v3.0.
Deletes all versions of thisDocument
object (including, if
it exists, an initial version of the object that has not yet been checked
in). The user must have Delete permission (Permission.RIGHT_DELETE
)
on all versions (including the reservation object, if the current version
is checked out). To delete a specific document version, use the
delete(allVersions)
form of this method.
There might be other constraints upon the document that make it unable to
be deleted:
Document
object whose
ContentRetentionDate
property is non-null, the Content Services returns a run-time error.Document
object that references
(via an object-valued property) one or more objects, and the object-valued
property's DeletionAction metadata property is set to 1 (Prevent), the
Content Services returns a run-time error. For example, assume the document
you are attempting to delete is a workflow definition, and the
WorkflowDefinition
object's WorkflowSourceSubscriptions
property has a value other than null
. Attempting to delete
the workflow definition will fail because the WorkflowSourceSubscription
property's DeletionAction metadata property is set to 1 (Prevent).Document
object that references
one or more objects and the object-valued property's DeletionAction metadata
property is set to 2 (Cascade), the Content Services will attempt to delete
the referenced objects when the Document
object is deleted.
If the user does not have the appropriate permissions to delete the
referenced objects (or any objects that might be referenced by the
referenced objects, etc.), the original deletion will fail. Such a scenario
is possible, for example, when deleting a document that has annotations.Document
object that references
one or more objects and the object-valued property's DeletionAction metadata
property is set to 0 (None), the Document
object is deleted
without regard to its referenced objects. The referenced objects, if any,
neither prevent deletion of the Document
object, nor are
themselves deleted. If they reference back to the Document
object, they will contain a dangling reference to a nonexistent object.
A delete operation can fail because the transaction times out. This might
occur if there are a large number of versions (for example, in the thousands)
in this Document
object's version series, or if the delete
operation cascades to a large number of referenced objects. In any case,
the Content Services performs the delete operation as a single atomic
transaction; it will either successfully delete all the versions, or it
will fail and delete none of them. Note that the Microsoft Distributed
Transaction Coordinator (MS DTC) imposes the time limit on the duration
of the transaction (the default is one minute). For information on changing
the time limit used on a Content Services server, see your Microsoft documentation.
After a successful call to delete
, all
properties are considered stale and are removed from cache for this
Document
object.
public void delete(boolean allVersions)
Not Implemented in CS Java Connector v3.0.
Deletes either thisDocument
object or all versions of this
Document
object (including, if it exists, an initial version
of the object that has not yet been checked in). To delete only this
Document
object, set the allVersions
parameter
to false
; if true
, all versions of this
Document
object are deleted.
To successfully delete this Document
object, the user must
have Delete permission (Permission.RIGHT_DELETE
)
on the object. If this document is currently checked out, the user must
also have Delete permission on the reservation object. To successfully
delete all versions of this Document
object, the user must
have Delete permission on all versions (including the reservation object,
if the current version is checked out). There might be other constraints
upon the document that make it unable to be deleted:
Document
object whose
ContentRetentionDate
property is non-null, the Content Services returns a run-time error.Document
object that references
(via an object-valued property) one or more objects, and the object-valued
property's DeletionAction metadata property is set to 1 (Prevent), the
Content Services returns a run-time error. For example, assume the document
you are attempting to delete is a workflow definition, and the
WorkflowDefinition
object's WorkflowSourceSubscriptions
property has a value other than null
. Attempting to delete
the workflow definition will fail because the WorkflowSourceSubscription
property's DeletionAction metadata property is set to 1 (Prevent).Document
object that references
one or more objects and the object-valued property's DeletionAction metadata
property is set to 2 (Cascade), the Content Services will attempt to delete
the referenced objects when the Document
object is deleted.
If the user does not have the appropriate permissions to delete the
referenced objects (or any objects that might be referenced by the
referenced objects, etc.), the original deletion will fail. Such a scenario
is possible, for example, when deleting a document that has annotations.Document
object that references
one or more objects and the object-valued property's DeletionAction metadata
property is set to 0 (None), the Document
object is deleted
without regard to its referenced objects. The referenced objects, if any,
neither prevent deletion of the Document
object, nor are
themselves deleted. If they reference back to the Document
object, they will contain a dangling reference to a nonexistent object.
A delete operation can fail because the transaction times out. This might
occur if you are deleting all versions of a document and there are a
large number of versions (for example, in the thousands)
in this Document
object's version series, or if the delete
operation cascades to a large number of referenced objects. In any case,
the Content Services performs the delete operation as a single atomic
transaction; it will either successfully delete all the versions, or it
will fail and delete none of them. Note that the Microsoft Distributed
Transaction Coordinator (MS DTC) imposes the time limit on the duration
of the transaction (the default is one minute). For information on changing
the time limit used on a Content Services server, see your Microsoft documentation.
After a successful call to delete
, all
properties are considered stale and are removed from cache for this
Document
object.
allVersions
- A boolean
that specifies whether to delete all
versions of this Document
object
(true
) or delete only this
Document
object version (false
).public java.lang.String getVersionsXML(java.lang.String[] propNames)
Document
object that the user has permission to view.
If the propNames
parameter is
null
or an empty array, this method returns all properties for the document
versions. If the array includes properties that do not exist for the
document versions, those properties are ignored (no exception is thrown).
This method always makes a roundtrip to the Content Services server and
never uses cached properties.
propNames
- A String array whose elements specify the
symbolic names of the properties to retrieve.
If null
or an empty array, returns all
properties for the document versions.
However, if you pass in a null
, you must
first explicitly cast it to a String[] to avoid a compilation error.
Documents
collection that contains all versions of
this Document
object.public java.lang.String getUserAccessXML()
Not Implemented in CS Java Connector v3.0.
public java.lang.String getPermissionsXML()
Permission
elements for this Document
object.
public Documents getPublications(PublicationFilter filter, MimeTypes mimeTypes, java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0.
Retrieves a collection of documents (and their requested properties) that are published from thisDocument
object and that have the specified MIME types. Use the
filter
parameter to select the documents
to be returned. Valid values are:
Document
object as a source.
Document
object version as a source.
null
- returns the most recent version of all publications
that have any of the versions of this
Document
object as a source.
propNames
parameter.
If null
or an empty array, this method retrieves an initial
set of hard-coded properties. However, because this set can vary from release
to release, we recommend you specify the properties your application
requires in the propNames
array.
filter
- A PublicationFilter
object that specifies how
to filter the returned documents. If null
,
returns the most recent version of all
publications that have any of the versions of this
Document
object as a source.
mimeTypes
- A MimeTypes
collection that specifies how to
filter the returned documents based on their MIME
types. If null
or an empty collection, returns documents
with all MIME types.
propNames
- A String array whose elements specify the symbolic
names of the properties to retrieve. Note that any
properties specified in the array must be selectable
or this method throws an exception. (A property is
selectable if the value of the IsSelectable property
for the PropertyDescription
object that
describes the property is true.) Also note that if you
pass in a null
for the propNames
parameter, you must first explicitly cast it to a
String[] to avoid a compilation error.
Document
objects that are published
from this Document
object and that have the specified MIME types.public java.lang.String getPublicationsXML(PublicationFilter filter, MimeTypes mimeTypes, java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0.
Retrieves a string in XML that represents the collection of documents (and their requested properties) that are published from thisDocument
object and that have the specified
MIME types.
Use the filter
parameter to select the documents to be returned. Valid values are:
Document
object as a source.Document
object version as a source.null
- returns the most recent version of all
publications that have any of the versions of this Document
object
as a source.propNames
parameter.
If null
or an empty array, this method retrieves an initial
set of hard-coded properties. However, because this set can vary from release
to release, we recommend you specify the properties your application
requires in the propNames
array. If the
propNames
array includes properties that
do not exist for the documents, those properties are ignored (no exception
is thrown). This method always makes a roundtrip to the Content Services
server and never uses cached properties.
filter
- A PublicationFilter
object that specifies how
to filter the returned documents. If null
,
returns the most recent version of all
publications that have any of the versions of this
Document
object as a source.
mimeTypes
- A MimeTypes
collection that specifies how to
filter the returned documents based on their MIME
types. If null
or an empty collection, returns documents
with all MIME types.
propNames
- A String array whose elements specify the symbolic
names of the properties to retrieve. Note that any
properties specified in the array must be selectable
or this method throws an exception. (A property is
selectable if the value of the IsSelectable property
for the PropertyDescription
object that
describes the property is true.) Also note that if you
pass in a null
for the propNames
parameter, you must first explicitly cast it to a
String[] to avoid a compilation error.
Document
object and
that have the specified MIME types.
For documentation that describes the XML schema used to generate
the string, refer to
Schemas
in the FileNet P8 Developer's Roadmap.public PublishTemplates getPublishTemplates(MimeTypes mimeTypes, java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0.
Retrieves a collection of publish templates (and their requested properties) that can be applied to thisDocument
object and that produce the specified MIME type. If
mimeTypes
is null
or an empty collection, this method returns
all appropriate publish templates with any MIME type.
If propNames
is null
or an empty array, this method retrieves an initial
set of hard-coded properties. However, because this set can vary from release
to release, we recommend you specify the properties your application
requires in the propNames
array.
mimeTypes
- A MimeTypes
collection that specifies how to
filter the returned publish templates based on MIME types.
If null
or an empty collection, returns
all appropriate publish templates with any MIME type.
propNames
- A String array whose elements specify the
symbolic names of the properties to retrieve.
(If you pass in a null
, you must
first explicitly cast it to a String[] to avoid a compilation error.)
PublishTemplate
objects that can be
applied to this Document
object.public java.lang.String getPublishTemplatesXML(MimeTypes mimeTypes, java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0.
Retrieves a string in XML containing a representation of the collection of publish templates (and their requested properties) that can be applied to thisDocument
object and
that produce the specified MIME type.
If mimeTypes
is null
or an empty collection, this method
returns all appropriate publish templates with any MIME type.
If propNames
is
null
or an empty array, this method retrieves an initial
set of hard-coded properties. However, because this set can vary from release
to release, we recommend you specify the properties your application
requires in the propNames
array. If
the array includes properties that
do not exist for the publish templates, those properties are ignored (no
exception is thrown). This method always makes a roundtrip to the Content
Services server and never uses cached properties.
mimeTypes
- A MimeTypes
collection that specifies how to
filter the returned publish templates based on MIME types.
If null
or an empty collection, returns
all appropriate publish templates with any MIME type.
propNames
- A String array whose
elements specify the symbolic names of the properties
to retrieve.
(If you pass in a null
, you must
first explicitly cast it to a String[] to avoid a compilation error.)
Document
object.
For documentation that describes the XML schema used to generate
the string, refer to
Schemas
in the FileNet P8 Developer's Roadmap.public boolean isDependent()
Not Implemented in CS Java Connector v3.0.
Specifies if thisDocument
object is a published document that is
dependent on its source document. If a document is dependent on its source
document, the dependent document is deleted if the source document is deleted.
true
if this Document
object is a published
document that is dependent on its source document; otherwise false
.public boolean isPublication()
Not Implemented in CS Java Connector v3.0.
Specifies if thisDocument
object is a published document.
true
if this Document
object is a published
document; otherwise false
.public PublishRequest publish(PublishTemplate publishTemplate, java.lang.String publishOptions)
Not Implemented in CS Java Connector v3.0.
Publishes thisDocument
object according to the specifications
included in the specified publish template as modified by the contents of
the publishOptions
parameter. This method returns the
PublishRequest
object that is queued for this request.
However, if the publish operation occurs immediately (that is, no transform
is involved), the PublishRequest
object will reflect a completed
status and will not represent a persisted publish request.
The publish template you specify, as well as any objects specified in the
publish template itself, must reside on the same object store as this
Document
object. Note that publishing to a document class
containing a required binary- or object-valued property is not supported
as there is no way to set these property values during publishing.
The publishOptions
parameter is a string containing XML that
specifies the publish options for the published document. The string can include:
publicationname
node.outputfoldername
node) or
its ID (in the outputfolderid
node). No more than one name
or ID can be specified. Including the output folder name or ID in the
string overrides the output folder specified in the publish template.eventactionname
node) or its ID (in the eventactionid
node). No more than
one name or ID can be specified. Including the event action name or ID in
the string overrides the event action (if any) specified in the publish
template. If the publish template specifies an event action and none is
desired, include an eventactionname
node with no name
specified in the publishOptions
parameter.
The following shows an example of valid publishOptions
XML:
String pubOptions = new String("<publishoptions><publicationname>My New Title</publicationname><outputfoldername>MyFolder</outputfoldername><eventactionname>MyEventActionName</eventactionname></publishoptions>");
PublishRequest pubReq = sourceDoc.publish(pubTemplate, pubOptions);
publish
, the following
properties are considered stale and are removed from cache for this
Document
object:
A subsequent request for any of these properties causes the Content Services Java Connector to retrieve fresh data from the Content Services server.
publishTemplate
- The PublishTemplate
object to use
for this publish operation.
publishOptions
- A string containing XML that specifies the publish options
for the published document.
PublishRequest
object that is queued for thispublic PublishRequest republish(Document publishedDocument, java.lang.String publishOptions)
Not Implemented in CS Java Connector v3.0.
Republishes the specified published document. The specified published document must have been published with a publish template that still exists and had thisDocument
object as its source document. This method returns the
PublishRequest
object that is queued for this request.
However, if the publish operation occurs immediately (that is, no transform
is involved), the PublishRequest
object will reflect a
completed status and will not represent a persisted publish request.
The publishOptions
parameter is a string containing XML that
specifies the publish options for the republished document. The string can include:
publicationname
node.outputfoldername
node) or
its ID (in the outputfolderid
node). No more than one name
or ID can be specified. Including the output folder name or ID in the
string overrides the output folder specified in the publish template.eventactionname
node) or its ID (in the eventactionid
node). (Note that the
event action does not need to be the same event action (if any) specified
when the document was initially published.) No more than one name or ID
can be specified. Including the event action name or ID in the string
overrides the event action (if any) specified in the publish template.
If the publish template specifies an event action and none is desired,
include an eventactionname
node with no name specified in
the publishoptions
parameter.
The following shows an example of valid publishOptions
XML:
String pubOptions = new String("<publishoptions><publicationname>My New Title</publicationname><outputfoldername>MyFolder</outputfoldername><eventactionname>MyEventActionName</eventactionname></publishoptions>");
PublishRequest pubReq = sourceDoc.republish(pubDoc, pubOptions);
republish
, the following
properties are considered stale and are removed from cache for this
Document
object:
A subsequent request for any of these properties causes the Content Services Java Connector to retrieve fresh data from the Content Services server.
publishedDocument
- The Document
object that is the published
document to republish.
publishOptions
- A string containing XML that specifies the publish options
for the republished document.
PublishRequest
object that is queued for this
request.public void setContentReference(java.lang.String location, java.lang.String mimeType, int contentElement)
Not Implemented in CS Java Connector v3.0.
Sets external content information for the specified content reference element in thisDocument
object. This
information includes the location, in URL format, of the content as well
as the external content type referenced by the URL. Note that this
content type does not get reflected back to the document's MimeType
property.
For this call to succeed, this Document
object must be a
checked-out document (its IsReserved property is true).
The setContentReference
method throws an exception if
called from the StoredSearch
or PublishTemplate
interfaces via inheritance.
After a successful call to setContentReference
, the following
properties are considered stale and are removed from cache for this
Document
object:
A subsequent request for any of these properties causes the Content Services Java Connector to retrieve fresh data from the Content Services server.
location
- A String that specifies, in URL format, the name of
the resource that contains the content data.
mimeType
- A String that specifies the MIME type of the external
content associated with this Document
object. Note
that this is not the MIME type of the document
referencing the external content.
contentElement
- The number of the content element to set.
Content element numbering begins at 1.public java.lang.String getContentReferenceLocation()
Not Implemented in CS Java Connector v3.0.
Returns the location, in URL format, for the first content element in thisDocument
object. The first content element must be a content
reference element, otherwise this method returns null
.
For this call to succeed, this Document
object
must be the current released version (or, if none exists, the current version).
The getContentReferenceLocation
method throws an exception if
called from the StoredSearch
or PublishTemplate
interfaces via inheritance.
If a document has more than one content reference element associated with it, use the
getContentReferenceLocation(contentElement)
form of this method. To determine whether a content element is a content reference
or a content transfer element, call
getContentElementObjectTypes()
.
Document
object; null
if the
first content element is not a content reference element.public java.lang.String getContentReferenceLocation(int contentElement)
Not Implemented in CS Java Connector v3.0.
Returns the location, in URL format, for the specified content reference element in thisDocument
object. For this call to succeed,
this Document
object
must be the current released version (or, if none exists, the current version).
The getContentReferenceLocation
method throws an exception if
called from the StoredSearch
or PublishTemplate
interfaces via inheritance.
To determine whether a content element is a content reference
or a content transfer element, call
getContentElementObjectTypes()
.
contentElement
- The number of the content element.
Content element numbering begins at 1.
Document
object; null
if the
content element in question is not a content reference element.public java.lang.String getContentReferenceMimeType()
Document
object. The first content element must be a content
reference element, otherwise this method returns null
.
For this call to succeed, this Document
object
must be the current version (its IsCurrentVersion property is true).
If a document has more than one content reference element associated with it, use the
getContentReferenceMimeType(contentElement)
form of this method. To determine whether a content element is a content reference
or a content transfer element, call
getContentElementObjectTypes()
.
Document
object; null
if the
first content element is not a content reference element.public java.lang.String getContentReferenceMimeType(int contentElement)
Document
object.
Note: The CS Java Connector v3.0. supports the first content reference element only.
For this call to succeed, thisDocument
object
must be the current version (its IsCurrentVersion property is true).
To determine whether a content element is a content reference
or a content transfer element, call
getContentElementObjectTypes()
.
contentElement
- The number of the content element.
You must enter 1; otherwise, an exception will be thrown.
Document
object; null
if the
content element in question is not a content reference element.
public java.lang.String getFilename()
Document
object. The first content element must be a content
transfer element, otherwise this method returns null
.
Note: The CS Java Connector v3.0. supports only the first content transfer element.
If a document has more than one content transfer element associated with it, use thegetFilename(contentElement)
form of this method. To determine whether a content element is a content transfer
or a content reference element, call
getContentElementObjectTypes()
.
Document
object; null
if the
first content element is not a content transfer element.
public java.lang.String getFilename(int contentElement)
Document
object.
Note: The CS Java Connector v3.0. supports the first content transfer element only.
To determine whether a content element is a content transfer or a content reference element, callgetContentElementObjectTypes()
.
contentElement
- The number of the content element.
You must enter 1; otherwise, an exception will be thrown.
Document
object; null
if the
content element in question is not a content transfer element.public Permissions getUserAccess()
Not Implemented in CS Java Connector v3.0.
Retrieves the access rights (permissions) for the current user on thisDocument
object. (The current user is
identified in the Session
object.) The elements in the returned collection are the access rights
assigned to the current user and to any groups to which this user belongs.
If the user does not have explicit rights, this method returns only the
access rights of the groups to which the user belongs.
Note that the returned Permissions
collection represents
basic object permissions (i.e., an object's Permissions property). To
specify the type of permissions (basic object or audit) to retrieve for the current user, use
getUserAccess(collectionType)
.
To retrieve permissions for a specified user, use
getUserAccess(collectionType, userId, domain)
.
Permissions
collection containing the
access rights for the current user on this
Document
object.public Permissions getUserAccess(java.lang.String collectionType)
Not Implemented in CS Java Connector v3.0.
Retrieves the access rights (permissions) of the specified type for the current user on thisDocument
object. (The current user is
identified in the Session
object.) The elements in the returned collection are the access rights
assigned to the current user and to any groups to which this user belongs.
If the user does not have explicit rights, this method returns only the
access rights of the groups to which the user belongs.
Specify the type of permissions
(basic object or audit)
to return in the collectionType
parameter.
If the user is not an Administrator and does not have specific
privileges to access audit permissions, this method throws an
InsufficientPermissionException if the specified collection type is
Property.AUDIT_PERMISSIONS
. This exception occurs even if the user
has been granted full control access rights (Permission.LEVEL_FULL_CONTROL
)
to the object. To set audit permissions privileges for the user, refer to the
Enable security auditing
topic.
getUserAccess(collectionType, userId, domain)
form of this method.
collectionType
- A String that is the name of a property whose value is a
collection of Content Services Permission
objects.
Use Property.PERMISSIONS
for basic object permissions or
Property.AUDIT_PERMISSIONS
for audit permissions.
Permissions
collection of the specified type
containing the access rights
for the current user on this
Document
object.public Permissions getUserAccess(java.lang.String collectionType, java.lang.String userId)
Not Implemented in CS Java Connector v3.0.
Retrieves the access rights (permissions) of the specified type for the specified user on thisDocument
object.
The elements in the returned collection are the access rights
assigned to the specified user and to any groups to which this user belongs.
If the user does not have explicit rights, this method returns only the
access rights of the groups to which the user belongs.
Specify the type of permissions to return in the collectionType
parameter.
Currently, the only valid value for collectionType
is the
Property.PERMISSIONS
constant for
basic object permissions
(that is, an object's Permissions property).
getUserAccess()
or
getUserAccess(collectionType)
.
These two methods offer equivalent functionality.
collectionType
- A String that is the name of a property whose value is a
collection of Content Services Permission
objects.
Currently, the only valid value is Property.PERMISSIONS
(for basic object permissions). This method throws a
RemoteServerException if you specify any other value.
userId
- A String (whose value is a User object's Name property) that
identifies the user for whom permissions are to be retrieved.
Permissions
collection of the specified type
containing the access rights for the specified user on this
Document
object.
public Permissions getUserAccess(java.lang.String collectionType, java.lang.String userId, java.lang.String domain)
Not Implemented in CS Java Connector v3.0.
public VersionSeries getVersionSeries()
VersionSeries
object representing the collection
of versions of this Document
object. Use the VersionSeries
object if you want to assure that your application is using the current
version of a document (see the
VersionSeries
interface description for more information).
VersionSeries
object.public void changeClass(java.lang.String classId, Properties props, Permissions perms)
Document
object is
associated in the object store. The new class and the old class must have the same
base class type (that is, if an object's current class is a document class,
you cannot change its class to a folder class, custom object class, etc.).
Since the
required properties for the two classes might differ, this method takes an
optional Properties
collection as one of its parameters.
The collection can be empty or the parameter can be
null
if no changes are required. This method will
throw an exception if you explicitly set the value of a contained
Property
object that cannot be set due to its Settability
property (e.g., it is Read-only). Note that this exception will be thrown
even if the new value of a property you explicitly set is the same as its
old value.
This method also takes an optional Permissions
collection
as one of its parameters.
If this parameter is null
, the Document
object's security is not modified. Note that this Permissions
collection
represents the basic object permissions for the object (i.e., the object's
Permissions property). If you pass in an empty Permissions
collection,
all existing permissions are removed. Note that, if the permissions
are modified inappropriately, it is possible to make a change that cannot
be reversed by the same user.
classId
- A String
that represents the ID or the
symbolic name of the class to which this object is to be
changed. (The ClassDescription
interface has constants for well-known class IDs.)
props
- A Properties
collection. The elements
of the collection specify properties to change. Can be null
or an empty collection if no property changes are required.
perms
- A Permissions
collection. The elements of
the collection specify the permissions to change. Can be null
if no permission changes are necessary. Passing an empty collection
removes all existing permissions.
public int[] getContentElementObjectTypes()
Document
object. The object types, which are either
Content Services ContentReference
or ContentTransfer
objects, are represented
in the array as BaseObject
constants of type int
(either
TYPE_CONTENT_REFERENCE
or TYPE_CONTENT_TRANSFER
). You would typically use
this method to determine if a specific content element is a content transfer
(content stored in a Content Services object store) or content reference (content
stored externally) element.
int
array, where each element in the array is the object type
of a content element associated with this Document
object.public Links getHeadLinks(java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0.
Returns a collection ofLink
objects for which this
Document
object is the logical head of a link relationship.
propNames
- A String
array whose elements specify the
symbolic names of the properties to retrieve. If
null
or an empty array, returns the
Id, Name, Head, and Tail properties.
Links
collection containing any Link
objects for which this Document
object is the
logical head of a link relationship.public Links getTailLinks(java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0.
Returns a collection ofLink
objects for which this
Document
object is the logical tail of a link relationship.
propNames
- A String
array whose elements specify the
symbolic names of the properties to retrieve. If
null
or an empty array, returns the
Id, Name, Head, and Tail properties.
Links
collection containing any Link
objects for which this Document
object is the
logical tail of a link relationship.public java.lang.String getSecurityPolicyXML()
Not Implemented in CS Java Connector v3.0.
Returns a string in XML that represents thesecurity policy
associated with
this Document
object. To successfully execute this method,
the user must have permission to read this Document
object's
security (see the RIGHT_READ_ACL
constant in the
Permission
interface).
public void applySecurityTemplate(java.lang.String applyStateId)
Not Implemented in CS Java Connector v3.0.
Applies the specifiedsecurity template
to this Document
object. To successfully execute this
method, the user must have permission to modify this Document
object's security (see the RIGHT_WRITE_ACL
constant in the
Permission
interface).
The parameter to this method is a GUID that is used to identify and locate
a corresponding security template from those available in the
SecurityPolicy
container
object assigned to this Document
object. If you pass in
null
, this method locates and applies the
SecurityTemplate
associated with the current value of
the Document
object's VersionStatus property.
This method is useful for propagating a security policy change to
objects that are currently using that security policy. You can use a
query approach of your choice to retrieve a list of objects that are using the
SecurityPolicy
object, then iterate over the returned list,
calling this method on each item to explicitly apply the change.
When applying a versioning security template, the applyStateId
parameter is a GUID that corresponds to a logical version status:
InProcess, Released, Reservation, or Superseded.
You can use constants defined in the
VersionableObject
interface
to supply the GUID.
When applying an application security template, the input parameter is
a user-defined GUID that is managed by your application.
applyStateId
- A String
containing a GUID that identifies
the security template you want to apply from those available in the security
policy. Can be null
. If null
, applies the
security template associated with the current value of this
Document
object's VersionStatus property.public void applySecurityTemplate()
Not Implemented in CS Java Connector v3.0.
Applies thesecurity template
associated with the current value of this Document
object's
VersionStatus property. To successfully execute this
method, the user must have permission to modify this Document
object's security (see the RIGHT_WRITE_ACL
constant in the
Permission
interface).
This method is useful for propagating a security policy change to
objects that are currently using that security policy. You can use a
query approach of your choice to retrieve a list of objects that are using the
SecurityPolicy
object, then iterate over the returned list,
calling this method on each item to explicitly apply the change.
public Subscriptions getSubscriptions(java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0.
Returns a collection ofSubscription
objects for which
this Document
object is the subscription's target object.
An object is a target object if a Subscription
object's
SubscriptionTarget property points to the object, to the object's
VersionSeries
object, or to the
ClassDescription
of the object (or to some superclass of
the ClassDescription
if it is a class subscription whose
IncludeSubclassesRequested property is true).
If propNames
is null
or an empty array, this method retrieves an initial
set of hard-coded properties. However, because this set can vary from release
to release, we recommend you specify the properties your application
requires in the propNames
array.
propNames
- A String array whose elements specify the
symbolic names of the properties to retrieve.
Subscriptions
collection that contains the
Subscription
objects associated with this
Document
object.public Event raiseEvent(java.lang.String classId, Properties props)
Not Implemented in CS Java Connector v3.0.
Raises a custom audit event for thisDocument
object and returns
an Event
object. The returned object represents the audit event
that is recorded for this Document
object. The user must have
Read permission (Permission.RIGHT_READ
) on this Document
object.
You must specify the ID (or the symbolic name) for the custom event in the classId
parameter. To retrieve the ID for a custom event, call the
getAuditDefinitions(incInherited)
method on this Document
object's ClassDescription
;
then call the
getEventClassId
method on the AuditDefinition
that defines the custom event.
You must include the EventStatus
property in the collection you pass in for the props
parameter.
Set the property's value to whatever is meaningful for your application.
(For system audit events, the Content Services sets the property's value to
0 indicating a successful operation, or to an error code for failure. For
a custom audit event, it is up to the client application to define and
interpret the value of this property.) Properties that are not specified
that have default values in the Content
Engine object store take the defaults. This method will throw an exception
if you explicitly set the value
of a contained Property
object that cannot be set due to its
Settability property (e.g., it is Read-only).
Note that if auditing is disabled for the object store, this method will
not throw an exception. However, the audit event will not be recorded and
method calls on the returned Event
object will throw a
BadReferenceException
.
classId
- A String
that represents the ID or the symbolic
name of the custom event class. If null
or
if this custom event is not defined for this Document
object's class, this method throws an exception.
props
- A Properties
collection that specifies the
properties to set for the event. The collection must include
the EventStatus property, which is a required property when
you create an Event
object.
Event
object that represents the audit event that
is recorded for this Document
object.public java.lang.String getHeadLinksXML(java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0.
Returns a string in XML that represents a collection ofLink
objects for which this
Document
object is the logical head of a link relationship.
If the propNames
parameter is
null
or an empty array, this method returns all readily-available
properties for the Link
objects.
If the array includes properties that do not exist for the
Link
objects, those properties are ignored (no exception is thrown).
Note that this method never returns binary-valued properties.
This method always makes a roundtrip to the Content Services server and
never uses cached properties.
propNames
- A String
array whose elements specify the
symbolic names of the properties to retrieve. If
null
or an empty array, returns all
readily-available properties for the Link
objects.
String
containing an XML representation of the Link
objects for which this Document
object is the
logical head of a link relationship.
For documentation that describes the XML schema used to generate
the string, refer to
Schemas
in the FileNet P8 Developer's Roadmap.public java.lang.String getTailLinksXML(java.lang.String[] propNames)
Not Implemented in CS Java Connector v3.0.
Returns a string in XML that represents a collection ofLink
objects for which this
Document
object is the logical tail of a link relationship.
If the propNames
parameter is
null
or an empty array, this method returns all readily-available
properties for the Link
objects.
If the array includes properties that do not exist for the
Link
objects, those properties are ignored (no exception is thrown).
Note that this method never returns binary-valued properties.
This method always makes a roundtrip to the Content Services server and
never uses cached properties.
propNames
- A String
array whose elements specify the
symbolic names of the properties to retrieve. If
null
or an empty array, returns all
readily-available properties for the Link
objects.
String
containing an XML representation of the Link
objects for which this Document
object is the
logical tail of a link relationship.
For documentation that describes the XML schema used to generate
the string, refer to
Schemas
in the FileNet P8 Developer's Roadmap.public int getAccessMask()
Not Implemented in CS Java Connector v3.0.
Returns an integer representing a bit mask of access rights for thisDocument
object.
The returned value represents a collection of access rights
granted on this Document
object to the current user.
You can use bitwise comparisons against the access right and level constants
in the Permission
interface to determine the user's specific access rights.
If the Document
object has any markings
applied, the mask reflects any access rights denied by the marking
constraint mask. Use the returned integer to determine if the user has
the appropriate access rights to perform an operation on the object.
Note that if markings are not being used, or you need to specify a
particular user, you can perform a similar function by calling
getUserAccess().asMask()
.
However, the value returned by getAccessMask()
always
accurately reflects the access rights granted to the user, whereas asMask()
can only reflect the access rights as they apply to the Permissions
collection upon which you are acting. For example, the value returned by
asMask()
will not reflect access rights granted or denied
by assigned markings.
|
FileNet Content Services Java Connector v3.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |