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:
  • Field Details

    • createDocument$UPDATES

      static final boolean createDocument$UPDATES
      Deprecated.
      See Also:
    • createDocuments$UPDATES

      static final boolean createDocuments$UPDATES
      Deprecated.
      See Also:
    • updateDocument$UPDATES

      static final boolean updateDocument$UPDATES
      Deprecated.
      See Also:
    • updateDocuments$UPDATES

      static final boolean updateDocuments$UPDATES
      Deprecated.
      See Also:
    • updateForumForDocument$UPDATES

      static final boolean updateForumForDocument$UPDATES
      Deprecated.
      See Also:
    • updateForumForDocuments$UPDATES

      static final boolean updateForumForDocuments$UPDATES
      Deprecated.
      See Also:
    • deleteDocument$UPDATES

      static final boolean deleteDocument$UPDATES
      Deprecated.
      See Also:
    • deleteDocuments$UPDATES

      static final boolean deleteDocuments$UPDATES
      Deprecated.
      See Also:
    • getDocument$UPDATES

      static final boolean getDocument$UPDATES
      Deprecated.
      See Also:
    • getDocumentsPaging$UPDATES

      static final boolean getDocumentsPaging$UPDATES
      Deprecated.
      See Also:
    • getDocuments$UPDATES

      static final boolean getDocuments$UPDATES
      Deprecated.
      See Also:
    • moveDocument$UPDATES

      static final boolean moveDocument$UPDATES
      Deprecated.
      See Also:
    • moveDocuments$UPDATES

      static final boolean moveDocuments$UPDATES
      Deprecated.
      See Also:
    • unlockDocument$UPDATES

      static final boolean unlockDocument$UPDATES
      Deprecated.
      See Also:
    • lockDocument$UPDATES

      static final boolean lockDocument$UPDATES
      Deprecated.
      See Also:
    • createLink$UPDATES

      static final boolean createLink$UPDATES
      Deprecated.
      See Also:
    • createLinks$UPDATES

      static final boolean createLinks$UPDATES
      Deprecated.
      See Also:
    • deleteLink$UPDATES

      static final boolean deleteLink$UPDATES
      Deprecated.
      See Also:
    • deleteLinks$UPDATES

      static final boolean deleteLinks$UPDATES
      Deprecated.
      See Also:
    • createVersion$UPDATES

      static final boolean createVersion$UPDATES
      Deprecated.
      See Also:
    • createVersions$UPDATES

      static final boolean createVersions$UPDATES
      Deprecated.
      See Also:
    • deleteVersion$UPDATES

      static final boolean deleteVersion$UPDATES
      Deprecated.
      See Also:
    • deleteVersions$UPDATES

      static final boolean deleteVersions$UPDATES
      Deprecated.
      See Also:
    • getVersion$UPDATES

      static final boolean getVersion$UPDATES
      Deprecated.
      See Also:
    • getVersionsPaging$UPDATES

      static final boolean getVersionsPaging$UPDATES
      Deprecated.
      See Also:
    • getVersions$UPDATES

      static final boolean getVersions$UPDATES
      Deprecated.
      See Also:
    • getAllVersionsForDocument$UPDATES

      static final boolean getAllVersionsForDocument$UPDATES
      Deprecated.
      See Also:
    • getAllVersionsForDocumentPaging$UPDATES

      static final boolean getAllVersionsForDocumentPaging$UPDATES
      Deprecated.
      See Also:
    • approveChangesForDocument$UPDATES

      static final boolean approveChangesForDocument$UPDATES
      Deprecated.
      See Also:
    • approveChangesForDocuments$UPDATES

      static final boolean approveChangesForDocuments$UPDATES
      Deprecated.
      See Also:
    • rejectChangesForDocument$UPDATES

      static final boolean rejectChangesForDocument$UPDATES
      Deprecated.
      See Also:
    • rejectChangesForDocuments$UPDATES

      static final boolean rejectChangesForDocuments$UPDATES
      Deprecated.
      See Also:
    • approveChangesForVersion$UPDATES

      static final boolean approveChangesForVersion$UPDATES
      Deprecated.
      See Also:
    • approveChangesForVersions$UPDATES

      static final boolean approveChangesForVersions$UPDATES
      Deprecated.
      See Also:
    • rejectChangesForVersion$UPDATES

      static final boolean rejectChangesForVersion$UPDATES
      Deprecated.
      See Also:
    • rejectChangesForVersions$UPDATES

      static final boolean rejectChangesForVersions$UPDATES
      Deprecated.
      See Also:
    • getFavoriteDocuments$UPDATES

      static final boolean getFavoriteDocuments$UPDATES
      Deprecated.
      See Also:
    • getFavoriteDocumentsPaging$UPDATES

      static final boolean getFavoriteDocumentsPaging$UPDATES
      Deprecated.
      See Also:
    • addDocumentToFavorites$UPDATES

      static final boolean addDocumentToFavorites$UPDATES
      Deprecated.
      See Also:
    • addDocumentsToFavorites$UPDATES

      static final boolean addDocumentsToFavorites$UPDATES
      Deprecated.
      See Also:
    • removeDocumentFromFavorites$UPDATES

      static final boolean removeDocumentFromFavorites$UPDATES
      Deprecated.
      See Also:
    • removeDocumentsFromFavorites$UPDATES

      static final boolean removeDocumentsFromFavorites$UPDATES
      Deprecated.
      See Also:
    • downloadDocument$UPDATES

      static final boolean downloadDocument$UPDATES
      Deprecated.
      See Also:
    • downloadDocuments$UPDATES

      static final boolean downloadDocuments$UPDATES
      Deprecated.
      See Also:
    • undeleteDocument$UPDATES

      static final boolean undeleteDocument$UPDATES
      Deprecated.
      See Also:
    • unexpireDocuments$UPDATES

      static final boolean unexpireDocuments$UPDATES
      Deprecated.
      See Also:
    • validateDocumentIds$UPDATES

      static final boolean validateDocumentIds$UPDATES
      Deprecated.
      See Also:
    • validateDocumentId$UPDATES

      static final boolean validateDocumentId$UPDATES
      Deprecated.
      See Also:
    • searchDocuments$UPDATES

      static final boolean searchDocuments$UPDATES
      Deprecated.
      See Also:
    • searchDocumentsPaging$UPDATES

      static final boolean searchDocumentsPaging$UPDATES
      Deprecated.
      See Also:
    • getViewableDocumentsPaging$UPDATES

      static final boolean getViewableDocumentsPaging$UPDATES
      Deprecated.
      See Also:
    • getDocumentsList$UPDATES

      static final boolean getDocumentsList$UPDATES
      Deprecated.
      See Also:
    • getSystemDocumentId$UPDATES

      static final boolean getSystemDocumentId$UPDATES
      Deprecated.
      See Also:
    • setSystemDocumentId$UPDATES

      static final boolean setSystemDocumentId$UPDATES
      Deprecated.
      See Also:
    • suggest$UPDATES

      static final boolean suggest$UPDATES
      Deprecated.
      See Also:
    • getContentIdForDocumentId$UPDATES

      static final boolean getContentIdForDocumentId$UPDATES
      Deprecated.
      See Also:
    • getContentIdsForDocumentIds$UPDATES

      static final boolean getContentIdsForDocumentIds$UPDATES
      Deprecated.
      See Also:
    • getDocumentIdForContentId$UPDATES

      static final boolean getDocumentIdForContentId$UPDATES
      Deprecated.
      See Also:
    • getDocumentIdsForContentIds$UPDATES

      static final boolean getDocumentIdsForContentIds$UPDATES
      Deprecated.
      See Also:
  • Method Details

    • createDocument

      Deprecated.
      Create a document.
      Parameters:
      doc_ - a Document object which should contain all of the information required to create a valid document.
      The minimum required fields are: name, description (can be null or "", if not set), extension, size, folderId, and status.
      Returns:
      the created document
      Throws:
      InvalidUserException - if the user calling this method is invalid
      InvalidFolderException - if the folder ID specified by the document does not correspond to a valid folder
      InvalidDocumentException - if the document does not contain all of the required information
      PrivilegeException - if the current user is neither an editor nor an administrator of the folder
      StorageLimitException - if the current user is not an administrator and will exceed his/her quota on a community KC by creating this document in it
      ServiceException - if any system-level error occurs
    • createDocuments

      Deprecated.
      Create multiple documents.
      Parameters:
      docs_ - an array of Document objects which should contain all of the information required to create valid documents.
      The minimum required fields are: name, description (can be null or "", if not set), extension, size, folderId, and status.
      Returns:
      the created documents
      Throws:
      InvalidUserException - if the user calling this method is invalid
      InvalidFolderException - if the folder ID specified by any of the documents does not correspond to a valid folder
      InvalidDocumentException - if any of the documents does not contain all of the required information
      PrivilegeException - if the current user is neither an editor nor an administrator of the folder
      StorageLimitException - if the current user is not an administrator and will exceed his/her quota on a community KC by creating this document in it
      ServiceException - if any system-level error occurs
    • updateDocument

      Deprecated.
      Updates a document.
      Parameters:
      doc_ - a Document object, which should contain all of the information required to update a document.
      The minimum required fields are: name, description (can be an empty String), extension, size, folderId, status and id.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      PrivilegeException - if the current user is neither an editor nor an administrator of the folder
      InvalidDocumentException - if the ID of the document does not correspond to a valid document
      InvalidFolderException - if the folder ID specified by the document does not correspond to a valid folder
      ServiceException - if any system-level error occurs
    • updateDocuments

      Deprecated.
      Updates multiple documents.
      Parameters:
      docs_ - an array of Document objects, which should each contain all of the information required to update a document.
      The minimum required fields are: name, description (can be an empty String), extension, size, folderId, status and id.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      PrivilegeException - if the current user is neither an editor nor an administrator of the folder
      InvalidDocumentException - if the ID of any of the documents does not correspond to a valid document
      InvalidFolderException - if the folder ID specified by any of the documents does not correspond to a valid folder
      ServiceException - if any system-level error occurs
    • updateForumForDocument

      void updateForumForDocument(Document doc_) throws InvalidDocumentException, PrivilegeException
      Deprecated.
      Updates the discussion forum associated with a document.
      Parameters:
      doc_ - a Document object which should contain the updated discussion forum information. The fields that should be populated on the document are: id and forum. All other fields will be ignored. If forum is set to null, any forum associations are removed.
      Throws:
      InvalidDocumentException - if the ID of the document does not correspond to a valid document
      PrivilegeException - if 1) the current user does not have access to the folder containing the document or 2) the current user is not an editor of the folder containing the document, and a forum currently exists for the document
      ServiceException - if any system-level error occurs
    • updateForumForDocuments

      void updateForumForDocuments(Document[] docs_) throws InvalidDocumentException, PrivilegeException
      Deprecated.
      Updates the discussion forums associated with multiple documents.
      Parameters:
      docs_ - a list of Document object which should contain the updated discussion forum information. The fields that should be populated on each document are: id and forum. All other fields will be ignored. If forum is set to null, any forum associations are removed.
      Throws:
      InvalidDocumentException - if the ID of any of the documents does not correspond to a valid document
      PrivilegeException - if 1) the current user does not have access to the folder containing one of the documents or 2) the current user is not an editor of the folder containing one of the documents, and a forum currently exists for the document
      ServiceException - if any system-level error occurs
    • deleteDocument

      Deprecated.
      Use the method #deactivate(Long, Boolean) instead.
      Deactivates all versions of the specified document. Does not remove the file from disk and does not log in deletion.log. Can be reversed with #undelete(Long).
      Parameters:
      doid_ - the ID of the document to be deleted.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      PrivilegeException - if the current user is not an administrator of the folder or the owner of the document
      InvalidDocumentException - if the ID does not correspond to a valid document
      ServiceException - if any system-level error occurs
    • deleteDocuments

      Deprecated.
      Use the method #deactivate(Long[], Boolean) instead.
      Deactivates all versions of multiple documents. Does not remove the files from disk and does not log in deletion.log. Can be reversed with #undelete(Long).
      Parameters:
      doids_ - the IDs of the documents to be deleted.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      PrivilegeException - if the current user is not an administrator of the folder or the owner of the documents
      InvalidDocumentException - if any of the IDs does not correspond to a valid document
      ServiceException - if any system-level error occurs
    • getDocument

      Deprecated.
      Retrieves a document (without the internalFilename property populated). If you need the internalFilename property, use the downloadDocument method.
      Parameters:
      doid_ - the ID of the document.
      Returns:
      the retrieved document
      Throws:
      InvalidDocumentException - if the ID does not correspond to a valid document
      PrivilegeException - if the current user does not have viewing privileges to the folder
      InvalidUserException - if the user calling this method is invalid
      ServiceException - if any system-level error occurs
    • getDocumentsPaging

      ResultPage getDocumentsPaging(Long[] doids_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidDocumentException, PrivilegeException, InvalidUserException
      Deprecated.
      Retrieves several documents (without the internalFilename property populated). If you need the internalFilename property, use the downloadDocument method.
      Parameters:
      doids_ - an array of unique document IDs.
      startIndex_ - the index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - the number of results to return. Negative numbers will result in the entire collection being returned, but this is STRONGLY discouraged.
      sortProperty_ - the property by which the results should be sorted. This should be one of the SORT_BY_XXX constants in Document.
      sortOrder_ - the order in which to sort the results. This should be either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING.
      Returns:
      a ResultPage containing a list of Document objects, representing the documents with the given IDs (without the internalFilename property set). If you need the internalFilename property, use the downloadDocument method
      Throws:
      InvalidDocumentException - if any of the IDs does not correspond to a valid document
      PrivilegeException - if the current user does not have viewing privileges to the folder(s)
      InvalidUserException - if the user calling this method is invalid
      ServiceException - if any system-level error occurs
    • getDocuments

      Retrieves several documents (without the internalFilename set). If you need the internalFilename property, use the downloadDocuments method
      Parameters:
      doids_ - an array of unique document IDs.
      Returns:
      the documents corresponding to the given IDs
      Throws:
      InvalidDocumentException - if any of the IDs does not correspond to a valid document
      PrivilegeException - if the current user context does not have the rights to perform this operation
      InvalidUserException - if the user calling this method is invalid
      ServiceException - if any system-level error occurs
    • moveDocument

      Deprecated.
      Moves a document to another folder.
      Parameters:
      docid_ - The id of the document to be moved.
      newFolderId_ - The id of the folder to move the document to.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      PrivilegeException - if the current user is not an administrator of both the old and new knowledge centers
      InvalidFolderException - if the folder does not exist
      ServiceException - if any system-level error occurs
      InvalidDocumentException
    • moveDocuments

      void moveDocuments(Long[] docids_, Long newFolderId_) throws InvalidUserException, PrivilegeException, InvalidFolderException, InvalidDocumentException
      Deprecated.
      Moves multiple documents to another folder.
      Parameters:
      docids_ - An array of ids of the documents to be moved.
      newFolderId_ - The id of the folder to move the documents to.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      PrivilegeException - if the current user is not an administrator of both the old and new knowledge centers
      InvalidFolderException - if the folder does not exist
      InvalidDocumentException - if one or more of the documents does not exist, or has been deleted
      ServiceException - if any system-level error occurs
    • unlockDocument

      Deprecated.
      Unlocks a document.
      Parameters:
      doid_ - The id of the document to unlock.
      Throws:
      PrivilegeException - if the current user is not an administrator of the folder nor the person who locked the document
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted
      ServiceException - if any system-level error occurs
    • lockDocument

      Deprecated.
      Locks a document.
      Parameters:
      doid_ - The id of the document to lock.
      Throws:
      PrivilegeException - if the current user is neither an editor nor an administrator of the folder
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted
      ServiceException - if any system-level error occurs
    • createLink

      Deprecated.
      Creates a symbolic link to a document.
      Parameters:
      docId_ - The id of the document to create the link to.
      foid_ - The id of the folder where the link should be created.
      Throws:
      PrivilegeException - if the current user is not an administrator of both the folder containing the document and the folder where the link is being created
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted
      InvalidFolderException - if the folder does not exist
      ServiceException - if any system-level error occurs
    • createLinks

      Deprecated.
      Creates a list of symbolic links to documents.
      Parameters:
      docIds_ - The ids of the documents to create the links to.
      foid_ - The id of the folder where the links should be created.
      Throws:
      PrivilegeException - if the current user is not an administrator of both the folder containing the document and the folder where the links are being created
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if any document does not exist, or has been deleted
      InvalidFolderException - if the folder does not exist
      ServiceException - if any system-level error occurs
    • createLinks

      Deprecated.
      Creates multiple symbolic links to documents in a list of folders; a single link is created in each of the folders (ie each index in docIds_ maps to an index in foids_).
      Parameters:
      docIds_ - The ids of the documents to create the links to.
      foids_ - The ids of the folders where the links should be created. This array must be the same size as the docIds array.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      PrivilegeException - if the current user is not an administrator of both the folder containing the document and the folder where the links are being created
      InvalidDocumentException - if any of the documents does not exist, or has been deleted
      InvalidFolderException - if any of the folders does not exist
      ServiceException - if any system-level error occurs
    • deleteLink

      Deprecated.
      Deletes a symbolic link to a document from a folder.
      Parameters:
      docId_ - The id of the document to which the link points.
      foId_ - The id of the folder which contains the link.
      Throws:
      PrivilegeException - if the current user is not an administrator of the folder or the owner of the link
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted
      InvalidFolderException - if the folder does not exist
      ServiceException - if any system-level error occurs
    • deleteLinks

      Deprecated.
      Deletes multiple symbolic links from a folder.
      Parameters:
      docIds_ - An array of ids of the documents to which the links point.
      foId_ - The id of the folder which contains the links.
      Throws:
      PrivilegeException - f the current user is not an administrator of the folder or the owner of the links
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if any of the documents does not exist, or has been deleted
      InvalidFolderException - if the folder does not exist
      ServiceException - if any system-level error occurs
    • createVersion

      Deprecated.
      Creates a new version of a document.
      Parameters:
      document_ - A Document object which should contain all of the information required to create a valid document (see createDocument(com.appiancorp.suiteapi.collaboration.Document)). The id field of the passed object should be the id of the document for which the new version is being created.
      Returns:
      A Document object representing the new version of the document.
      Throws:
      InvalidUserException - if the current user context is not found
      InvalidFolderException - if the folder specified by the document does not exist
      InvalidDocumentException - if the document ID does not correspond to a valid document
      PrivilegeException - if the current user is neither an editor nor an administrator of the folder
      InvalidOperationException - if the document is pending approval, or has been checked out
      StorageLimitException - if there is no space on the filesystem to store the document version
      ServiceException - if any system-level error occurs
    • createVersions

      Deprecated.
      Creates new versions of multiple documents.
      Parameters:
      documents_ - An array of Document objects which should contain all of the information required to create valid documents (see createDocument(com.appiancorp.suiteapi.collaboration.Document)). The id field of each passed objects should be the id of the document for which a new version is being created.
      Returns:
      An array of Document objects representing the new versions of the documents
      Throws:
      InvalidUserException - if the current user context is not found
      InvalidFolderException - if the folder specified by any of the documents does not exist
      InvalidDocumentException - if any of the document IDs does not correspond to a valid document
      PrivilegeException - if the current user is neither an editor nor an administrator of the folder
      InvalidOperationException - if any of the documents is pending approval, or has been checked out
      StorageLimitException - if there is no space on the filesystem to store the document versions
      ServiceException - if any system-level error occurs
    • deleteVersion

      Deprecated.
      Deactivates the specified version of a document. Does not remove the file from disk and does not log in deletion.log.
      Parameters:
      doid_ - The id of a document.
      versionId_ - The version number of the document version to be deleted.
      Throws:
      PrivilegeException - if the current user is not the administrator of the fodler or the owner of the version
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted, or if the specified version does not exist
      ServiceException - if any system-level error occurs
    • deleteVersions

      @Deprecated void deleteVersions(Long doid_, Integer[] versionIds_) throws InvalidUserException, PrivilegeException, InvalidDocumentException
      Deprecated.
      Deactivates multiple versions of a document. Does not remove the file from disk and does not log in deletion.log.
      Parameters:
      doid_ - The id of a document.
      versionIds_ - The version numbers of the document versions to be deleted.
      Throws:
      PrivilegeException - if the current user is not the administrator of the fodler or the owner of the versions
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted, or if any of the specified versions does not exist
      ServiceException - if any system-level error occurs
    • getVersion

      Deprecated.
      Gets a specific version of a document.
      Parameters:
      doid_ - The id of a document.
      versionId_ - The version number of the document version to retrieve.
      Returns:
      A Document object representing the specified version of the document.
      Throws:
      InvalidDocumentException - if the document does not exist, or has been deleted, or if the specified version does not exist
      PrivilegeException - if the current user does not have viewing privileges to the folder
      InvalidVersionException - if the passed version id is invalid
      ServiceException - if any system-level error occurs
    • getVersionsPaging

      ResultPage getVersionsPaging(Long doid_, Integer[] versionIds_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidDocumentException, PrivilegeException, InvalidVersionException
      Deprecated.
      Gets specific versions of a document, paging.
      Parameters:
      doid_ - The id of a document.
      versionIds_ - An array containing the version numbers of the document versions to retrieve.
      startIndex_ - The index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - The number of results to return. Negative numbers will result in the entire collection being returned, but this is STRONGLY discouraged.
      sortProperty_ - The property by which the results should be sorted. This should be one of the SORT_BY_XXX constants defined in Document.
      sortOrder_ - The order in which to sort the results. This should be either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING.
      Returns:
      A ResultPage containing a list of Document objects, which hold information about the specified versions of the document with the passed id.
      Throws:
      InvalidDocumentException - if the document does not exist, or has been deleted, or if any of the specified versions does not exist
      PrivilegeException - if the current user does not have viewing privileges to the folder
      InvalidVersionException - if any one of the passed version ids is invalid
      ServiceException - if any system-level error occurs
    • getVersions

      Gets specific versions of a document.
      Parameters:
      doid_ - The id of a document.
      versionIds_ - An array containing the version numbers of the document versions to retrieve.
      Returns:
      A list of Document objects representing the specified versions of the document.
      Throws:
      InvalidDocumentException - if the document does not exist, or has been deleted, or if any of the specified versions does not exist
      PrivilegeException - if the current user does not have viewing privileges to the folder
      InvalidVersionException - if any one of the passed version ids is invalid
      ServiceException - if any system-level error occurs
    • getAllVersionsForDocument

      @Deprecated Document[] getAllVersionsForDocument(Long doid_) throws InvalidDocumentException, PrivilegeException
      Gets all versions of a document.
      Parameters:
      doid_ - The id of a document.
      Returns:
      A list of Document objects representing all the document's versions.
      Throws:
      InvalidDocumentException - if the document does not exist or has been deleted
      PrivilegeException - if the current user does not have viewing privileges to the folder
      ServiceException - if any system-level error occurs
    • getAllVersionsForDocumentPaging

      ResultPage getAllVersionsForDocumentPaging(Long doid_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidDocumentException, PrivilegeException
      Deprecated.
      Gets all versions of a document, paging.
      Parameters:
      doid_ - The id of a document.
      startIndex_ - The index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - The number of results to return. Negative numbers will result in the entire collection being returned, but this is STRONGLY discouraged.
      sortProperty_ - The property by which the results should be sorted. This should be one of the SORT_BY_XXX constants defined in Document.
      sortOrder_ - The order in which to sort the results. This should be either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING.
      Returns:
      A ResultPage containing a list of Document objects, which hold information about each of the versions of the document with the passed id.
      Throws:
      InvalidDocumentException - if the document does not exist, or has been deleted
      PrivilegeException - if the current user does not have viewing privileges to the folder
      ServiceException - if any system-level error occurs
    • approveChangesForDocument

      void approveChangesForDocument(Long doid_) throws InvalidUserException, PrivilegeException, InvalidDocumentException
      Deprecated.
      Approves the changes for a document; to approve creation of a document, pass the id of the document, to approve deletion of a document, pass (-1 * (document id)).
      Parameters:
      doid_ - The id of the document to approve creation or the negation of the document id to approve deletion.
      Throws:
      PrivilegeException - if the current user is not an administrator of the KC containing the document
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted
      ServiceException - if any system-level error occurs
    • approveChangesForDocuments

      void approveChangesForDocuments(Long[] doids_) throws InvalidUserException, PrivilegeException, InvalidDocumentException
      Deprecated.
      Approves changes for multiple documents; to approve creation of a document, pass the id of the document, to approve deletion of a document, pass (-1 * (document id)).
      Parameters:
      doids_ - An array of ids of the documents to approve; to approve creation of a document, pass the id of the document, to approve deletion of a document, pass (-1 * (document id)).
      Throws:
      PrivilegeException - if the current user is not an administrator of the KC containing the document
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if any of the documents does not exist, or has been deleted
      ServiceException - if any system-level error occurs
    • rejectChangesForDocument

      void rejectChangesForDocument(Long doid_) throws InvalidUserException, PrivilegeException, InvalidDocumentException
      Deprecated.
      Rejects changes made to a document; to reject creation of a document, pass the id of the document, to reject deletion of a document, pass (-1 * (document id)).
      Parameters:
      doid_ - The id of a document; to reject creation of a document, pass the id of the document directly, to reject deletion of a document, pass (-1 * (document id)).
      Throws:
      PrivilegeException - if the current user is not an administrator of the KC containing the document
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted
      ServiceException - if any system-level error occurs
    • rejectChangesForDocuments

      void rejectChangesForDocuments(Long[] doids_) throws InvalidUserException, PrivilegeException, InvalidDocumentException
      Deprecated.
      Rejects changes made to multiple documents; to reject creation of a document, pass the id of the document, to reject deletion of a document, pass (-1 * (document id)).
      Parameters:
      doids_ - An array of ids of documents; to reject creation of a document, pass the id of the document directly, to reject deletion of a document, pass (-1 * (document id)).
      Throws:
      PrivilegeException - if the current user is not an administrator of the KC containing the document
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if any of the documents does not exist, or has been deleted
      ServiceException - if any system-level error occurs
    • approveChangesForVersion

      void approveChangesForVersion(Long doid_, Integer vid_) throws InvalidUserException, PrivilegeException, InvalidDocumentException
      Deprecated.
      Approves changes made for a specific version of a document; to approve creation of a version, pass the id of the document directly, to approve deletion of a version, pass (-1 * (document id)).
      Parameters:
      doid_ - The id of a document; to approve creation of a version, pass the id of the document directly, to approve deletion of a version, pass (-1 * (document id)).
      vid_ - The version number of the document version to approve.
      Throws:
      PrivilegeException - if the current user is not an administrator of the KC containing the document
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted, or if the specified version does not exist
      ServiceException - if any system-level error occurs
    • approveChangesForVersions

      void approveChangesForVersions(Long[] doids_, Integer[] vids_) throws InvalidUserException, PrivilegeException, InvalidDocumentException
      Deprecated.
      Approves changes made for specific versions of multiple documents; approves the passed version of the corresponding document (ie each index in doids_ maps to an index in vids_). To approve creation of a version, pass the id of the document directly, to approve deletion of a version, pass (-1 * (document id)).
      Parameters:
      doids_ - An array of ids of documents; to approve creation of a version, pass the id of the document directly, to approve deletion of a version, pass (-1 * (document id)).
      vids_ - An array of the version numbers of the document versions to approve. This should be the same size as the doids array.
      Throws:
      PrivilegeException - if the current user is not an administrator of the KC containing the document
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if any of the documents does not exist, or has been deleted, or if the specified version does not exist
      ServiceException - if any system-level error occurs
    • rejectChangesForVersion

      void rejectChangesForVersion(Long doid_, Integer vid_) throws InvalidUserException, PrivilegeException, InvalidDocumentException
      Deprecated.
      Rejects the changes made for a specific version of a document; to reject creation of a version, pass the id of the document directly, to reject deletion of a version, pass (-1 * (document id)).
      Parameters:
      doid_ - The id of a document; to reject creation of a version, pass the id of the document directly, to reject deletion of a version, pass (-1 * (document id)).
      vid_ - The version number of the document version.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      PrivilegeException - if the current user is not an administrator of the KC containing the document
      InvalidDocumentException - if the document does not exist, or has been deleted, or if the specified version does not exist
      ServiceException - if any system-level error occurs
    • rejectChangesForVersions

      void rejectChangesForVersions(Long[] doids_, Integer[] vids_) throws InvalidUserException, PrivilegeException, InvalidDocumentException
      Deprecated.
      Rejects changes made for specific versions of multiple documents; to reject creation of a version, pass the id of the document directly, to reject deletion of a version, pass (-1 * (document id)).
      Parameters:
      doids_ - An array of ids of documents; to reject creation of a version, pass the id of the document directly, to reject deletion of a version, pass (-1 * (document id)).
      vids_ - An array of the version numbers of the document versions. This should be the same size as the doids array.
      Throws:
      PrivilegeException - if the current user is not an administrator of the KC containing the document
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if any of the documents does not exist, or has been deleted, or if the specified version does not exist
      ServiceException - if any system-level error occurs
    • getFavoriteDocuments

      @Deprecated Document[] getFavoriteDocuments(Integer sortOrder_, String sortColumn_) throws InvalidUserException
      Retrieves the list of the current user's favorite documents.
      Parameters:
      sortOrder_ - The order in which to sort the results. This should be either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING.
      sortColumn_ - The field of the Document object by which to sort the returned list of documents. This is one of the SORT_BY_XX in Document
      Returns:
      A list of the user's favorite documents.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      ServiceException - if any system-level error occurs
    • getFavoriteDocumentsPaging

      ResultPage getFavoriteDocumentsPaging(int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidUserException
      Deprecated.
      Retrieves the list of the current user's favorite documents, paging.
      Parameters:
      startIndex_ - The index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - The number of results to return. Negative numbers will result in the entire collection being returned, but this is STRONGLY discouraged.
      sortProperty_ - The property by which the results should be sorted. This should be one of the SORT_BY_XXX constants defined in Document.
      sortOrder_ - The order in which to sort the results. This should be either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING.
      Returns:
      A ResultPage containing a list of Document objects, representing those documents that are the current user's favorites.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      ServiceException - if any system-level error occurs
    • addDocumentToFavorites

      void addDocumentToFavorites(Long doid_) throws InvalidUserException, InvalidDocumentException
      Deprecated.
      Adds a document to the current user's list of favorites.
      Parameters:
      doid_ - The id of the document to add to favorites.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted
      ServiceException - if any system-level error occurs
    • addDocumentsToFavorites

      void addDocumentsToFavorites(Long[] doids_) throws InvalidUserException, InvalidDocumentException, InvalidDataFormatException
      Deprecated.
      Adds multiple documents to the current user's list of favourites.
      Parameters:
      doids_ - An array of ids of the documents to add to favorites.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if any of the documents does not exist, or has been deleted
      InvalidDataFormatException - if doids_ is null.
      ServiceException - if any system-level error occurs
    • removeDocumentFromFavorites

      void removeDocumentFromFavorites(Long doid_) throws InvalidUserException, InvalidDocumentException
      Deprecated.
      Removes a document from the current user's list of favorites.
      Parameters:
      doid_ - The id of the document to remove from favorites.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist, or has been deleted
      ServiceException - if any system-level error occurs
    • removeDocumentsFromFavorites

      void removeDocumentsFromFavorites(Long[] doids_) throws InvalidUserException, InvalidDocumentException, InvalidDataFormatException
      Deprecated.
      Removes multiple documents from the current user's list of favorites.
      Parameters:
      doids_ - An array of ids of the documents to remove from favorites.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if any of the documents does not exist, or has been deleted
      InvalidDataFormatException - if doids_ is null.
      ServiceException - if any system-level error occurs
    • downloadDocument

      Document downloadDocument(Long doid_, Integer vid_, int adminOverride_) throws InvalidDocumentException, PrivilegeException, InvalidOperationException
      Deprecated.
      Download a document. The fileSystemId of the returned document is:
      • -1, if the user cannot see the document
      • -2, if the document is pending revision
      • the actual file system id otherwise; irrespective of whether the document is expired or not
      The getDocument(java.lang.Long) method should be used to return document metadata (not logged as a download and security is more strict), while this method will allow downloads from low security knowledge centers, and the download will be logged.
      Parameters:
      doid_ - The id of the document to be downloaded.
      vid_ - The version number of the document version to be downloaded (use Document.CURRENT_VERSION for the current version; otherwise version numbers start at 1).
      adminOverride_ - Should usually be set to 0. Set to 1 to allow any user to see a document to which he/she ordinarily does not have viewing rights.
      Returns:
      A Document object representing the downloaded document.
      Throws:
      PrivilegeException - if the current user does not have viewing privileges to the folder
      InvalidDocumentException - if the document does not exist, or has expired
      InvalidOperationException - if the document is pending changes approval
      ServiceException - if any system-level error occurs
    • downloadDocuments

      Document[] downloadDocuments(Long[] doids_, Integer vid_, int adminOverride_) throws InvalidDocumentException, PrivilegeException
      Deprecated.
      Download multiple documents. The fileSystemId of the returned documents is:
      • -1, if the user cannot see the document
      • -2, if the document is pending revision
      • the actual file system id otherwise; irrespective of whether the document is expired or not
      The getDocumentsPaging(java.lang.Long[], int, int, java.lang.Integer, java.lang.Integer) method should be used to return document metadatas (not logged as a download and security is more strict), while this method will allow downloads from low security knowledge centers, and the download will be logged.
      Parameters:
      doids_ - The ids of the documents to be downloaded.
      vid_ - The version number of the documents' version to be downloaded (use Document.CURRENT_VERSION for the current version; otherwise version numbers start at 1).
      adminOverride_ - Should usually be set to 0. Set to 1 to allow any user to see a document to which he/she ordinarily does not have viewing rights.
      Returns:
      A list of Document objects representing the downloaded documents.
      Throws:
      PrivilegeException - if the current user does not have viewing privileges to the folder
      InvalidDocumentException - if any of the documents does not exist, or has expired
      ServiceException - if any system-level error occurs
    • undeleteDocument

      Deprecated.
      Reactivates (undeletes) a document (NOTE: This method does not currently check whether the user has permission to reactivate the document).
      Parameters:
      doid_ - The id of the document to reactivate.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if the document does not exist
      PrivilegeException - if the current user is not an administrator of the folder or the owner of the document
      ServiceException - if any system-level error occurs
    • unexpireDocuments

      Deprecated.
      Unexpires multiple documents.
      Parameters:
      kcid_ - The id of the knowledge center containing the documents.
      doids_ - The ids of the documents to be unexpired.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      InvalidDocumentException - if any of the documents does not exist, or has been deleted
      InvalidKnowledgeCenterException - if the passed knowledge center or the knowledge center referenced by any of the documents is invalid
      PrivilegeException - if the current user is not an administrator of the folder or the owner of the documents
      ServiceException - if any system-level error occurs
    • validateDocumentIds

      Integer[] validateDocumentIds(Long[] ids_)
      Deprecated.
      Validates document ids. This method takes an array of document ids and determines whether each document id in the array is valid. An array of '0's (NOT valid) and '1's (valid) will be returned. For example, given the array of document ids {100, 101, 102}, an output of {1, 0, 0} will be returned if document id '100' is valid (a document with that id exists), and document ids '101' and '102' are invalid (no documents with those ids exist).
      Parameters:
      ids_ - An array of document ids to be validated.
      Returns:
      An Integer[] of '0's and '1's corresponding to the array of document ids that was passed as argument. '1' means 'valid', while '0' means Invalid.
      Throws:
      ServiceException - if any system-level error occurs
    • validateDocumentId

      Integer validateDocumentId(Long id_)
      Deprecated.
      Validates a document ID. If the id is valid (a document with the passed id exists), '1' is returned; otherwise returns '0'.
      Parameters:
      id_ - The document id to validate.
      Returns:
      An Integer that is either '0' (if the passed id is invalid) or '1' (if the passed id is valid).
      Throws:
      ServiceException - if any system-level error occurs
    • searchDocuments

      @Deprecated Document[] searchDocuments(String searchTerm_, int startIndex_, int scrollLength_) throws InvalidUserException
      Search for documents by name.
      Parameters:
      searchTerm_ - The string representing the name of the document for which to search. A document will match if its name contains the value of searchTerm_.
      startIndex_ - The starting index of the first Document to return.
      scrollLength_ - The number of consecutive Document objects to return after the first.
      Returns:
      A list of Document objects whose names match the specified search term, the list can have null values in it. Here, null means that user does not have access to that document.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      ServiceException - if any system-level error occurs
    • searchDocumentsPaging

      ResultPage searchDocumentsPaging(String searchTerm_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidUserException
      Deprecated.
      Search for documents by name.
      Parameters:
      searchTerm_ - The string representing the document name for which to search. A document will match if its name contains the value of searchTerm_.
      startIndex_ - The index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - The number of results to return. Negative numbers will result in the entire collection being returned, but this is STRONGLY discouraged.
      sortProperty_ - The property by which the results should be sorted. This should be one of the SORT_BY_XXX constants defined in Document.
      sortOrder_ - The order in which to sort the results. This should be either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING.
      Returns:
      A ResultPage containing a list of Document objects, representing those documents whose names match the specified search term.
      Throws:
      InvalidUserException - if the user calling this method is invalid
      ServiceException - if any system-level error occurs
    • getViewableDocumentsPaging

      ResultPage getViewableDocumentsPaging(Long[] documentIds_, int startIndex_, int batchSize_, Integer sortProperty_, Integer sortOrder_) throws InvalidUserException, InvalidDocumentException
      Deprecated.
      Gets the documents that the current user is allowed to access from a list of documents.
      Parameters:
      documentIds_ - A list of ids of documents.
      startIndex_ - The index into the collection of total results at which to start. Negative numbers are treated as zeros.
      batchSize_ - The number of results to return. Negative numbers will result in the entire collection being returned, but this is STRONGLY discouraged.
      sortProperty_ - The property by which the results should be sorted. This should be one of the SORT_BY_XXX constants defined in Document.
      sortOrder_ - The order in which to sort the results. This should be either Constants.SORT_ORDER_ASCENDING or Constants.SORT_ORDER_DESCENDING.
      Returns:
      A ResultPage containing a list of Document objects, representing those documents which the current user is allowed to access.
      Throws:
      InvalidUserException - if the current user does not exist
      InvalidDocumentException - if any of the documents is invalid
      ServiceException - if any system-level error occurs
    • getDocumentsList

      ResultList getDocumentsList(Long[] docIds_)
      Deprecated.
      Gets the specified documents, returning the valid results even if all the results cannot be retrieved (for instance, if some of the documents corresponding to the ids no longer exist).
      Parameters:
      docIds_ - The ids of the documents to retrieve.
      Returns:
      A ResultList containing documents and result codes. the Result.getResults() method should be used to get all the documents that were successfully retrieved. In addition ResultList.getResultCodes() can be used to get the list of result codes corresponding to each of the specified document ids. Each code represents the successful retrieval of a document, or, if the document could not be retrieved, the reason for the failure. Each code will be one of the CODE_XXX or COLLAB_CODE_XXX constants in ResultList
      See Also:
    • getSystemDocumentId

      @Deprecated Long getSystemDocumentId(String name_) throws InvalidDocumentException
      This is a small wrapper on Content's getSystemId, but returns the content id as a document id.
      Parameters:
      name - A case-insensitive system name.
      Returns:
      the id of the document mapped to that name.
      Throws:
      InvalidDocumentException - if the string is not recognized
    • setSystemDocumentId

      @Deprecated void setSystemDocumentId(String name_, Long id_) throws InvalidDocumentException
      Deprecated.
      use createDocument(Document) with a pre-populated UUID
      Stores and associates the specified id value with the specified name key.
      Parameters:
      name - A case-insensitive system name.
      id - The document id.
      Throws:
      InvalidDocumentException - if the string is not recognized
    • suggest

      String suggest(String query_, int maxItems_, SuggestParam[] params_, Boolean groupResults_)
      Deprecated.
      Parameters:
      query -
      maxItems -
      params - list of information on what is being suggested and what format the results should be in. valid types are document.
      groupResults - if specifying more than one SuggestParam, would you like to group the results by type, or mixed together and sorted? Default is true. If grouped, order of types matches the order of the suggestParams passed in.
      Returns:
      a JSON formatted string
    • suggest

      String suggest(String query_, int maxItems_, SuggestParam[] params_, Boolean groupResults_, Long[] allowList)
      Deprecated.
      Parameters:
      query -
      maxItems -
      params - list of information on what is being suggested and what format the results should be in. valid types are document.
      groupResults - if specifying more than one SuggestParam, would you like to group the results by type, or mixed together and sorted? Default is true. If grouped, order of types matches the order of the suggestParams passed in.
      allowList - list of IDs that will be automatically added to returned results, filtered by query. Ignored if null or empty.
      Returns:
      a JSON formatted string
    • getContentIdForDocumentId

      Long getContentIdForDocumentId(Long id_)
      Deprecated.
      Returns the Content Id given a Document Id. Note that for documents, the document id and the content id will always be the same.
      Parameters:
      id_ - the document id.
    • getContentIdsForDocumentIds

      Long[] getContentIdsForDocumentIds(Long[] id_)
      Deprecated.
      Returns the Content Id given a Document Id. Note that for documents, the document id and the content id will always be the same.
      Parameters:
      id_ - the document id.
    • getDocumentIdForContentId

      Long getDocumentIdForContentId(Long id_)
      Deprecated.
      Returns the document Id given a content Id. Note that for documents, the document id and the content id will always be the same.
      Parameters:
      id_ - the document id.
    • getDocumentIdsForContentIds

      Long[] getDocumentIdsForContentIds(Long[] id_)
      Deprecated.
      Returns the document Id given a content Id. Note that for documents, the document id and the content id will always be the same.
      Parameters:
      id_ - the document id.