Package com.cloudofficeprint.Output
Class Output
- java.lang.Object
-
- com.cloudofficeprint.Output.Output
-
public class Output extends java.lang.Object
Class representing the output configuration of a request. The class only has the Output() constructor, you need to use the set functions to populate this object.
-
-
Constructor Summary
Constructors Constructor Description Output(java.lang.String filetype, java.lang.String encoding, java.lang.String converter, CloudAccessToken token, java.lang.String serverDirectory, PDFOptions pdfOptions, CsvOptions csvOptions)
Constructor to create a populated output object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CloudAccessToken
getAccessToken()
java.lang.String
getConverter()
CsvOptions
getCsvOptions()
java.lang.String
getEncoding()
com.google.gson.JsonObject
getJSON()
PDFOptions
getPDFOptions()
java.lang.String
getServerDirectory()
java.lang.String
getType()
void
setAccessToken(CloudAccessToken accessToken)
Sets the access token object of the output, if you want to store the output on a cloud based service.void
setConverter(java.lang.String converter)
void
setCsvOptions(CsvOptions csvOptions)
void
setEncoding(java.lang.String encoding)
void
setPDFOptions(PDFOptions PDFOptions)
void
setServerDirectory(java.lang.String serverDirectory)
void
setType(java.lang.String type)
Sets the file type (extension) of the output to type.
-
-
-
Constructor Detail
-
Output
public Output(java.lang.String filetype, java.lang.String encoding, java.lang.String converter, CloudAccessToken token, java.lang.String serverDirectory, PDFOptions pdfOptions, CsvOptions csvOptions)
Constructor to create a populated output object. If you don't need to instantiate some variables, use their default value as argument.- Parameters:
filetype
- This states what kind of output file type is required. It can be either the same as template_type ("docx", "pptx", "xlsx", "html", "md"), "pdf" or any other output file supported by libreoffice/openoffice. Special output type: "onepagepdf", this will cause the output to be converted to pdf and all the pages will be merged into one single page. Default : null (the type of the template will be used).encoding
- This states what kind of output encoding is wished for the output file. It must be either "raw" (bytes) or "base64". Default : raw.converter
- This states which software the server should use to convert the output to pdf. The Cloud Office Print server uses LibreOffice. If you are running the on premise version then the available values are : "officetopdf" (only when server runs on Windows ) or "libreoffice" (Windows, Linux, OSX) "libreoffice-standalone" or any other custom defined converters in the aop_config.json file. Default : libreoffice.token
- If you want to store the output on a cloud based service, a specific CloudAccessToken object needs to be specified. Default : null.serverDirectory
- If you want to save the output on the server a directory on the server needs to be specified. Default : null.pdfOptions
- Optional PDF options. They are described in the PDFOptions class. Default : null.
-
-
Method Detail
-
getEncoding
public java.lang.String getEncoding()
- Returns:
- the encoding to use for the output.
-
getType
public java.lang.String getType()
- Returns:
- The file type as extension to use for the output.
-
getAccessToken
public CloudAccessToken getAccessToken()
- Returns:
- the accesstoken object of this output.
-
getConverter
public java.lang.String getConverter()
- Returns:
- the PDF converter for this output.
-
getPDFOptions
public PDFOptions getPDFOptions()
- Returns:
- the PDFOptions object for this output.
-
getServerDirectory
public java.lang.String getServerDirectory()
- Returns:
- the directory path on server for the output.
-
setEncoding
public void setEncoding(java.lang.String encoding)
- Parameters:
encoding
- Encoding of the output. It must be either "raw" or "base64".
-
setType
public void setType(java.lang.String type)
Sets the file type (extension) of the output to type.- Parameters:
type
- extension for the output
-
setAccessToken
public void setAccessToken(CloudAccessToken accessToken)
Sets the access token object of the output, if you want to store the output on a cloud based service.- Parameters:
accessToken
- for the output
-
setConverter
public void setConverter(java.lang.String converter)
- Parameters:
converter
- Sets which software the server should use to convert the output to pdf. The Cloud Office Print server uses LibreOffice. If you are running the on premise version then the available values are : "officetopdf" (only when server runs on Windows ) or "libreoffice" (Windows, Linux, OSX) "libreoffice-standalone" or any other custom defined converters in the aop_config.json file.
-
setServerDirectory
public void setServerDirectory(java.lang.String serverDirectory)
- Parameters:
serverDirectory
- Directory path on server, if you want to save the output on the server.
-
setPDFOptions
public void setPDFOptions(PDFOptions PDFOptions)
- Parameters:
PDFOptions
- PDF options object of this output. All the options are described in the PDFOptions class.
-
getCsvOptions
public CsvOptions getCsvOptions()
- Returns:
- the CsvOptions object for this output.
-
setCsvOptions
public void setCsvOptions(CsvOptions csvOptions)
- Parameters:
csvOptions
- Csv options object of this output. All the options are described in the CsvOptions class.
-
getJSON
public com.google.gson.JsonObject getJSON()
- Returns:
- JSONObject with the tags for the output for the Cloud Office Print server.
-
-