Worked example: Using returned URIs to navigate to resources (Web Interface REST service)
This worked example demonstrates how you can use URIs that are returned from REST service requests to navigate from the Modeler server, to a model, item.
In this example, we use the URIs that are returned from REST service requests to navigate to a top-level Package in a model. We then find out whether the Package is a profile Package.
In the address bar of our web browser, we type the URI of the Web Interface website.
https://localhost:57850
The Web Interface website opens the log in page for the website. We log in to the website using a valid user name and password.
In the address bar of our web browser, we type the URI for the REST service that is provided by the Web Interface website.
https://localhost:57850/ModelerService
The ModelerService request returns the following XML that includes URIs for operation requests that can be made against the REST service.
We copy the URI for the servers request to the address bar of the web browser.
https://localhost:57850/ModelerService/Servers
The Servers request returns URIs for the servers that can be accessed through the REST service. We copy the URI for the Server123@MODELER server instance to the address bar of the web browser.
The Server123@MODELER request returns URIs for operation requests that can be made against the Server123@MODELER server instance. We copy the URI for the Repositories request to the address bar of the web browser.
The Repositories request returns URIs for the repositories that can be accessed through the REST service. We copy the URI for the Repository123 repository to the address bar of the web browser.
The Repository123 request returns URIs for operation requests that can be made against the Database123 repository. We copy the URI for the Models request to the address bar of the web browser.
The Models request returns URIs for the models that can be accessed through the REST service. We copy the URI for the Model123 model to the address bar of the web browser.
The Model123 request returns URIs for operation requests that can be made against the Model123 model. We copy the URI for the ModelVersions request to the address bar of the web browser.
The ModelVersions request returns URIs for the model versions that can be accessed through the REST service. We copy the URI for the 0 model version to the address bar of the web browser.
The 0 request returns URIs for operation requests that can be made against version 0 of the Model123 model. We copy the URI for the ChildItems request to the address bar of the web browser.
The ChildItems request returns URIs for the model items that are scoped directly to the model.
We want to find top-level Packages that are set up as profile packages, that is, Packages that have the Profile check box selected on their Property Pages. When the Profile check box is selected, the 'Is Profile Package' property of the Package is set to TRUE.
The returned XML contains an <ModelItem> section for each returned item. For example, this is the <ModelItem> section for Package1.
By searching for the text 'Package' between the <ResourceType> and </ResourceType> tags, we can find the <ModelItem> sections for Packages. We copy the URI for Package1 to address bar of the web browser.
The item request returns URIs for operation requests that can be made against the 090983e8-6792-4264-9582-11f608765549 item, that is, Package1. We copy the URI for the PropertyDescriptors request to the address bar of the web browser.
The PropretyDescriptors request returns URIs for the properties of the item. We copy the URI for the 'Is Profile Package' property to the address bar of the web browser. Note that the property name is percent encoded, so each space character is replaced with %20.