Integrating : Integrating with applications that support REST XML APIs : Retrieving resources from another application to Focal Point®
  
Retrieving resources from another application to Focal Point®
If an application supports RESTful APIs, you can connect to that application to retrieve artifacts and create elements out of them.
Before you begin
Ensure that the application from where Focal Point® is retrieving the artifacts has exposed its APIs through a RESTful interface.
Add the application as a Friends(Outbound) in Focal Point®. For more information, see Connecting to the Rational solution for Collaborative Lifecycle Management application server.
Make sure that the content of the application that supports REST APIs is in the XML format.
Be aware of the XML structure of the application artifacts and have the rights to access them.
About this task
If any of the application attribute IDs exist in Focal Point®, the GET method updates the artifacts associated with that attribute IDs. For example, if, for the first time, you map the IDs and use the GET method, the method retrieves the artifacts from the application. If the artifacts are updated in that application and the next time you map the same IDs and use the GET method, the method updates your existing artifacts in Focal Point®.
Procedure
1 In Focal Point®, open the workspace where you want to retrieve the artifacts.
2 Click the Settings icon Settings icon and then, from the Configure group, click REST client view command. Click Add view command.
3 Select a view where you want to add the view command.
4 In REST Client Connector Name, type a name for identifying the connection.
5 In REST Request Method, select the GET method. For information about the usage of each method, see Supported methods to manage resources.
6 In Friends List, select the application that you added as a friend to Focal Point®.
7 In REST Application Request URL, type the URL that has artifacts of the application.
Tip Open a web browser and type the URL that you used when adding the REST application as a friend. A list of high-level artifacts is displayed. Find the artifact that you want to retrieve and copy its URL in REST Application Request URL.
8 Click Connect.
9 If the connection is successful, click Select to select the root XPath of the artifact. You can restrict your search to an artifact by selecting an appropriate XPath. If the connection was not successful, you will not be able to select the root XPath.
10 To ensure that the artifacts are not duplicated, in the Identification Mapping section, click Add and map the attribute ID of Focal Point® and another application. You can map only one attribute.
11 In the Attributes Mapping section, click Add to map the application attributes with the attributes of Focal Point®. The mapped attributes are displayed against the element fetched from the application. Ensure that the attributes are editable.
The attribute that you selected in the Identification Mapping section is not displayed in the Attributes Mapping section because that attribute is internally mapped and is available for the fetched elements.
If there are custom attributes in the application from where you are retrieving artifacts and you require a specific item, you can edit the XPath to include that item. For example, if there are multiple custom attributes such as Status, Priority, and Cost, you can add [@attribute:name='Status'] after the customer attribute entry to retrieve the Status attribute.
rrm:collaboration/rrm:attributes/attribute:objectType/attribute:customAttribute[@attribute:name='Status']/@attribute:literalName
12 In REST Application supported Date Format, type the date format that the external application uses.
13 In Focal Point® Separator, type a separator value such as , (comma) or ; (semi‑colon); this will be used to separate the MultiChoice and the LinkedList items.
14 In the Request Header Mapping section, click Add, and then type the name and value of the header.
For the Rational solution for CLM applications the headers are:
 
Header name
Header value
Accept
application/rdf+xml
Content-Type
application/rdf+xml
OSLC-Core-Version
2.0
15 Click Save.
Results
To check whether the artifacts are fetched from the application, navigate to the Display menu and click the view. Select the connector name from the dropdown list. The elements are fetched and loaded in the view.
See also
Adding an application that supports REST
Supported attributes for applications supporting RESTful APIs
Supported methods to manage resources
Integrating with applications that support REST XML APIs