Package org.imixs.workflow.jaxrs
Class ReportRestService
java.lang.Object
org.imixs.workflow.jaxrs.ReportRestService
@Path("/report")
@Produces({"application/xml","application/json","text/html","text/xml"})
public class ReportRestService
extends Object
The WorkflowService Handler supports methods to process different kind of
request URIs
- Author:
- rsoika
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
deleteReport
(String name) Deletes a report by name or by its $uniqueID or name.void
fopTranformation
(String xmlSource, String xslSource, String aEncoding, OutputStream output) This method dos a apache FOP transformation using the FopFactoryjakarta.ws.rs.core.Response
getCustomResult
(String reportName, int pageSize, int pageIndex, String sortBy, boolean sortReverse, String encoding, jakarta.ws.rs.core.UriInfo uriInfo, jakarta.servlet.http.HttpServletResponse servlerResponse) Returns a Datatable corresponding to the report definition and report content type.jakarta.ws.rs.core.Response
getExcecuteReport
(String reportName, int pageSize, int pageIndex, String sortBy, boolean sortReverse, String encoding, jakarta.ws.rs.core.UriInfo uriInfo) Executes a single report defined by name or uniqueid The output depends on the requested media format Since 2.1.2: the ReportService also supports FOP Transformation.jakarta.ws.rs.core.StreamingOutput
getHTMLResult
(String reportName, int pageSize, int pageIndex, String sortBy, boolean sortReverse, String encoding, jakarta.ws.rs.core.UriInfo uriInfo, jakarta.servlet.http.HttpServletResponse servlerResponse) Returns an HTML Stream with a HTML Datatable corresponding to the report query.getJSONResult
(String name, int pageSize, int pageIndex, String sortBy, boolean sortReverse, String encoding, jakarta.ws.rs.core.UriInfo uriInfo, jakarta.servlet.http.HttpServletResponse servlerResponse) Returns a JSON stream from a report If a attribute list is defined in the report only the corresponding properties will be returend in the xml stream.jakarta.ws.rs.core.Response
getPdfReport
(String reportName, int pageSize, int pageIndex, String sortBy, boolean sortReverse, String encoding, jakarta.ws.rs.core.UriInfo uriInfo) helper method for .pdf file extentiongetReportDefinition
(String name) Returns a single report by name or by uniqueidgetXMLResult
(String reportName, int pageSize, int pageIndex, String sortBy, boolean sortReverse, String encoding, jakarta.ws.rs.core.UriInfo uriInfo, jakarta.servlet.http.HttpServletResponse servlerResponse) Returns a xml stream from a report If a attribute list is defined in the report only the corresponding properties will be returend in the xml stream.void
postReport
(XMLDocument reportCol) void
putReport
(XMLDocument reportCol) This method updates or creates a Report object provided in a XMLItemCollection object
-
Constructor Details
-
ReportRestService
public ReportRestService()
-
-
Method Details
-
getHelpHTML
@GET @Produces("text/html") public jakarta.ws.rs.core.StreamingOutput getHelpHTML() -
getReportsDefinitions
-
getReportDefinition
@GET @Path("/definitions/{name}") public XMLDataCollection getReportDefinition(@PathParam("name") String name) Returns a single report by name or by uniqueid- Parameters:
name
- reportname or uniqueid of report- Returns:
-
getExcecuteReport
@GET @Path("/{name}.imixs-report") public jakarta.ws.rs.core.Response getExcecuteReport(@PathParam("name") String reportName, @DefaultValue("1000") @QueryParam("pageSize") int pageSize, @DefaultValue("0") @QueryParam("pageIndex") int pageIndex, @QueryParam("sortBy") String sortBy, @QueryParam("sortReverse") boolean sortReverse, @DefaultValue("") @QueryParam("encoding") String encoding, @Context jakarta.ws.rs.core.UriInfo uriInfo) Executes a single report defined by name or uniqueid The output depends on the requested media format Since 2.1.2: the ReportService also supports FOP Transformation. If the ContentType is 'application/pdf' the method will call fopTransofrmation instat of xslTransformation. The FOP API need to be provided by the main application.- Parameters:
name
- reportname of the report to be executed- Returns:
- a collection of entiteis
-
getPdfReport
@GET @Path("/{name}.pdf") public jakarta.ws.rs.core.Response getPdfReport(@PathParam("name") String reportName, @DefaultValue("1000") @QueryParam("pageSize") int pageSize, @DefaultValue("0") @QueryParam("pageIndex") int pageIndex, @QueryParam("sortBy") String sortBy, @QueryParam("sortReverse") boolean sortReverse, @DefaultValue("") @QueryParam("encoding") String encoding, @Context jakarta.ws.rs.core.UriInfo uriInfo) helper method for .pdf file extention- Parameters:
name
- reportname of the report to be executed- Returns:
- a collection of entiteis
-
getHTMLResult
@GET @Produces({"text/html","application/xhtml+xml"}) @Path("/{name}.html") public DocumentTable getHTMLResult(@PathParam("name") String reportName, @DefaultValue("1000") @QueryParam("pageSize") int pageSize, @DefaultValue("0") @QueryParam("pageIndex") int pageIndex, @QueryParam("sortBy") String sortBy, @QueryParam("sortReverse") boolean sortReverse, @DefaultValue("") @QueryParam("encoding") String encoding, @Context jakarta.ws.rs.core.UriInfo uriInfo, @Context jakarta.servlet.http.HttpServletResponse servlerResponse) Returns an HTML Stream with a HTML Datatable corresponding to the report query.- Parameters:
name
-start
-count
-- Returns:
-
getCustomResult
@GET @Path("/custom/{name}.{s:.*}") public jakarta.ws.rs.core.Response getCustomResult(@PathParam("name") String reportName, @DefaultValue("1000") @QueryParam("pageSize") int pageSize, @DefaultValue("0") @QueryParam("pageIndex") int pageIndex, @QueryParam("sortBy") String sortBy, @QueryParam("sortReverse") boolean sortReverse, @DefaultValue("") @QueryParam("encoding") String encoding, @Context jakarta.ws.rs.core.UriInfo uriInfo, @Context jakarta.servlet.http.HttpServletResponse servlerResponse) Returns a Datatable corresponding to the report definition and report content type.The path annotation allows any file extension.
- Parameters:
name
-start
-count
-- Returns:
-
getXMLResult
@GET @Produces({"application/xml","text/xml"}) @Path("/{name}.xml") public XMLDataCollection getXMLResult(@PathParam("name") String reportName, @DefaultValue("100") @QueryParam("pageSize") int pageSize, @DefaultValue("0") @QueryParam("pageIndex") int pageIndex, @QueryParam("sortBy") String sortBy, @QueryParam("sortReverse") boolean sortReverse, @DefaultValue("") @QueryParam("encoding") String encoding, @Context jakarta.ws.rs.core.UriInfo uriInfo, @Context jakarta.servlet.http.HttpServletResponse servlerResponse) throws Exception Returns a xml stream from a report If a attribute list is defined in the report only the corresponding properties will be returend in the xml stream. If the query param 'items' is provided the attribute list in the report will be ignored.- Parameters:
name
- reportname of the report to be executedstart
-count
-- Returns:
- Throws:
Exception
-
getJSONResult
@GET @Produces("application/json") @Path("/{name}.json") public XMLDataCollection getJSONResult(@PathParam("name") String name, @DefaultValue("-1") @QueryParam("pageSize") int pageSize, @DefaultValue("0") @QueryParam("pageIndex") int pageIndex, @QueryParam("sortBy") String sortBy, @QueryParam("sortReverse") boolean sortReverse, @DefaultValue("") @QueryParam("encoding") String encoding, @Context jakarta.ws.rs.core.UriInfo uriInfo, @Context jakarta.servlet.http.HttpServletResponse servlerResponse) throws Exception Returns a JSON stream from a report If a attribute list is defined in the report only the corresponding properties will be returend in the xml stream.- Parameters:
name
- reportname of the report to be executedstart
-count
-- Returns:
- Throws:
Exception
-
deleteReport
Deletes a report by name or by its $uniqueID or name.- Parameters:
name
- of report or uniqueid
-
putReport
@PUT @Consumes({"application/xml","application/octet-stream","text/plain","text/xml"}) public void putReport(XMLDocument reportCol) This method updates or creates a Report object provided in a XMLItemCollection object- Parameters:
reportCol
- - report data
-
postReport
@POST @Consumes({"application/xml","application/octet-stream","text/plain","text/xml"}) public void postReport(XMLDocument reportCol) -
fopTranformation
public void fopTranformation(String xmlSource, String xslSource, String aEncoding, OutputStream output) throws Exception This method dos a apache FOP transformation using the FopFactory- Parameters:
xmlSource
-xslSource
-aEncoding
-outputWriter
-- Throws:
Exception
-