FileNet Content Services
Java Connector v3.0

com.filenet.wcm.api
Interface Document

All Superinterfaces:
BaseObject, ContainableObject, CreatableObject, GettableObject, LockableObject, ReadableMetadataObject, ReadableSecurityObject, java.io.Serializable, ValueObject, VersionableObject, WorkflowTarget, WriteableMetadataObject, WriteableSecurityObject
All Known Subinterfaces:
Document, PublishTemplate, StoredSearch, WorkflowDefinition

public interface Document
extends BaseObject, ContainableObject, VersionableObject, GettableObject, CreatableObject, WorkflowTarget, WriteableSecurityObject, LockableObject

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):

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.

See Also:
CS Java Toolkit Developer's Guide

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.BaseObject
EXPORT_DEFAULT, EXPORT_ENCODED_CONTENT, EXPORT_FULL, EXPORT_OBJECT_ID, EXPORT_OBJECT_SECURITY, IMPORT_DEFAULT, IMPORT_OBJECT_ID, IMPORT_OWNER, IMPORT_PERMISSIONS, TYPE_ACTIVE_MARKING, TYPE_ANNOTATION, TYPE_ANY, TYPE_CBR_ENGINE_TYPE, TYPE_CHOICE, TYPE_CHOICELIST, TYPE_CLASS_SUBSCRIPTION, TYPE_CLASSDEFINITION, TYPE_CLASSDESCRIPTION, TYPE_COLUMN_DEFINITION, TYPE_COMPUTER, TYPE_CONTENT_CACHE_SERVICE, TYPE_CONTENT_MGR_SERVICE, TYPE_CONTENT_REFERENCE, TYPE_CONTENT_TRANSFER, TYPE_CUSTOMOBJECT, TYPE_DOCUMENT, TYPE_DOCUMENT_CLASSIFICATION_ACTION, TYPE_DOCUMENT_LIFECYCLE_ACTION, TYPE_DOCUMENT_LIFECYCLE_POLICY, TYPE_DOCUMENTSTATE, TYPE_DOMAIN, TYPE_DYNAMIC_REFERENTIAL_CONTAINMENT_RELATIONSHIP, TYPE_ENTIRENETWORK, TYPE_EVENT, TYPE_EVENT_ACTION, TYPE_FEATURE_ADD_ON, TYPE_FILESTORE, TYPE_FOLDER, TYPE_GROUP, TYPE_INSTANCE_SUBSCRIPTION, TYPE_LINK, TYPE_LOCALIZED_STRING, TYPE_MARKING_SET, TYPE_MULTIPLEVALUES, TYPE_OBJECT_STORE, TYPE_OBJECTSET, TYPE_OBJSTORE_SERVICE, TYPE_PERMISSION, TYPE_PROPERTY_DEFINITION, TYPE_PROPERTYDESCRIPTION, TYPE_PROPERTYDESCRIPTIONS, TYPE_PUBLISH_REQUEST, TYPE_PUBLISH_TEMPLATE, TYPE_READONLY_OBJECT_SET, TYPE_REALM, TYPE_REFERENTIAL_CONTAINMENT_RELATIONSHIP, TYPE_SECURITY_POLICY, TYPE_SECURITY_TEMPLATE, TYPE_STORAGE_POLICY, TYPE_STORED_SEARCH, TYPE_STYLE_TEMPLATE, TYPE_SUBSCRIPTION, TYPE_TABLE_DEFINITION, TYPE_TRANSIENT, TYPE_USER, TYPE_VERSIONSERIES, TYPE_WORKFLOW_CLASS_SUBSCRIPTION, TYPE_WORKFLOW_INSTANCE_SUBSCRIPTION, TYPE_WORKFLOWDEFINITION, TYPE_XML_PROPERTY_MAPPING_SCRIPT
 
Fields inherited from interface com.filenet.wcm.api.ContainableObject
INVALID_CONTAINMENT_NAME_CHARACTERS
 
Fields inherited from interface com.filenet.wcm.api.VersionableObject
APPLY_STATE_ID_IN_PROCESS, APPLY_STATE_ID_RELEASED, APPLY_STATE_ID_RESERVATION, APPLY_STATE_ID_SUPERSEDED, RESERVATION_TYPE_COLLABORATIVE, RESERVATION_TYPE_DEFAULT, RESERVATION_TYPE_EXCLUSIVE, VERSION_STATUS_IN_PROCESS, VERSION_STATUS_RELEASED, VERSION_STATUS_RESERVATION, VERSION_STATUS_SUPERSEDED
 
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

UNKNOWN_CONTENT_LENGTH

public static final long UNKNOWN_CONTENT_LENGTH

Not Implemented in CS Java Connector v3.0.

Value of -1; the content length is not known.

See Also:
Constant Field Values

LIFECYCLE_NO_CHANGE

public static final int LIFECYCLE_NO_CHANGE

Not Implemented in CS Java Connector v3.0.

Value of 0; no change in document lifecycle.

See Also:
Constant Field Values

LIFECYCLE_PROMOTE

public static final int LIFECYCLE_PROMOTE

Not Implemented in CS Java Connector v3.0.

Value of 1048576; promote document lifecycle to next state.

See Also:
Constant Field Values

LIFECYCLE_DEMOTE

public static final int LIFECYCLE_DEMOTE

Not Implemented in CS Java Connector v3.0.

Value of 2097152; demote document lifecycle to previous state.

See Also:
Constant Field Values

LIFECYCLE_SET_EXCEPTION

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).

See Also:
Constant Field Values

LIFECYCLE_CLEAR_EXCEPTION

public static final int LIFECYCLE_CLEAR_EXCEPTION

Not Implemented in CS Java Connector v3.0.

Value of 4194304; clear document lifecycle exception state.

See Also:
Constant Field Values

LIFECYCLE_RESET

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.

See Also:
Constant Field Values
Method Detail

changeLifeCycleState

public void changeLifeCycleState(int state)

Not Implemented in CS Java Connector v3.0.

Changes the state of the lifecycle associated with this Document 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.

Parameters:
state - Specifies the lifecycle state for this Document object.

getLifeCycleStates

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 this Document object.

Returns:
An array of Strings that specify the lifecycle state names for this Document object.

canDemoteLifeCycleState

public boolean canDemoteLifeCycleState()

Not Implemented in CS Java Connector v3.0.

Specifies whether the current lifecycle state of this Document 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.

Returns:
true if the current lifecycle state of this Document object can be demoted, otherwise false.

getContent

public TransportInputStream getContent()
Provides a stream retrieving the first content element of this 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.

Returns:
A TransportInputStream object that contains the input stream of this Document object's first content element.

getContentElement

public TransportInputStream getContentElement(int contentElement)
Provides a stream retrieving the specified content transfer element of this Document object.

Note: The CS Java Connector v3.0. only supports the first 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).

To return the MIME type of a specified content reference element, call getContentReferenceMimeType(contentElement).

Parameters:
contentElement - The number of the content transfer element to be retrieved. Content element numbering begins at 1.

Returns:
A TransportInputStream object that contains the content for the specified content element.


setContent

public void setContent(TransportInputStream content,
                       boolean doCheckin,
                       boolean doAutoClassify)
Sets the content for this 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 the doCheckin 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:

A subsequent request for any of these properties causes the CS Java Connector to retrieve fresh data from the Content Services server.

Parameters:
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..

delete

public void delete()

Not Implemented in CS Java Connector v3.0.

Deletes all versions of this Document 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:

If you attempt to delete a 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.


delete

public void delete(boolean allVersions)

Not Implemented in CS Java Connector v3.0.

Deletes either this Document 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:

If you attempt to delete a 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.

Parameters:
allVersions - A boolean that specifies whether to delete all versions of this Document object (true) or delete only this Document object version (false).

getVersionsXML

public 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. 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.

Parameters:
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.
Returns:
A String containing an XML representation of the Documents collection that contains all versions of this Document object.

getUserAccessXML

public java.lang.String getUserAccessXML()
Deprecated. Use method getUserAccess.

Not Implemented in CS Java Connector v3.0.


getPermissionsXML

public java.lang.String getPermissionsXML()
Retrieves a string in XML that represents a collection of all the Permission elements for this Document object.

Returns:
A String in XML that represents all of the permissions for this object.

getPublications

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 this Document object and that have the specified MIME types. Use the filter parameter to select the documents to be returned. Valid values are:

Specify the properties to return in the 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.

Parameters:
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.

Returns:
A collection of Document objects that are published from this Document object and that have the specified MIME types.

getPublicationsXML

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 this Document object and that have the specified MIME types.

Use the filter parameter to select the documents to be returned. Valid values are:

Specify the properties to return in the 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.

Parameters:
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.

Returns:
A String containing an XML representation of the collection of documents that are published from this 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.

getPublishTemplates

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 this Document 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.

Parameters:
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.)

Returns:
A collection of PublishTemplate objects that can be applied to this Document object.

getPublishTemplatesXML

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 this Document 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.

Parameters:
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.)

Returns:
A String containing an XML representation of the collection of publish templates that can be applied to this Document object. For documentation that describes the XML schema used to generate the string, refer to Schemas in the FileNet P8 Developer's Roadmap.

isDependent

public boolean isDependent()

Not Implemented in CS Java Connector v3.0.

Specifies if this Document 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.

Returns:
true if this Document object is a published document that is dependent on its source document; otherwise false.

isPublication

public boolean isPublication()

Not Implemented in CS Java Connector v3.0.

Specifies if this Document object is a published document.

Returns:
true if this Document object is a published document; otherwise false.

publish

public PublishRequest publish(PublishTemplate publishTemplate,
                              java.lang.String publishOptions)

Not Implemented in CS Java Connector v3.0.

Publishes this Document 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:

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);

After a successful call to 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.

Parameters:
publishTemplate - The PublishTemplate object to use for this publish operation.

publishOptions - A string containing XML that specifies the publish options for the published document.

Returns:
The PublishRequest object that is queued for this

republish

public 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 this Document 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:

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);

After a successful call to 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.

Parameters:
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.

Returns:
The PublishRequest object that is queued for this request.

setContentReference

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 this Document 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.

Parameters:
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.

getContentReferenceLocation

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 this 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 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().

Returns:
A String that specifies, in URL format, the name of the resource that contains the first content element in this Document object; null if the first content element is not a content reference element.

getContentReferenceLocation

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 this Document 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().

Parameters:
contentElement - The number of the content element. Content element numbering begins at 1.

Returns:
A String that specifies, in URL format, the name of the resource that contains the first content element in this Document object; null if the content element in question is not a content reference element.

getContentReferenceMimeType

public java.lang.String getContentReferenceMimeType()
Returns the MIME content type for the first content element in this 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().

Returns:
A String that specifies the MIME content type for the first content element in this Document object; null if the first content element is not a content reference element.

getContentReferenceMimeType

public java.lang.String getContentReferenceMimeType(int contentElement)
Returns the MIME content type for the specified content reference element in this Document object.

Note: The CS Java Connector v3.0. supports the first content reference element only.

For this call to succeed, this Document 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().

Parameters:
contentElement - The number of the content element. You must enter 1; otherwise, an exception will be thrown.

Returns:
A String that specifies the MIME content type for the specified content element in this Document object; null if the content element in question is not a content reference element.


getFilename

public java.lang.String getFilename()
Returns the file name (but no path information) for the first content element in this 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 the getFilename(contentElement) form of this method. To determine whether a content element is a content transfer or a content reference element, call getContentElementObjectTypes().

Returns:
A String that specifies the file name for the first content element in this Document object; null if the first content element is not a content transfer element.


getFilename

public java.lang.String getFilename(int contentElement)
Returns the file name (but no path information) for the specified content transfer element in this 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, call getContentElementObjectTypes().

Parameters:
contentElement - The number of the content element. You must enter 1; otherwise, an exception will be thrown.

Returns:
A String that specifies the file name for the specified content element in this Document object; null if the content element in question is not a content transfer element.

getUserAccess

public Permissions getUserAccess()

Not Implemented in CS Java Connector v3.0.

Retrieves the access rights (permissions) for the current user on this Document 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).

Returns:
A Permissions collection containing the access rights for the current user on this Document object.

getUserAccess

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 this Document 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.

To retrieve permissions for a specified user, use the getUserAccess(collectionType, userId, domain) form of this method.

Parameters:
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.

Returns:
A Permissions collection of the specified type containing the access rights for the current user on this Document object.

getUserAccess

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 this Document 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).

To retrieve permissions for the current user, call either getUserAccess() or getUserAccess(collectionType). These two methods offer equivalent functionality.

Parameters:
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.

Returns:
A Permissions collection of the specified type containing the access rights for the specified user on this Document object.


getUserAccess

public Permissions getUserAccess(java.lang.String collectionType,
                                 java.lang.String userId,
                                 java.lang.String domain)
Deprecated. Use (collectionType, userId) form of this method.

Not Implemented in CS Java Connector v3.0.


getVersionSeries

public VersionSeries getVersionSeries()
Returns a 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).

Returns:
A VersionSeries object.

changeClass

public void changeClass(java.lang.String classId,
                        Properties props,
                        Permissions perms)
Changes the class with which this 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.

Parameters:
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.


getContentElementObjectTypes

public int[] getContentElementObjectTypes()
Returns an array that contains the object types for the content elements associated with this 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.

Returns:
An int array, where each element in the array is the object type of a content element associated with this Document object.

getHeadLinks

public Links getHeadLinks(java.lang.String[] propNames)

Not Implemented in CS Java Connector v3.0.

Returns a collection of Link objects for which this Document object is the logical head of a link relationship.

Parameters:
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.

Returns:
A Links collection containing any Link objects for which this Document object is the logical head of a link relationship.

getTailLinks

public Links getTailLinks(java.lang.String[] propNames)

Not Implemented in CS Java Connector v3.0.

Returns a collection of Link objects for which this Document object is the logical tail of a link relationship.

Parameters:
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.

Returns:
A Links collection containing any Link objects for which this Document object is the logical tail of a link relationship.

getSecurityPolicyXML

public java.lang.String getSecurityPolicyXML()

Not Implemented in CS Java Connector v3.0.

Returns a string in XML that represents the security 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).

Returns:
A String containing an XML representation of the security policy associated with this document. For documentation that describes the XML schema used to generate the string, refer to Schemas in the FileNet P8 Developer's Roadmap.

applySecurityTemplate

public void applySecurityTemplate(java.lang.String applyStateId)

Not Implemented in CS Java Connector v3.0.

Applies the specified security 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.

Parameters:
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.

applySecurityTemplate

public void applySecurityTemplate()

Not Implemented in CS Java Connector v3.0.

Applies the security 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.


getSubscriptions

public Subscriptions getSubscriptions(java.lang.String[] propNames)

Not Implemented in CS Java Connector v3.0.

Returns a collection of Subscription 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.

Parameters:
propNames - A String array whose elements specify the symbolic names of the properties to retrieve.

Returns:
A Subscriptions collection that contains the Subscription objects associated with this Document object.

raiseEvent

public Event raiseEvent(java.lang.String classId,
                        Properties props)

Not Implemented in CS Java Connector v3.0.

Raises a custom audit event for this Document 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.

Parameters:
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.

Returns:
An Event object that represents the audit event that is recorded for this Document object.

getHeadLinksXML

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 of Link 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.

Parameters:
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.

Returns:
A 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.

getTailLinksXML

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 of Link 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.

Parameters:
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.

Returns:
A 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.

getAccessMask

public int getAccessMask()

Not Implemented in CS Java Connector v3.0.

Returns an integer representing a bit mask of access rights for this Document 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.

Returns:
An integer representing a bit mask of the assigned access rights.


FileNet Content Services
Java Connector v3.0