Interface ConversionService
-
- All Known Implementing Classes:
RestConversionService
@Consumes({"application/xml","application/json"}) @Produces("application/json") public interface ConversionService
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description javax.activation.DataHandler
convertDocument(long docId, String fileVersion, String format)
Converts an existing document and saves the generated conversion in LogicalDOC.long
convertDocumentAndSave(long docId, String fileVersion, String format)
Converts an existing document and saves the generated conversion in LogicalDOC.void
convertDocumentToPdf(long docId, String fileVersion)
Creates the PDF conversion of the given document.javax.activation.DataHandler
convertFile(String fileName, String format, org.apache.cxf.jaxrs.ext.multipart.Attachment fileContent)
Converts a given file and returns the conversion.
-
-
-
Method Detail
-
convertDocument
@GET @Path("/convertDocument") @Produces("application/octet-stream") javax.activation.DataHandler convertDocument(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion, @QueryParam("format") String format) throws Exception
Converts an existing document and saves the generated conversion in LogicalDOC.- Parameters:
docId
- The document idfileVersion
- The file versionformat
- The output conversion format- Returns:
- The conversion's binary
- Throws:
Exception
- error in the service
-
convertDocumentAndSave
@GET @Path("/convertDocumentAndSave") @Produces("text/plain") long convertDocumentAndSave(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion, @QueryParam("format") String format) throws Exception
Converts an existing document and saves the generated conversion in LogicalDOC.- Parameters:
docId
- The document idfileVersion
- The file versionformat
- The output conversion format- Returns:
- the ID of the generated conversion file
- Throws:
Exception
- error in the service
-
convertDocumentToPdf
@GET @Path("/convertDocumentToPdf") void convertDocumentToPdf(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion) throws Exception
Creates the PDF conversion of the given document. If the conversion was already created, nothing will happen.- Parameters:
docId
- The document idfileVersion
- The specific file version(it can be empty)- Throws:
Exception
- error in the service
-
convertFile
@POST @Path("/convertFile") @Consumes("multipart/form-data") @Produces("application/octet-stream") javax.activation.DataHandler convertFile(String fileName, String format, org.apache.cxf.jaxrs.ext.multipart.Attachment fileContent) throws Exception
Converts a given file and returns the conversion.- Parameters:
fileName
- name of the original fileformat
- The output format (ag: pdf, ods, doc)fileContent
- The content of the original file- Returns:
- the raw content of the converted file
- Throws:
Exception
- error in the service
-
-