The resource service supports several HTTP methods to view, download, create, and modify resources in the repository.
GET is used to show the information about a specific resource. Getting a resource can serve several purposes:
• | In the case of JasperReports, also known as report units, this service returns the structure of the JasperReport, including resourceDescriptors for any linked resources. |
• | For resources that contain files, specifying the fileData=true argument downloads the file content. |
• | Specifying a query-based input control with arguments for running the query returns the dynamic values for the control. |
A new service is also available to interact with report options. See The v2/options Service. |
Method | URL | ||
GET | http://<host>:<port>/jasperserver[-pro]/rest/resource/path/to/resource/?<arguments> | ||
Argument | Type/Value | Description | |
fileData? | Boolean | For resources that contain a file, set this argument to true to download the file. When not specified, this argument is false by default and the method returns the description of the resource. | |
IC_GET_QUERY_DATA? | String | Used to get the items to fill an input control which subtend a query resource. The value of this parameter must be the URI of the data source to use to execute the query. Set the null string to use the default data source. | |
P_<param name>? | String | If the IC_GET_QUERY_DATA is specified, one or more parameters can be specified to be used in the query: Use the "P_" prefix for single values. Use the "PL_" prefix for list of values. | |
PL_<param name>? | String | ||
Return Value on Success | Typical Return Values on Failure | ||
200 OK – The body is either: XML giving the resourceDescriptors that make up the resource, including nested descriptors. The native content of the specified file. | 404 Not Found – When the specified resource URI is not found in the repository |
The GET method returns the structure and definition of resources in the repository, and using that information can be used to download any files attached to the resources. Resources are defined through resourceDescriptor tags in XML.
The following example shows the resource descriptor of a folder:
The following example shows the resource descriptor of a data source. The various resourceProperty tags define the properties of the data source, specific to the JNDI type:
The following example shows the resource descriptor of a query resource, with properties for the query string and query language:
Recommended Comments
There are no comments to display.