Class SoapDocumentClient

    • Method Detail

      • create

        public WSDocument create​(String sid,
                                 WSDocument document,
                                 javax.activation.DataHandler content)
                          throws Exception
        Description copied from interface: DocumentService
        Create a new document. The user can completely customize the document through a value object containing the document's metadata
        Specified by:
        create in interface DocumentService
        Parameters:
        sid - identifier of the session
        document - Web service value object containing the document's metadata
        content - The document's binary content
        Returns:
        The value object containing the document's metadata
        Throws:
        Exception - error in the server application
      • checkout

        public void checkout​(String sid,
                             long docId)
                      throws Exception
        Description copied from interface: DocumentService
        Checks out an existing document with the given identifier.
        Specified by:
        checkout in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        Throws:
        Exception - error in the server application
      • delete

        public void delete​(String sid,
                           long docId)
                    throws Exception
        Description copied from interface: DocumentService
        Deletes an existing document with the given identifier.
        Specified by:
        delete in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        Throws:
        Exception - error in the server application
      • getDocument

        public WSDocument getDocument​(String sid,
                                      long docId)
                               throws Exception
        Description copied from interface: DocumentService
        Gets the metadata of an existing document with the given identifier
        Specified by:
        getDocument in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        Returns:
        A value object containing the document's metadata
        Throws:
        Exception - error in the server application
      • getDocumentByCustomId

        public WSDocument getDocumentByCustomId​(String sid,
                                                String customId)
                                         throws Exception
        Description copied from interface: DocumentService
        Gets document metadata of an existing document with the given custom identifier
        Specified by:
        getDocumentByCustomId in interface DocumentService
        Parameters:
        sid - identifier of the session
        customId - The custom id
        Returns:
        A value object containing the document's metadata
        Throws:
        Exception - error in the server application
      • isReadable

        public boolean isReadable​(String sid,
                                  long docId)
                           throws Exception
        Description copied from interface: DocumentService
        Tests if a document is readable
        Specified by:
        isReadable in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        Returns:
        True if the identifier denotes a document, otherwise false
        Throws:
        Exception - error in the server application
      • lock

        public void lock​(String sid,
                         long docId)
                  throws Exception
        Description copied from interface: DocumentService
        Locks an existing document with the given identifier.
        Specified by:
        lock in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        Throws:
        Exception - error in the server application
      • move

        public void move​(String sid,
                         long docId,
                         long folderId)
                  throws Exception
        Description copied from interface: DocumentService
        Moves an existing document with the given identifier.
        Specified by:
        move in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        folderId - Identifier of the new document's folder
        Throws:
        Exception - error in the server application
      • copy

        public WSDocument copy​(String sid,
                               long docId,
                               long folderId)
                        throws Exception
        Description copied from interface: DocumentService
        Copies a document into another folder.
        Specified by:
        copy in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        folderId - Identifier of the new document's folder
        Returns:
        The created copy
        Throws:
        Exception - error in the server application
      • unlock

        public void unlock​(String sid,
                           long docId)
                    throws Exception
        Description copied from interface: DocumentService
        Unlocks an existing document with the given identifier.
        Specified by:
        unlock in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - identifier of the document
        Throws:
        Exception - error in the server application
      • update

        public void update​(String sid,
                           WSDocument document)
                    throws Exception
        Description copied from interface: DocumentService
        Updates an existing document with the value object containing the document's metadata
        Specified by:
        update in interface DocumentService
        Parameters:
        sid - identifier of the session
        document - The value object containing the document's metadata
        Throws:
        Exception - error in the server application
      • checkin

        public void checkin​(String sid,
                            long docId,
                            String comment,
                            String filename,
                            boolean release,
                            javax.activation.DataHandler content)
                     throws Exception
        Description copied from interface: DocumentService
        Checks in an existing document with the given identifier to create a new version.
        Specified by:
        checkin in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        comment - The check in operation comment
        filename - The document file name
        release - True if this is a new release(eg: 2.0) rather than a subversion(eg: 1.1)
        content - The document's binary content
        Throws:
        Exception - error in the server application
      • checkinDocument

        public void checkinDocument​(String sid,
                                    long docId,
                                    String comment,
                                    String filename,
                                    boolean release,
                                    WSDocument docVO,
                                    javax.activation.DataHandler content)
                             throws Exception
        Description copied from interface: DocumentService
        Checks in an existing document with the given identifier to create a new version.
        Specified by:
        checkinDocument in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        comment - The check in operation comment
        filename - The document file name
        release - True if this is a new release(e.g.: 2.0) rather than a subversion(e.g.: 1.1)
        docVO - metadata for the document
        content - The document's binary content
        Throws:
        Exception - error in the server application
      • getContent

        public javax.activation.DataHandler getContent​(String sid,
                                                       long docId)
                                                throws Exception
        Description copied from interface: DocumentService
        Gets the content of an existing document with the given identifier
        Specified by:
        getContent in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        Returns:
        The requested document's binary
        Throws:
        Exception - error in the server application
      • getVersionContent

        public javax.activation.DataHandler getVersionContent​(String sid,
                                                              long docId,
                                                              String version)
                                                       throws Exception
        Description copied from interface: DocumentService
        Gets the content of a specific version of a document
        Specified by:
        getVersionContent in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        version - The specific version(it can be empty)
        Returns:
        The requested version's binary
        Throws:
        Exception - error in the server application
      • getResource

        public javax.activation.DataHandler getResource​(String sid,
                                                        long docId,
                                                        String fileVersion,
                                                        String suffix)
                                                 throws Exception
        Description copied from interface: DocumentService
        Gets the content of a resource associated to the given document.
        Specified by:
        getResource in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        fileVersion - The specific file version(it can be empty)
        suffix - Suffix specification(it can be empty, conversion.pdf to get the PDF conversion)
        Returns:
        The requested resource's binary
        Throws:
        Exception - error in the server application
      • restore

        public void restore​(String sid,
                            long docId,
                            long folderId)
                     throws Exception
        Description copied from interface: DocumentService
        Restores a deleted document
        Specified by:
        restore in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        folderId - Id of the folder in which the document must be restored
        Throws:
        Exception - error in the server application
      • rename

        public void rename​(String sid,
                           long docId,
                           String name)
                    throws Exception
        Description copied from interface: DocumentService
        Renames the title of an existing document with the given identifier.
        Specified by:
        rename in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        name - The new document title
        Throws:
        Exception - error in the server application
      • getDocuments

        public WSDocument[] getDocuments​(String sid,
                                         Long[] docIds)
                                  throws Exception
        Description copied from interface: DocumentService
        Gets document metadata of a collection of existing documents with the given identifiers
        Specified by:
        getDocuments in interface DocumentService
        Parameters:
        sid - identifier of the session
        docIds - identifiers of the documents
        Returns:
        the list of documents
        Throws:
        Exception - error in the server application
      • getRecentDocuments

        public WSDocument[] getRecentDocuments​(String sid,
                                               Integer max)
                                        throws Exception
        Description copied from interface: DocumentService
        Lists of last modified documents of the current session.
        Specified by:
        getRecentDocuments in interface DocumentService
        Parameters:
        sid - identifier of the session
        max - Maximum number of returned records
        Returns:
        Array of documents
        Throws:
        Exception - error in the server application
      • sendEmail

        public void sendEmail​(String sid,
                              Long[] docIds,
                              String recipients,
                              String subject,
                              String message)
                       throws Exception
        Description copied from interface: DocumentService
        Sends a set of documents as mail attachments
        Specified by:
        sendEmail in interface DocumentService
        Parameters:
        sid - identifier of the session
        docIds - Set of document identifiers
        recipients - Set of recipients(comma separated)
        subject - The email subject
        message - The email message body
        Throws:
        Exception - error in the server application
      • createAlias

        public WSDocument createAlias​(String sid,
                                      long docId,
                                      long folderId,
                                      String type)
                               throws Exception
        Description copied from interface: DocumentService
        Creates a new document alias for the given document inside a specified folder
        Specified by:
        createAlias in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The original document id
        folderId - Identifier of the folder in which will be stored the alias.
        type - Type of the alias
        Returns:
        The value object containing the document's metadata
        Throws:
        Exception - error in the server application
      • reindex

        public void reindex​(String sid,
                            long docId,
                            String content)
                     throws Exception
        Description copied from interface: DocumentService
        Re-indexes(or indexes from scratch) a document
        Specified by:
        reindex in interface DocumentService
        Parameters:
        sid - Session identifier
        docId - The document id
        content - The content to be used (if null the file is parsed)
        Throws:
        Exception - error in the server application
      • listDocuments

        public WSDocument[] listDocuments​(String sid,
                                          long folderId,
                                          String fileName)
                                   throws Exception
        Description copied from interface: DocumentService
        Gets a document in a specific folder
        Specified by:
        listDocuments in interface DocumentService
        Parameters:
        sid - identifier of the session
        folderId - The folder id
        fileName - Optional file name filter
        Returns:
        A value object containing the document's metadata
        Throws:
        Exception - error in the server application
      • getAliases

        public WSDocument[] getAliases​(String sid,
                                       long docId)
                                throws Exception
        Description copied from interface: DocumentService
        Gets the aliases of the given document
        Specified by:
        getAliases in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The master document ID
        Returns:
        Arrays of aliases
        Throws:
        Exception - error in the server application
      • link

        public WSLink link​(String sid,
                           long doc1,
                           long doc2,
                           String type)
                    throws Exception
        Description copied from interface: DocumentService
        Creates a new link between two documents.
        Specified by:
        link in interface DocumentService
        Parameters:
        sid - identifier of the session
        doc1 - ID of document 1
        doc2 - ID of document 2
        type - The link type(it can be empty)
        Returns:
        the new link
        Throws:
        Exception - error in the server application
      • getLinks

        public WSLink[] getLinks​(String sid,
                                 long docId)
                          throws Exception
        Description copied from interface: DocumentService
        Gets all the links of a specific document
        Specified by:
        getLinks in interface DocumentService
        Parameters:
        sid - Session identifier
        docId - ID of the document
        Returns:
        The new links of the document
        Throws:
        Exception - error in the server application
      • deleteLink

        public void deleteLink​(String sid,
                               long id)
                        throws Exception
        Description copied from interface: DocumentService
        Removes an existing link
        Specified by:
        deleteLink in interface DocumentService
        Parameters:
        sid - identifier of the session
        id - ID of the link
        Throws:
        Exception - error in the server application
      • createPdf

        public void createPdf​(String sid,
                              long docId,
                              String fileVersion)
                       throws Exception
        Description copied from interface: DocumentService
        Creates the PDF conversion of the given document. If the conversion was already created, nothing will happen.
        Specified by:
        createPdf in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        fileVersion - The specific file version(it can be empty)
        Throws:
        Exception - error in the server application
      • createThumbnail

        public void createThumbnail​(String sid,
                                    long docId,
                                    String fileVersion,
                                    String type)
                             throws Exception
        Description copied from interface: DocumentService
        Creates the thumbnail of the given document. If the thumbnail was already created, nothing will happen.
        Specified by:
        createThumbnail in interface DocumentService
        Parameters:
        sid - Session identifier
        docId - The document id
        fileVersion - The specific file version(it can be empty)
        type - The thumbnail type(eg: thumb, tile, mobile, thumbXXX where XXX is a resolution in pixels)
        Throws:
        Exception - error in the server application
      • uploadResource

        public void uploadResource​(String sid,
                                   long docId,
                                   String fileVersion,
                                   String suffix,
                                   javax.activation.DataHandler content)
                            throws Exception
        Description copied from interface: DocumentService
        Uploads a new resource attached to the given document. If the resource already exists it is overwritten.
        Specified by:
        uploadResource in interface DocumentService
        Parameters:
        sid - Session identifier
        docId - The document id
        fileVersion - The specific file version(it can be empty)
        suffix - Suffix specification(it cannot be empty, use 'conversion.pdf' to put the PDF conversion)
        content - The resource's binary content
        Throws:
        Exception - error in the server application
      • getExtractedText

        public String getExtractedText​(String sid,
                                       long docId)
                                throws Exception
        Description copied from interface: DocumentService
        Gets the document's text stored in the full-text index
        Specified by:
        getExtractedText in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        Returns:
        The requested document's text
        Throws:
        Exception - error in the server application
      • createDownloadTicket

        public String createDownloadTicket​(String sid,
                                           long docId,
                                           String suffix,
                                           Integer expireHours,
                                           String expireDate,
                                           Integer maxDownloads)
                                    throws Exception
        Description copied from interface: DocumentService
        Creates a new download ticket
        Specified by:
        createDownloadTicket in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - identifier of the document
        suffix - can be null or 'conversion.pdf'
        expireHours - expiration time expressed in hours
        expireDate - exact expiration date expressed in the format yyyy-MM-dd
        maxDownloads - maximum number of downloads allowed
        Returns:
        the download ticket
        Throws:
        Exception - error in the server application
      • setPassword

        public void setPassword​(String sid,
                                long docId,
                                String password)
                         throws Exception
        Description copied from interface: DocumentService
        Puts a password protection to the document
        Specified by:
        setPassword in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - identifier of the document
        password - the new password
        Throws:
        Exception - error in the server application
      • unsetPassword

        public void unsetPassword​(String sid,
                                  long docId,
                                  String currentPassword)
                           throws Exception
        Description copied from interface: DocumentService
        Removes the password protection from the document
        Specified by:
        unsetPassword in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - identifier of the document
        currentPassword - the password
        Throws:
        Exception - error in the server application
      • unprotect

        public boolean unprotect​(String sid,
                                 long docId,
                                 String password)
                          throws Exception
        Description copied from interface: DocumentService
        Unprotects a document that is password protected. If the given password is right, the document remains unprotected for the duration of the session
        Specified by:
        unprotect in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - identifier of the document
        password - the password
        Returns:
        was it uprotected?
        Throws:
        Exception - error in the server application
      • addNote

        public WSNote addNote​(String sid,
                              long docId,
                              String note)
                       throws Exception
        Description copied from interface: DocumentService
        Adds a new note for the given document
        Specified by:
        addNote in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - identifier of the document
        note - text of the note
        Returns:
        the created note
        Throws:
        Exception - error in the server application
      • deleteNote

        public void deleteNote​(String sid,
                               long noteId)
                        throws Exception
        Description copied from interface: DocumentService
        Adds a new note for the given document
        Specified by:
        deleteNote in interface DocumentService
        Parameters:
        sid - identifier of the session
        noteId - identifier of the note
        Throws:
        Exception - error in the server application
      • getNotes

        public WSNote[] getNotes​(String sid,
                                 long docId)
                          throws Exception
        Description copied from interface: DocumentService
        Gets the notes for the given document
        Specified by:
        getNotes in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - identifier of the document
        Returns:
        array of notes
        Throws:
        Exception - error in the server application
      • rateDocument

        public WSRating rateDocument​(String sid,
                                     long docId,
                                     int vote)
                              throws Exception
        Description copied from interface: DocumentService
        Puts a new rating on the given document
        Specified by:
        rateDocument in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - identifier of the document
        vote - the vote
        Returns:
        the rating
        Throws:
        Exception - error in the server application
      • getRatings

        public WSRating[] getRatings​(String sid,
                                     long docId)
                              throws Exception
        Description copied from interface: DocumentService
        Gets all the ratings of the given document
        Specified by:
        getRatings in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - identifier of the document
        Returns:
        the array of ratings
        Throws:
        Exception - error in the server application
      • deleteVersion

        public String deleteVersion​(String sid,
                                    long docId,
                                    String version)
                             throws Exception
        Description copied from interface: DocumentService
        Deletes a version of a document with the given identifiers. You can not delete the latest version of a document
        Specified by:
        deleteVersion in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        version - The specific version
        Returns:
        the latest version
        Throws:
        Exception - when the version to delete is not available
      • replaceFile

        public void replaceFile​(String sid,
                                long docId,
                                String fileVersion,
                                String comment,
                                javax.activation.DataHandler content)
                         throws Exception
        Description copied from interface: DocumentService
        Replaces the file associated to a given version.
        Specified by:
        replaceFile in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        fileVersion - The file version
        comment - The comment left for this action
        content - The file's binary content
        Throws:
        Exception - if an error occurs, this exception is thrown
      • promoteVersion

        public void promoteVersion​(String sid,
                                   long docId,
                                   String version)
                            throws Exception
        Description copied from interface: DocumentService
        Promotes an old version to the current default one. If you promote a prior version, what it does is make it the default version again. (regardless of there being many versions).
        Specified by:
        promoteVersion in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - the document to be updated
        version - the version
        Throws:
        Exception - if an error occurs, this exception is thrown
      • saveNote

        public WSNote saveNote​(String sid,
                               long docId,
                               WSNote note)
                        throws Exception
        Description copied from interface: DocumentService
        Adds a new note for the given document
        Specified by:
        saveNote in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - identifier of the document
        note - the note to add
        Returns:
        the added note
        Throws:
        Exception - error in the server application
      • upload

        public long upload​(String sid,
                           Long docId,
                           Long folderId,
                           boolean release,
                           String filename,
                           String language,
                           javax.activation.DataHandler content)
                    throws Exception
        Description copied from interface: DocumentService
        Creates a new document or updates an existing one.
        Specified by:
        upload in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id (optional)
        folderId - The folder id (optional)
        release - True if this is a major release(eg: 2.0) rather than a minor release(eg: 1.12)
        filename - The document file name
        language - The language for the document
        content - The document's binary content
        Returns:
        The created/updated document's ID
        Throws:
        Exception - error in the server application
      • getVersions

        public WSDocument[] getVersions​(String sid,
                                        long docId)
                                 throws Exception
        Description copied from interface: DocumentService
        Gets the version history of an existing document with the given identifier
        Specified by:
        getVersions in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        Returns:
        Array of versions
        Throws:
        Exception - error in the server application
      • getVersion

        public WSDocument getVersion​(String sid,
                                     long docId,
                                     String version)
                              throws Exception
        Description copied from interface: DocumentService
        Gets a specific version
        Specified by:
        getVersion in interface DocumentService
        Parameters:
        sid - identifier of the session
        docId - The document id
        version - The version number
        Returns:
        The version
        Throws:
        Exception - error in the server application