Interface DocumentService

All Superinterfaces:
com.appiancorp.services.ContextSensitiveService, Service

@Deprecated public interface DocumentService extends com.appiancorp.services.ContextSensitiveService
Deprecated.
Use the class ContentService instead.
Defines methods for managing collaboration documents. Documents are stored within collaboration folders. The security attached to a document is set from the security the document's parent folder. Documents can also be set to expire - expiration days is a configurable property of the knowledge center in which the document resides.

Documents can have symbolic links, ie there can be a link to a document in a different location than where the document itself resides. A link provides direct access to the document and it is removed if the real document is removed.

Documents can be versioned using the createVersion() or createVersions() methods which add new versions to an existing document.

A document can also be locked, which prevents anyone from making changes to it (however, it is still accessible for viewing).

NOTE: This service does not actually write any documents to disk - it only provides functionality for storing and handling document metadata, so documents must still be manually written to disk. The path on disk to which a document should be written is obtained from doc.getInternalFilename() method. Note that this field is only populated when creating a new document object, creating a new version or retrieving the Documents with DocumentService.downloadDocument().

Methods of service classes can all throw the unchecked exception ServiceException if any system-level error (for example, server failure) occurs, and will in general throw a checked exception (InvalidXXXException) when an entity to be retrieved is inaccessible, instead of returning null. Exceptions to this paradigm (including the use of ResultList as described below) are noted. All checked exceptions extend AppianException.

It may be necessary to retrieve a subset of results as opposed to an entire collection, and also to sort the subset by some property of the returned object. "Paging" methods which return a ResultPage are provided in certain instances for this purpose. The ResultPage will contain the sorted subset of results (via Result.getResults()), and the total number of items in the available result set (via ResultPage.getAvailableItems()).

It may also be necessary to retrieve some results, even if all results cannot be retrieved (for instance, some of the entities corresponding to a list of entity IDs may no longer exist). Methods which return a ResultList are provided for this purpose. The Result.getResults() method in this case will return all results which can be retrieved. In addition, there will be a list of result codes (ResultList.getResultCodes()) that represent the successful retrieval of an entity, or, if the entity could not be retrieved, the reason for the failure. See the CODE_XXX constants in ResultList for details.

See Also: