Top Banner
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: [email protected] - Oppidoc Christine Vanoirbeek Contact: [email protected]
26

Small Data in the large with Oppidum

Jul 12, 2015

Download

Technology

stsire
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Small Data in the large with Oppidum

Acknowledgements MEDIA research Group

Small Data in the large with OppidumXML web development with Oppidum and eXist-DB

Presented at XML London 2013 (read the full article)

Stéphane Sire

Contact: [email protected] - Oppidoc

Christine Vanoirbeek

Contact: [email protected]

Page 2: Small Data in the large with Oppidum

IntroductionPresentation vs. semantic

“ On the left, what browsers see. On the right, what humans see. Can webridge the gap so browsers see more of what we see? ”

Source W3CRDFa 1.1 Primer Rich Structured Data Markup for Web Documents

Page 3: Small Data in the large with Oppidum

Small data applicationsdocument structure (sections, paragraphs, lists, etc.)

truffled with structured data inside

Page 4: Small Data in the large with Oppidum

edit | xml | hide | previewXML Prague 2010Introduction of the AXEL Javascript library for XML authoring in thebrowser

S. Sire, C. Vanoirbeek, V. Quint, C. Roisin,Authoring XML all the Time, Everywhere and by Everyone. InProceedings of XML Prague 2010, pages 125 - 149 , Institute forTheoretical 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>

Page 5: Small Data in the large with Oppidum

</Author> <Author> <Name>C. Vanoirbeek</Name> </Author> <Author> <Name>V. Quint</Name> </Author> <Author> <Name>C. Roisin</Name> </Author> </Authors> <Title>Authoring XML all the Time, Everywhere and by Everyone</Title> <Conference>Proceedings of XML Prague 2010</Conference> <Pages> <Start>125</Start> <End>149</End> </Pages> <Location>Institute for Theoretical Computer Science</Location> </Publication></References>

Page 6: Small Data in the large with Oppidum

Motivation: full XML stack

Page 8: Small Data in the large with Oppidum

Oppidum PrinciplesA unique XML file to represent the application architecture

the mapping associates each REST resource from the application with arendering pipeline

Page 9: Small Data in the large with Oppidum

Oppidum PipelineLimited 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 :

Page 10: Small Data in the large with Oppidum

Article Editing ApplicationFully specificed by 6 pipelines

Page 11: Small Data in the large with Oppidum
Page 12: Small Data in the large with Oppidum

Mapping file example

<collection name="articles"> <item> => articles/xml-london[.xml] <access> <rule action="edit POST" role="g:authors" message="author"/> </access> <model src="oppidum:actions/read.xql"/> <view src="article/article2html.xsl"/> <action name="edit"> => articles/xml-london/edit <model src="actions/edit.xql"/> <view src="views/edit.xsl"/> </action> <action name="POST"> => POST articles/xml-london <model src="actions/write.xql"/> </action> <collection name="images"> => articles/xml-london/images/ <model src="models/forbidden.xql"/> <action name="POST"> => POST articles/xml-london/images/ <model src="images/upload.xql"/> </action> <item> => articles/xml-london/images/1.png <model src="images/image.xql"/> </item> </collection> </item> </collection>

Page 13: Small Data in the large with Oppidum

Oppidum Execution Modela two time engine

eXist-DB implementation

1st step : controller.xql calls gen:process( HTTP Request )

2nd step: URLRewriteFilter executes pipeline

Page 14: Small Data in the large with Oppidum

Oppidum Design PatternsTemplating 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>

Page 15: Small Data in the large with Oppidum

Sample flowModel output

<Document> <Parag>Hello World</Parag></Document>

View output

<site:view> <site:content> <p>Hello World</p> </site:content></site:view>

Epilogue output

<html xmlns="http://www.w3.org/1999/xhtml"> <body> <div id="article"> <p>Hello World</p> </div> </body></html>

Page 16: Small Data in the large with Oppidum

Epilogue templating functionuniversal typeswitch function (cut-and-paste between projects) to includein 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())};

Page 17: Small Data in the large with Oppidum

More design patternsSkinning applications

declarative way to keep the association between CSS and JS files and applicationpages 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 collectionshierarchy

Form-based access control

Development life cycle (mode="dev|test|prdo" attribute)

Page 18: Small Data in the large with Oppidum

Application : FocusNewsletter editor

editorial tool chain for publishing a 4 pages newsletter (3000 printed copies)

Page 19: Small Data in the large with Oppidum
Page 20: Small Data in the large with Oppidum

Application : AllianceWeb site of the Association Alliance

form editor for participant registration with tool chain to publish badges and list ofparticipants

Page 21: Small Data in the large with Oppidum
Page 22: Small Data in the large with Oppidum

Application : UAPWeb site of the Union des Artisans du Patrimoine de Belgique

moderated classified ads service for the craftmen member of the association

Page 23: Small Data in the large with Oppidum
Page 24: Small Data in the large with Oppidum

Application : PSEdatabase 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

Page 25: Small Data in the large with Oppidum
Page 26: Small Data in the large with Oppidum

ConclusionEffective 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