XML London 2013 presentation
The paper addresses the topic of frameworks intended to speed up the development of web applications using the XML stack (XQuery, XSLT and native XML databases). These frameworks must offer the ability to produce exploitable XML content by web users - without technical skills – and must be simple enough to lower the barrier entry cost for developers. This is particularly true for a low-budget class of applications that we call Small Data applications. This article presents Oppidum, a lightweight open source framework to build web applications relying on a RESTful approach, sustained by intuitive authoring facilities to populate an XML database. This is illustrated with a simple application created for editing this article on the web.
Exploring the Future Potential of AI-Enabled Smartphone Processors
Small Data in the large with Oppidum
1. Acknowledgements MEDIA research Group
Small Data in the large with Oppidum
XML web development with Oppidum and eXist-DB
Presented at XML London 2013 (read the full article)
Stéphane Sire
Contact: s.sire@oppidoc.fr - Oppidoc
Christine Vanoirbeek
Contact: christine.varnoirbeek@epfl.ch
2. Introduction
Presentation vs. semantic
“ On the left, what browsers see. On the right, what humans see. Can we
bridge the gap so browsers see more of what we see? ”
Source W3C
RDFa 1.1 Primer Rich Structured Data Markup for Web Documents
4. edit | xml | hide | previewXML Prague 2010
Introduction of the AXEL Javascript library for XML authoring in the
browser
S. Sire, C. Vanoirbeek, V. Quint, C. Roisin,
Authoring XML all the Time, Everywhere and by Everyone. In
Proceedings of XML Prague 2010, pages 125 - 149 , Institute for
Theoretical Computer Science, 14/03/2010
Self-service demo:
click a first time on “edit” to transform the bibliographic reference into an editor
click on “xml” (resp. “hide”) to show (resp. hide) its current XML content
click on “preview” to hide / show editor structure editing controls
<References>
<Publication Date="2010-03-14">
<Authors>
<Author>
<Name>S. Sire</Name>
7. XML web development
Languages (W3C)
XPath => XQuery, XSLT
XForms XTiger XML (Adaptable XML Editing Library)
Native XML databases
eXist-DB, Sausalito, baseX, Marklogic
XRX programming style and 2/3 architectures
But still very few application frameworks !
RESTXQ, EXPath
Orbeon Forms, Oppidum
8. Oppidum Principles
A unique XML file to represent the application architecture
the mapping associates each REST resource from the application with a
rendering pipeline
9. Oppidum Pipeline
Limited to 3 steps (KISS-principle)
a model implemented as an XQuery script
a (optional) view implemented as an XSLT transformation
an (optional) epilogue implemented as a unique XQuery script called epilogue.xql
sample :
13. Oppidum Execution Model
a two time engine
eXist-DB implementation
1st step : controller.xql calls gen:process( HTTP Request )
2nd step: URLRewriteFilter executes pipeline
14. Oppidum Design Patterns
Templating system
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:site="http://oppidoc.com/oppidum/site">
<body>
<div id="article">
<site:content/>
</div>
</body>
</html>
16. Epilogue templating function
universal typeswitch function (cut-and-paste between projects) to include
in the epilogue
declare function local:render( $cmd as element(), $source as element(),
$view as element()* ) as element()
{
element { node-name($source) }
{
...typeswitch function calling site:branch function
for every site:* extension point...
}
};
application-dependent function defining the extension points
declare function site:branch( $cmd as element(), $source as element(),
$view as element()* ) as node()*
{
typeswitch($source)
case element(site:skin) return site:skin($cmd, $view)
case element(site:lang) return site:lang($cmd, $view)
case element(site:navigation) return site:navigation($cmd, $view)
case element(site:error) return site:error($cmd, $view)
case element(site:login) return site:login($cmd)
... (: default implicitly manages other modules :)
default return $view/*[local-name(.) = local-name($source)]/(*|text())
};
17. More design patterns
Skinning applications
declarative way to keep the association between CSS and JS files and application
pages into a skin.xml resource inside the database
Error and message management (Flash a-la Ruby on Rails)
Data mapping
maintaining a relation between URL input space hierarchy and database collections
hierarchy
Form-based access control
Development life cycle (mode="dev|test|prdo" attribute)
20. Application : Alliance
Web site of the Association Alliance
form editor for participant registration with tool chain to publish badges and list of
participants
21.
22. Application : UAP
Web site of the Union des Artisans du Patrimoine de Belgique
moderated classified ads service for the craftmen member of the association
23.
24. Application : PSE
database of startup companies member of the Science Park at EPFL
multilingual content and search engine (Apache Lucene)
generation of personalized recommendations to improve company pages
JSON export towards an internal advertising TV screen network
25.
26. Conclusion
Effective and efficient XML full stack
implicit “model driven” approach with clear division of work for developers
user generated content with AXEL and AXEL-FORMS (article XML Prague)
backend development with eXist-DB and Oppidum (article XML London)
Open source (available on Github)
Opened issues to go beyond "Small Data"
code portability
abstraction layer for cross-database execution environments ?
see EXPath Webapp framework ? XProc ? RESTXQ ?
failover and load balancing