Integrating MagooClient with JMS SOA (5)

Customizing Form Appearance

As can be seen from earlier sections, MagooClient provides a powerful XML editor for working with SOAP/XML content. The editor has its own rendering engine which creates a default form view based on the WSDL/Schema information. This allows it to tailor field appearance and navigation accordingly and provides a rich editing environment which is ideal for development and prototyping purposes.

 

However for non-technical end-users, it may be convenient to tailor form appearance. Such modifications could include:
  • Providing additional text information to aid user input.
  • Changing element order and positioning.
  • Customizing element and attribute labels.
  • Customizing document appearance through use of colours and logos.
  • Hiding elements such as SOAP Envelopes or transaction/security information.
  • Adding extra form controls such as buttons to trigger scripts.
Stylesheet capability is provided in MagooClient via an XSL/XHTML model. MagooClient supports the generation, editing and configuring of XSL-based stylesheets which are then used to generate XHTML from the XML message content. An XHTML-processor provides browser-like functionality to render the completed XHTML for viewing and editing. Through use of references within the XHTML document, the full capabilities of the MagooClient XML editor to be used to control document content. Stylesheets are also automatically re-applied whenever a structural change is made to the document. This approach allows the best of browser and XML editing capabilities to be combined.

 

The co-ordination between the XHTML view and the underlying model has a number of distinct advantages in terms of simplifying the XHTML content:
  • Automatic Field Formatting: The nature of the XHTML <input> tag is steered by the underlying schema. Unlike a normal <input> tag where a type attribute is usually specified to determine whether the input is a text field, drop-down or checkbox, MagooClient uses the schema information to automatically create the correct field type in a similar fashion to the default Magoo Form view. Input field creation observes all of the schema instructions such as simple type, field lengths and enumerations.
  • Automatic Field Validation: As the XHTML <input> tags are linked to underlying XML elements and attributes, schema-based validation is automatically applied by MagooClient as per the default Magoo form view. Therefore no additional content validation scripts are required and the XHTML input fields benefit from the MagooClient keystroke-driven XML validation which provides immediate feedback on erroneous data entry.

In this way, the XSL/XHTML capabilities of MagooClient combine the flexibility of a fully-customizable presentation layer with the power of a validating XML editor.

 

Packing Slip Form Modifications

To generate a sample stylesheet, open the required processPackingSlip message type and select Create from the Stylesheets menu. A complete XSL stylesheet will be generated for the XML document. When applied, the stylesheet will generate standard XHTML representing the XML content.

 

With some basic changes to the generated XSL, it is possible to change the appearance of the rectifyPackingSlip and processPackingSlip forms as follows:

  • Fields are re-sized and re-positioned.
  • Logos/Images added and the color-scheme modified – for instance to fit with corporate style guides.
  • Buttons are added to facilitate adding and removing Items and Error Notes.
MagooClient also allows the level of XML detail to be tuned to the target audience. In this case, a shipping operator would be expected to have little or no knowledge of underlying XML and so the MagooClient user mode is set to ‘User’. This means that neither the usual left-hand navigation tree panel nor the raw XML pane is rendered.

 

As a transform has been configured, the processPackingSlip message show below and will be automatically created from a rectifyPackingSlip message when the user selects Reply. Note that:
  • The To: field is automatically populated with the correct endpoint details for the processPackingSlip endpoint from the WSDL definition.
  • XML validation is still applied and details such as drop-down entries are still populated using the schema enumeration values.
The processPackingSlip message as it appears to the user is shown below. This illustrates the use of transforms to copy message contents between different message types as well as stylesheet support to tune the form look and feel.

 

 

Once the user has corrected the errors in the PackingSlip, they simply click on Send and the message will be put into the correct Process Queue to be picked up again by the processPackingSlip() operation thus completing the modification scenario.

 

< Previous 1 2 3 4 5