SlideShare a Scribd company logo
1 of 14
What is XForms?
●
W3C standard web form specification
●
MVC architecture
●
XPath validation
●
Manipulate complex XML models*
●
Interacts with REST services
*XPath/XSLT 3.0 and XSLT 2.0 support JSON-LD
See more at http://en.wikipedia.org/wiki/XForms
Basic XForms workshop by Ethan Gruber. June 12, 2015
Kerameikos XRX-ish Architecture
XForms, REST, SPARQL/Solr
XForms processor
(Orbeon)
XForms
instructions
Fuseki
Triplestore
Solr
Save
(REST)
Author/editor
Web Form
User
(interface)
HTML5:
XSLT+JS+CSS
VIAF
DBpedia
Pleiades
Getty LOD
Web Services
External Content
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events"
xmlns:xxforms="http://orbeon.org/oxf/xml/xforms">
<head>
<title>hello world</title>
<xforms:model>
<xforms:instance id="hello-world">
<foo>hello world</foo>
</xforms:instance>
</xforms:model>
</head>
<body>
<h1>hello world</h1>
<xforms:output ref="instance('hello-world')">
<xforms:label>Label</xforms:label>
</xforms:output>
<xforms:output value="concat(instance('hello-world'), '!')">
<xforms:label>Label</xforms:label>
</xforms:output>
</body>
</html>
Model:
Instances, actions, bindings,
submissions
View:
Inputs, outputs, triggers,
actions
<head>
<xforms:model>
<xforms:instance id="list">
<list title="" xmlns="">
<item lang=""></item>
<item lang=""></item>
</list>
</xforms:instance>
<xforms:bind nodeset="instance('list')">
<xforms:bind nodeset="@title" required="true()"></xforms:bind>
<xforms:bind nodeset="item" required="true()" type="xs:string">
<xforms:bind nodeset="@lang"
constraint="string-length(.) &gt; 0 and
count(ancestor::list/item[@lang='en']) = 1 and count(ancestor::list/item/@lang) = count(distinct-
values(ancestor::list/item/@lang))"
></xforms:bind>
</xforms:bind>
</xforms:bind>
</xforms:model>
</head>
<body>
<div>
<xforms:input ref="instance('list')/@title">
<xforms:label>Title</xforms:label>
<xforms:alert>Required</xforms:alert>
</xforms:input>
</div>
</body>
<body>
<div>
<xforms:input ref="instance('list')/@title">
<xforms:label>Title</xforms:label>
<xforms:alert>Required</xforms:alert>
</xforms:input>
</div>
<xforms:repeat nodeset="instance('list')/item">
<div>
<xforms:input ref=".">
<xforms:label>Item</xforms:label>
<xforms:alert>Required</xforms:alert>
</xforms:input>
</div>
<div>
<xforms:input ref="@lang">
<xforms:label>Lang</xforms:label>
<xforms:alert>English Required. Must be Unique</xforms:alert>
</xforms:input>
</div>
</xforms:repeat>
</body>
<xforms:group ref="instance('list')">
<div>
<xforms:input ref="@title">
<xforms:label>Title</xforms:label>
<xforms:alert>Required</xforms:alert>
</xforms:input>
</div>
<xforms:repeat nodeset="item">
<div>
<xforms:input ref=".">
<xforms:label>Item</xforms:label>
<xforms:alert>Required</xforms:alert>
</xforms:input>
</div>
<div>
<xforms:input ref="@lang">
<xforms:label>Lang</xforms:label>
<xforms:alert>English Required. Must be Unique</xforms:alert>
</xforms:input>
</div>
</xforms:repeat>
</xforms:group>
XForms Group as a conditional for UI displays
<xforms:group ref=".[instance('list')//@lang[string-length(.) = 0]]">
<p>A language attribute is empty.</p>
</xforms:group>
<xforms:repeat nodeset="item">
<div>
<xforms:input ref=".">
<xforms:label>Item</xforms:label>
<xforms:alert>Required</xforms:alert>
</xforms:input>
</div>
<div>
<xforms:select1 ref="@lang">
<xforms:label>Type</xforms:label>
<xforms:alert>Required</xforms:alert>
<xforms:item>
<xforms:label>Select...</xforms:label>
<xforms:value></xforms:value>
</xforms:item>
<xforms:itemset nodeset="instance('languages')/lang">
<xforms:label ref="."></xforms:label>
<xforms:value ref="@code"></xforms:value>
</xforms:itemset>
</xforms:select1>
</div>
</xforms:repeat>
<xforms:instance id="languages">
<languages xmlns="">
<lang code="en">English</lang>
<lang code="fr">French</lang>
</languages>
</xforms:instance>
<xforms:trigger>
<xforms:label>Add Item</xforms:label>
<xforms:insert context="instance('list')" nodeset="./child::node()[last()]"
origin="instance('item-template')" ev:event="DOMActivate"/>
</xforms:trigger>
<xforms:instance id="item-template">
<item xmlns=""/>
</xforms:instance>
<xforms:trigger>
<xforms:label>Add Item</xforms:label>
<xforms:action ev:event="DOMActivate">
<xforms:insert context="instance('list')" nodeset="./child::node()[last()]"
origin="instance('item-template')"/>
<xforms:insert context="instance('list')/item[last()]"
origin="xforms:attribute('lang', instance('languages')/lang[1]/@code)"/>
<xforms:setvalue ref="instance('list')/item[last()]" value="'test'"/>
</xforms:action>
</xforms:trigger>
See more events: http://en.wikibooks.org/wiki/XForms/Events_Overview
<xforms:repeat nodeset="item">
<div>
<xforms:input ref=".">
<xforms:label>Item</xforms:label>
<xforms:alert>Required</xforms:alert>
</xforms:input>
</div>
<div>
<xforms:select1 ref="@lang">
<xforms:label>Type</xforms:label>
<xforms:alert>Required</xforms:alert>
<xforms:item>
<xforms:label>Select...</xforms:label>
<xforms:value></xforms:value>
</xforms:item>
<xforms:itemset nodeset="instance('languages')/lang">
<xforms:label ref="."></xforms:label>
<xforms:value ref="@code"></xforms:value>
</xforms:itemset>
</xforms:select1>
</div>
<xforms:trigger appearance="minimal">
<xforms:delete ev:event="DOMActivate" context="."></xforms:delete>
<xforms:label>Delete</xforms:label>
</xforms:trigger>
</xforms:repeat>
<xforms:submission id="load-submission" serialization="none" method="get"
action="{instance('exist-config')/url}eaditor/{instance('control-instance')/collection-
name}/guides/{instance('guide')/ead:eadheader/ead:eadid}.xml"
replace="instance" instance="guide" xxforms:username="{instance('exist-config')/username}"
xxforms:password="{instance('exist-config')/password}">
<xforms:message ev:event="xforms-submit-error" level="modal">Unable to load finding
aid</xforms:message>
<xforms:send submission="load-toc" ev:event="xforms-submit-done"/>
</xforms:submission>
SUBMISSIONS
<xforms:submit submission="load-submission" appearance="minimal">
<xforms:label>Load</xforms:label>
</xforms:submit>
<xforms:submission id="save-submission" ref="instance('guide')"
action="{instance('exist-config')/url}eaditor/{instance('control-instance')/collection-
name}/guides/{instance('guide')/ead:eadheader/ead:eadid}.xml" method="put"
replace="none" xxforms:username="{instance('exist-config')/username}"
xxforms:password="{instance('exist-config')/password}">
<xforms:message ev:event="xforms-submit-error" level="modal">Error Saving Documents. Be
sure all required inputs are filled in.</xforms:message>
<xforms:action ev:event="xforms-submit-done">
<xforms:setvalue ref="instance('control-instance')/status">EAD guide
saved.</xforms:setvalue>
<!-- check to see if the document is already published to Solr -->
<xforms:send submission="query-solr-for-publication"/>
<!-- reload toc -->
<xforms:send submission="load-toc"/>
</xforms:action>
</xforms:submission>
<xforms:submission id="query-solr-for-publication" serialization="none" method="get"
action="{instance('config')/solr_published}select/?q=id:&#x022;
{instance('guide')/ead:eadheader/ead:eadid}&#x022;" replace="instance" instance="is-published">
<!-- if the document is found in solr, get the updated solr doc -->
<xforms:action ev:event="xforms-submit-done" if="instance('is-
published')/result[@name='response']/@numFound = '1'">
<!-- post doc to solr -->
<xforms:send submission="doc-to-solr"/>
<!-- post to SPARQL, if the URLs are available in the config -->
<xforms:send submission="get-rdf" if="string(instance('config')/sparql/update) and
string(instance('config')/sparql/store)"/>
</xforms:action>
</xforms:submission>
Interactive demo code: https://gist.github.com/ewg118/d5a3e4624c3075764d81

More Related Content

Similar to XForms workshop slides

XForms for Metadata creation
XForms for Metadata creationXForms for Metadata creation
XForms for Metadata creationeby
 
XForms for Metadata Creation
XForms for Metadata CreationXForms for Metadata Creation
XForms for Metadata Creationmw_park
 
XML London 2013 - Architecture of xproc.xq an XProc processor
XML London 2013 - Architecture of xproc.xq an XProc processorXML London 2013 - Architecture of xproc.xq an XProc processor
XML London 2013 - Architecture of xproc.xq an XProc processorjimfuller2009
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1Marco Gralike
 
Extending XForms with Server-Side Functionality
Extending XForms with Server-Side FunctionalityExtending XForms with Server-Side Functionality
Extending XForms with Server-Side FunctionalityMarkku Laine
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Marco Gralike
 
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...InSync2011
 
EXPath: the packaging system and the webapp framework
EXPath: the packaging system and the webapp frameworkEXPath: the packaging system and the webapp framework
EXPath: the packaging system and the webapp frameworkFlorent Georges
 
XFormsDB: An XForms-Based Framework for Simplifying Web Application Development
XFormsDB: An XForms-Based Framework for Simplifying Web Application DevelopmentXFormsDB: An XForms-Based Framework for Simplifying Web Application Development
XFormsDB: An XForms-Based Framework for Simplifying Web Application DevelopmentMarkku Laine
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeMarco Gralike
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat ClientPaul Klipp
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)Serhii Kartashov
 
01 overview-and-setup
01 overview-and-setup01 overview-and-setup
01 overview-and-setupsnopteck
 
Programming the Semantic Web
Programming the Semantic WebProgramming the Semantic Web
Programming the Semantic WebLuigi De Russis
 
attachment_3998 (3).pdf
attachment_3998 (3).pdfattachment_3998 (3).pdf
attachment_3998 (3).pdfssuser02a37f1
 
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicHTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicOracle
 

Similar to XForms workshop slides (20)

XForms for Metadata creation
XForms for Metadata creationXForms for Metadata creation
XForms for Metadata creation
 
XForms for Metadata Creation
XForms for Metadata CreationXForms for Metadata Creation
XForms for Metadata Creation
 
XML London 2013 - Architecture of xproc.xq an XProc processor
XML London 2013 - Architecture of xproc.xq an XProc processorXML London 2013 - Architecture of xproc.xq an XProc processor
XML London 2013 - Architecture of xproc.xq an XProc processor
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
 
Extending XForms with Server-Side Functionality
Extending XForms with Server-Side FunctionalityExtending XForms with Server-Side Functionality
Extending XForms with Server-Side Functionality
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
 
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
Developer & Fusion Middleware 1 | Mark Drake | An introduction to Oracle XML ...
 
Linq To XML Overview
Linq To XML OverviewLinq To XML Overview
Linq To XML Overview
 
EXPath: the packaging system and the webapp framework
EXPath: the packaging system and the webapp frameworkEXPath: the packaging system and the webapp framework
EXPath: the packaging system and the webapp framework
 
XFormsDB: An XForms-Based Framework for Simplifying Web Application Development
XFormsDB: An XForms-Based Framework for Simplifying Web Application DevelopmentXFormsDB: An XForms-Based Framework for Simplifying Web Application Development
XFormsDB: An XForms-Based Framework for Simplifying Web Application Development
 
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco GralikeBoost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
Boost Your Environment With XMLDB - UKOUG 2008 - Marco Gralike
 
Krug Fat Client
Krug Fat ClientKrug Fat Client
Krug Fat Client
 
eXtensible Markup Language (XML)
eXtensible Markup Language (XML)eXtensible Markup Language (XML)
eXtensible Markup Language (XML)
 
Legislation.gov.uk
Legislation.gov.ukLegislation.gov.uk
Legislation.gov.uk
 
01 overview-and-setup
01 overview-and-setup01 overview-and-setup
01 overview-and-setup
 
Programming the Semantic Web
Programming the Semantic WebProgramming the Semantic Web
Programming the Semantic Web
 
Spring Surf 101
Spring Surf 101Spring Surf 101
Spring Surf 101
 
attachment_3998 (3).pdf
attachment_3998 (3).pdfattachment_3998 (3).pdf
attachment_3998 (3).pdf
 
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogicHTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
HTTP Session Replication with Oracle Coherence, GlassFish, WebLogic
 
RDFauthor (EKAW)
RDFauthor (EKAW)RDFauthor (EKAW)
RDFauthor (EKAW)
 

More from ewg118

LOD for Numismatic LAM Integration
LOD for Numismatic LAM IntegrationLOD for Numismatic LAM Integration
LOD for Numismatic LAM Integrationewg118
 
Integrating Geographic Linked Data
Integrating Geographic Linked DataIntegrating Geographic Linked Data
Integrating Geographic Linked Dataewg118
 
From 0 to 60 in SPARQL in 50 Minutes
From 0 to 60 in SPARQL in 50 MinutesFrom 0 to 60 in SPARQL in 50 Minutes
From 0 to 60 in SPARQL in 50 Minutesewg118
 
Linking Lives, Linking Data
Linking Lives, Linking DataLinking Lives, Linking Data
Linking Lives, Linking Dataewg118
 
xEAC: XForms for EAC-CPF
xEAC: XForms for EAC-CPFxEAC: XForms for EAC-CPF
xEAC: XForms for EAC-CPFewg118
 
Linked Open Pottery
Linked Open PotteryLinked Open Pottery
Linked Open Potteryewg118
 
Roman Imperial Social Network and other things
Roman Imperial Social Network and other thingsRoman Imperial Social Network and other things
Roman Imperial Social Network and other thingsewg118
 
Roman Republican Coinage Online: How does it work?
Roman Republican Coinage Online: How does it work?Roman Republican Coinage Online: How does it work?
Roman Republican Coinage Online: How does it work?ewg118
 
Numismatic Linked Open Data and Geographic Analysis
Numismatic Linked Open Data and Geographic AnalysisNumismatic Linked Open Data and Geographic Analysis
Numismatic Linked Open Data and Geographic Analysisewg118
 
Building Interlinked Prosopographies: A New Approach
Building Interlinked Prosopographies: A New ApproachBuilding Interlinked Prosopographies: A New Approach
Building Interlinked Prosopographies: A New Approachewg118
 
Linking Roman Coins: CAA2012
Linking Roman Coins: CAA2012Linking Roman Coins: CAA2012
Linking Roman Coins: CAA2012ewg118
 

More from ewg118 (11)

LOD for Numismatic LAM Integration
LOD for Numismatic LAM IntegrationLOD for Numismatic LAM Integration
LOD for Numismatic LAM Integration
 
Integrating Geographic Linked Data
Integrating Geographic Linked DataIntegrating Geographic Linked Data
Integrating Geographic Linked Data
 
From 0 to 60 in SPARQL in 50 Minutes
From 0 to 60 in SPARQL in 50 MinutesFrom 0 to 60 in SPARQL in 50 Minutes
From 0 to 60 in SPARQL in 50 Minutes
 
Linking Lives, Linking Data
Linking Lives, Linking DataLinking Lives, Linking Data
Linking Lives, Linking Data
 
xEAC: XForms for EAC-CPF
xEAC: XForms for EAC-CPFxEAC: XForms for EAC-CPF
xEAC: XForms for EAC-CPF
 
Linked Open Pottery
Linked Open PotteryLinked Open Pottery
Linked Open Pottery
 
Roman Imperial Social Network and other things
Roman Imperial Social Network and other thingsRoman Imperial Social Network and other things
Roman Imperial Social Network and other things
 
Roman Republican Coinage Online: How does it work?
Roman Republican Coinage Online: How does it work?Roman Republican Coinage Online: How does it work?
Roman Republican Coinage Online: How does it work?
 
Numismatic Linked Open Data and Geographic Analysis
Numismatic Linked Open Data and Geographic AnalysisNumismatic Linked Open Data and Geographic Analysis
Numismatic Linked Open Data and Geographic Analysis
 
Building Interlinked Prosopographies: A New Approach
Building Interlinked Prosopographies: A New ApproachBuilding Interlinked Prosopographies: A New Approach
Building Interlinked Prosopographies: A New Approach
 
Linking Roman Coins: CAA2012
Linking Roman Coins: CAA2012Linking Roman Coins: CAA2012
Linking Roman Coins: CAA2012
 

Recently uploaded

Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 

Recently uploaded (20)

Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 

XForms workshop slides

  • 1. What is XForms? ● W3C standard web form specification ● MVC architecture ● XPath validation ● Manipulate complex XML models* ● Interacts with REST services *XPath/XSLT 3.0 and XSLT 2.0 support JSON-LD See more at http://en.wikipedia.org/wiki/XForms Basic XForms workshop by Ethan Gruber. June 12, 2015
  • 2. Kerameikos XRX-ish Architecture XForms, REST, SPARQL/Solr XForms processor (Orbeon) XForms instructions Fuseki Triplestore Solr Save (REST) Author/editor Web Form User (interface) HTML5: XSLT+JS+CSS VIAF DBpedia Pleiades Getty LOD Web Services External Content
  • 3. <html xmlns="http://www.w3.org/1999/xhtml" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms"> <head> <title>hello world</title> <xforms:model> <xforms:instance id="hello-world"> <foo>hello world</foo> </xforms:instance> </xforms:model> </head> <body> <h1>hello world</h1> <xforms:output ref="instance('hello-world')"> <xforms:label>Label</xforms:label> </xforms:output> <xforms:output value="concat(instance('hello-world'), '!')"> <xforms:label>Label</xforms:label> </xforms:output> </body> </html> Model: Instances, actions, bindings, submissions View: Inputs, outputs, triggers, actions
  • 4. <head> <xforms:model> <xforms:instance id="list"> <list title="" xmlns=""> <item lang=""></item> <item lang=""></item> </list> </xforms:instance> <xforms:bind nodeset="instance('list')"> <xforms:bind nodeset="@title" required="true()"></xforms:bind> <xforms:bind nodeset="item" required="true()" type="xs:string"> <xforms:bind nodeset="@lang" constraint="string-length(.) &gt; 0 and count(ancestor::list/item[@lang='en']) = 1 and count(ancestor::list/item/@lang) = count(distinct- values(ancestor::list/item/@lang))" ></xforms:bind> </xforms:bind> </xforms:bind> </xforms:model> </head> <body> <div> <xforms:input ref="instance('list')/@title"> <xforms:label>Title</xforms:label> <xforms:alert>Required</xforms:alert> </xforms:input> </div> </body>
  • 5. <body> <div> <xforms:input ref="instance('list')/@title"> <xforms:label>Title</xforms:label> <xforms:alert>Required</xforms:alert> </xforms:input> </div> <xforms:repeat nodeset="instance('list')/item"> <div> <xforms:input ref="."> <xforms:label>Item</xforms:label> <xforms:alert>Required</xforms:alert> </xforms:input> </div> <div> <xforms:input ref="@lang"> <xforms:label>Lang</xforms:label> <xforms:alert>English Required. Must be Unique</xforms:alert> </xforms:input> </div> </xforms:repeat> </body>
  • 6. <xforms:group ref="instance('list')"> <div> <xforms:input ref="@title"> <xforms:label>Title</xforms:label> <xforms:alert>Required</xforms:alert> </xforms:input> </div> <xforms:repeat nodeset="item"> <div> <xforms:input ref="."> <xforms:label>Item</xforms:label> <xforms:alert>Required</xforms:alert> </xforms:input> </div> <div> <xforms:input ref="@lang"> <xforms:label>Lang</xforms:label> <xforms:alert>English Required. Must be Unique</xforms:alert> </xforms:input> </div> </xforms:repeat> </xforms:group>
  • 7. XForms Group as a conditional for UI displays <xforms:group ref=".[instance('list')//@lang[string-length(.) = 0]]"> <p>A language attribute is empty.</p> </xforms:group>
  • 8. <xforms:repeat nodeset="item"> <div> <xforms:input ref="."> <xforms:label>Item</xforms:label> <xforms:alert>Required</xforms:alert> </xforms:input> </div> <div> <xforms:select1 ref="@lang"> <xforms:label>Type</xforms:label> <xforms:alert>Required</xforms:alert> <xforms:item> <xforms:label>Select...</xforms:label> <xforms:value></xforms:value> </xforms:item> <xforms:itemset nodeset="instance('languages')/lang"> <xforms:label ref="."></xforms:label> <xforms:value ref="@code"></xforms:value> </xforms:itemset> </xforms:select1> </div> </xforms:repeat> <xforms:instance id="languages"> <languages xmlns=""> <lang code="en">English</lang> <lang code="fr">French</lang> </languages> </xforms:instance>
  • 9. <xforms:trigger> <xforms:label>Add Item</xforms:label> <xforms:insert context="instance('list')" nodeset="./child::node()[last()]" origin="instance('item-template')" ev:event="DOMActivate"/> </xforms:trigger> <xforms:instance id="item-template"> <item xmlns=""/> </xforms:instance> <xforms:trigger> <xforms:label>Add Item</xforms:label> <xforms:action ev:event="DOMActivate"> <xforms:insert context="instance('list')" nodeset="./child::node()[last()]" origin="instance('item-template')"/> <xforms:insert context="instance('list')/item[last()]" origin="xforms:attribute('lang', instance('languages')/lang[1]/@code)"/> <xforms:setvalue ref="instance('list')/item[last()]" value="'test'"/> </xforms:action> </xforms:trigger> See more events: http://en.wikibooks.org/wiki/XForms/Events_Overview
  • 10. <xforms:repeat nodeset="item"> <div> <xforms:input ref="."> <xforms:label>Item</xforms:label> <xforms:alert>Required</xforms:alert> </xforms:input> </div> <div> <xforms:select1 ref="@lang"> <xforms:label>Type</xforms:label> <xforms:alert>Required</xforms:alert> <xforms:item> <xforms:label>Select...</xforms:label> <xforms:value></xforms:value> </xforms:item> <xforms:itemset nodeset="instance('languages')/lang"> <xforms:label ref="."></xforms:label> <xforms:value ref="@code"></xforms:value> </xforms:itemset> </xforms:select1> </div> <xforms:trigger appearance="minimal"> <xforms:delete ev:event="DOMActivate" context="."></xforms:delete> <xforms:label>Delete</xforms:label> </xforms:trigger> </xforms:repeat>
  • 11. <xforms:submission id="load-submission" serialization="none" method="get" action="{instance('exist-config')/url}eaditor/{instance('control-instance')/collection- name}/guides/{instance('guide')/ead:eadheader/ead:eadid}.xml" replace="instance" instance="guide" xxforms:username="{instance('exist-config')/username}" xxforms:password="{instance('exist-config')/password}"> <xforms:message ev:event="xforms-submit-error" level="modal">Unable to load finding aid</xforms:message> <xforms:send submission="load-toc" ev:event="xforms-submit-done"/> </xforms:submission> SUBMISSIONS <xforms:submit submission="load-submission" appearance="minimal"> <xforms:label>Load</xforms:label> </xforms:submit>
  • 12. <xforms:submission id="save-submission" ref="instance('guide')" action="{instance('exist-config')/url}eaditor/{instance('control-instance')/collection- name}/guides/{instance('guide')/ead:eadheader/ead:eadid}.xml" method="put" replace="none" xxforms:username="{instance('exist-config')/username}" xxforms:password="{instance('exist-config')/password}"> <xforms:message ev:event="xforms-submit-error" level="modal">Error Saving Documents. Be sure all required inputs are filled in.</xforms:message> <xforms:action ev:event="xforms-submit-done"> <xforms:setvalue ref="instance('control-instance')/status">EAD guide saved.</xforms:setvalue> <!-- check to see if the document is already published to Solr --> <xforms:send submission="query-solr-for-publication"/> <!-- reload toc --> <xforms:send submission="load-toc"/> </xforms:action> </xforms:submission>
  • 13. <xforms:submission id="query-solr-for-publication" serialization="none" method="get" action="{instance('config')/solr_published}select/?q=id:&#x022; {instance('guide')/ead:eadheader/ead:eadid}&#x022;" replace="instance" instance="is-published"> <!-- if the document is found in solr, get the updated solr doc --> <xforms:action ev:event="xforms-submit-done" if="instance('is- published')/result[@name='response']/@numFound = '1'"> <!-- post doc to solr --> <xforms:send submission="doc-to-solr"/> <!-- post to SPARQL, if the URLs are available in the config --> <xforms:send submission="get-rdf" if="string(instance('config')/sparql/update) and string(instance('config')/sparql/store)"/> </xforms:action> </xforms:submission>
  • 14. Interactive demo code: https://gist.github.com/ewg118/d5a3e4624c3075764d81