Interface DocumentService

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      WSNote addNote​(long docId, String note)
      Adds a new note for the given document
      javax.ws.rs.core.Response checkin​(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> attachments)  
      void checkout​(long docId)  
      javax.ws.rs.core.Response create​(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> atts)  
      void createPdf​(long docId, String fileVersion)
      Creates the PDF conversion of the given document; if the PDF conversion was already created, nothing will happen
      void createThumbnail​(long docId, String fileVersion)
      Creates the thumbail of the given document; if the thumbnail was already created, nothing will happen
      void delete​(long docId)  
      void deleteNote​(long noteId)
      Deletes a new note by note identifier
      String deleteVersion​(long docId, String version)
      Deletes a version by document identifier and version ID.
      javax.activation.DataHandler getContent​(long docId)  
      WSDocument getDocument​(long docId)  
      WSNote[] getNotes​(long docId)
      Gets the notes for the given document
      WSRating[] getRatings​(long docId)
      Gets all the ratings of the given document
      javax.activation.DataHandler getVersionContent​(long docId, String version)  
      WSDocument[] list​(long folderId)  
      WSDocument[] listDocuments​(long folderId, String fileName)  
      void move​(long docId, long folderId)
      Moves an existing document with the given identifier
      void promoteVersion​(long docId, String version)
      Promotes an old version to the current default one.
      WSRating rateDocument​(long docId, int vote)
      Puts a new rating on the given document
      javax.ws.rs.core.Response replaceFile​(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> attachments)  
      void update​(WSDocument document)
      Updates an existing document with the value object containing the document's metadata.
      javax.ws.rs.core.Response upload​(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> attachments)  
    • Method Detail

      • create

        @POST
        @Path("/create")
        @Consumes("multipart/form-data")
        javax.ws.rs.core.Response create​(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> atts)
                                  throws Exception
        Throws:
        Exception
      • getDocument

        @GET
        @Path("/getDocument")
        @Produces({"application/json","application/xml"})
        WSDocument getDocument​(@QueryParam("docId")
                               long docId)
                        throws Exception
        Throws:
        Exception
      • checkout

        @POST
        @Path("/checkout")
        @Consumes("application/x-www-form-urlencoded")
        void checkout​(@FormParam("docId")
                      long docId)
               throws Exception
        Throws:
        Exception
      • checkin

        @POST
        @Path("/checkin")
        @Consumes("multipart/form-data")
        @Produces({"text/plain","application/json","application/xml"})
        javax.ws.rs.core.Response checkin​(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> attachments)
                                   throws Exception
        Throws:
        Exception
      • replaceFile

        @POST
        @Path("/replaceFile")
        @Consumes("multipart/form-data")
        @Produces({"text/plain","application/json","application/xml"})
        javax.ws.rs.core.Response replaceFile​(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> attachments)
                                       throws Exception
        Throws:
        Exception
      • upload

        @POST
        @Path("/upload")
        @Consumes("multipart/form-data")
        @Produces({"text/plain","application/json","application/xml"})
        javax.ws.rs.core.Response upload​(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> attachments)
                                  throws Exception
        Throws:
        Exception
      • delete

        @DELETE
        @Path("/delete")
        void delete​(@QueryParam("docId")
                    long docId)
             throws Exception
        Throws:
        Exception
      • list

        @GET
        @Path("/list")
        @Produces("application/json")
        WSDocument[] list​(@QueryParam("folderId")
                          long folderId)
                   throws Exception
        Throws:
        Exception
      • listDocuments

        @GET
        @Path("/listDocuments")
        WSDocument[] listDocuments​(@QueryParam("folderId")
                                   long folderId,
                                   @QueryParam("fileName")
                                   String fileName)
                            throws Exception
        Throws:
        Exception
      • update

        @PUT
        @Path("/update")
        void update​(WSDocument document)
             throws Exception
        Updates an existing document with the value object containing the document's metadata.
        Parameters:
        document - the document to update
        Throws:
        Exception - error in the server application
      • getContent

        @GET
        @Path("/getContent")
        @Produces("application/octet-stream")
        javax.activation.DataHandler getContent​(@QueryParam("docId")
                                                long docId)
                                         throws Exception
        Throws:
        Exception
      • getVersionContent

        @GET
        @Path("/getVersionContent")
        @Produces("application/octet-stream")
        javax.activation.DataHandler getVersionContent​(@QueryParam("docId")
                                                       long docId,
                                                       @QueryParam("version")
                                                       String version)
                                                throws Exception
        Throws:
        Exception
      • addNote

        @POST
        @Path("/addNote")
        @Consumes("application/x-www-form-urlencoded")
        WSNote addNote​(@FormParam("docId")
                       long docId,
                       @FormParam("note")
                       String note)
                throws Exception
        Adds a new note for the given document
        Parameters:
        docId - identifier of the document
        note - the note to add
        Returns:
        the added note
        Throws:
        Exception - error in the server application
      • deleteNote

        @DELETE
        @Path("/deleteNote")
        void deleteNote​(@QueryParam("noteId")
                        long noteId)
                 throws Exception
        Deletes a new note by note identifier
        Parameters:
        noteId - identifier of the note
        Throws:
        Exception - error in the server application
      • getNotes

        @GET
        @Path("/getNotes")
        WSNote[] getNotes​(@QueryParam("docId")
                          long docId)
                   throws Exception
        Gets the notes for the given document
        Parameters:
        docId - identifier of the document
        Returns:
        array of notes
        Throws:
        Exception - error in the server application
      • rateDocument

        @GET
        @Path("/rateDocument")
        WSRating rateDocument​(@QueryParam("docId")
                              long docId,
                              @QueryParam("vote")
                              int vote)
                       throws Exception
        Puts a new rating on the given document
        Parameters:
        docId - identifier of the document
        vote - the vote
        Returns:
        the rating
        Throws:
        Exception - error in the server application
      • getRatings

        @GET
        @Path("/getRatings")
        WSRating[] getRatings​(@QueryParam("docId")
                              long docId)
                       throws Exception
        Gets all the ratings of the given document
        Parameters:
        docId - identifier of the document
        Returns:
        the ratings
        Throws:
        Exception - error in the server application
      • deleteVersion

        @DELETE
        @Path("/deleteVersion")
        String deleteVersion​(@QueryParam("docId")
                             long docId,
                             @QueryParam("version")
                             String version)
                      throws Exception
        Deletes a version by document identifier and version ID. You can not delete the latest version of a document
        Parameters:
        docId - identifier of the document
        version - the document's version
        Returns:
        the latest version of the document
        Throws:
        Exception - error in the server application
      • move

        @PUT
        @Path("/move")
        void move​(@QueryParam("docId")
                  long docId,
                  @QueryParam("folderId")
                  long folderId)
           throws Exception
        Moves an existing document with the given identifier
        Parameters:
        docId - The document id
        folderId - Identifier of the new document's folder
        Throws:
        Exception - error in the server application
      • createThumbnail

        @PUT
        @Path("/createThumbnail")
        void createThumbnail​(@QueryParam("docId")
                             long docId,
                             @QueryParam("fileVersion")
                             String fileVersion)
                      throws Exception
        Creates the thumbail of the given document; if the thumbnail was already created, nothing will happen
        Parameters:
        docId - The document id
        fileVersion - The specific file version(it can be empty)
        Throws:
        Exception - error in the server application
      • createPdf

        @PUT
        @Path("/createPdf")
        void createPdf​(@QueryParam("docId")
                       long docId,
                       @QueryParam("fileVersion")
                       String fileVersion)
                throws Exception
        Creates the PDF conversion of the given document; if the PDF conversion was already created, nothing will happen
        Parameters:
        docId - The document id
        fileVersion - The specific file version(it can be empty)
        Throws:
        Exception - error in the server application
      • promoteVersion

        @GET
        @Path("/promoteVersion")
        void promoteVersion​(@QueryParam("docId")
                            long docId,
                            @QueryParam("version")
                            String version)
                     throws Exception
        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).
        Parameters:
        docId - the document to be updated
        version - the version
        Throws:
        Exception - if an error occurs, this exception is thrown