The IPublishTemplate type exposes the following members.

ToggleMethods

Type NameDescription
Public methodAccessContentStreamOverloaded.
Public methodAddPendingAction
Adds the specified pending action to this object's PendingActions collection.
Note Note: You probably won't directly manipulate an object's pending actions in this manner. You will more likely call wrapper methods such as Delete and Checkin, which add a pending action to the collection.)
(Inherited from IIndependentlyPersistableObject.)
Public methodApplySecurityTemplate
Applies a security policy template to the given object. The specified value for the applyStateId parameter must match the value of the ApplyStateID property of one of the templates in the security policy for the object. For a versioning security template, the apply state ID can be one of the following:
  • VersionStatusId.IN_PROCESS
  • VersionStatusId.RELEASED
  • VersionStatusId.RESERVATION
  • VersionStatusId.SUPERSEDED
For an application security template, the apply state ID is defined by your application.
(Inherited from IDocument.)
Public methodCancelCheckout
Cancels the check-out reservation held on this document or version series by deleting the reservation object associated with it. Any changes made to the reservation object are lost. If the reservation object is an exclusive reservation (the object's ReservationType property is set to EXCLUSIVE), only the user who checked out the document can cancel the check out, or must have both WRITE_OWNER and DELETE access rights. Note that this method is provided only as a convenience method for canceling a checkout; all it does is delete the reservation version held by the document or version series from which it is called.

After a document's reservation object is deleted, the Content Engine performs the following steps on the reserved document version:

  • Sets the IsReserved property to false.
  • Sets the ReservationType property to null.

An error occurs if the document is not checked out or is a newly created object that has never been checked in.

(Inherited from IVersionable.)
Public methodChangeClass
Changes the class of a Content Engine object. The new class must already exist and both it and the original class must be subclasses of the same base class. The ChangeClass method does not modify the security for an object, even if the object's current security is derived from the default security for its source class. For the object's user-defined properties, the following rules apply:
  • Any user-defined properties that exist in the new class but not in the original class are set to the default value defined by the new class (or to null if there is no default defined).
  • Any user-defined properties that exist in both the original and the new class that are writable and have the same value (including null) as the default value defined in the original class will be set to the default value defined by the new class. However, any user-defined property that has had its value modified from the default value will retain that modified value in the new class.
  • Any user-defined properties whose definitions exist in the original class but not in the new class will no longer exist on the object when its class is changed.
  • Property constraints for the new class (for example, required values, choice lists, ranges) are not enforced.

When the class of a document object is changed, the default document lifecycle policy of the new class will only be applied to the document object's DocumentLifecyclePolicy property if both of the following scenarios occur:

  • The document has no current lifecycle policy.
  • The document is either a reservation object, or is the current version object and is not reserved.

Changing the document class of a document object has no effect on the storage location of the document’s content. For more information, see the Document Storage topic in the "Document Concepts" section of the Content Engine Java and .NET API Developer’s Guide.

(Inherited from IVersionable.)
Public methodChangeState
Changes the current, user-defined lifecycle state of this document, or the current state of a ICmTask object (see TaskState for a list of the states). The ChangeState method must be followed by a Save() or an equivalent batch operation to commit the state change. Every state change generates a IChangeStateEvent, to which you can subscribe or audit.

For documents, you cannot change the state of a document that is a reservation object. Valid lifecycle states are defined by the collection of DocumentState objects belonging to this document's associated DocumentLifecyclePolicy object.

For documents, the LifecycleChangeFlags constant can be used as follows:

  • PROMOTE: Promotes the document's current lifecycle state to the next state in its document lifecycle policy and sets the document's CurrentState property to the name of the next state. Throws an error if the document is in the exception state, in the first state of its lifecycle, or does not allow demotion.
  • DEMOTE: Demotes the document's current lifecycle state to the previous state in its document lifecycle policy and sets the document's CurrentState property to the name of the previous state, unless the CanBeDemoted property of the document’s current state (DocumentState object) is set to false. Throws an error if the document is in the exception state or in the first state of its lifecycle.
  • SET_EXCEPTION: Places the document into the exception state and sets its IsInExceptionState property to true. Throws an error if the document's IsInExceptionState property is already set to true.
  • CLEAR_EXCEPTION: Removes the document from the exception state and sets its IsInExceptionState property to false. Throws an error if the document's IsInExceptionState property is already set to false.
  • RESET: Resets the lifecycle state to the initial state in its document lifecycle policy and sets the document's CurrentState property to the name of the initial state. Throws an error if the document is in the exception state.

For tasks, the LifecycleChangeFlags constant can be used as follows:

  • PROMOTE: Promotes the task's current state to the next state.
  • DEMOTE: Demotes the task's current state to the previous state.
  • SET_EXCEPTION: Places the task into the exception state.
  • CLEAR_EXCEPTION: Removes the task from the exception state.
  • RESET: Not supported for tasks.

For a detailed description of task states, see Task State Machine.

(Inherited from IDocument.)
Public methodCheckin
Checks in this document reservation object by saving it as a new document version. You must have the appropriate access rights to check in a document (MAJOR_VERSION to check it in a major version or MINOR_VERSION to check it in a minor version). A major version is either the current released document version (if it is the latest major version) or a former released version that has been superseded. A minor version is either the in-process document version (if it is the latest minor version) or a former in-process version that has been superseded. In addition, if the reservation object is an exclusive reservation (its ReservationType property is set to EXCLUSIVE), you must be the user who checked out the document, or have the WRITE_OWNER access right. An error will occur if this method is called by a document that is not a reservation object.

Before you can check in a document that has content, you must set the content for the document by adding to its ContentElements collection one or more ContentTransfer objects if the content is stored in a Content Engine object store, or one or more ContentReference objects if the content is stored externally. If you do not want the Content Engine to assign a MIME type to the checked-in document, you must explicitly set the value of the document's MimeType property before calling the Checkin method. After a successful check-in, the reservation object becomes the new current version of the document (its IsCurrentVersion property is set to true). During a minor version check-in, the new minor document version is marked as in-process (its VersionStatus property is set to IN_PROCESS) and the previous in-process minor document version (if it exists) is marked as superseded (its VersionStatus property is set to SUPERSEDED). During a major version check-in, the new major document version is marked as released (its VersionStatus property is set to RELEASED) and the previous released major document version and in-process minor document version (if they exist) are marked as superseded.

The checkinType parameter specifies whether to check in a document as a minor or a major version; set it to MINOR_VERSION to check in a minor version, or MAJOR_VERSION to check in a major version. The autoClassify parameter specifies whether the document should have automatic document classification enabled. (This feature is not supported for publish templates.) If set to AUTO_CLASSIFY, and if a classifier exists for the document's content type, the document will automatically be assigned the proper document class and its properties will be populated based on the document content (and, in the case of XML document classification, mapping rules from user-defined scripts). The Content Engine's classification service uses a document's MIME type to determine if there is a classifier capable of parsing the document. If you set the autoClassify parameter to AUTO_CLASSIFY, the check-in operation changes the value of the document's ClassificationStatus property to CLASSIFICATION_PENDING; if you set it to DO_NOT_AUTO_CLASSIFY, the property is set to NOT_CLASSIFIED.

(Inherited from IDocument.)
Public methodCheckout
Creates a reservation object that can be modified and checked in as a new version of this document. The reservation object can be accessed from this document's Reservation property. You can either specify the type of checkout reservation (exclusive or collaborative) or use the default checkout reservation setting of the object store.

To successfully check out a document, the following requirements must be met or an exception will be thrown:

  • The document must be the current version (IsCurrentVersion property is set to true).
  • The document must not already be checked out (IsReserved property is set to false).
  • The document must be version-enabled (IsVersioningEnabled property is set to true).
  • The user must have the appropriate access rights (MINOR_VERSION to check out a minor version, or MAJOR_VERSION to check out a released version).

After a successful call to Checkout, the Content Engine performs the following steps:

  • Applies the versioning security template for the reservation state (if it exists and is enabled) to the newly created reservation object.
  • Sets the IsReserved property of the checked-out document to true.
  • Sets the ReservationType property of the checked-out document to the appropriate setting: (COLLABORATIVE or EXCLUSIVE).
(Inherited from IVersionable.)
Public methodClearPendingActions
Clears out the list of pending actions for this object. For example, if you called Delete() without subsequently calling Save, then called ClearPendingActions(), the Delete pending action would no longer be in the object's pending actions list. This effectively cancels changes not yet saved.
(Inherited from IIndependentlyPersistableObject.)
Public methodClone
Creates a new object that is a copy of the current instance.
(Inherited from ICloneable.)
Public methodCreateAnnotation
Creates and associates a new annotation to a specific content element of this document. This is a convenience method for creating an Annotation object from the document. You can also create an Annotation directly using the Factory.Annotation.createInstance() method, and then setting the AnnotatedObject property with the object on which the Annotation is placed.

To persist the created Annotation object to the object store, you must explicitly call its Save method, which will also cause the server to add it to the Annotations collection of this document.

(Inherited from IVersionable.)
Public methodDelete
Adds a Delete pending action to this object's PendingActions collection. You must subsequently commit the change to the repository. (See PendingAction for more information about pending actions.)

For IVersionSeries, all document versions are deleted.

For ICmRecoveryItem, this method deletes the item contained within the ICmRecoveryBin object. It also deletes all recoverable objects represented by the ICmRecoveryItem object.

(Inherited from IIndependentlyPersistableObject.)
Public methodDemoteVersion
Demotes the latest major version of this document to an unreleased minor version. This method changes the previous major version (if it exists) to the current released major version, but does not delete any document versions (including content) from the document's version series, therefore allowing you to continue to have access to all version changes. Note that you can demote frozen document versions and documents that are not versioning-enabled (documents whose IsVersioningEnabled property is set to false).

To successfully demote a document, the following requirements must be met or an error will occur:

  • The document must be the latest major version (VersionStatus property is set to RELEASED).
  • The document must be the current version (IsCurrentVersion property is set to true).
  • The user must have the appropriate access rights (MINOR_VERSION).
  • The document must not be reserved (IsReserved property is set to false).

After a successful call to demoteVersion, the Content Engine performs the following steps on the document version that is being demoted:

  • Applies the versioning security template (if it exists and is enabled) for the IN_PROCESS state.
  • Decrements the value of the MajorVersionNumber property by 1.
  • Sets the value of the MinorVersionNumber property to the number of the latest minor version belonging to the last major version + 1.
  • Sets the VersionStatus property to IN_PROCESS.

In addition, the Content Engine performs the following steps on the previous major document version:

  • Sets the VersionStatus property to RELEASED.
  • Applies the versioning security template for the RELEASED state.

(Inherited from IVersionable.)
Public methodFetchPropertiesOverloaded.
Public methodFetchPropertyOverloaded.
Public methodFreeze
Prevents changes to the custom properties of this document version. You can freeze any checked-in document version, but you cannot freeze a reservation object. Once a document version has been frozen, it cannot be unfrozen; to change a frozen document's custom properties, a new document version must be created. Note, however, that you can change a document version's writable system properties at any time. After a successful Freeze call, the IsFrozenVersion property of the object representing the document version is set to true. An error is generated if this document is a reservation object (VersionStatus = RESERVATION) or is already a frozen version (IsFrozenVersion = true).
(Inherited from IVersionable.)
Public methodGetAccessAllowed
Returns a value representing a bit mask of access rights granted to the user requesting this object.
(Inherited from IIndependentlyPersistableObject.)
Public methodGetClassName
Returns the name of the class from which this object is instantiated.
(Inherited from IEngineObject.)
Public methodGetConnection
Returns a Connection object that represents a logical connection to the FileNet P8 domain. The returned Connection object is used as input to methods such as factory instantiation methods.
(Inherited from IEngineObject.)
Public methodGetObjectReference
Returns an object reference that represents the object's identity.

The ID of an independent object is the class name and ID of the object. The ID can be a path, GUID, or name of the object.

(Inherited from IIndependentObject.)
Public methodGetObjectStore
Returns a reference to the object store to which this object is persisted.
(Inherited from IRepositoryObject.)
Public methodGetPendingActions
Returns the pending actions for this object.
(Inherited from IIndependentlyPersistableObject.)
Public methodGetPublicationStatus
Returns a PublicationStatus enumeration value, which identifies the document's publication status (dependent, independent, or not a publication).

Return Value

A PublicationStatus object.
(Inherited from IDocument.)
Public methodGetSuperClasses
Returns a String array specifying the names of the superclasses of the class from which this object is instantiated.
(Inherited from IEngineObject.)
Public methodGetUpdateSequenceNumber
Returns the update sequence number (USN) for this object.

You can use the returned value to determine if the object has been modified since some earlier fetch of the same object.

An IndependentlyPersistableObject has an update sequence number (USN), which is an Integer value on the object that protects it against concurrent updates. The USN value increases monotonically with each update to the object. When you update the object, the USN from the retrieved object is checked against the currently persisted USN value. If the values are different, the operation fails.

As a special case, a USN value of Null causes the server-side check to be skipped during updates (this is sometimes called "unprotected update"). An IndependentlyPersistableObject instantiated by calling one of the GetInstance methods on a Factory class (such as Factory.CustomObject.GetInstance) does not fetch the object from the server, and therefore, is unaware of the persisted USN. Calling GetUpdateSequence on such an object returns Null.

(Inherited from IIndependentlyPersistableObject.)
Public methodIsCurrent
Returns a value indicating whether or not the state of this object is consistent with its state in the repository.

When one or more of the object's properties are "dirty" (have been marked as changed since the last time they were saved), IsCurrent returns False. You can then do one of the following:

  • Save changes to the persistent store. (You can either call the Save method or add the object to an UpdatingBatch then call UpdateBatch, which effectively calls Save on each IndependentlyPersistableObject in the batch.)
  • Call the object's Refresh method to cancel the changes and restore the object's state to that of the persistent store.
  • Remove dirty properties by calling RemoveFromCache.
(Inherited from IIndependentlyPersistableObject.)
Public methodIsLocked
Queries this object's lock state. This helper method examines the object's lock-related properties and determines the object's lock state. An alternative approach is to call the LockObject method and handle any exception thrown if the method fails.

Note that this method returns an approximation of the locked state at the time of the call. Once this method executes and returns the value, the object's lock state could be immediately changed by another application's call to the LockObject method or the lock could expire.

Before calling this method, make sure that the object's LockToken, LockTimeout, and DateLastModified properties have relatively fresh values. If any of those properties is missing, they are silently fetched from the server and added to the object's property cache.

The IsLocked method returns False if the LockTimeout property is not set or if the lock has expired. The lock is determined to be expired if the DateLastModified property value plus the number of seconds specified by the LockTimeout property is less than the current system time. (All millisecond components are dropped from the calculation.) If the DateLastModified property is not set, this method returns False because the check against the lock timeout value or the lock token will reflect that the object is not locked. As soon as some action locks the object, the DateLastModified property will be updated and can then be used for the expiration calculation.

Note To successfully run IsLocked and other cooperative locking methods, system clocks on the IBM FileNet P8 platform engine machines must be synchronized. The calculation performed by the IsLocked() method is done on the client system. If the client and server machine clocks are not synchronized, the result of this calculation might be incorrect.

(Inherited from IDocument.)
Public methodLockObject
Sets a new lock or updates an existing lock on the object. Calling this method has no effect in preventing others from updating a locked object (with the exception that others cannot re-lock the locked object). This lock mechanism is used for custom purposes only and has no bearing on the actual ability to update an object.

To successfully execute this method, the current user must have permission to modify this object's properties. For example, locking a Document object requires the following combination of access rights: AccessRight.CHANGE_STATE | AccessRight.CREATE_INSTANCE | AccessRight.LINK | AccessRight.UNLINK | AccessRight.VIEW_CONTENT | AccessRight.WRITE | AccessRight.READ_ACL | AccessLevel.READ.

If the call succeeds:

  • The object's LockOwner property is populated with the user name specified in the owner parameter. (New lock only.)
  • The value specified by timeoutis applied to the object's LockTimeout property.
  • A LockToken (GUID) is internally created by the server. (New lock only.)

To update an existing lock, the objects needs to be in the locked state and the current user needs to match the user of the lock. Note that the user is the logged in user, not the owner string. If the call succeeds, then only the LockTimeout property is updated with the timeout value. The owner parameter in this case is ignored. (See the UpdateLock() method instead.)

(Inherited from IDocument.)
Public methodMoveContent
Moves the content data of an object to a new storage area. For IVersionSeries, this method moves the content for all associated document versions.

After a successful call to the MoveContent method, the content data is deleted from the original location unless the content data is IBM FileNet Content Federation Services for Image Services federated content. To enable deletion of IBM FileNet Content Federation Services for Image Services federated content from its original location, set the com.filenet.replication.EnableLegacyMoveContentBehaviour JVM parameter to true for your application server. For information about how to assign JVM parameter values for your application server, see Setting JVM parameters.

You can force content to be encrypted, re-encrypted, or decrypted based on the current encryption configuration for the destination storage area. Likewise, you can force content to be compressed or decompressed based on the content compression configuration for the destination storage area. For more information, see Content encryption and Content compression.

(Inherited from IDocument.)
Public methodPromoteVersion
Promotes an unreleased minor version of this document to a released major version. This method changes the current released major version (if it exists) to a superseded major version, but does not delete any document versions (including content) from the document's version series, therefore allowing you to continue to have access to all version changes. Note that you can promote frozen document versions and documents that are not versioning-enabled (documents whose IsVersioningEnabled property is set to false).

To successfully promote a document, the following requirements must be met or an error will occur:

  • The document must be the latest minor version (VersionStatus property is set to IN_PROCESS).
  • The document must be the current version (IsCurrentVersion property is set to true).
  • The user must have the appropriate access rights (MAJOR_VERSION).
  • The document must not be reserved (IsReserved property is set to false).

After a successful call to PromoteVersion, the Content Engine performs the following steps on the document version that is being promoted:

  • Applies the versioning security template (if it exists and is enabled) for the RELEASED state.
  • Sets the MinorVersionNumber property to 0.
  • Increments the MajorVersionNumber property by 1.
  • Sets the VersionStatus property to RELEASED.

In addition, the Content Engine performs the following steps on the previous major document version that is being superseded:

  • Sets the VersionStatus property to SUPERSEDED.
  • Applies the versioning security template (if it exists and is enabled) for the SUPERSEDED state.

(Inherited from IVersionable.)
Public methodPublish
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. All publish requests are asynchronous, including copy operations, which do not transform the document. A publish request is always enqueued, and a copy of the PublishRequest object is always returned to the caller.

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. See Publish Options XML for more information.

After a successful call to publish, call the Save method of the returned PublishRequest object to submit the request to the publish queue.

(Inherited from IDocument.)
Public methodRaiseEvent
Raises a custom event for this ISubscribable object. For example, you can define a custom event class in the Content Engine for an operation such as publishing a document, then specify the custom event in a call to the raiseEvent method on a IDocument object after you call the publish method on that document.

Before you can use this method, the following conditions must be met:

  • An appropriate CustomEvent object must exist.
  • A subscription subscribes to the ISubscribable object; that is, the subscription's SubscriptionTarget property has been set to this ISubscribable object.
  • A subscription subscribes to the custom event to be raised; that is, the subscription's SubscribedEvents property has been set to a ISubscribedEventList collection that includes the custom event.
(Inherited from ISubscribable.)
Public methodRefreshOverloaded.
Public methodRepublish
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. All publish requests are asynchronous, including copy operations, which do not transform the document. A publish request is always enqueued, and a copy of the PublishRequest object is always returned to the caller.

The publishOptions parameter is a string containing XML that specifies the publish options for the republished document. See Publish Options XML for more information.

(Inherited from IDocument.)
Public methodSaveOverloaded.
Public methodSetUpdateSequenceNumber
Sets the update sequence number (USN) for this object. You can cause update sequence checking to be skipped for this object by setting the USN value to Null.
(Inherited from IIndependentlyPersistableObject.)
Public methodTakeFederatedOwnership
For a document that has been federated by Content Federation Services (CFS), grants exclusive control of this document to the FileNet P8 Content Engine by making the corresponding external document read-only. (Since the external document ceases to change, no changes exist for CFS to propagate from the external repository to the Content Engine, and the Content Engine becomes the sole means for modifying or deleting the document.) For non-federated documents or for documents for which this method has already been called, this method has no effect. An error is generated if this document is a reservation object (VersionStatus property is set to RESERVATION).
(Inherited from IDocument.)
Public methodUnlock
Explicitly removes the lock from this object. Only the user who locked the object may remove the lock. If the current user is not the user of the lock, the current user can still remove the lock provided that user has AccessRight.WRITE_ACL permission on the object. An exception is thrown if the above conditions are not met. Upon successful execution of this method, the values for the object's LockOwner, LockToken, and LockTimeout properties are removed (set to null). If you do not call Unlock to explicitly remove the lock, the lock is implicitly removed when the lock's timeout value expires. If the object is not locked (absence of a LockToken).
(Inherited from IDocument.)
Public methodUpdateLock
Adjusts the timeout period of the lock on this object.

This method updates the object's DateLastModified property to the current time and its LockTimeout property to the timeout value. The net effect of this may extend or shorten the original lock's expiration time. Only the user who locked the object can successfully call this method; for any other user, an exception is thrown. There is no limit to the number of times you can call this method.

(Inherited from IDocument.)

ToggleSee Also