Skip to content

Manage List Items


Data Type

You can manage list items by specifying list-item as <dataType> in the SEAL OP-CLI call:

opcli list-item <command> <option>

Display the Options and Parameters

By specifying the --help option, you get the available options and parameters for the list-item data type:

opcli list-item --help

Create a List Item

With the create command, you create a list item:

opcli list-item create <listId> --href <href> [--index <index>] [--metadata <metadata>]
  • <listId>: ID of the list to which the new list item is to be added; mandatory

  • --href <href>: Reference of the document to be linked to the list item; mandatory

  • --index <index>: List position of the new list item; <index> starts at 0; default: The item is appended to the list.

  • --metadata <metadata>: Metadata in JSON syntax, for example, '{"status":"new", "origin":"system"}'

Example - create a list item at the end of the list referring to last.pdf

opcli list-item create b4522d9e-8503-4562-bb20-ae2d8454402e --href last.pdf

Example - create a list item at the second position of the list referring to test.pdf with the status metadata

opcli list-item create b4522d9e-8503-4562-bb20-ae2d8454402e --index 1 --href test.pdf --metadata '{"status":"new"}'

Get the Metadata of a List Item

With the get command, you get the metadata of a list item. The metadata are output as JSON object on STDOUT.

opcli list-item get <listId> --index <index>
  • <listId>: ID of the list with the list item; mandatory

    Hint - uuid

    The list ID is the value of the uuid setting and output when the list is created, for example, "uuid":"cf5bfb0d-7861-499e-ad29-704f3ba1943c".

  • --index <index>: List position of the list item; <index> starts at 0; mandatory

Example - get the metadata of the of the second item of the list with the ID cf5bfb0d-7861-499e-ad29-704f3ba1943c

opcli list-item get cf5bfb0d-7861-499e-ad29-704f3ba1943c --index 1

Replace or Delete the Metadata of a List Item

With the replace-meta command, you replace the metadata of a list item. The existent metadata are deleted and the specified metadata are set. For deleting the existent metadata, specify an empty JSON object as metadata.

opcli list-item replace-meta <listId> --index <index> --file <file>|--metadata <metadata>
  • <listId>: ID of the list with the list item; mandatory

  • --file <file>: Path and name of a file containing the new metadata as JSON object

  • --index <index>: List position of the list item; <index> starts at 0; mandatory

  • --metadata <metadata>: New metadata in JSON syntax, for example, '{"status":"obsolete"}'

Example - replace the metadata of the second list item by the metadata specified as option

opcli list-item replace-meta cf5bfb0d-7861-499e-ad29-704f3ba1943c --index 1 --metadata '{"status":"obsolete"}'

Example - replace the metadata of the second list item by the metadata specified in the metadata.json file

opcli list-item replace-meta cf5bfb0d-7861-499e-ad29-704f3ba1943c --index 1 --file metadata.json

Example - delete the metadata of the second list item

opcli list-item replace-meta cf5bfb0d-7861-499e-ad29-704f3ba1943c --index 1 --metadata '{}'

Back to top