{oitem:type:ids:format:delim}

Description

Renders fields and aliases of objects from the AA object store (the object_ database tables), the way the item command renders rows of a slice. The first parameter is the object type; the only type the engine registers is datovka (Czech Data Box / Datova schranka messages), so in practice oitem reads datovka send-log objects. Give it dash-separated object ids - usually produced by the oids command - and a format string; for each object the format is expanded with that object aliases (_#STATE___, _#STATETXT, _#DATOVKA_, _#AA_NAME_, and more) and its field-getters such as stateTxt, state or datovka_id. The objects rendered are those owned by the current site or slice. Returns empty when the type is not datovka, when no ids match an object, or when the id list is empty. A well-formed id that has no matching object raises an error, so only feed ids that exist - the oids command is the safe source. It never sends a message and never writes - it only reads and displays.

Parameters

type required default (none - must be datovka)

Object type to read. The only type the engine registers is datovka (Czech Data Box messages); any other value makes oitem return empty.

ids optional default (empty)

Dash-separated object ids to render, one block of output per id. Usually supplied by the oids command, for example {oids:datovka}. An empty or non-matching list produces empty output.

format optional default (empty)

Format string expanded once per object. Reference the object data with its aliases (_#STATE___, _#STATETXT, _#AA_NAME_, ...) or field-getters ({stateTxt}, {state}, {datovka_id}, ...). Empty format yields empty output.

delim optional default (empty string)

Text placed between the rendered objects (not before the first or after the last). Spaces are kept verbatim. Empty means the blocks are concatenated with no separator.

Examples

test[{oitem:widget:abc:_#STATE___}]
Expected[]
Actual[]
Only the object type datovka is registered. Any other type returns empty - oitem never errors on an unknown type.
test[{oitem::abc:_#STATE___}]
Expected[]
Actual[]
An empty first parameter is not the datovka type, so oitem returns empty - the same as any unknown type.
test[{oitem:datovka:{oids:datovka}}]
Expected[]
Actual[]
{oids:datovka} returns the ids of every datovka object owned by the current site. This documentation install has no datovka messages, so the list is empty; on a site that has sent messages oitem would render one block per id.
test[{oitem:datovka:not-an-id:_#STATETXT}]
Expected[]
Actual[]
Anything in the id list that is not a valid object id is silently dropped, so this yields empty. Warning - a well-formed id that has no matching object is a different case: oitem then raises 'object not loaded' and aborts the page. Only feed ids you know exist, which is why the oids command is the safe source.
virtual{oitem:datovka:{oids:datovka}:_#AA_NAME_ - _#STATETXT:<br>}
Expected(one line per message, e.g. 'DS 2024-06-13 14:51:12 - Start', joined by line breaks; empty on an install without datovka messages)
The canonical pattern: feed {oids:datovka} as the id list and format each object with its aliases - _#AA_NAME_ is the auto-generated object name, _#STATETXT the last state text. The fourth parameter <br> separates the messages. Runtime-dependent, so marked illustrative.
virtual{oitem:datovka:{oids:datovka}:{stateTxt} (recipient {dbIDRecipient})}
Expected(per message the state text and recipient data-box id, e.g. 'Start (recipient bkfj8cu)'; empty without datovka messages)
Inside the format you can also use plain field-getters such as {stateTxt} and {dbIDRecipient} instead of the _# aliases; both read the current object. Runtime-dependent, so illustrative.
virtual{oitem:datovka:{oids:datovka}:_#DATOVKA_: - }
Expected(the datovka_id of each message joined by ' - ', the surrounding spaces preserved; empty on an install without datovka messages)
oitem does not trim its parameters, so a delimiter built from spaces is kept verbatim. Here each message datovka_id is joined by a dash padded with spaces on both sides. Runtime-dependent, so illustrative.