Requirement

A requirement is traditionally a part of a requirement specification. Having a separate requirement page has some advantages over that

  • Requirements may be arbitrarily restructured.
  • The requirement document can be copied to some new location and be used in another context, for example in a change request document or, vice versa, from the change request page to the actual requirement specification.
  • Having a separate identity allows the automatic creation of human readable ids, which in turn can be used to unambigously identify the requirement.
  • A separate requirement page facilitates the generation of references between different architecture artifacts. For example, a test case may reference the requirement it is testing.
  • A document called a book can be created and downloaded at any time from a the virtual pages associated to a node and its successor nodes, optionally including nodes followed by hyperlinks. Currently supported formats for such a book are EPUB and zipped HTML.

Schema

nodes:requirement inherits from nodes:shortId and nodes:versionable. Inheriting nodes:versionable will create a new version each time the node is saved. Inheriting from nodes:shortId will generate a unique property nodes:id the node is created the first time. It will use the value constraint for the nodes:baseId property for a prefix, i.e. it will generate names like REQ-1504.

A node may have properties

  • nodes:priority with values HIGH, MEDIUM and LOW
  • nodes:risk with values HIGH, MEDIUM, LOW and NO.

The node may have child nodes

  • nodes:description. This is a nodes:htmlDiv, i.e. an HTML DIV used to describe the requirement.
  • nodes with arbitrary names of type nodes:requirement. This can be multiple, i.e. the node may have up to multiple sub requirements.

As custom_nodestypes.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>

Template

The template looks like

The priority and the risk as well as the type of the sub requirements will be displayed as icons.

For that, in addition to configure the template columns as images here, you have to add the icons. For instance for the enumerated values of nodes:priority you have to add image files with the names HIGH, LOW and MEDIUM in folder /jcr:system/nodes/icons/nodes:requirement/nodes:priority.