Jump to content
  • Creating a Domain in JasperReports Server using REST v1


    bnee_1
    • Features: Domains, JasperReports Server, Web Services Version: v5.5 Product: JasperReports® Server

    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

    screenshot1(2).png.5b367105ae3daf5f58cc8e3af3209523.png

     

     

     

     

     

     

     

     

     

     

    [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.

    screenshot2.png.a952a069c2314fd4e5cd9c4951833ff3.png

     

     

     

     

     

    [screenshot 2a]

     

    screenshot3.png.16efecaf533f3377bd3b157e14df1059.png

     

     

     

     

     

     

     

    [screenshot 2b]

     

     

    screenshot4.png.b3d63280fa93c5567ee1c9cddba02353.png

     

     

     

     

     

     

     

     

     

    [screenshot 2c]

     

    screenshot5.png.099951432f338daa2beb916f8dae1b8e.png[screenshot 2d]

     

    Under the Auth tab, select BASIC, then enter the username and password.

    screenshot6.png.cf3faa805b065dee566c965d3719e979.png

     

     

     

     

     

     

     

     

     

     

    [screenshot 3]

     

    Send the request, and the HTTP Response should show: Status: HTTP/1.1 201 Created.

    supermartdomain_domain_security.

    schema.xml

    supermart_domain.properties

    resourcedescriptor.xml


    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...