X 6 : neXt pleX Xml fleXibility eXperience: Xforms
description
Transcript of X 6 : neXt pleX Xml fleXibility eXperience: Xforms
X6: neXt pleX Xml fleXibility eXperience: Xforms
Willem de Vries, Remia
Simon Jasperse, Kiboko
Session No. 10C
Agenda
● Introduction● Background: Flexibility and XML● XForms: positioning and concepts● Application within Remia’s architecture● XForms: inside the models● Demo● Q&A
Introduction
● Remia: Manufacturer of Sauces and Margarine● Kiboko: Independent software consultancy● Software development in 2E and Plex● Strategic choice for model based development
– Development speed
– Reduced maintenance
● Pattern-advantage main reason for Plex
Flexibility in applications
● Application: Customer Relationship Management
● Requirement: high level of configurability– For fast adaptation to business-requirements
– To empower users
● Example: User Definable Data pattern● Example: Document management module
User definable data pattern and XML
● Two level (Feature / Feature aspect) representations of flexible data-structure
● XML as a tool to provide ‘single screen’ layout– XML-pattern for creation of ‘data-document’
– XSLT for ‘user-definable’ HTML-generation
● Use of XML extended beyond HTML- presentation
Short DEMO
Document Management
● Business documents like ‘contracts’, ‘letters’, ‘invitations’, ‘resumes’, ‘product-specification-sheet’
● User defines ‘ functional ‘ types● Creation of actual Docs from Plex-application
– Handling of external application (e.g. MS-Word)
– Interfacing application-data to ‘document’
● Support for external applications programmed ‘individually’
Document-management
Functional Concept
Technical Concept
MS-Word
MS-Excel
Flexibility: results
● Results of Flexible data structure– Specific layouts for specific purposes
– Users like ‘single-screen’ overview
● Results of Document system– Fast configuration of ‘forms’
– General available competence: office-templates
– Documents ‘managed’ within applications
Flexibility: more to wish ?
● Drawbacks of Document system– Information inside not retrievable
– Storage / transfer too costly
– Too little ‘guidance’ / validation for users User
● Single-screen output– Users ask for ‘ Single-screen ‘ input instead of
‘wizards’ and ‘tabs’
Some requirements for documents
● Form-like interface to offer ‘guidance’ and validation
● Easily configurable (as Word / Excel templates)● Integration with Plex-application based upon
data-interface● Structured (XML-) document to support
– ‘searchability’
– Integration-facilities in back-office
Possible directions
● Altova’s Authentic● Microsoft’s Infopath● Scripting a generalized HTML-solution
● XForms: W3C next generation HTML-forms– Promise of ‘open standard’
– Ambitious requirements
– Growing support by implementors
Global features of XForms
● Events, Actions and Validation: declarative– Full support for XPath for ‘calculations’ and
‘validations’
– Schema-support for data-types and validation
● Clean separation of data logic and presentation● Highly regular XML structure● Abstract controls for device-independence
– Processor ‘decides’ the actual ‘presentation’
– E.g. Full browser, Mobile phone, Voice……
Flexibility: more to wish ?
<fp:model id="rm_model" >
<fp:instance id="rm_doc">
<Contract xmlns="">
<Relatie NodeID="1">
<Relatienaam>Eurodisney</Relatienaam>
</Relatie>
<Currency>EUR</Currency>
<ContractDate></ContractDate>
<ContractDetails>
<DetailLine>
<Subtotal />
</DetailLine>
</ContractDetails>
</Contract>
</fp:instance>
<fp:bind id="conDate" nodeset="/Contract/ContractDate" required="true()" type="xsd:date" />
<fp:bind id="relNaam" nodeset="/Contract/Relatie/Relatienaam" required="true()" />
<fp:bind nodeset="/Contract/ContractDetails/DetailLine/Subtotal" calculate="../Quantity * ../Price" readonly="true()" />
<fp:submission id="rm_submit1" replace="none" action="url" method="post" ref="instance('rm_doc')" />
</fp:model>
Main elements: model
<body><fp:input bind="conDate">
<fp:label>Contract Date</fp:label><fp:alert>Please enter a value</fp:alert>
</fp:input><fp:select1 bind="conCurrency" style="display:inline">
<fp:label>Currency</fp:label><fp:item style="width: 200px;">
<fp:label>Euro</fp:label><fp:value>EUR</fp:value>
</fp:item/></fp:select1><fp:repeat id="r1" nodeset="/Contract/ContractDetails/DetailLine">
<fp:output ref="Subtotal"><fp:label>Subtotal</fp:label>
</fp:output></fp:repeat><fp:submit submission="rm_submit1">
<fp:label> Ready </fp:label></fp:submit>
</body>
Main elements: result
Implementations (examples)
● Client-side– Mozquito DENG (Flash)
• Supported in every browser
– X-Smiles (Java)• Strong device-independence
– X-port Formsplayer (IE 6 plug-in)• Currently most complete implementation
● Server-side– Chiba (open source)
– Novell’s exteNd (Silverstream) Mozilla
– IBM’s Xforms Package (Alphaworks) Mozilla
The pilot: XForms-Documents
● Development of a new “DocProgramma”● Resulting document is .XML● Interfacing from application-data● Form based on XForms● Enables:
– Smaller documents (storage / transfer)
– Validation
– Processing by back-office applications
Xforms Demo: Document Flow
● Document travels through organisation “workflow”– Approval / Edit / Distribution / Function
Xforms Demo: Documentflow
● Configuration determines document flow / status– Steps allocated by user function – Todo list
Xforms Demo: Documentflow
● User can start document types based on user function– Select a style refers to programme (word / xForms)
Xforms Demo: The Application
● DEMO
Xforms Demo: Create xForm Document
Xform Pattern● Write Relation data to C/temp/naw.xml
– uses Remia XML pattern ● Get contract.xhtml location on file system (on database/registry info)
● Load contract.xhtml into XMLDOM● Load naw.xml into XMLDOM(2)● Parse naw.xml data into contract.xhtml.Model.instance● Save as C/temp/myForm.xhtml● Display myForm.xhtml in Shdocvw ● Save instance XML as 7315.999
Xforms Demo: Create xForm Document
Xforms Demo: Saved XML
● Contract XML saved on file system as 7568.45
Xforms Demo: Edit xForm Document
● DEMO
Xforms Demo: xForm Functionality
● DEMO
Repeat
RepeatBind
Data Typing
Bind:Calculate
Bind:Calculate
Bind:Calculate
Bind:Calculate
EventEvent No Scripting!
Xforms Demo: Documents
● Show XML’s
Xforms Demo: Plex Integration
● DEMO
shdocvwXHTML
XML
Plex
Translate to Logical Event
Formsplayer
Xforms Demo: Register Event
WebBrowser1.Navigate FileName
Function RegisterForEvent(evtSource,evtName,HandlerName)' get a pointer to the function with the given name
dim fpHandlerset fpHandler = getRef(HandlerName)
'bind it to the requested event nameevtSource.attachEvent evtName,fpHandler
End Function
Sub WebBrowser1_DocumentComplete(pDisp, URL) Set g_document = WebBrowser1.DocumentRegisterForEvent g_document.getElementById(submitID), "xforms-submit-
done","getAddr_Submit_Done" End Sub
Function getAddr_Submit_Done(e)Ad.LogicalEvent("xfSubmit")
End Function
Xforms Demo: Save Instance
At LogicalEvent("xfSubmit")
set g_document = WebBrowser1.Document
set model = g_document.getElementById(ModelID)
set formDoc = model.getInstanceDocument(InstanceID)
formDoc.save (FileName)
go sub terminate
Xforms Demo: Experiences
● xForms is promising, maturing● Integration with Plex simple● Better document handling Size / Data retrieval ● Layout xForms in css needs practice!
Ideas for extension
● Physical separation of Model and Layout– Layout as pure user-responsibility
● Extending the pattern around documents– Support for database-lookups– Coupling of printing/export facilities– ..
● Model-controlled structure for User-defined data– Processing XML-results to database
● Meta-programming for panel-alternative
References
● W3C – www.w3.org/MarkUp/Forms/
● Micah Dubinko Xforms essentials
– http://xformsinstitute.com/essentials/● x-port.net Ltd
– www.formsplayer.com
● DSTC University of Queensland– xforms.dstc.edu.au/index.html
● Novell – developer.novell.com/xforms/