Creation of a new virtual page type

The creation of a new type of virtual page, i.e. a new development artifact, will usually involve two steps:

  1. The creation of a new node type.
  2. The creation of one or more templates for the new node type.

Creation of the type

This 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,

  • A short id, which shall be generated each time a new node of the type will be created. In that case, let the node type inherit from nodes:shortId.
  • A description of the requirement.
  • The priority for the implementation.
  • The risk for the implementation.
  • A list of subrequirements.

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 template

Next, 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:

  1. You create an HTML page, that looks like the representation you have in mind.
  2. You map elements of the page to properties or child nodes of the node type.
  3. Optionally, if the node type has a reference to another node type (e.g. a test case to a use case), you must specify the reference, that is used.

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.