Skip navigation links

Oracle® WebCenter Content Java API Reference for Imaging
11g Release 1 (11.1.1)

E12853-03


oracle.imaging
Interface DocumentService


public interface DocumentService

The service for interacting with imaging documents. The methods on this service interact primarily with the Document data structure object.


Method Summary
 java.lang.String copyDocument(java.lang.String documentId, NameId applicationId, java.util.List<Document.FieldValue> fieldValues, boolean copyAnnotations)
          Copies a document in the imaging system.
 java.lang.String createDocument(java.lang.String uploadToken, NameId applicationId, java.util.List<Document.FieldValue> fieldValues, boolean submitToWorkflow)
          Adds a new document to the imaging system.
 void deleteDocument(java.lang.String documentId)
          Deletes a document from the Imaging system.
 void deleteDocuments(java.lang.String[] documentIds)
          Deletes multiple documents from the Imaging system.
 javax.activation.DataHandler getAnnotations(java.lang.String documentId)
          This method is reserved for Oracle internal use only.
 Document getDocument(java.lang.String documentId, Document.SectionSet sectionSet)
          Gets a Document data structure containing the detail sections for latest version of a given imaging document.
 java.util.List<Document> getDocuments(java.lang.String[] documentIds, Document.SectionSet sectionSet)
          Gets multiple Document data structures containing the requested detail sections for a list of Imaging document ids.
 Document getDocumentVersion(java.lang.String documentId, long version, Document.SectionSet sectionSet)
          Gets a Document data structure containing the detail sections for a specific version of a given Imaging document.
 javax.activation.DataHandler getSupportingContent(java.lang.String documentId, java.lang.String key)
          Retrieves the supporting content for a document.
 Application getTargetApplication(NameId appNameId)
           
 boolean hasStatusChanged(java.lang.String documentId, java.lang.String status)
          Determines if a document's status has changed.
 java.util.List<NameId> listTargetApplications(Document.Ability ability)
           
 Document lockDocument(java.lang.String documentId, Document.SectionSet sectionSet)
          Locks a document to the requesting user.
 void modifyPageOrder(java.lang.String documentId, java.util.List<PageChange> pageChanges)
          Affects the page changes described by the collection of PageChange objects in the supplied collection.
 java.lang.String moveDocument(java.lang.String documentId, NameId applicationId, java.util.List<Document.FieldValue> fieldValues)
          Moves a document in the imaging system from one application to another.
 void setAnnotations(java.lang.String documentId, javax.activation.DataHandler annotData)
          This method is reserved for Oracle internal use only.
 void setSupportingContent(java.lang.String documentId, java.lang.String key, java.lang.String fileName, javax.activation.DataHandler data)
          Adds supporting content to a document.
 void submitToWorkflow(java.lang.String documentId)
          Triggers the creation of a workflow process instance for a given document.
 void unlockDocument(java.lang.String documentId)
          Unlocks a document from the requesting user.
 java.lang.String updateDocument(java.lang.String documentId, java.lang.String uploadToken, java.util.List<Document.FieldValue> fieldValues, boolean reserved)
          Updates a document in the imaging system.

 

Method Detail

createDocument

java.lang.String createDocument(java.lang.String uploadToken,
                                NameId applicationId,
                                java.util.List<Document.FieldValue> fieldValues,
                                boolean submitToWorkflow)
                                throws ImagingException,
                                       ValidationException
Adds a new document to the imaging system. The operation will throw an exception if the user does not have rights to create a document within the specified application.
Parameters:
uploadToken - A unique identifer to a document uploaded with the DocumentContentService uploadDocument operation.
applicationId - The guid of the application into which the document is to be stored. The NameId can consist of just Name, just Id, or both. Referencing by Id will make the operation execute faster.
fieldValues - A list of Document FieldValue data structures supplying the primary application metadata for the document. The Document.FieldValues in the list must match valid Application.FieldDefinitions in the application specified by the application parameter. used to detect the mime type.
submitToWorkflow - Indicates whether the newly created document should trigger the creation of a workflow process instance for the document. If true, a workflow process instance is created only if the application in which the document is create is configured for workflow and the configuration is enabled. If false, no process instance is triggered. A process instance may be triggered at a later time using the submitToWorkflow method.
Returns:
The document guid of the newly added document
Throws:
ImagingException
ValidationException

getDocument

Document getDocument(java.lang.String documentId,
                     Document.SectionSet sectionSet)
                     throws ImagingException
Gets a Document data structure containing the detail sections for latest version of a given imaging document. The operation will only return those sections specified by the sectionFlags parameter. The operation will throw an exception if requested document does not exist or the requesting user does not have permissions to view it.
Parameters:
documentId - The guid of the document being requested.
sectionSet - An array representing which sections of the document to return. If only the FieldValues are needed, then pass in an array of 1 containing Document.SectionFlag.FIELDVALUES. It is suggested to only return what is needed for best performance.
Returns:
A Document data structure containing the requested detail sections for the specified document.
Throws:
ImagingException

getDocumentVersion

Document getDocumentVersion(java.lang.String documentId,
                            long version,
                            Document.SectionSet sectionSet)
                            throws ImagingException
Gets a Document data structure containing the detail sections for a specific version of a given Imaging document. The operation will only return those sections specified by the sectionFlags parameter. The operation will throw an exception if requested document does not exist, requested version does not exist or the requesting user does not have permissions to view it.
Parameters:
documentId - The guid of the document being requested.
version - The version of the document being requested
sectionSet - An array representing which sections of the document to return. If only the FieldValues are needed, then pass in an array of 1 containing Document.SectionFlag.FIELDVALUES. It is suggested to only return what is needed for best performance.
Returns:
A Document data structure containing the requested detail sections for the specified document.
Throws:
ImagingException

getDocuments

java.util.List<Document> getDocuments(java.lang.String[] documentIds,
                                      Document.SectionSet sectionSet)
                                      throws ImagingException
Gets multiple Document data structures containing the requested detail sections for a list of Imaging document ids. The operation will only return those sections specified by the sectionFlags parameter. Any documents specified in the documentIds parameter that either do not exist or are not permitted to be returned, based on the requesting user's permissions, will not be returned in the list. If no existing or visible documents are found, the returned list will be an empty list.
Parameters:
documentIds - An array of document ids to be retrieved
sectionSet - An array representing which sections of the document to return. If only the FieldValues are needed, then pass in an array of 1 containing Document.SectionFlag.FIELDVALUES. It is suggested to only return what is needed for best performance.
Returns:
A list of Document data structures containing the requested details sections for the specified documents.
Throws:
ImagingException

deleteDocument

void deleteDocument(java.lang.String documentId)
                    throws ImagingException
Deletes a document from the Imaging system. The operation will throw an exception if the document is not locked to the requesting user, if the document does not exist, or if the requesting user does not have rights to delete documents in that application.
Parameters:
documentId - The document guid of the document to be deleted
Throws:
ImagingException

deleteDocuments

void deleteDocuments(java.lang.String[] documentIds)
                     throws ImagingException
Deletes multiple documents from the Imaging system. The operation will throw an exception if the document(s) are not locked to the requesting user, if the document(s) do not exit, or if the requesting user does not have rights to delete documents in that application.
Parameters:
documentIds - An array of document ids specifying the documents to be deleted
Throws:
ImagingException

lockDocument

Document lockDocument(java.lang.String documentId,
                      Document.SectionSet sectionSet)
                      throws ImagingException
Locks a document to the requesting user. The specified sections of the locked document are returned in a Document data structure.

When a document is locked, the versionDocument, replaceDocument, modifyDocumentFieldValues, and deleteDocument operation will fail for any user other than the user who has the document locked. These operations will succeed it either no user has the document locked or if the user requesting the operation has the document locked. Once a user locks a document, it will remain locked to the user until the user either calls the unlockDocument operation or the Application defined LockTimeOut period expires.

The operation will throw and ImagingException if the document is already locked to another user.

Parameters:
documentId - The document guid of the document to be locked
sectionSet - An array representing which sections of the document to return. If only the FieldValues are needed, then pass in an array of 1 containing Document.SectionFlag.FIELDVALUES. It is suggested to only return what is needed for best performance.
Returns:
A Document data structure containing the requested detail sections for the locked document.
Throws:
ImagingException

unlockDocument

void unlockDocument(java.lang.String documentId)
                    throws ImagingException
Unlocks a document from the requesting user.

The operation will throw and ImagingException if the document is not locked to the requesting user, or if the user does not have rights to unlock documents.

Parameters:
documentId - The document guid of the document to be unlocked
Throws:
ImagingException

updateDocument

java.lang.String updateDocument(java.lang.String documentId,
                                java.lang.String uploadToken,
                                java.util.List<Document.FieldValue> fieldValues,
                                boolean reserved)
                                throws ImagingException,
                                       ValidationException
Updates a document in the imaging system.

Throws an exception if the document is not locked to the requesting user, or if the requesting user doesn't have the rights to Modify Content.

Parameters:
documentId - The unique identifier of the document to modify.
uploadToken - A unique identifer to a document uploaded with the DocumentContentService uploadDocument operation, or null if only updating a documents field values.
fieldValues - The fieldValues for the targetItemId application definition used to detect the mime type.
reserved - Reserved for future use.
Returns:
Returns the document identifier of the document after the update has occurred.
Throws:
ImagingException - The exception code may be one of the following values:
  • ImagingExceptionCode.DEFINITION_NOT_FOUND - if the user does not have rights to the application to which the document belongs
ValidationException

copyDocument

java.lang.String copyDocument(java.lang.String documentId,
                              NameId applicationId,
                              java.util.List<Document.FieldValue> fieldValues,
                              boolean copyAnnotations)
                              throws ImagingException,
                                     ValidationException
Copies a document in the imaging system. This operation will throw an exception if the document is not locked to the requesting user, or if the requesting user doesn't have the rights to Create documents in the destination application.
Parameters:
documentId - The guid of the document to be copied.
applicationId - The guid of the application into which the document is to be copied.
fieldValues - The fieldValues for the targetItemId application definition
copyAnnotations - A flag to indicate that existing annotations should be copied with the document
Returns:
long The document guid of the new document.
Throws:
ImagingException
ValidationException

moveDocument

java.lang.String moveDocument(java.lang.String documentId,
                              NameId applicationId,
                              java.util.List<Document.FieldValue> fieldValues)
                              throws ImagingException,
                                     ValidationException
Moves a document in the imaging system from one application to another. This operation will throw an exception if the document is not locked to the requesting user, or if the requesting user doesn't have the rights to Create documents in the destination application.
Parameters:
documentId - The guid of the document to be moved.
applicationId - The guid of the application into which the document is to be moved.
fieldValues - The fieldValues for the targetItemId application definition
Returns:
long The document guid of the new document.
Throws:
ImagingException
ValidationException

getAnnotations

@ResponseWrapper(targetNamespace="http://imaging.oracle/",
                 classname="imaging_oracle_proxy_types_GetAnnotationsResponse",
                 localname="getAnnotationsResponse")
javax.activation.DataHandler getAnnotations(java.lang.String documentId)
                                            throws ImagingException
This method is reserved for Oracle internal use only.
Throws:
ImagingException

setAnnotations

@RequestWrapper(targetNamespace="http://imaging.oracle/",
                classname="oracle_imaging_proxy_types_SetAnnotations",
                localname="setAnnotations")
void setAnnotations(java.lang.String documentId,
                                   javax.activation.DataHandler annotData)
                    throws ImagingException
This method is reserved for Oracle internal use only.
Throws:
ImagingException

modifyPageOrder

void modifyPageOrder(java.lang.String documentId,
                     java.util.List<PageChange> pageChanges)
                     throws ImagingException
Affects the page changes described by the collection of PageChange objects in the supplied collection. Pages may be deleted from a document, moved within a document, appended to the document, or inserted into the document. Any insert or append operation is performed first, then all page delete operations are performed before any page move operations. Each operation specified in the pageChanges collection are performed independently of the others. Because of this, each PageChange object must set the currentPageNumber and newPageNumber fields according to the document state at the time of that operation. For example, if a single page is to be inserted at page position 2, the original page 2 is now page 3. A subsequent request to move page 4 to page 1 will move the document's original page 3 (now page 4 because of the previous insert). Additionally, the previously inserted page 2 will become page three after the move. This method is only valid for TIFF document combinations.
Parameters:
documentId - The ID of the document to which the changes are to be applied
pageChanges - A List of PageChange objects indicating the operations to be performed on the document
Throws:
ImagingException

setSupportingContent

@RequestWrapper(targetNamespace="http://imaging.oracle/",
                classname="oracle_imaging_proxy_types_SetSupportingContent",
                localname="setSupportingContent")
void setSupportingContent(java.lang.String documentId,
                                         java.lang.String key,
                                         java.lang.String fileName,
                                         javax.activation.DataHandler data)
                          throws ImagingException
Adds supporting content to a document. This operation will throw an exception if requesting user doesn't have rights to Modify Content.
Parameters:
documentId - The guid of the document to add supporting content to.
key - The supporting content key to be added. If there is already content associated with this key, the content will be overwritten.
fileName - The name of the supporting content file being added.
data - A DataHandler object representing the document to add as supporting content. If null, removes any entry for the matching key.
Throws:
ImagingException

getSupportingContent

@ResponseWrapper(targetNamespace="http://imaging.oracle/",
                 classname="imaging_oracle_oracle_proxy_types_GetSupportingContentResponse",
                 localname="getSupportingContentResponse")
javax.activation.DataHandler getSupportingContent(java.lang.String documentId,
                                                                  java.lang.String key)
                                                  throws ImagingException
Retrieves the supporting content for a document. The operation will throw an exception if there is no content for the requested key or if the requesting user doesn't have rights to View.
Parameters:
documentId - The guid of the document to get the supporting content for.
key - The supporting content key for the content to be retrieved.
Throws:
ImagingException

listTargetApplications

java.util.List<NameId> listTargetApplications(Document.Ability ability)
                                              throws ImagingException
Throws:
ImagingException

getTargetApplication

Application getTargetApplication(NameId appNameId)
                                 throws ImagingException
Throws:
ImagingException

hasStatusChanged

boolean hasStatusChanged(java.lang.String documentId,
                         java.lang.String status)
                         throws ImagingException
Determines if a document's status has changed. The document status tracks whether changes have occurred to the document (content or annotations) since the document was retrieved.
Parameters:
documentId - The guid of the document to check.
status - Current document status.
Returns:
true if document status has changed, otherwise false
Throws:
ImagingException

submitToWorkflow

void submitToWorkflow(java.lang.String documentId)
                      throws ImagingException
Triggers the creation of a workflow process instance for a given document. A process instance is only created if the application in which the document was created is configured for workflow. If the application is not configured for workflow, the operation takes no action but returns succeessfully. The calling user must have permissions to view the document for this operation to succeed. Multiple process instances will be created for a document if this method is called multiple times with the same document id.
Parameters:
documentId - The id of the document that is to be submitted to workflow
Throws:
ImagingException

Skip navigation links

Oracle® WebCenter Content Java API Reference for Imaging
11g Release 1 (11.1.1)

E12853-03


Copyright © 2010, 2011, Oracle and/or its affiliates. All rights reserved.