Download XML London 2013 Proceedings

Transcript
Small Data in the large with Oppidum
To some point XForms could have solved the first issue.
However it has been designed for form-based data and is
less powerful for handling document-oriented semistructured data (see for instance these developer's
question on Stack Overflow [3] [4]).
The blossoming of many XML development
environments based on XQuery (BaseX, eXist-DB,
MarkLogic, Sausalito) could solve the second issue.
However each one comes with its own extensions and
conventions to build applications, often still at very low
abstraction level compared to over MVC frameworks
available for other platforms (e.g. Ruby on Rails).
Despite these obstacles we have started to develop
Small Data applications with XML during the last three
years. We have solved the first issue by developing a
Javascript library for XML authoring in the browser
called AXEL [13]. It uses the concept of template to
allow developers to create customized editing user
interfaces guaranteeing the validity of data [6]. We
resolve the second issue by providing a lightweight
framework called Oppidum that is described in this
paper.
Oppidum is an open source XML-oriented
framework written in XQuery / XSLT. It is designed to
create custom Content Management Solutions (CMS)
involving lightweight XML authoring chains. It is
currently available as a Github repository to be deployed
inside an eXist-DB host environment.
The paper is organized as follows. The first section
describes the architecture of Oppidum and its two-steps
execution model. The second section presents the way it
manages some common web application design patterns.
The third section presents some example applications
done with it. Finally the fourth section discusses some
design choices of Oppidum compared with over XML
technologies.
Page 70 of 162
2. Oppidum architecture
2.1. Application model
Oppidum provides developers with a simple application
model that allows them to rapidly and efficiently deploy
a RESTful application; it relies on a few fundamental
principles:
• the application must be entirely defined in terms of
actions on resources;
• each action is defined declaratively in a mapping file
as a sequential pipeline composed of three steps :
• the first step, called the model, is always an XQuery
script;
• the second step, called the view, is always an XSLT
transformation;
• the third step, called the epilogue, is always an
XQuery script that must be called epilogue.xql;
• a pipeline may have only the first step, the first and
second steps, the first and third steps, or the three
steps.
It is always possible to extend a pipeline by invoking one
or more XSLT transformations from XQuery in the first
and the third steps.