File tree Expand file tree Collapse file tree 4 files changed +63
-0
lines changed
client/src/main/java/com/jaspersoft/android/sdk/client Expand file tree Collapse file tree 4 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -784,6 +784,32 @@ public URI getReportStatusCheckURI(String executionId) {
784
784
return new UriTemplate (fullUri ).expand (executionId );
785
785
}
786
786
787
+ /**
788
+ * Sends request for the current running export for the status check.
789
+ *
790
+ * @param executionId Identifies current id of running report.
791
+ * @param exportOutput Identifier which refers to current requested export.
792
+ * @return response which expose current export status.
793
+ */
794
+ public ReportStatusResponse runExportStatusCheck (String executionId , String exportOutput ) {
795
+ return restTemplate .getForObject (getExportStatusCheckURI (executionId , exportOutput ), ReportStatusResponse .class );
796
+ }
797
+
798
+ /**
799
+ * Generates link for requesting report execution status.
800
+ *
801
+ * @param executionId Identifies current id of running report.
802
+ * @param exportOutput Identifier which refers to current requested export.
803
+ * @return "{server url}/rest_v2/reportExecutions/{executionId}/exports/{exportOutput}/status"
804
+ */
805
+ public URI getExportStatusCheckURI (String executionId , String exportOutput ) {
806
+ String outputResourceUri = "/{executionId}/exports/{exportOutput}/status" ;
807
+ String fullUri = jsServerProfile .getServerUrl () + REST_SERVICES_V2_URI + REST_REPORT_EXECUTIONS + outputResourceUri ;
808
+
809
+ UriTemplate uriTemplate = new UriTemplate (fullUri );
810
+ return uriTemplate .expand (executionId , exportOutput );
811
+ }
812
+
787
813
/**
788
814
* Saves resource ouput in file.
789
815
*
Original file line number Diff line number Diff line change 1
1
package com .jaspersoft .android .sdk .client .oxm .report ;
2
2
3
3
import org .simpleframework .xml .Element ;
4
+ import org .simpleframework .xml .ElementList ;
4
5
import org .simpleframework .xml .Root ;
5
6
import org .simpleframework .xml .Serializer ;
6
7
import org .simpleframework .xml .core .Persister ;
7
8
import org .springframework .web .client .HttpStatusCodeException ;
8
9
9
10
import java .io .StringWriter ;
11
+ import java .util .List ;
10
12
11
13
/**
12
14
* @author Tom Koptel
@@ -19,6 +21,9 @@ public class ErrorDescriptor {
19
21
@ Element (required = false )
20
22
private String message ;
21
23
24
+ @ ElementList (name = "parameters" , entry = "parameter" , required = false )
25
+ private List <String > parameters ;
26
+
22
27
public static ErrorDescriptor valueOf (HttpStatusCodeException exception ) {
23
28
String response = exception .getResponseBodyAsString ();
24
29
Serializer serializer = new Persister ();
@@ -46,4 +51,13 @@ public String getMessage() {
46
51
public void setMessage (String message ) {
47
52
this .message = message ;
48
53
}
54
+
55
+ public List <String > getParameters () {
56
+ return parameters ;
57
+ }
58
+
59
+ public void setParameters (List <String > parameters ) {
60
+ this .parameters = parameters ;
61
+ }
62
+
49
63
}
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ public class ExportExecution {
50
50
@ ElementList (empty =false , entry ="attachment" , required =false )
51
51
private List <ReportOutputResource > attachments ;
52
52
53
+ @ Element (required =false )
54
+ private ErrorDescriptor errorDescriptor ;
55
+
53
56
54
57
public String getId () {
55
58
return id ;
@@ -83,4 +86,12 @@ public void setAttachments(List<ReportOutputResource> attachments) {
83
86
this .attachments = attachments ;
84
87
}
85
88
89
+ public ErrorDescriptor getErrorDescriptor () {
90
+ return errorDescriptor ;
91
+ }
92
+
93
+ public void setErrorDescriptor (ErrorDescriptor errorDescriptor ) {
94
+ this .errorDescriptor = errorDescriptor ;
95
+ }
96
+
86
97
}
Original file line number Diff line number Diff line change @@ -57,6 +57,9 @@ public class ReportExecutionResponse {
57
57
@ Element (required =false )
58
58
private int totalPages ;
59
59
60
+ @ Element (required =false )
61
+ ErrorDescriptor errorDescriptor ;
62
+
60
63
61
64
public String getRequestId () {
62
65
return requestId ;
@@ -109,4 +112,13 @@ public void setTotalPages(int totalPages) {
109
112
public ReportStatus getReportStatus () {
110
113
return ReportStatus .valueOf (status );
111
114
}
115
+
116
+ public ErrorDescriptor getErrorDescriptor () {
117
+ return errorDescriptor ;
118
+ }
119
+
120
+ public void setErrorDescriptor (ErrorDescriptor errorDescriptor ) {
121
+ this .errorDescriptor = errorDescriptor ;
122
+ }
123
+
112
124
}
You can’t perform that action at this time.
0 commit comments