Skip to content

Commit 4ceb08d

Browse files
committed
Updated docs
1 parent bee6984 commit 4ceb08d

6 files changed

Lines changed: 126 additions & 2 deletions

File tree

WebContent/docs/remotetm.pdf

7.48 KB
Binary file not shown.

docs/remotetm.ditamap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@
6868
<topicref href="rest/closeMemory.dita"/>
6969
<topicref href="rest/closeMemories.dita"/>
7070
<topicref href="rest/storeTu.dita"/>
71+
<topicref href="rest/getTu.dita"/>
7172
<topicref href="rest/removeTu.dita"/>
7273
<topicref href="rest/commit.dita"/>
7374
<topicref href="rest/searchTranslations.dita"/>

docs/rest/closeMemories.dita

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,16 @@
3535
<codeblock>{
3636
"command": "closeMemories"
3737
}</codeblock>
38-
<p>RemoteTM closes all open memories.</p>
38+
<p>RemoteTM responds with a JSON object.</p>
39+
<p>On success, field 'status' is set to 'OK'. Example:</p>
40+
<codeblock translate="no">{
41+
"status": "OK"
42+
}</codeblock>
43+
<p>On error, field 'status' is set to 'Error' and field 'reason' contains the error cause.
44+
Example:</p>
45+
<codeblock translate="no">{
46+
"status": "Error",
47+
"reason": "Access denied"
48+
}</codeblock>
3949
</body>
4050
</topic>

docs/rest/getTu.dita

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
3+
<topic id="getTu">
4+
<title>Get Translation Unit</title>
5+
<body>
6+
<p>End point: <tt>[RemoteTM URL]/memories</tt><tt> </tt></p>
7+
<p>Send a <tt>POST</tt> request with these headers:</p>
8+
<simpletable>
9+
<sthead>
10+
<stentry>Header</stentry>
11+
<stentry>Value</stentry>
12+
</sthead>
13+
<strow>
14+
<stentry><tt>Session</tt> </stentry>
15+
<stentry>The ticket received from <xref href="authorizationRequest.dita">Authorization Request</xref></stentry>
16+
</strow>
17+
<strow>
18+
<stentry><tt>Content-Type</tt></stentry>
19+
<stentry><tt>application/json</tt></stentry>
20+
</strow>
21+
</simpletable>
22+
<p>Include these parameters in a JSON body:</p>
23+
<simpletable>
24+
<sthead>
25+
<stentry>Parameter</stentry>
26+
<stentry>Value</stentry>
27+
</sthead>
28+
<strow>
29+
<stentry><tt>command</tt></stentry>
30+
<stentry><tt>getTu</tt></stentry>
31+
</strow>
32+
<strow>
33+
<stentry><tt>memory</tt> </stentry>
34+
<stentry>ID of the memory to query</stentry>
35+
</strow>
36+
<strow>
37+
<stentry><tt>tuid</tt> </stentry>
38+
<stentry>ID of the translation unit to retrieve</stentry>
39+
</strow>
40+
</simpletable>
41+
<p>Example:</p>
42+
<codeblock>{
43+
"command": "getTu",
44+
"memory": "1617963861912",
45+
"tuid": "1668707130-10-12-12"
46+
}</codeblock>
47+
<p>RemoteTM responds with a JSON object.</p>
48+
<p>On success, field 'status' is set to 'OK' and requested translation unit is included in
49+
'tu' field, escaped for JSON format. Example:</p>
50+
<codeblock translate="no">{
51+
"tu": "&lt;tu tuid=\"1668707130-10-12-12\"> ... &lt;/tu>",
52+
"status": "OK"
53+
}</codeblock>
54+
<p>On error, field 'status' is set to 'Error' and field 'reason' contains the error cause.
55+
Example:</p>
56+
<codeblock translate="no">{
57+
"status": "Error",
58+
"reason": "TU does not exist"
59+
}</codeblock>
60+
</body>
61+
</topic>

docs/rest/memoriesManagement.dita

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<li><xref href="closeMemory.dita">Close Memory</xref></li>
3131
<li><xref href="closeMemories.dita">Close Memories</xref></li>
3232
<li><xref href="storeTu.dita">Store Translation Unit</xref></li>
33+
<li><xref href="getTu.dita">Get Translation Unit</xref></li>
3334
<li><xref href="removeTu.dita">Remove Translation Unit</xref></li>
3435
<li><xref href="commit.dita">Commit</xref></li>
3536
<li><xref href="searchTranslations.dita">Search Translations</xref></li>

docs/rest/storeTu.dita

Lines changed: 52 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,57 @@
33
<topic id="storeTu">
44
<title>Store Translation Unit</title>
55
<body>
6-
<p></p>
6+
<p>End point: <tt>[RemoteTM URL]/memories</tt><tt> </tt></p>
7+
<p>Send a <tt>POST</tt> request with these headers:</p>
8+
<simpletable>
9+
<sthead>
10+
<stentry>Header</stentry>
11+
<stentry>Value</stentry>
12+
</sthead>
13+
<strow>
14+
<stentry><tt>Session</tt> </stentry>
15+
<stentry>The ticket received from <xref href="authorizationRequest.dita">Authorization Request</xref></stentry>
16+
</strow>
17+
<strow>
18+
<stentry><tt>Content-Type</tt></stentry>
19+
<stentry><tt>application/json</tt></stentry>
20+
</strow>
21+
</simpletable>
22+
<p>Include these parameters in a JSON body:</p>
23+
<simpletable>
24+
<sthead>
25+
<stentry>Parameter</stentry>
26+
<stentry>Value</stentry>
27+
</sthead>
28+
<strow>
29+
<stentry><tt>command</tt></stentry>
30+
<stentry><tt>storeTu</tt></stentry>
31+
</strow>
32+
<strow>
33+
<stentry><tt>memory</tt> </stentry>
34+
<stentry>ID of the memory to update</stentry>
35+
</strow>
36+
<strow>
37+
<stentry><tt>tu</tt> </stentry>
38+
<stentry>Translation unit to import as TMX &lt;tu> element</stentry>
39+
</strow>
40+
</simpletable>
41+
<p>Example:</p>
42+
<codeblock>{
43+
"command": "storeTu",
44+
"memory": "1617963861912",
45+
"tu": "&lt;tu tuid=\"1668707130-10-12-12\"> ... &lt;/tu>"
46+
}</codeblock>
47+
<p>RemoteTM responds with a JSON object.</p>
48+
<p>On success, field 'status' is set to 'OK'. Example:</p>
49+
<codeblock translate="no">{
50+
"status": "OK"
51+
}</codeblock>
52+
<p>On error, field 'status' is set to 'Error' and field 'reason' contains the error cause.
53+
Example:</p>
54+
<codeblock translate="no">{
55+
"status": "Error",
56+
"reason": "Memory is closed"
57+
}</codeblock>
758
</body>
859
</topic>

0 commit comments

Comments
 (0)