This repository has been archived by the owner on Nov 9, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
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
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.
/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)
/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
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