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 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.

Basically, there There are the following use cases for this type of requests: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
    Single-update
    1. Non-unique attribute 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. Unique attribute 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
      2. Picklist attributes (e.g. of type processStatus, administrativeStatus, termType, grammaticalGender and others)
        1. attrId
        2. value
      3. Plaintext attributes 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.
    2. Batch-confirm draft attributes, so attributes won't be drafts anymore. Such usage is involved when user presses Save-button in batch-edit window
      1. attrId/attrId
      2. dropId
      3. draft0/draft0
     Batch-update
    1. Non-unique attribute at it's level.
    2. Unique attribute at it's level


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"
}


...