collection
NamedUserCollection schema creation
You can configure a Schema when you create a collection, such as a NamedUserCollection. This schema is either added to the SchemaDefinition or updates an existing schema.
When defining a NamedUserCollection, reference the Schemas to read,create or update using the _itemTypes property.
In the following NamedUserCollection, RelatedItem objects in the collection are associated with the AssetFile schema but are not required to conform to it:
Code example: NamedUserCollection references AssetFile schema type
{
"_uri": "/nameduseritems/6698bfcc20ae2d3c8f682db7",
"_name": "Root Container",
"_userType": "file_container",
"_tipId": "6698bfcc20ae2d3c8f682db8",
"_irn": "itemsvc:nameduseritem:6698bfcc20ae2d3c8f682db7",
"_itemTypes": [
"AssetFile"
],
"_namespaces": [
"iputgraph_w3SARCv6"
],
"_nextVersion": 2,
"_shortName": "Root Container",
"_tipVersion": 1,
"_versionsCount": 1,
"_itemClass": "NamedFileCollection",
"_userItemId": "root container_3RvcCgocBI",
"_id": "6698bfcc20ae2d3c8f682db7",
"_description": "Root Container",
"_kind": "collection"
}
Partial SchemaDefinition updates
When you create a NamedUserCollection you can include a Schema, which is appended to the namespace’s existing SchemaDefinition with the following behaviour:
- If a Schema with the
_typeNamealready exists, the service replaces the existing schema with the updated definition. - If a Schema with the
_typeNamedoes not exist, the service appends the new Schema to the SchemaDefinition.