Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Rest API Terminology

Alex Eng edited this page Dec 21, 2016 · 2 revisions

IMPORTANT: Zanata's wiki has moved to https://github.com/zanata/zanata-platform/wiki

New link: https://github.com/zanata/zanata-platform/wiki/Rest-API-Terminology


Translations of REST api terms

These DTOs all provide different views of a document (HDocument in our domain model):

XML element Java DTO type Description
resource-meta ResourceMeta document: metadata and Extensions only, no content
resource Resource source document: source text (TextFlows), metadata and Extensions
translations TranslationsResource translated document: target text (TextFlowTargets) and Extensions, but not the source document metadata

Supported extensions for PUT/POST operations: Resource/ResourceMeta: PoHeader TranslationsResource: PoTargetHeader nothing??: PoTargetHeaders -> PoTargetHeaderEntry nothing??: PotEntryHeader TextFlowTarget: SimpleComment

NB: There doesn't appear to be any live, referenced code which processes the extensions PotEntryHeader, PoTargetHeaders, PoTargetHeaderEntry. And SimpleComments are only handled for TextFlowTarget, not TextFlow.

URL Patterns

Hierarchy

/p/sample-project/v/1.0/r/mydoc.txt (document level)
/p/sample-project/v/1.0/r/mydoc.txt/metadata (document level)
/p/sample-project/v/1.0/r/mydoc.txt/translations/en-AU (document level)
/p/sample-project/v/1.0/r/mydoc.txt/translations/en-AU/metadata (document level)

Resource Level

/r/ GET returns list of resources
/r/ POST adds resource
/r/{id} GET returns specific resource
/r/{id}/meta GET returns specific resource
/r/{id}/translations

Future Extensions

Access to individual TextFlows and Translations

Source: /p/sample-project/v/1.0/r/mydoc.txt/content/tf1

Translations: /p/sample-project/v/1.0/r/mydoc.txt/content/tf1/translations/en-AU

Clone this wiki locally