Displaying ospi.description from xsd in outputted form

The scope of this page spans from creating ospi forms with XSD, publishing the xsd and the users input to the outputted form.

Administrators may find that they need to display text explaining to the user how to fill in a form (or other xml-valid information) in the final output of a form generated from xsd.

Sakai does not currently support this so enabling this involves editting a velocity macro and recompiling/deploying the source.

When writing the XSD put the text you would like to appear as inside an annotation element in a documentation tag with the attribute source="ospi.documentation":

...
<xs:element name="example" minOccurs="0" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation source="ospi.label">
Example Label (this is already used as the fields name)
</xs:documentation>
<xs:documentation source="ospi.description">
Example instructions or text to be displayed to the user.
</xs:documentation>
</xs:annotation>
...
</xs:element>
...

Next open the Sakai source and edit the following file:
osp/presentation/tool/src/webapp/WEB-INF/templates/addPresentationProperty.vm

and insert:
#if ($field.annotations.containsKey("description"))
<label class="instruction">$field.annotations.description</label>
#end

Where you would like the text to appear in relation to the field name (ospi.label).

Recompile and redeploy and you should now see values of the 'ospi.description' element appearing in the form input pages.

This information was taken from an email thread on the portfolio@collab.sakaiproject.com around 2nd Jan 2007 called 'ospi.description'

The following link was valid at time of article being written:
https://collab.sakaiproject.org/portal/site/1106591343141-69275/page/1106591343269-69284

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.