|
Creation of a new virtual page typeThe creation of a new type of virtual page, i.e. a new development artifact, will usually involve two steps:
Creation of the typeThis involves deciding which properties and child nodes will be used by the new node type. For example, you would like to create a node type describing a requirement. You will think about which attributes it may have. For instance,
You will store the new node type using the New node type action of the setup wizard of the New action. This will look like
(please compare as well the use case description). This will create an entry in nodes/repository-1.0/repository/nodetypes/custom_nodetypes.xml: <nodeType hasOrderableChildNodes="true" isMixin="false" name="nodes:requirement" primaryItemName=""> <supertypes> <supertype>nt:base</supertype> <supertype>nodes:shortId</supertype> <supertype>nodes:versionable</supertype> </supertypes> <propertyDefinition autoCreated="false" mandatory="false" multiple="false" name="nodes:priority" onParentVersion="COPY" protected="false" requiredType="String"> <valueConstraints> <valueConstraint>HIGH</valueConstraint> <valueConstraint>MEDIUM</valueConstraint> <valueConstraint>LOW</valueConstraint> </valueConstraints> </propertyDefinition> <propertyDefinition autoCreated="false" mandatory="false" multiple="false" name="nodes:baseId" onParentVersion="COPY" protected="false" requiredType="String"> <valueConstraints> <valueConstraint>REQ</valueConstraint> </valueConstraints> </propertyDefinition> <propertyDefinition autoCreated="false" mandatory="false" multiple="false" name="nodes:risk" onParentVersion="COPY" protected="false" requiredType="String"> <valueConstraints> <valueConstraint>HIGH</valueConstraint> <valueConstraint>MEDIUM</valueConstraint> <valueConstraint>LOW</valueConstraint> <valueConstraint>NO</valueConstraint> </valueConstraints> </propertyDefinition> <childNodeDefinition autoCreated="false" defaultPrimaryType="nodes:requirement" mandatory="false" name="*" onParentVersion="COPY" protected="false" sameNameSiblings="true"> <requiredPrimaryTypes> <requiredPrimaryType>nodes:requirement</requiredPrimaryType> </requiredPrimaryTypes> </childNodeDefinition> <childNodeDefinition autoCreated="false" defaultPrimaryType="nodes:htmlDiv" mandatory="false" name="nodes:description" onParentVersion="COPY" protected="false" sameNameSiblings="false"> <requiredPrimaryTypes> <requiredPrimaryType>nodes:htmlDiv</requiredPrimaryType> </requiredPrimaryTypes> </childNodeDefinition> </nodeType> For instance, it is not possible to add a mandatory property to an existing definition, as may put the repository in an inconsistent state, if there are already nodes of the type. In such cases, you will have to edit the custom_nodetypes.xml manually. For instance, you could add a non-mandatory property of the same name first, then add that property to all existing nodes of the node type and finally set the property to mandatory in custom_nodetypes.xml. You should only edit the file, while the repository is not running. Creation of the templateNext, you use the New template action of the setup wizard to create a new template and edit it directly afterwards, see as well the use case.. Usually, you will do that in two steps:
The HTML page may look like
You can map the HTML elements to child nodes, properties or referenced node types using the context menu of the explorer panel of the assistent:
Map to new element maps the element to another node type, which is connected via references. Map to extended node type maps the element to some property or child node of the template node type:
The final mapping may look like
In our example, we do not have a reference to some other node type, so the optional third step is omitted. |