This is a guide on how the view layer was put together and where to look to make changes.
The view layer is built using XSLT version 1.0 and Javascript which makes light work for developing new stylesheets to meet your requirements.
XSLT stands for XSL Transformations and is an XML-based style sheet language. As the SOCKET consumer delivers XML data to the view layer, XSLT is a good choice as a technology for displaying the consumer software output. Other technologies can be used such as JSP.
The socket-view directory containing the stylesheets can be downloaded from the SOCKET SourceForge repository or from the download page on the web site.
Simply drop the xslt directory within socket-view into /path/to/tomcat/your_consumer/ and away you go.
The stylesheet structure comprises of .xsl files as well as an accompanying css file to provide formatting and 3 javascript files to provide form functionality. These being:-
service-input.xsl - displays form for submission to consumer factory.
This file performs data validation on all input boxes by use of javascript to ensure the correct data type is entered into each specific input box. It also provides functionality should the consumer factory provide an array of a data type, and thus multiple input boxes are required.
service-output.xsl - displays the output from data submitted through the service-input.xsl form
operation-list.xsl - lists all operations, providing hyperlinks to these operations
soap-exception.xsl - displays data on a soap exception i.e. should there be a soap error
remote-exception.xsl - displays data on a remote exception i..e should a web service not be available
consumer-exception.xsl - displays data on a consumer exception i.e. a fault in the consumer application
socket.css - provides text, background and layout formatting
authentication.js - provides data validation of all data types
more_fields.js - provides multiple input box functionality should an array be submitted
calendarDateInput.js - provides a date picker for the date data type
SOCKET stylesheets are relatively easy to customise. Customisation is particularly useful for the service-input.xsl stylesheet that passes data from a form into the consumer Web application. Labels come through as non user-friendly strings such as arg0, arg1, arg2 etc. A better representation of these is to convert them into a meaningful string to label the input boxes.
To do this go to line: 333 of service-input.xsl and look for the line of code starting:-
<xsl:variable name="label"><xsl:value-of select="label"/></xsl:variable>
<xsl:choose>
<xsl:when test="$label='arg0'">:</xsl:when>
<xsl:when test="$label='arg1'">Input Data1:</xsl:when>
<xsl:when test="$label='arg2'">Input Data2:</xsl:when>
<xsl:otherwise>Enter value: </xsl:otherwise>
</xsl:choose>
This can now be adapted to suit your requirments e.g.
<xsl:variable name="label"><xsl:value-of select="label"/></xsl:variable>
<xsl:choose>
<xsl:when test="$label='arg0'">Stylesheet Name:</xsl:when>
<xsl:when test="$label='arg1'">Institution Name:</xsl:when>
<xsl:when test="$label='arg2'">Faculty Name:</xsl:when>
<xsl:otherwise>Enter value: </xsl:otherwise>
</xsl:choose>
There is scope for further development and bug fixes. Below is a list of bugs that require attention and some ideas for how the stylesheets could be developed further.
1. Calander Arrays - currently throws a null pointer error on submission to the consumer factory. This is due to incorrect naming of the calander input boxes. Fixes here should be directed towards calendarDateInput.js.
2. Multiple input box feature - on submission of multiple operations, service-input.xsl requires indivual naming of the 'NoBoxes' input field, otherwise they lose indivuality and it breaks. Fixes here should be directed towards more_fields.js and service-input.xsl.
SOCKET, A JISC ELF Toolkit Project
r.garbutt@leeds.ac.uk, August 2006
Document last modified 23 September 2006