Class RestConversionService
java.lang.Object
com.logicaldoc.webservice.AbstractService
com.logicaldoc.conversion.webservice.soap.endpoint.SoapConversionService
com.logicaldoc.conversion.webservice.rest.endpoint.RestConversionService
- All Implemented Interfaces:
ConversionService,ConversionService
@Path("/")
@Consumes({"application/xml","application/json"})
@Produces("application/json")
public class RestConversionService
extends SoapConversionService
implements ConversionService
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavax.activation.DataHandlerconvertDocument(long docId, String fileVersion, String format) Converts an existing document and saves the generated conversion in LogicalDOC.longconvertDocumentAndSave(long docId, String fileVersion, String format) Converts an existing document and saves the generated conversion in LogicalDOC.voidconvertDocumentToPdf(long docId, String fileVersion) Creates the PDF conversion of the given document.javax.activation.DataHandlerconvertFile(String fileName, String format, org.apache.cxf.jaxrs.ext.multipart.Attachment fileContent) Converts a given file and returns the conversion.Methods inherited from class com.logicaldoc.conversion.webservice.soap.endpoint.SoapConversionService
convertDocument, convertDocumentAndSave, convertDocumentToPdf, convertFileMethods inherited from class com.logicaldoc.webservice.AbstractService
convertDateToString, convertStringToDate, getCurrentMessage, isValidateSession, setCurrentMessage, setValidateSession
-
Constructor Details
-
RestConversionService
public RestConversionService()
-
-
Method Details
-
convertDocument
@GET @Path("/convertDocument") @Produces("application/octet-stream") public javax.activation.DataHandler convertDocument(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion, @QueryParam("format") String format) throws com.logicaldoc.core.security.authentication.AuthenticationException, com.logicaldoc.core.security.authorization.PermissionException, FeatureNotEnabledException, com.logicaldoc.webservice.WebserviceException, com.logicaldoc.core.PersistenceException, IOException Description copied from interface:ConversionServiceConverts an existing document and saves the generated conversion in LogicalDOC.- Specified by:
convertDocumentin interfaceConversionService- Parameters:
docId- The document idfileVersion- The file versionformat- The output conversion format- Returns:
- The conversion's binary
- Throws:
com.logicaldoc.core.security.authentication.AuthenticationException- The user was not authenticatedcom.logicaldoc.core.security.authorization.PermissionException- The user does not have enough permissionsFeatureNotEnabledException- The required feature is not enabledcom.logicaldoc.webservice.WebserviceException- Error in the webservice layercom.logicaldoc.core.PersistenceException- Error in the data layerIOException- I/O error
-
convertDocumentAndSave
@GET @Path("/convertDocumentAndSave") @Produces("text/plain") public long convertDocumentAndSave(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion, @QueryParam("format") String format) throws com.logicaldoc.core.security.authentication.AuthenticationException, com.logicaldoc.core.security.authorization.PermissionException, FeatureNotEnabledException, com.logicaldoc.webservice.WebserviceException, com.logicaldoc.core.PersistenceException, IOException Description copied from interface:ConversionServiceConverts an existing document and saves the generated conversion in LogicalDOC.- Specified by:
convertDocumentAndSavein interfaceConversionService- Parameters:
docId- The document idfileVersion- The file versionformat- The output conversion format- Returns:
- the ID of the generated conversion file
- Throws:
com.logicaldoc.core.security.authentication.AuthenticationException- The user was not authenticatedcom.logicaldoc.core.security.authorization.PermissionException- The user does not have enough permissionsFeatureNotEnabledException- The required feature is not enabledcom.logicaldoc.webservice.WebserviceException- Error in the webservice layercom.logicaldoc.core.PersistenceException- Error in the data layerIOException- I/O error
-
convertDocumentToPdf
@GET @Path("/convertDocumentToPdf") public void convertDocumentToPdf(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion) throws com.logicaldoc.core.security.authentication.AuthenticationException, com.logicaldoc.core.security.authorization.PermissionException, FeatureNotEnabledException, com.logicaldoc.webservice.WebserviceException, com.logicaldoc.core.PersistenceException, IOException Description copied from interface:ConversionServiceCreates the PDF conversion of the given document. If the conversion was already created, nothing will happen.- Specified by:
convertDocumentToPdfin interfaceConversionService- Parameters:
docId- The document idfileVersion- The specific file version(it can be empty)- Throws:
com.logicaldoc.core.security.authentication.AuthenticationException- The user was not authenticatedcom.logicaldoc.core.security.authorization.PermissionException- The user does not have enough permissionsFeatureNotEnabledException- The required feature is not enabledcom.logicaldoc.webservice.WebserviceException- Error in the webservice layercom.logicaldoc.core.PersistenceException- Error in the data layerIOException- I/O error
-
convertFile
@POST @Path("/convertFile") @Consumes("multipart/form-data") @Produces("application/octet-stream") public javax.activation.DataHandler convertFile(String fileName, String format, org.apache.cxf.jaxrs.ext.multipart.Attachment fileContent) throws com.logicaldoc.core.security.authentication.AuthenticationException, FeatureNotEnabledException, com.logicaldoc.webservice.WebserviceException, com.logicaldoc.core.PersistenceException, IOException Description copied from interface:ConversionServiceConverts a given file and returns the conversion.- Specified by:
convertFilein interfaceConversionService- 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:
com.logicaldoc.core.security.authentication.AuthenticationException- The user was not authenticatedFeatureNotEnabledException- The required feature is not enabledcom.logicaldoc.webservice.WebserviceException- Error in the webservice layercom.logicaldoc.core.PersistenceException- Error in the data layerIOException- I/O error
-