Page tree

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 27 Next »

Description

The database-side storage of terms is extended by the "TermCollection",  which makes it possible, for example, to group terms that belong to a specifc client. This way an end client can be assigned to one or more TermCollections.


If the API changes in an incompatible manner this is listed explicitly in the "important release notes" section of each releases changelog.

Get termcollections list

RequestGET /editor/termcollection
Response
{
    "rows": [
        {
            "id": "1",
            "entityVersion": "4",
            "langResUuid": "6860f07a-e09f-4822-b82d-30d1961665aa",
            "name": "Some termcollection",
            "color": "19737d",
            "resourceId": "editor_Services_TermCollection",
            "serviceType": "editor_Services_TermCollection",
            "serviceName": "TermCollection",
            "specificData": "{\"fileName\":\"terminology.tbx\",\"status\":\"available\",\"termEntry\":2727,\"term\":15813,\"attribute\":47439}",
            "timestamp": "2025-05-29 09:59:02",
            "resourceType": "termcollection",
            "writeSource": "0",
            "specificId": null
        },
        {
            "id": "2",
            "entityVersion": "3",
            "langResUuid": "c6c275e1-fd72-47f2-9f8d-47ce01f0510e",
            "name": "Some another termcollection",
            "color": "19737d",
            "resourceId": "editor_Services_TermCollection",
            "serviceType": "editor_Services_TermCollection",
            "serviceName": "TermCollection",
            "specificData": "{\"fileName\":\"160.tbx\",\"status\":\"available\",\"termEntry\":1656,\"term\":13218,\"attribute\":48330}",
            "timestamp": "2025-05-29 10:10:10",
            "resourceType": "termcollection",
            "writeSource": "0",
            "specificId": null
        },
    ],
    "total": 2
}

Get an info for a certain termcollection

Request

GET /editor/termcollection/ID 

URI ParamsID Required. Id of a termcollection
Response
{
    "rows": {
        "id": "2",
        "entityVersion": "3",
        "langResUuid": "c6c275e1-fd72-47f2-9f8d-47ce01f0510e",
        "name": "Some another termcollection",
        "color": "19737d",
        "resourceId": "editor_Services_TermCollection",
        "serviceType": "editor_Services_TermCollection",
        "serviceName": "TermCollection",
        "specificData": "{\"fileName\":\"160.tbx\",\"status\":\"available\",\"termEntry\":1656,\"term\":13218,\"attribute\":48330}",
        "timestamp": "2025-05-29 10:10:10",
        "resourceType": "termcollection",
        "writeSource": "0",
        "specificId": null
    }
}

Create a termcollection

Request

POST /editor/termcollection

Paramsname Required. Human-readable name for the termcollection, up to 1024 characters.

customerIds Required. Comma-separated list of customers ids for this termcollection to be associated with.
Response
{
    "rows": {
        "id": 13,
        "entityVersion": "0",
        "langResUuid": "4df34ca9-5e2f-42ad-a31e-946990bb135a",
        "name": "Some new termcollection",
        "color": "19737d",
        "resourceId": "editor_Services_TermCollection",
        "serviceType": "editor_Services_TermCollection",
        "serviceName": "TermCollection",
        "specificData": null,
        "timestamp": "2025-06-17 12:18:31",
        "resourceType": "termcollection",
        "writeSource": "0",
        "specificId": null
    }
}

Delete termcollection

Request

DELETE /editor/termcollection/ID 

URI ParamsID Required. Id of a termcollection to be deleted

Note: Deleting term collection will remove all terms, terms attributes and term entry attributes assigned to this term collection

Response
{
    "success": true
}

Import terms to the TermCollection via tbx-file

Request

POST /editor/termcollection/import

ParamscollectionId Required. Id of a TermCollection where terms should be imported to.

customerIds Optional. Comma-separated list of customers ids for this termcollection to be associated with.

mergeTerms Optional. Boolean value to merge imported terms with terms already existing (if any) in the target termcollection. By default - false. The merge process is complex and completely described here.

importSource Optional. If given, should be either 'filesystem' or 'crossApi'

deleteTermsLastTouchedOlderThan Optional. If given, should be a date in YYYY-MM-DD format, so that any terms last updated before that date - will be deleted from the target TermCollection. 'Last updated' date for a term is initially set up at current date on import and then refreshed each time term is renamed and/or any of it's attributes created/updated/deleted.

'Last updated' date is maintained internally by translate5, and is not directly shown in TermPortal UI. However, it is replicated to 'Updated by'-field in 'Term attributes'-panel in TermPortal UI each time any further change happended to the term itself or it's attributes after initial import.


deleteTermsOlderThanCurrentImport Optional. Boolean value to delete all terms from the target TermCollection, that are were last updated before the the start of the current import.

deleteProposalsLastTouchedOlderThan Optional. If given, should be a date in YYYY-MM-DD format, so that any terms last updated before that date and having Process status = Unprocessed - will be deleted from the target TermCollection. Also, any attributes (of any remaining terms) initially imported from tbx and updated since then but before the given date - will be reverted to back to their original values. At the same time, any attributes that were not initially imported from tbx, i.e. created afterwards but before the given date - will be deleted from the any remaining terms in the target TermCollection.
Response
{
    "success": true
}


POST request parameters example(json):

{

"data":{

          "collectionId": 1, 

          "customerId":1000,

          "mergeTerms":true,

          "tbxUpload": ,

          "deleteTermsLastTouchedOlderThan": "2018-05-01",

          "deleteTermsOlderThanCurrentImport": true,

          "deleteProposalsLastTouchedOlderThan": 2018-05-01",

          "deleteProposalsOlderThanCurrentImport" : true

          }
}


tbxUpload

tbx file/files (or a zip file containing TBX files) uploaded as multipart/form-data

deleteProposalsLastTouchedOlderThan (date format Y-m-d)

Delete all proposals in a listed termCollections, that have a creation date older than this configs value.

deleteProposalsOlderThanCurrentImport (boolean)

Delete all proposals in a listed termCollections, that have a creation date older than the start of the current import. 


Important: with the import call, one or multiple tbx files must be provided. Importing additional files in term collection is also available via the general language resource import route:  /editor/languageresourceinstance/[ID]/import. More info can be found here.



There can be additional possibility to import terms to the term collection. 

  1. Import tbx files via language resources panel with term collection as resource
  2. Using the term import plugin ( see more at Plug-In TermImport: TermImport )


  • No labels