Object types (IRPCObjectTypes)

View as Markdown

An interface for reading object types.

This interface provides read-only access to object types.

gRPC serviceMFiles.IRPCObjectTypes
Book and levelVault API, core
Methods3
Proto filemfiles/IRPCObjectTypes.proto

Overview

Reads the object types of the vault: the kinds of objects users create, such as Document (0), Customer or Project. Use it to resolve object type IDs to names, find the property definition that refers to objects of a type, and check whether the user can create objects of a type.

Job Call
List all object types (with icons) GetObjectTypes
Read one object type or value list by ID GetObjectType
Object types and plain value lists, without icons GetValueLists
Ask the server to re-read an external object type now RefreshExternalObjectType

ID spaces. An object type is a value list whose items are objects, so object types and value lists share one ID space and both are described by ValueList (is_real_object_type tells them apart). Property definition IDs (IRPCPropertyDefs) are a separate space, and so are the item IDs inside each list: a class ID, for example, is an item ID in value list 1 (Classes). Built-in object types keep their IDs in every vault (0 Document, 9 Document collection, 10 Assignment); the IDs of custom object types differ between vaults, so resolve them by alias or GUID with GetMetadataStructureItemIdByAlias instead of hard-coding them.

The read calls are cacheable: keep the result until the metadata structure version that the server returns in the mfiles-metadata-version-bin trailer changes. See Vault and metadata structure and Metadata structure version and caching.

Highlighted methods

MethodSummaryFacts
GetObjectTypesGets all object types (real object types only, not plain value lists), with their icons.read session or assertion idempotent returns metadata structure version
GetObjectTypeGets one object type or value list by ID, with its icon.write session or assertion returns metadata structure version

Other methods

MethodSummaryFacts
RefreshExternalObjectTypeRefreshes the items of an external object type or value list from its external database now.write session or assertion idempotent returns metadata structure version