SelectedEntry

One selected object, normalized identically in all environments. SelectedEntry is the element type of InitContext.selection and InitContext.lastSelectedEntry (see InitContext).

1. Fields

Field Type Meaning

osid

number | null

Object ID as a number, or null when missing/empty.

objectTypeId

number | null

Canonical object type ID. Typeless (internal / workflow tray) documents normalize to the same marker -1 in both raw shapes (rich-client 13107200 / 19660800, webclient "-1"). null when missing/empty.

mainType

number | null

Main type — see the computation below. null when there is no type ID.

typeless

boolean

true for typeless (internal / workflow tray) documents.

2. The mainType computation

mainType follows three branches:

  • typeless document → the document class value 1 (both environments);

  • with a type ID → objectTypeId >>> 16 — 0 = folder, 99 = register, anything else = document;

  • without a type ID → the host-declared main type when present, else null.

The library exports the two well-known main types as named constants:

MAIN_TYPE_FOLDER   // 0
MAIN_TYPE_REGISTER // 99

3. SelectedObjectRef — the getSelectedObjects result shape

SelectedObjectRef is the looser shape returned by getSelectedObjects: { objectId: string | number | null, objectTypeId: string | number | null } — ids may arrive as strings or numbers depending on the host; the webclient host’s array is resolved directly, the rich client’s raw bridge string is parsed (empty selection → []; typeless documents carry the -1 type marker in the rich client).