-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathICarboneServices.java
More file actions
88 lines (73 loc) · 3.18 KB
/
ICarboneServices.java
File metadata and controls
88 lines (73 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
package io.carbone;
import java.io.IOException;
public interface ICarboneServices {
/**
* Upload template to Carbone
* @param templateFile file's content as byte[]
* @return the template ID
* @throws CarboneException contain CarboneResponse format with API error code and error messages
*/
String addTemplate(byte[] templateFile) throws CarboneException;
/**
* Upload template to Carbone
* @param templatePath path of the template as String
* @return the template ID
* @throws CarboneException contain CarboneResponse format with API error code and error messages
* @throws IOException
*/
String addTemplate(String templatePath) throws CarboneException, IOException;
/**
* Delete uploaded template
* @param templateId id returned by addTemplate() method
* @throws CarboneException contain CarboneResponse format with API error code and error messages
*/
boolean deleteTemplate(String templateId) throws CarboneException;
/**
* Download rendered report
* @param templateId id returned by renderReport()
* @return report content in byte[]
* @throws CarboneException contain CarboneResponse format with API error code and error messages
*/
byte[] getTemplate(String templateId) throws CarboneException;
/**
* Render report
* @param json Json object with data set to replace in template
* @param templateId id returned by addTemplate() method
* @return id of rendered report
* @throws CarboneException contain CarboneResponse format with API error code and error messages
*/
String renderReport(String json, String templateId) throws CarboneException;
/**
* Download rendered report
* @param renderId id returned by renderReport()
* @return report content in CarboneDocument
* @throws CarboneException contain CarboneResponse format with API error code and error messages
*/
CarboneDocument getReport(String renderId) throws CarboneException;
/**
* Give the status
* @return report the status of the API as a JSON: {"success":true,"code":200,"message":"OK","version":"4.22.8"}
* @throws CarboneException contain CarboneResponse format with API error code and error messages
*/
String getStatus() throws CarboneException;
/**
* render report
* @param Json JSON dataset injected into the template, to generate the document
* @param fileOrTemplateID id returned by addTemplate() method or the id of document of studio or a local path
* @return report content in CarboneDocument
* @throws CarboneException contain CarboneResponse format with API error code and error messages
*/
CarboneDocument render(String Json, String fileOrTemplateID) throws CarboneException;
/**
* precalculates the template id
* @param path local path to the template file
* @return give a precalculates templateId
*/
String generateTemplateId(String path);
/**
* precalculates the template id
* @param fileBytes byte content of the template file
* @return give a precalculates templateId
*/
String generateTemplateId(byte[] fileBytes);
}