Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Update attribute
RequestPUT /editor/attribute
ParamsattrId Required if draft0-param is not given. Comma separated IDs of attributes, whose values should be updated

dropId Optional Comma-separated list of IDs of draft-attributes, that should be deleted with preliminary usage of their values to spoof values of existing attributes identified by corresponding values from attrId-param

draft0 Required if attrId-param is not given. Comma-separated IDs of attributes, that currently are drafts, but should be un-drafted. Here can be IDs of attributes of types that can be non-unique within their level. Also, there can be IDs of attributes of types that should be unique within their levels, but that currently are unique, e.g. there were no existing attributes found of those types.

dataIndex=(value|target) Required if ALL attrs identified by attrId-param are of type xGraphic or externalCrossReference


value Required if it's a picklist-attribute

target Optional Must be valid termEntryTbxId (for termEntry-level attributes) or termTbxId (for term-level attributes)

termLang,mainLang Optional RFC5646-codes for preferred languages to return terms found by target-param. 

figure Required if ALL attrs identified by attrId-param are of type figure.

There are the following use cases each with set of request params involved:

  1. Value of some certain single attribute needs to be updated
    1. It's an attribute of a type that can be non-unique at it's level (e.g. of type xGraphic, externalCrossReference, crossReference and figure)
      1. xGraphic, externalCrossReference
        1. attrId
        2. dataIndex
        3. value
      2. crossReference
        1. attrId
        2. target
        3. termLang
        4. mainLang
      3. figure
        1. attrId
        2. figure
    2. It's an attribute of a type that should be unique at it's level (all other attribute types, mean other than mentioned in point 1.a)
      1. It's a picklist attribute (e.g. of type processStatus, administrativeStatus, termType, grammaticalGender and others)
        1. attrId
        2. value
      2. It's a plaintext attribute (e.g. of type definition, source, context, geographicalUsage, subjectField and others)
        1. attrId
        2. value
  2. Multiple attrs can be affected
    1. Batch-update draft attributes (but attributes will be remain drafts) - request params are same as described in point 1. Such usage is involved when user updates any attributes within batch-edit window. All attributes identified by comma-separated Ids given by attrId-param should be of same type, otherwise error response will be returned.
    2. Batch-confirm draft attributes, so attributes won't be drafts anymore. Such usage is involved when user press Save-button in batch-edit window
      1. attrId/attrId
      2. dropId
      3. draft0/draft0


Code Block
languagejs
titleResponse: figure
collapsetrue
{
    "src": "/editor/plugins/termimage/TermPortal/tc_82/4a70516e-1ae0-4a02-96bc-139a18ff51e3.jpg",
    "updated": "Pavel Perminov, 10.05.2022 13:03:59"
}


Code Block
languagejs
titleResponse: externalCrossReference and xGraphic
collapsetrue
{
    "updated": "Pavel Perminov, 10.05.2022 12:58:16",
    "isValidUrl": 1
}


Code Block
languagejs
titleResponse: crossReference
collapsetrue
{
    "updated": "Pavel Perminov, 10.05.2022 12:51:19",
    "isValidTbx": false,
    "id": "2020436",
    "collectionId": "82",
    "termEntryId": "16609",
    "language": "en",
    "termId": "222615",
    "termTbxId": "ida2526eba-c92e-4887-9137-df5838ac8f73",
    "dataTypeId": "78",
    "type": "crossReference",
    "value": null,
    "target": "asd",
    "isCreatedLocally": "1",
    "createdBy": null,
    "createdAt": "2022-04-18 21:41:05",
    "updatedBy": null,
    "updatedAt": "2022-05-10 13:51:19",
    "termEntryGuid": "08c9df82-8656-417c-888b-42f95c409b82",
    "langSetGuid": null,
    "termGuid": "791aecf8-753f-43d3-8207-c7351b659914",
    "guid": "8149f91f-98e9-4fee-a0dc-bd40cc7e5853",
    "elementName": "ref",
    "attrLang": "en",
    "isDescripGrp": "0",
    "isDraft": "0",
    "createdBy_back": "17",
    "updatedBy_back": "17"
}


Code Block
languagejs
titleResponse
collapsetrue
{
    "success": true,
    "updated": "Pavel Perminov, 10.05.2022 12:49:02",
    "status": {
        "status": "admittedTerm",
        "others": []
    },
    "icons": {
        "222615": {
            "status": "admittedTerm"
        }
    }
}



Delete attribute
RequestDELETE /editor/attribute
ParamsattrId Required ID of attribute to be deleted. Can be also be comma-separated list of attribute IDs


Code Block
languagejs
titleResponse
collapsetrue
{
    "updated": "Pavel Perminov, 09.05.2022 10:24:17"
}


...