Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Page Properties
hiddentrue

Status

Status
colourYellow
titleprogress

Priority
Note
AssigneeAntje

Resources

Remarks

  • Antje: page created as a copy of the schema tutorial


Excerpt

Change for an object property whether it is optional or mandatoryUse the same property in different object types. In some of them, the property is required and in others it is not.


Section
bordertrue


Column

Table of Contents

Table of Contents
maxLevel3
exclude(Table of Contents|Read on|Another Tutorial|Another Concept Article|Another interesting Tutorial|Managing the Schema|Schema - Defining Object Types|DMS Endpoints)


Introduction

Any property definition in the schema needs the specification of the required attribute. Its boolean value decides if the corresponding property is mandatory (true) or optional (false) for an object.  However, the value of the required attribute can be overwritten by a propertyReference in object type definitions or secondary object type definitions. This provides the possibility to decide for each property if it is required or not in each single object type. Since schema structures can even be changed at runtime, yuuvis

Tutorial Content

Handling Object Type Definitions

In an object type definition, a propertyReference can be used to set a value for the required attribute for a property. This value can be different from the value specified in the property definition. In this case, the required attribute will have the value from the object type definition.

...

Code Block
languageyml
titleOverwriting of the required attribute by object type definition
linenumberstrue
<propertyStringDefinition>
    <id>name</id>
    <propertyType>string</propertyType>
    <cardinality>single</cardinality>
    <required>true</required>
</propertyStringDefinition>
 
<typeDocumentDefinition>
    <id>document</id>
    <baseId>system:document</baseId>
    <propertyReference required="false">name</propertyReference>
    <contentStreamAllowed>allowed</contentStreamAllowed>
</typeDocumentDefinition>

Handling of Secondary Object Type Definitions

An object type definition can be based on a secondary object type. Also in the definition of the secondary object type, a propertyReference can be used to set a value for the required attribute for a property. The required attribute value specified in the original property definition is again overwritten.

...

Code Block
languageyml
titleOverwriting of the required attribute by secondary object type definition
linenumberstrue
<propertyStringDefinition>
    <id>name</id>
    <propertyType>string</propertyType>
    <cardinality>single</cardinality>
    <required>false</required>
</propertyStringDefinition>
 
<typeDocumentDefinition>
    <id>document</id>
    <baseId>system:document</baseId>
    <contentStreamAllowed>allowed</contentStreamAllowed>
    <secondaryObjectTypeId static="false">invoice</secondaryObjectTypeId>
</typeDocumentDefinition>
 
<typeSecondaryDefinition>
    <id>invoice</id>
    <baseId>system:secondary</baseId>
    <propertyReference required="true">name</propertyReference>
</typeSecondaryDefinition>

Handling of Multiple Property References

In an object type definition, it is possible to set a value for the required attribute, and additionally include multiple secondary object types specifying the required attribute as well. If at least in one definition among the others implies required=true, it will be true for every object of the corresponding type. The value true dominates over false independently on the location of the definition.

...

Code Block
languageyml
titleOverwriting of the required attribute by an object type definition and different secondary object type definitions
linenumberstrue
<propertyStringDefinition>
    <id>name</id>
    <propertyType>string</propertyType>
    <cardinality>single</cardinality>
    <required>false</required>
</propertyStringDefinition>
 
<typeDocumentDefinition>
    <id>document</id>
    <baseId>system:document</baseId>
    <contentStreamAllowed>allowed</contentStreamAllowed>
    <secondaryObjectTypeId static="false">invoice</secondaryObjectTypeId>
    <secondaryObjectTypeId static="false">deliverySlip</secondaryObjectTypeId>
</typeDocumentDefinition>
 
<typeSecondaryDefinition>
    <id>invoice</id>
    <baseId>system:secondary</baseId>
    <propertyReference required="true">name</propertyReference>
</typeSecondaryDefinition>
 
<typeSecondaryDefinition>
    <id>deliverySlip</id>
    <baseId>system:secondary</baseId>
    <propertyReference>name</propertyReference>
</typeSecondaryDefinition>

Summarizing Example

A property name is defined. It is mandatory, since the required attribute is set to true.

...

Code Block
languageyml
titleDifferent secondary object type definitions
linenumberstrue
<typeSecondaryDefinition>
    <id>invoice</id>
    <baseId>system:secondary</baseId>
    <propertyReference required="false">name</propertyReference>
</typeSecondaryDefinition>
 
<typeSecondaryDefinition>
    <id>deliverySlip</id>
    <baseId>system:secondary</baseId>
    <propertyReference>name</propertyReference>
</typeSecondaryDefinition>

Summary


Info
iconfalse

Read on

Section


Column
width25%

Managing the Schema

Insert excerpt
Managing the Schema
Managing the Schema
nopaneltrue
 Keep reading


Column
width25%

Schema - Defining Object Types

Insert excerpt
Schema - Defining Object Types
Schema - Defining Object Types
nopaneltrue
 Keep reading


Column
width25%

DMS Endpoints

To update the instance of an object type with the property group of a floating secondary object type as well as specific values use one of the two endpoints for updating metadata. Keep reading



...