Creating a domain is a multipart request. Not every REST client handles multiple attachments equally, so the following steps are for RESTClient 3.2.1.
A domain will have a schema xml file and a data source at minimum. It may also have a security file and any number of resource bundle properties files.
These should all be specified in the resource decriptor used in the REST request.
The below steps use the sample Supermart Domain (/public/Samples/Domains/supermartDomain) that comes with JasperReports Server, and it uses the sample Foodmart JNDI data source (/public/Samples/Data_Sources/FoodmartDataSourceJNDI). The schema xml file, security file, and bundle properties file belong to that existing domain, and the resource descriptor was modified to create a domain with a new name (createdSupermartDomain) in the repository directly under the Public folder.
Start the RESTClient 3.2.1 and type in the URL: http://127.0.0.1:8080/jasperserver-pro/rest/resource
Under the Method tab, select HTTP Method: PUT
[screenshot 1]
Under the Body tab, click the String or File buttons to attach each file to the request (see screenshots 2a - 2d below):
String, text/plain; charset=UTF-8, ResourceDescriptor, <location_in_file_system>
File, application/xml; charset=UTF-8, /public/createdSupermartDomain_files/schema.xml, <location_in_file_system>
FIle, text/plain; charset=UTF-8, /public/createdSupermartDomain_files/supermartDomain_domain_security, <location_in_file_system>
File, text/plain; charset=UTF-8, /public/createdSupermartDomain_files/supermart_domain.properties, <location_in_file_system>
*Notice that the path for the files must have "_files" appended to the name of the Domain.
[screenshot 2a]
[screenshot 2b]
[screenshot 2c]
Under the Auth tab, select BASIC, then enter the username and password.
[screenshot 3]
Send the request, and the HTTP Response should show: Status: HTTP/1.1 201 Created.
Recommended Comments
There are no comments to display.