Integrating : Integrating with applications that support REST XML APIs : Synchronizing artifacts from the application to Focal Point®
  
Synchronizing artifacts from the application to Focal Point®
After getting the artifacts to Focal Point®, if some of the artifacts are modified in the original application, you can synchronize those artifacts back in Focal Point®.
Before you begin
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.
Procedure
1 In Focal Point®, open the workspace.
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 Command Configuration section, complete these steps:
In REST Client Connector Name, type a name to identify the connection.
In REST Request Method, select the SYNCHRONIZE method. For information about each method, see Supported methods to manage resources.
In Friends List, select the application that you added as a friend to Focal Point®.
In Choose URL Attribute to REST Artifact, click Select, and select an attribute. This attribute should contain the URL to the artifact of the application.
5 In the REST Client Template XML Configuration section, complete these steps:
In REST Application URL to Template XML, type the URL that points to an artifact in the application, and click Get Template XML. The XML loads in the REST Application Template XML text box. If you do not want XML to load dynamically, you can copy the XML in the REST Application Template XML text box.
The XML in the REST application template XML text box must support posting of new data to the application. If the XML does not support that, you have to manually create or edit the XML.
In Root XPath to REST Application Artifact, click Select and select the root XPath for attributes. The Select button is enabled only if the XML in REST Application Template XML is correct.
6 In the Attribute Mapping section, click Add, and map the Focal Point® attributes with the attributes of the application. For example, if the value of the Severity attribute is modified in the application, map the Severity attribute of Focal Point® with the dc:severity attribute of the application. After the SYNCHRONIZE operation, the Severity attribute in Focal Point® is modified with the new value.
7 In the Configuration section, complete these steps:
In REST Application supported Date Format, type the date format that the external application uses.
In Focal Point® Separator, type a separator value such as a comma (,) or a semicolon (;). The MultiChoice and the LinkedList items will be separated by the specified separator.
8 To map the IDs of the attributes between Focal Point® and the application, in the Request Parameter Table section, click Add and select a Focal Point® attribute. Type the ID of the application in the Key column. For example, if you select Project ID for Focal Point®, in the Key column, type the ID that is used for the project ID in the application.
9 In the Request Header Mapping section, click Add, and then type the name and value of the header. For the Rational solution for Collaborative Lifecycle Management applications, the headers are:
 
Header name
Header value
Accept
application/rdf+xml
Content-Type
application/rdf+xml
OSLC-Core-Version
2.0
10 Click Save.
11 In the Display menu, click the view the elements of which you want to synchronize with the other application.
12 To synchronize all the artifacts available in the view, from the view toolbar click the dropdown list and select the SYNCHRONIZE view command and then click the Go icon Go.
13 To synchronize one artifact, from the artifact toolbar select the SYNCHRONIZE view command and then click the Go icon Go.
See also
Creating batch view commands
Scheduling the REST client view command
Integrating with applications that support REST XML APIs