Class RestDocumentService
- java.lang.Object
-
- com.logicaldoc.webservice.AbstractService
-
- com.logicaldoc.webservice.soap.endpoint.SoapDocumentService
-
- com.logicaldoc.webservice.rest.endpoint.RestDocumentService
-
- All Implemented Interfaces:
DocumentService
,DocumentService
- Direct Known Subclasses:
RestDocumentSwagger
@Path("/") @Consumes({"application/xml","application/json"}) @Produces("application/json") public class RestDocumentService extends SoapDocumentService implements DocumentService
-
-
Constructor Summary
Constructors Constructor Description RestDocumentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WSNote
addNote(long docId, String note)
Adds a new note for the given documentjavax.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 happenvoid
createThumbnail(long docId, String fileVersion)
Creates the thumbail of the given document; if the thumbnail was already created, nothing will happenvoid
delete(long docId)
void
deleteNote(long noteId)
Adds a new note for the given documentString
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 documentWSRating[]
getRatings(long docId)
Gets all the ratings of the given documentjavax.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 identifiervoid
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 documentjavax.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)
-
Methods inherited from class com.logicaldoc.webservice.soap.endpoint.SoapDocumentService
addNote, checkin, checkin, checkinDocument, checkinDocument, checkout, create, create, createAlias, createDownloadTicket, createPdf, createThumbnail, delete, deleteLink, deleteNote, deleteVersion, getAliases, getContent, getDocument, getDocumentByCustomId, getDocuments, getExtractedText, getLinks, getNotes, getRatings, getRecentDocuments, getResource, getVersionContent, getVersions, isReadable, link, listDocuments, lock, move, promoteVersion, rateDocument, reindex, rename, replaceFile, restore, saveNote, sendEmail, setPassword, unlock, unprotect, unsetPassword, update, upload, uploadResource
-
Methods inherited from class com.logicaldoc.webservice.AbstractService
convertDateToString, convertStringToDate, getContext, getMessageContext, isValidateSession, setContext, setMessageContext, setValidateSession
-
-
-
-
Method Detail
-
create
@POST @Path("/create") @Consumes("multipart/form-data") public javax.ws.rs.core.Response create(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> atts) throws Exception
- Specified by:
create
in interfaceDocumentService
- Throws:
Exception
-
getDocument
@GET @Path("/getDocument") @Produces({"application/json","application/xml"}) public WSDocument getDocument(@QueryParam("docId") long docId) throws Exception
- Specified by:
getDocument
in interfaceDocumentService
- Throws:
Exception
-
checkout
@POST @Path("/checkout") @Consumes("application/x-www-form-urlencoded") public void checkout(@FormParam("docId") long docId) throws Exception
- Specified by:
checkout
in interfaceDocumentService
- Throws:
Exception
-
checkin
@POST @Path("/checkin") @Consumes("multipart/form-data") @Produces({"text/plain","application/json","application/xml"}) public javax.ws.rs.core.Response checkin(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> attachments) throws Exception
- Specified by:
checkin
in interfaceDocumentService
- Throws:
Exception
-
upload
@POST @Path("/upload") @Consumes("multipart/form-data") @Produces({"text/plain","application/json","application/xml"}) public javax.ws.rs.core.Response upload(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> attachments) throws Exception
- Specified by:
upload
in interfaceDocumentService
- Throws:
Exception
-
replaceFile
@POST @Path("/replaceFile") @Consumes("multipart/form-data") @Produces({"text/plain","application/json","application/xml"}) public javax.ws.rs.core.Response replaceFile(List<org.apache.cxf.jaxrs.ext.multipart.Attachment> attachments) throws Exception
- Specified by:
replaceFile
in interfaceDocumentService
- Throws:
Exception
-
delete
@DELETE @Path("/delete") public void delete(@QueryParam("docId") long docId) throws Exception
- Specified by:
delete
in interfaceDocumentService
- Throws:
Exception
-
list
@GET @Path("/list") @Produces("application/json") public WSDocument[] list(@QueryParam("folderId") long folderId) throws Exception
- Specified by:
list
in interfaceDocumentService
- Throws:
Exception
-
listDocuments
@GET @Path("/listDocuments") public WSDocument[] listDocuments(@QueryParam("folderId") long folderId, @QueryParam("fileName") String fileName) throws Exception
- Specified by:
listDocuments
in interfaceDocumentService
- Throws:
Exception
-
getContent
@GET @Path("/getContent") @Produces("application/octet-stream") public javax.activation.DataHandler getContent(@QueryParam("docId") long docId) throws Exception
- Specified by:
getContent
in interfaceDocumentService
- Throws:
Exception
-
getVersionContent
@GET @Path("/getVersionContent") @Produces("application/octet-stream") public javax.activation.DataHandler getVersionContent(@QueryParam("docId") long docId, @QueryParam("version") String version) throws Exception
- Specified by:
getVersionContent
in interfaceDocumentService
- Throws:
Exception
-
deleteVersion
@DELETE @Path("/deleteVersion") public String deleteVersion(@QueryParam("docId") long docId, @QueryParam("version") String version) throws Exception
Description copied from interface:DocumentService
Deletes a version by document identifier and version ID. You can not delete the latest version of a document- Specified by:
deleteVersion
in interfaceDocumentService
- Parameters:
docId
- identifier of the documentversion
- the document's version- Returns:
- the latest version of the document
- Throws:
Exception
- error in the server application
-
update
@PUT @Path("/update") public void update(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 interfaceDocumentService
- Parameters:
document
- the document to update- Throws:
Exception
- error in the server application
-
addNote
@POST @Path("/addNote") @Consumes("application/x-www-form-urlencoded") public WSNote addNote(@FormParam("docId") long docId, @FormParam("note") String note) throws Exception
Description copied from interface:DocumentService
Adds a new note for the given document- Specified by:
addNote
in interfaceDocumentService
- Parameters:
docId
- identifier of the documentnote
- the note to add- Returns:
- the added note
- Throws:
Exception
- error in the server application
-
deleteNote
@DELETE @Path("/deleteNote") public void deleteNote(@QueryParam("noteId") long noteId) throws Exception
Adds a new note for the given document- Specified by:
deleteNote
in interfaceDocumentService
- Parameters:
noteId
- identifier of the note- Throws:
Exception
- error in the server application
-
getNotes
@GET @Path("/getNotes") public WSNote[] getNotes(@QueryParam("docId") long docId) throws Exception
Gets the notes for the given document- Specified by:
getNotes
in interfaceDocumentService
- Parameters:
docId
- identifier of the document- Returns:
- array of notes
- Throws:
Exception
- error in the server application
-
rateDocument
@GET @Path("/rateDocument") public WSRating rateDocument(@QueryParam("docId") long docId, @QueryParam("vote") int vote) throws Exception
Puts a new rating on the given document- Specified by:
rateDocument
in interfaceDocumentService
- Parameters:
docId
- identifier of the documentvote
- the vote- Returns:
- the rating
- Throws:
Exception
- error in the server application
-
getRatings
@GET @Path("/getRatings") public WSRating[] getRatings(@QueryParam("docId") long docId) throws Exception
Gets all the ratings of the given document- Specified by:
getRatings
in interfaceDocumentService
- Parameters:
docId
- identifier of the document- Returns:
- the ratings
- Throws:
Exception
- error in the server application
-
move
@PUT @Path("/move") public void move(@QueryParam("docId") long docId, @QueryParam("folderId") long folderId) throws Exception
Description copied from interface:DocumentService
Moves an existing document with the given identifier- Specified by:
move
in interfaceDocumentService
- Parameters:
docId
- The document idfolderId
- Identifier of the new document's folder- Throws:
Exception
- error in the server application
-
createThumbnail
@PUT @Path("/createThumbnail") public void createThumbnail(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion) throws Exception
Description copied from interface:DocumentService
Creates the thumbail of the given document; if the thumbnail was already created, nothing will happen- Specified by:
createThumbnail
in interfaceDocumentService
- Parameters:
docId
- The document idfileVersion
- The specific file version(it can be empty)- Throws:
Exception
- error in the server application
-
createPdf
@PUT @Path("/createPdf") public void createPdf(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion) throws Exception
Description copied from interface:DocumentService
Creates the PDF conversion of the given document; if the PDF conversion was already created, nothing will happen- Specified by:
createPdf
in interfaceDocumentService
- Parameters:
docId
- The document idfileVersion
- The specific file version(it can be empty)- Throws:
Exception
- error in the server application
-
promoteVersion
@GET @Path("/promoteVersion") public void promoteVersion(@QueryParam("docId") long docId, @QueryParam("version") 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 interfaceDocumentService
- Parameters:
docId
- the document to be updatedversion
- the version- Throws:
Exception
- if an error occurs, this exception is thrown
-
-