Storyline Length Constraints

Storyline length constraints are defined in storyline templates. A storyline template can contain several sets of constraints for different story sizes (short, medium and long, for example). The actual constraints used can then be selected by the CUE user when a story based on the template is actually created. The constraints are defined in a ui:content-length-restrictions element that must be inserted in the storyline template as a child of the elements element. For example:

<elements>
  ...
  <ui:content-length-restrictions>
    <ui:content-length-constraint name="small">
      <ui:label>Small</ui:label>
      <ui:minchars>50</ui:minchars>
      <ui:maxchars>200</ui:maxchars>
      <ui:maxwords>40</ui:maxwords>
    </ui:content-length-constraint>
    <ui:content-length-constraint name="medium" default="yes">
      <ui:label>Medium</ui:label>
      <ui:minchars>150</ui:minchars>
      <ui:maxchars>800</ui:maxchars>
    </ui:content-length-constraint>
    <ui:content-length-constraint name="large">
      <ui:label>Large</ui:label>
      <ui:minchars>500</ui:minchars>
      <ui:maxchars>5000</ui:maxchars>
      <ui:minwords>250</ui:minwords>
      <ui:maxwords>1000</ui:maxwords>
    </ui:content-length-constraint>
  </ui:content-length-restrictions>
  ...
</elements>

The above example defines three different sets of constraints, small, medium and large, with medium defined as the default. This means that when a content item is created based on this storyline template, the medium constraints will be preselected. If none of the content-length-constraint elements include a default="yes" attribute, then when a content item is created based on this storyline template, no constraints will be set.

Content types that reference storyline templates containing length constraints will usually need to include a story length field, so that CUE users are able to select the constraint set they want to use. A story length field is a field element that contains a ui:story-size and a ui:hidden element. For example:

<field name="story-size" type="basic" mime-type="text/plain">
  <ui:hidden />
  <ui:story-size />
</field>

The ui:story-size element identifies the field as a story size field, triggering CUE to display it as a drop-down field at the bottom of the Metrics panel, where it can be used to select the required length constraint set for the storyline. You must include a ui:hidden element to ensure that the field is not displayed as an ordinary content item field. Note the following:

  • It does not matter where you put the story size field definition in the content type definition, as long as it is a valid location for a field element.

  • The field's type and mime-type attributes are ignored: the field is always displayed as a drop-down in CUE.

  • The name of the field is not used by CUE, and nor is any ui:label element, should you include one in the field definition.

The following screenshot shows a Metrics panel containing a story size field:

graphics/metrics-panel-constraints.png

If a storyline template contains only one set of constraints and its default attribute is set to yes then a story length field is not required.

For a full description of the ui:content-length-restrictions element and its children, see here.