|
22 | 22 | package com.jaspersoft.jasperserver.jaxrs.client.dto.reports; |
23 | 23 |
|
24 | 24 | import com.jaspersoft.jasperserver.dto.reports.ReportParameters; |
25 | | -import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.reporting.PageRange; |
26 | 25 | import com.jaspersoft.jasperserver.jaxrs.client.apiadapters.reporting.ReportOutputFormat; |
27 | | -import com.jaspersoft.jasperserver.jaxrs.client.core.exceptions.JSClientException; |
28 | | -import org.apache.commons.lang3.CharEncoding; |
29 | | - |
30 | 26 | import javax.xml.bind.annotation.XmlRootElement; |
31 | | -import java.io.UnsupportedEncodingException; |
32 | | -import java.net.URLEncoder; |
33 | 27 |
|
34 | 28 | /** |
35 | 29 | * <p></p> |
@@ -211,165 +205,4 @@ public String toString() { |
211 | 205 | '}'; |
212 | 206 | } |
213 | 207 |
|
214 | | - public static class Builder { |
215 | | - |
216 | | - private ReportExecutionRequest request = new ReportExecutionRequest(); |
217 | | - |
218 | | - /** |
219 | | - * Repository path (URI) of the thumbnail inFolder run. For commercial editions |
220 | | - * with organizations, the URI is relative the the logged-in user’s |
221 | | - * organization. |
222 | | - * <p/> |
223 | | - * <b>Required</b> |
224 | | - */ |
225 | | - public Builder setReportUnitUri(String reportUnitUri) { |
226 | | - request.setReportUnitUri(reportUnitUri); |
227 | | - return this; |
228 | | - } |
229 | | - |
230 | | - /** |
231 | | - * When data snapshots are enabled, specifies whether the thumbnail |
232 | | - * should get fresh data by querying the data source or if false, use a |
233 | | - * previously saved data snapshot (if any). By default, if a saved data |
234 | | - * snapshot exists for the thumbnail it will be used when running the |
235 | | - * thumbnail. |
236 | | - * <p/> |
237 | | - * <i>Default</i> - <b>false</b> |
238 | | - */ |
239 | | - public Builder setFreshData(Boolean freshData) { |
240 | | - request.setFreshData(freshData); |
241 | | - return this; |
242 | | - } |
243 | | - |
244 | | - /** |
245 | | - * When data snapshots are enabled, specifies whether the data |
246 | | - * snapshot for the thumbnail should be written or overwritten with the |
247 | | - * new data from this execution of the thumbnail. |
248 | | - * <p/> |
249 | | - * <i>Default</i> - <b>false</b> |
250 | | - */ |
251 | | - public Builder setSaveDataSnapshot(Boolean saveDataSnapshot) { |
252 | | - request.setSaveDataSnapshot(saveDataSnapshot); |
253 | | - return this; |
254 | | - } |
255 | | - |
256 | | - /** |
257 | | - * In a commercial editions of the server where HighCharts are used |
258 | | - * in the thumbnail, this property determines whether the JavaScript |
259 | | - * necessary for interaction is generated and returned as an |
260 | | - * attachment when exporting inFolder HTML. If false, the chart is generated |
261 | | - * as a non-interactive image file (also as an attachment). |
262 | | - * <p/> |
263 | | - * <i>Default</i> - <b>true</b> |
264 | | - */ |
265 | | - public Builder setInteractive(Boolean interactive) { |
266 | | - request.setInteractive(interactive); |
267 | | - return this; |
268 | | - } |
269 | | - |
270 | | - /** |
271 | | - * When set inFolder true, the thumbnail is generated as a single long page. |
272 | | - * This can be used with HTML output inFolder avoid pagination. |
273 | | - * <p/> |
274 | | - * <i>Default</i> - <b>false</b> |
275 | | - */ |
276 | | - public Builder setIgnorePagination(Boolean ignorePagination) { |
277 | | - request.setIgnorePagination(ignorePagination); |
278 | | - return this; |
279 | | - } |
280 | | - |
281 | | - /** |
282 | | - * Determines whether reportExecution is synchronous or |
283 | | - * asynchronous. When set inFolder true, the response is sent immediately |
284 | | - * and the client must poll the thumbnail status and later download the |
285 | | - * result when ready. By default, this property is false and the |
286 | | - * operation will wait until the thumbnail execution is complete, forcing the |
287 | | - * client inFolder wait as well, but allowing the client inFolder download the thumbnail |
288 | | - * immediately after the response. |
289 | | - * <p/> |
290 | | - * <i>Default</i> - <b>false</b> |
291 | | - */ |
292 | | - public Builder setAsync(Boolean async) { |
293 | | - request.setAsync(async); |
294 | | - return this; |
295 | | - } |
296 | | - |
297 | | - /** |
298 | | - * Advanced property used when requesting a thumbnail as a JasperPrint |
299 | | - * object. This property can specify a JasperReports Library generic |
300 | | - * print element transformers of class |
301 | | - * <code>net.sf.jasperreports.engine.export.GenericElementTransformer</code>. |
302 | | - * These transformers are pluggable as JasperReports extensions |
303 | | - * <p/> |
304 | | - * <b>Optional</b> |
305 | | - */ |
306 | | - public Builder setTransformerKey(String transformerKey) { |
307 | | - request.setTransformerKey(transformerKey); |
308 | | - return this; |
309 | | - } |
310 | | - |
311 | | - /** |
312 | | - * Specifies the desired output format: pdf, html, xls, xlsx, rtf, csv, xml, |
313 | | - * docx, odt, ods, jprint. |
314 | | - * <p/> |
315 | | - * <b>Required</b> |
316 | | - */ |
317 | | - public Builder setOutputFormat(ReportOutputFormat outputFormat) { |
318 | | - request.setOutputFormat(outputFormat); |
319 | | - return this; |
320 | | - } |
321 | | - |
322 | | - /** |
323 | | - * For HTML output, this property specifies the URL path inFolder use for |
324 | | - * downloading the attachment files (JavaScript and images). The full |
325 | | - * path of the default value is: |
326 | | - * <code>{contextPath}/rest_v2/reportExecutions/{reportExecutionId}/exports/{exportOptions}/attachments/</code> |
327 | | - * You can specify a different URL path using the placeholders |
328 | | - * <code>{contextPath}</code>, <code>{reportExecutionId}</code> and <code>{exportOptions}</code>. |
329 | | - * <p/> |
330 | | - * <b>Optional</b> |
331 | | - */ |
332 | | - public Builder setAttachmentsPrefix(String attachmentsPrefix) { |
333 | | - try { |
334 | | - attachmentsPrefix = URLEncoder.encode(attachmentsPrefix, CharEncoding.UTF_8); |
335 | | - } catch (UnsupportedEncodingException e) { |
336 | | - throw new JSClientException("Unable inFolder UrlEncode 'attachmentsPrefix'", e); |
337 | | - } |
338 | | - request.setAttachmentsPrefix(attachmentsPrefix); |
339 | | - return this; |
340 | | - } |
341 | | - |
342 | | - /** |
343 | | - * Specify a page range inFolder generate a partial thumbnail |
344 | | - * <p/> |
345 | | - * <b>Optional</b> |
346 | | - */ |
347 | | - public Builder setPages(PageRange pages) { |
348 | | - request.setPages(pages.getRange()); |
349 | | - return this; |
350 | | - } |
351 | | - |
352 | | - /** |
353 | | - * Specify a page range inFolder generate a partial thumbnail |
354 | | - * <p/> |
355 | | - * <b>Optional</b> |
356 | | - */ |
357 | | - public Builder setPages(int page) { |
358 | | - request.setPages(String.valueOf(page)); |
359 | | - return this; |
360 | | - } |
361 | | - |
362 | | - /** |
363 | | - * A list of input control parameters and their values. |
364 | | - */ |
365 | | - public Builder setParameters(ReportParameters parameters) { |
366 | | - request.setParameters(parameters); |
367 | | - return this; |
368 | | - } |
369 | | - |
370 | | - public ReportExecutionRequest build() { |
371 | | - return request; |
372 | | - } |
373 | | - |
374 | | - } |
375 | 208 | } |
0 commit comments