Retrieving a managed resource with RESTful Interface

In this recipe, we will retrieve the managed resource for the portal sitemap using RESTful services within a browser.

Getting ready

The following is required for this recipe:

  • GateIn-3.2.0.Final

How to do it...

To retrieve the sitemap managed resource:

  1. Start the server.
  2. Open a browser and go to http://localhost:8080/rest/private/managed-components?format=xml

    Note

    http://localhost:8080/rest/private/managed-components is equivalent to http://localhost:8080/rest/private/managed-components?op=read-resource

  3. The browser will display a page that looks similar to the following screenshot:
    How to do it...
  4. Navigate to the URL specified in the href link under the mop child by copying it into the address bar of the browser.
  5. Navigate to the URL specified in the href link under the portalsites child by copying it into the address bar of the browser.
  6. Navigate to the URL specified in the href link under the classic child by copying it into the address bar of the browser.
  7. Navigate to the URL specified in the href link under the pages child by copying it into the address bar of the browser.
  8. Navigate to the URL specified in the href link under the sitemap child by copying it into the address bar of the browser.
  9. The browser will display a page that looks similar to the following screenshot:
    How to do it...

How it works...

Step 2 requests the top-most level of the REST entry point for managed components. The format=xml URL parameter simply asks the data to be returned in an XML format instead of the default, JSON, which makes it easier to visualize the structured content within a browser. Step 2 is also the equivalent to Step 8 in Deploying the CLI to GateIn.

Steps 4, 5, 6, 7, and 8 navigate through a child node of each managed resource in turn, until the sitemap is reached. It is also possible to directly navigate to a managed resource through REST, if the resource hierarchy is known.

See also

  • The Deploying the CLI to GateIn recipe
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.12.166.131