19 September 2016
The goal of this tutorial is to understand File Update Operation of Configurable RESTful Web Services.
This operation can be used for checking in file(s) to an object in ENOVIA. In this tutorial the use case is to set up an integration that performs this operation.
In brief, the flow in this tutorial is the following:
Client sends a HTTP request containing necessary information.
Web service corresponding to the request is located.
The IdLocator is executed. The IdLocator is responsible for locating the object that client is interested in. This is done by using parameters associated in the request.
The Operation is executed. The operation is the actual job to perform. For example, check in files to an object.
The response is sent back to the client.
On the TIF server we need to create a XML configuration file for the web service that allows to check in files into an object.
<Rest>
<DisplayName>File Check-in</DisplayName> (1)
<ServiceName>filecheckin</ServiceName> (2)
<IdLocator type="tnr">
<AllowWildcards>true</AllowWildcards>
</IdLocator> (3)
<Update type="file" (4)
format="generic" (5)
existStrategy="newversion" (6)
useCDM="true" /> (7)
</Rest>
1 | User friendly name of the service that is visible in Admin UI. |
2 | Unique name of the service that is used by clients to access the service. |
3 | Defines how to find the object the client is interested in. In this tutorial we are going to use TNR IdLocator that uses type, name and revision to identify the object. |
4 | This web service provides an update operation of type file. |
5 | File is in "generic" format. |
6 | Exist strategy is "newversion" meaning that a new version is created if file already exist. |
7 | Common Document Model or CDM must be enabled as we use "newversion" exist strategy. |
In this example "Postman" tool (available as a Chrome plugin) is used for testing.
We use PUT method and pass TNR ("CAD Drawing", A-0000100", "A") as query parameters for the id locator.
Two files "Example1.docx" and "Example2.txt" are added to the body of the request.
The response status "200/OK" indicates the files were checked in successfully.