SlideShare a Scribd company logo
1 of 43
Download to read offline
Bertrand Delacrétaz
Senior Developer, R&D, Day Software, now part of Adobe
Apache Software Foundation Member and Director
http://grep.codeconsult.ch - twitter: @bdelacretaz - bdelacretaz@apache.org
ApacheCon NA 2010, Atlanta
slides revision: 2010-11-03
1
RESTful web
applications with
Apache Sling
SlingRestful
WebApps
everything is
content
JCRAPI
The Java Content Repository
Tree of nodes and properties
JSR-170, JSR-283
URLs map to
resources, not
commands
Text, images, media,
configurations, code, binary
OSGi bundles, etc...
RESTful Web
website content
/content
/geometrixx
/en
/company
/jcr:content
/par
/title
blog design content
/etc/designs/blog/kubrick/jcr:content
code content!
/libs
/cq
/code
/install
/xyz.jar
Apache
SlingApplications layer for JCR repositories
«any» scripting languagescript == servlet
OSGi-basedpowerful default servlets
resource-based
powered by
storage
components
OSGi framework
(Apache Felix)
JCR
content
repository
javascript
JSP
Ruby
Velocity
etc..
debugger
WebDAV
server
Felix OSGi
console
browserfilesystem
JCR API
HTTP
resource
resolution
custom servlets
and components
JSR 223
scripting
servlet/script
resolution
standard
servlets
content administration UI
Apache Sling
architecture
Apache Sling
SlingRestful
WebApps Bertrand Delacretaz
Repository
/cars/audi/s4.details.html
Content
RepositoryPath
...selector+
extensionselectaparticularscript
Reclaiming the Web:
Sling URL decomposition
SlingRestful
WebApps Bertrand Delacretaz
Great for modularity
Fosters better structured code
Dynamic services and plugins
Tooling needs to improve, but usable
OSGi skills? - OSGi way of thinking is new...
Asynchronous startup can be problematic if
using declarative services
OSGi?
Appdevelopers,
don’tworry!
What
can you do with Sling?
Next-generation RESTful kernel for permeable,
social, personal and remixable collaboration/
learning environment.
See http://sakaiproject.org/case-studies
idium.no - full-
service hosted CMS
integrated with CRM.
Autoscales on
Amazon EC based
on JCR clustering
and Sling event
support.
BIG websites
Multi-channel + mobile
Customer
Engagement
Management
powered by
e-commerce
Web Content
Management
www.day.com
Digital Assets
Management
Content
Applications
Platform
CQ5
Sling blog
46 lines of code
http://x42.ch/05.40.01
SlingRestful
WebApps Bertrand Delacretaz
# POST to Sling
curl -F title=hi http://localhost:8888/foo
-> 200 OK
# GET created node in json format
curl http://localhost:8888/foo.tidy.json
{
"jcr:primaryType": "nt:unstructured",
"title": "hi"
}
POST
parametersset
nodeproperties
Sling POST Servlet: create content
Zerosetup!
SlingRestful
WebApps Bertrand Delacretaz
<form method="POST">
Title:
<input type="text" name="title"/>
Text:
<textarea name="text"></textarea>
<input type="submit" value="save"/>
<input type="hidden"
name=":redirect" value="*"/>
</form>
Formfields
drivethe
contentmodel
HTML form for editing
SlingRestful
WebApps Bertrand Delacretaz
<script src="/system/sling.js"></script>
<form method="POST">
...(as in step 1)...
</form>
<!-- set form fields to current node values -->
<script>Sling.wizard();</script>
InstantCRU(D)
sling.js: initializes form fields
SlingRestful
WebApps Bertrand Delacretaz
<ul>
<li>
<a href="/content/blog/*">[Create post]</a>
</li>
<script>
var posts = Sling.getContent("/content/blog", 2);
for(var post in posts) {
document.write(
"<li><a href=’” + post + "'>"
+ posts[post].title + "</a></li>");
}
</script>
</ul>
sling.js: generate navigation
more at http://x42.ch/05.40.01
we got a blog!
html form + Sling wizard() + Sling.getContent()
Slingbucks
RESTful coffee orders
Inspiredby
«HowtoGETa
cupofcoffee»
oninfoq.com
Stillabasicapp,
abitmore
realistic
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks demo
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks use case #1: order coffee
App displays order
form with configurable
options.
Customer indicates
their name, options,
submits order.
App generates hard to
guess order ID.
App redisplays order
for confirmation (use-
case #2).
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks use case #2: confirm order
App redisplays order
form.
Customer either
modifies and
recalculates price, or
confirms order.
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks use case #3: process order
Order moves to the
private Slingbucks
employees area.
App displays a list of
confirmed orders.
Employee delivers
order and deletes it
from list.
SlingRestful
WebApps Bertrand Delacretaz
OO design:
Highlight names to find objects
App displays order
form with configurable
options.
Customer indicates
their name, options,
submits order.
App redisplays order
for confirmation (use-
case #2).
Justkidding;-) Everythingis
CONTENT
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks resources design
New order form:
http://slingbucks.com/public/orders.html
Order editing and confirmation (example):
http://slingbucks.com/public/orders/54494da6029.html
Price of an order:
Same but ending with .price.html selector
List of confirmed orders:
http://slingbucks.com/private/confirmed.html
Obvioussecurity/privacy
Namedresources
MeaningfulURLs
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks demo
browser-friendly RESTful operations
POST to orders/
POST with orderConfirmed
POST to order resource
SlingRestful
WebApps Bertrand Delacretaz
Geeks order coffee with curl...
What else?
$ curl -D -
-F "customerName=Bob The Geek"
-F sling:resourceType=slingbucks/order
-F lastModified=""
-F opt_coffeetype=capuccino
-F opt_size=medium
-F opt_sugar=raw
-F opt_cup=rosewood
http://admin:admin@localhost:8080/content/slingbucks/public/orders/
HTTP/1.1 201 Created
Location: /slingbucks/public/orders/117936075d4de452cbba5b468
Naturally
Hackable(TM)
AddorderConfirmed
fieldtoconfirm,as
seeninconfirmform
SlingRestful
WebApps Bertrand Delacretaz
Coffee node content
$ curl http://localhost:8080/content/slingbucks/public/orders/
fad01d62f50aaca54209ae14c9505e3b.tidy.json
{
"opt_size": "small",
"customerName": "Anonymous Coffee Drinker",
"opt_coffeetype": "espresso",
"opt_sugar": "none",
"sling:resourceType": "slingbucks/order",
"opt_cup": "plastic",
"lastModified": "Mon Nov 01 2010 18:31:01 GMT+0100",
"jcr:primaryType": "nt:unstructured"
}
Out-oftheboxJSON
representation
Slingbucks
code walkthrough
SlingRestful
WebApps Bertrand Delacretaz
Hypermedia? Self-documenting?
<link
rel="slingbucks/options"
href="/content/slingbucks/readonly/
options.tidy.infinity.json"/>
...
<form method="POST"
action="/content/slingbucks/public/orders/"
...
<select name="opt_coffeetype">
<options>
<option value="espresso">Espresso</option>
<option value="capuccino">Capuccino</option>
<option value="macchiato">Macchiato</option>
</select>
... public/orders.html
form provides all
required «API» info.
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks code: order ID generation
// Just provide an OSGi service that implements NodeNameGenerator
@Component
@Service
public class HexNodeNameGenerator
implements org.apache.sling.servlets.post.NodeNameGenerator {
...
public String getNodeName(
SlingHttpServletRequest request,
String parentPath,
...)
{
if(SlingbucksConstants.ORDERS_PATH.equals(parentPath)) {
return computeHardToGuessNodeName();
}
return null;
}
}
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks code:
move confirmed orders 1/2
@Component
public class ConfirmedOrdersObserver
implements EventListener, Runnable {
@Reference
private SlingRepository repository;
/** Called by OSGi framework when component starts */
protected void activate(ComponentContext context){
session = repository.loginAdministrative(null);
om = session.getWorkspace().getObservationManager();
String path = "/content/slingbucks/orders";
om.addEventListener(this,
Event.PROPERTY_CHANGED | Event.PROPERTY_ADDED,
path...);
}
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks code:
move confirmed orders 2/2
@Component
public class ConfirmedOrdersObserver
implements EventListener, Runnable {
... code from page 1
public void onEvent(EventIterator it) {
while (it.hasNext()) {
if(path.endsWith(«orderConfirmed») {
... note property change and
... if confirmed move node later
... using session.getWorkspace().move(srcPath, destPath);
}
}
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks «code»:
initial content for options
src/main/resources/SLING-CONTENT/content/slingbucks/readonly/options.json:
"fields" : {
"coffeetype" : {
"jcr:title" : "Coffee type",
"espresso" : {
"jcr:title" : "Espresso",
"jcr:description" : "The Italian job",
"priceOffset" : 2.20
},
"capuccino" : {
"jcr:title" : "Capuccino",
"jcr:description" : "The one with cream on top",
"priceOffset" : 3.40
}
},
"size" : {
"jcr:title" : "Size",
"small" : {
"jcr:title" : "Small",
"jcr:description" : "1dl",
"priceFactor" : 1
},
"large" : {
"jcr:title" : "Large",
"jcr:description" : "5dl",
"priceFactor" : 2
}
},
LoadedbySlingas
nodes/properties
whenOSGibundle
isloaded
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks code: content -> options form
src/main/resources/SLING-CONTENT/apps/slingbucks/options/options.esp:
<%
// Make sure current node has a "fields" subnode,
// and visit it (duck typing content!)
if(currentNode["fields"]) {
var fields = currentNode["fields"];
for(i in fields) {
var f = fields[i];
// If field has a jcr:title property, we can use it
if(f["jcr:title"]) {
%>
// Generate HTML <select> for our field
<select name="<%= fieldName %>">
<options>
<%
for(j in f) {
var opt = f[j];
if(opt["jcr:title"]) {
%>
<option value="<%= j %>"><%= opt["jcr:title"] %></option>
<%
}
}
%>
...
// Set appropriate resource type on created coffee order
// and let Sling set lastModified property
<input type="hidden" name="sling:resourceType" value="slingbucks/order"/>
<input type="hidden" id="lastModified" name="lastModified" value=""/>
Server-side
Javascript
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks LOC
Java code: 250
171 src/main/java/org/apache...ConfirmedOrdersObserver.java
57 src/main/java/org/apache...HexNodeNameGenerator.java
28 src/main/java/org/apache...SlingbucksConstants.java
HTML representation scripts: 250
2 /apps/slingbucks/common/head.esp
15 /apps/slingbucks/confirmed/confirmed.esp
47 /apps/slingbucks/options/options.esp
25 /apps/slingbucks/order/backoffice.esp
58 /apps/slingbucks/order/order.esp
58 /apps/slingbucks/order/price.esp
32 /apps/slingbucks/orders/orders.esp
Initial content: 85
73 /content/slingbucks/readonly/options.json
6 /content/slingbucks/private.json
6 /content/slingbucks/public.json
Style etc: 43
38 /apps/slingbucks/common/slingbucks.css
5 /apps/slingbucks/common/slingbucks.js
SlingRestful
WebApps Bertrand Delacretaz
Content-driven app: new field
$ cat /tmp/logo.json
{
"jcr:title": "Cup Logo",
"slingbucks": {
"priceFactor": 1,
"jcr:title": "Slingbucks",
},
"apache": {
"priceFactor": 1.5,
"jcr:title": "Apache Software Foundation",
},
"swissflag": {
"priceFactor": 4.5,
"jcr:title": "Swiss flag",
}
}
curl -F:operation=import -F:contentType=json -F:contentFile=@/
tmp/logo.json http://admin:admin@127.0.0.1:8080/content/
slingbucks/readonly/options/fields/logo
RESTful
reconfiguration!
SlingRestful
WebApps Bertrand Delacretaz
Slingbucks next steps
Security:
Setup ACL on /public, /readonly, /private.
All done.
Scalability:
Built-in. No HTTP sessions. Cache-friendly.
RESTful.
End-to-end testing:
Easy using HTTP/JSON and HTTP/HTML
scenarios.
SlingRestful
WebApps Bertrand Delacretaz
That was not too hard, was it?
Code online soon,
stay tuned to twitter @bdelacretaz
or Sling mailing lists
SlingRestful
WebApps
RESTful apps with
Sling
Built-in RESTful
content creation/
editing URLs map to
resources, not
commands
Easy to plugin scripts,
(OSGi-based) servlets and
extensions.
RESTful Web
SlingRestful
WebApps
more about
Sling?
http://sling.apache.org
http://dev.day.com
http://grep.codeconsult.ch
@bdelacretaz on Twitter
slingbucks code on sling.apache.org soon
This slide deck is licensed under the
Creative Commons Attribution-Noncommercial-Share Alike 3 license.
Copyright (C) 2010, Bertrand Delacretaz

More Related Content

What's hot

Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 WorkflowsRyan Street
 
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendSpike Brehm
 
Front-end build tools - Webpack
Front-end build tools - WebpackFront-end build tools - Webpack
Front-end build tools - WebpackRazvan Rosu
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Saeed Zarinfam
 
Ruby on Rails Security
Ruby on Rails SecurityRuby on Rails Security
Ruby on Rails Securityamiable_indian
 
CIRCUIT 2015 - 10 Things Apache Sling Can Do
CIRCUIT 2015 - 10 Things Apache Sling Can DoCIRCUIT 2015 - 10 Things Apache Sling Can Do
CIRCUIT 2015 - 10 Things Apache Sling Can DoICF CIRCUIT
 
RESTful web service with JBoss Fuse
RESTful web service with JBoss FuseRESTful web service with JBoss Fuse
RESTful web service with JBoss Fuseejlp12
 
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey KolodnitskiyDeveloping Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey KolodnitskiyLohika_Odessa_TechTalks
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkBo-Yi Wu
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleHenryk Konsek
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on RailsMark Menard
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneidermfrancis
 
How to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorialHow to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorialKaty Slemon
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Coremohamed elshafey
 
Introduction to Play Framework
Introduction to Play FrameworkIntroduction to Play Framework
Introduction to Play FrameworkWarren Zhou
 
Using VueJS in front of Drupal 8
Using VueJS in front of Drupal 8Using VueJS in front of Drupal 8
Using VueJS in front of Drupal 8Brian Ward
 

What's hot (20)

Magento 2 Workflows
Magento 2 WorkflowsMagento 2 Workflows
Magento 2 Workflows
 
Sails.js Intro
Sails.js IntroSails.js Intro
Sails.js Intro
 
The Evolution of Airbnb's Frontend
The Evolution of Airbnb's FrontendThe Evolution of Airbnb's Frontend
The Evolution of Airbnb's Frontend
 
Front-end build tools - Webpack
Front-end build tools - WebpackFront-end build tools - Webpack
Front-end build tools - Webpack
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)
 
Ruby on Rails Security
Ruby on Rails SecurityRuby on Rails Security
Ruby on Rails Security
 
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter LehtoJavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
JavaCro'14 - Building interactive web applications with Vaadin – Peter Lehto
 
CIRCUIT 2015 - 10 Things Apache Sling Can Do
CIRCUIT 2015 - 10 Things Apache Sling Can DoCIRCUIT 2015 - 10 Things Apache Sling Can Do
CIRCUIT 2015 - 10 Things Apache Sling Can Do
 
Introduction to CQ5
Introduction to CQ5Introduction to CQ5
Introduction to CQ5
 
RESTful web service with JBoss Fuse
RESTful web service with JBoss FuseRESTful web service with JBoss Fuse
RESTful web service with JBoss Fuse
 
Developing Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey KolodnitskiyDeveloping Rest services with SailsJs by Andrey Kolodnitskiy
Developing Rest services with SailsJs by Andrey Kolodnitskiy
 
CodeIgniter PHP MVC Framework
CodeIgniter PHP MVC FrameworkCodeIgniter PHP MVC Framework
CodeIgniter PHP MVC Framework
 
Apache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whaleApache Camel in the belly of the Docker whale
Apache Camel in the belly of the Docker whale
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
 
OSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian SchneiderOSGi ecosystems compared on Apache Karaf - Christian Schneider
OSGi ecosystems compared on Apache Karaf - Christian Schneider
 
How to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorialHow to dockerize rails application compose and rails tutorial
How to dockerize rails application compose and rails tutorial
 
Asp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework CoreAsp.Net Core MVC , Razor page , Entity Framework Core
Asp.Net Core MVC , Razor page , Entity Framework Core
 
Introduction to Play Framework
Introduction to Play FrameworkIntroduction to Play Framework
Introduction to Play Framework
 
Intro to Sails.js
Intro to Sails.jsIntro to Sails.js
Intro to Sails.js
 
Using VueJS in front of Drupal 8
Using VueJS in front of Drupal 8Using VueJS in front of Drupal 8
Using VueJS in front of Drupal 8
 

Viewers also liked

OSGi for outsiders - Milen Dyankov
OSGi for outsiders - Milen DyankovOSGi for outsiders - Milen Dyankov
OSGi for outsiders - Milen Dyankovmfrancis
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Carsten Ziegeler
 
Monitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleMonitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleCarsten Ziegeler
 
OSGi toolchain from the ground up - Matteo Rulli
OSGi toolchain from the ground up - Matteo RulliOSGi toolchain from the ground up - Matteo Rulli
OSGi toolchain from the ground up - Matteo Rullimfrancis
 
Distributed Eventing in OSGi
Distributed Eventing in OSGiDistributed Eventing in OSGi
Distributed Eventing in OSGiCarsten Ziegeler
 
OSGi Specification Evolution - BJ Hargrave
OSGi Specification Evolution - BJ HargraveOSGi Specification Evolution - BJ Hargrave
OSGi Specification Evolution - BJ Hargravemfrancis
 
Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010sullis
 
Distributed Eventing in OSGi - Carsten Ziegeler
Distributed Eventing in OSGi - Carsten ZiegelerDistributed Eventing in OSGi - Carsten Ziegeler
Distributed Eventing in OSGi - Carsten Ziegelermfrancis
 
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho DelchevWebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchevmfrancis
 
Lean Microservices with OSGi - Christian Schneider
Lean Microservices with OSGi - Christian SchneiderLean Microservices with OSGi - Christian Schneider
Lean Microservices with OSGi - Christian Schneidermfrancis
 
OSGi Best Practices - Tim Ward
OSGi Best Practices - Tim WardOSGi Best Practices - Tim Ward
OSGi Best Practices - Tim Wardmfrancis
 
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...mfrancis
 
Service oriented web development with OSGi
Service oriented web development with OSGiService oriented web development with OSGi
Service oriented web development with OSGiCarsten Ziegeler
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Yevgeniy Brikman
 

Viewers also liked (16)

OSGi for outsiders - Milen Dyankov
OSGi for outsiders - Milen DyankovOSGi for outsiders - Milen Dyankov
OSGi for outsiders - Milen Dyankov
 
Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)Use Case: Building OSGi Enterprise Applications (QCon 14)
Use Case: Building OSGi Enterprise Applications (QCon 14)
 
Monitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web ConsoleMonitoring OSGi Applications with the Web Console
Monitoring OSGi Applications with the Web Console
 
OSGi toolchain from the ground up - Matteo Rulli
OSGi toolchain from the ground up - Matteo RulliOSGi toolchain from the ground up - Matteo Rulli
OSGi toolchain from the ground up - Matteo Rulli
 
Distributed Eventing in OSGi
Distributed Eventing in OSGiDistributed Eventing in OSGi
Distributed Eventing in OSGi
 
Reactive applications
Reactive applicationsReactive applications
Reactive applications
 
OSGi Specification Evolution - BJ Hargrave
OSGi Specification Evolution - BJ HargraveOSGi Specification Evolution - BJ Hargrave
OSGi Specification Evolution - BJ Hargrave
 
Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010Programming WebSockets - OSCON 2010
Programming WebSockets - OSCON 2010
 
Distributed Eventing in OSGi - Carsten Ziegeler
Distributed Eventing in OSGi - Carsten ZiegelerDistributed Eventing in OSGi - Carsten Ziegeler
Distributed Eventing in OSGi - Carsten Ziegeler
 
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho DelchevWebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
WebSockets and Equinox OSGi in a Servlet Container - Nedelcho Delchev
 
Lean Microservices with OSGi - Christian Schneider
Lean Microservices with OSGi - Christian SchneiderLean Microservices with OSGi - Christian Schneider
Lean Microservices with OSGi - Christian Schneider
 
OSGi Best Practices - Tim Ward
OSGi Best Practices - Tim WardOSGi Best Practices - Tim Ward
OSGi Best Practices - Tim Ward
 
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
Getting to the Next Level with Eclipse Concierge - Jan Rellermeyer + Tim Verb...
 
Service oriented web development with OSGi
Service oriented web development with OSGiService oriented web development with OSGi
Service oriented web development with OSGi
 
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...Infrastructure as code: running microservices on AWS using Docker, Terraform,...
Infrastructure as code: running microservices on AWS using Docker, Terraform,...
 
The AI Rush
The AI RushThe AI Rush
The AI Rush
 

Similar to RESTful Web Applications with Apache Sling

Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングscalaconfjp
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Ngoc Dao
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWAREFIWARE
 
Meetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfMeetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfLuca Mattia Ferrari
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCLFastly
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortalJennifer Bourey
 
Open stack ocata summit enabling aws lambda-like functionality with openstac...
Open stack ocata summit  enabling aws lambda-like functionality with openstac...Open stack ocata summit  enabling aws lambda-like functionality with openstac...
Open stack ocata summit enabling aws lambda-like functionality with openstac...Shaun Murakami
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsRemy Sharp
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WAREFermin Galan
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serializationGWTcon
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...Fabio Franzini
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)Igor Bronovskyy
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020Matt Raible
 
Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Spike Brehm
 
HTML5 for Rich User Experience
HTML5 for Rich User ExperienceHTML5 for Rich User Experience
HTML5 for Rich User ExperienceMahbubur Rahman
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'sAntônio Roberto Silva
 

Similar to RESTful Web Applications with Apache Sling (20)

Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディングXitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
Xitrum Web Framework Live Coding Demos / Xitrum Web Framework ライブコーディング
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
Developing your first application using FIWARE
Developing your first application using FIWAREDeveloping your first application using FIWARE
Developing your first application using FIWARE
 
Meetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdfMeetup 2022 - APIs with Quarkus.pdf
Meetup 2022 - APIs with Quarkus.pdf
 
Solving anything in VCL
Solving anything in VCLSolving anything in VCL
Solving anything in VCL
 
Spine.js
Spine.jsSpine.js
Spine.js
 
Rich Portlet Development in uPortal
Rich Portlet Development in uPortalRich Portlet Development in uPortal
Rich Portlet Development in uPortal
 
Always on! Or not?
Always on! Or not?Always on! Or not?
Always on! Or not?
 
Open stack ocata summit enabling aws lambda-like functionality with openstac...
Open stack ocata summit  enabling aws lambda-like functionality with openstac...Open stack ocata summit  enabling aws lambda-like functionality with openstac...
Open stack ocata summit enabling aws lambda-like functionality with openstac...
 
Arquitecturas de microservicios - Medianet Software
Arquitecturas de microservicios   -  Medianet SoftwareArquitecturas de microservicios   -  Medianet Software
Arquitecturas de microservicios - Medianet Software
 
HTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & socketsHTML5 tutorial: canvas, offfline & sockets
HTML5 tutorial: canvas, offfline & sockets
 
Developing your first application using FI-WARE
Developing your first application using FI-WAREDeveloping your first application using FI-WARE
Developing your first application using FI-WARE
 
GWT Web Socket and data serialization
GWT Web Socket and data serializationGWT Web Socket and data serialization
GWT Web Socket and data serialization
 
Excelian hyperledger walkthrough-feb17
Excelian hyperledger walkthrough-feb17Excelian hyperledger walkthrough-feb17
Excelian hyperledger walkthrough-feb17
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
09 - express nodes on the right angle - vitaliy basyuk - it event 2013 (5)
 
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 202010 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
10 Excellent Ways to Secure Spring Boot Applications - Okta Webinar 2020
 
Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)Building Isomorphic Apps (JSConf.Asia 2014)
Building Isomorphic Apps (JSConf.Asia 2014)
 
HTML5 for Rich User Experience
HTML5 for Rich User ExperienceHTML5 for Rich User Experience
HTML5 for Rich User Experience
 
using Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API'susing Mithril.js + postgREST to build and consume API's
using Mithril.js + postgREST to build and consume API's
 

More from Bertrand Delacretaz

VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?Bertrand Delacretaz
 
Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity Bertrand Delacretaz
 
Repoinit: a mini-language for content repository initialization
Repoinit: a mini-language for content repository initializationRepoinit: a mini-language for content repository initialization
Repoinit: a mini-language for content repository initializationBertrand Delacretaz
 
The Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaborationThe Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaborationBertrand Delacretaz
 
GraphQL in Apache Sling - but isn't it the opposite of REST?
GraphQL in Apache Sling - but isn't it the opposite of REST?GraphQL in Apache Sling - but isn't it the opposite of REST?
GraphQL in Apache Sling - but isn't it the opposite of REST?Bertrand Delacretaz
 
How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...Bertrand Delacretaz
 
L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019Bertrand Delacretaz
 
Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?Bertrand Delacretaz
 
Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?Bertrand Delacretaz
 
Serverless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesServerless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesBertrand Delacretaz
 
State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018Bertrand Delacretaz
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Bertrand Delacretaz
 
Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)Bertrand Delacretaz
 
They don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenchesThey don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenchesBertrand Delacretaz
 
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)Bertrand Delacretaz
 
Project and Community Services the Apache Way
Project and Community Services the Apache WayProject and Community Services the Apache Way
Project and Community Services the Apache WayBertrand Delacretaz
 
La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017Bertrand Delacretaz
 
Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Bertrand Delacretaz
 
Building an Apache Sling Rendering Farm
Building an Apache Sling Rendering FarmBuilding an Apache Sling Rendering Farm
Building an Apache Sling Rendering FarmBertrand Delacretaz
 

More from Bertrand Delacretaz (20)

VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?VanillaJS & the Web Platform, a match made in heaven?
VanillaJS & the Web Platform, a match made in heaven?
 
Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity Surviving large online communities with conciseness and clarity
Surviving large online communities with conciseness and clarity
 
Repoinit: a mini-language for content repository initialization
Repoinit: a mini-language for content repository initializationRepoinit: a mini-language for content repository initialization
Repoinit: a mini-language for content repository initialization
 
The Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaborationThe Moving House Model, adhocracy and remote collaboration
The Moving House Model, adhocracy and remote collaboration
 
GraphQL in Apache Sling - but isn't it the opposite of REST?
GraphQL in Apache Sling - but isn't it the opposite of REST?GraphQL in Apache Sling - but isn't it the opposite of REST?
GraphQL in Apache Sling - but isn't it the opposite of REST?
 
Open Source Changes the World!
Open Source Changes the World!Open Source Changes the World!
Open Source Changes the World!
 
How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...How to convince your left brain (or manager) to follow the Open Source path t...
How to convince your left brain (or manager) to follow the Open Source path t...
 
L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019L'Open Source change le Monde - BlendWebMix 2019
L'Open Source change le Monde - BlendWebMix 2019
 
Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?Shared Neurons - the Secret Sauce of Open Source communities?
Shared Neurons - the Secret Sauce of Open Source communities?
 
Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?Sling and Serverless, Best Friends Forever?
Sling and Serverless, Best Friends Forever?
 
Serverless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètesServerless - introduction et perspectives concrètes
Serverless - introduction et perspectives concrètes
 
State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018State of the Feather - ApacheCon North America 2018
State of the Feather - ApacheCon North America 2018
 
Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?Karate, the black belt of HTTP API testing?
Karate, the black belt of HTTP API testing?
 
Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)Open Source at Scale: the Apache Software Foundation (2018)
Open Source at Scale: the Apache Software Foundation (2018)
 
They don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenchesThey don't understand me! Tales from the multi-cultural trenches
They don't understand me! Tales from the multi-cultural trenches
 
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
Prise de Décisions Asynchrone, Devoxx France 2018 (avec vidéo)
 
Project and Community Services the Apache Way
Project and Community Services the Apache WayProject and Community Services the Apache Way
Project and Community Services the Apache Way
 
La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017La Fondation Apache - keynote au Paris Open Source Summit 2017
La Fondation Apache - keynote au Paris Open Source Summit 2017
 
Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017Asynchronous Decision Making - FOSS Backstage 2017
Asynchronous Decision Making - FOSS Backstage 2017
 
Building an Apache Sling Rendering Farm
Building an Apache Sling Rendering FarmBuilding an Apache Sling Rendering Farm
Building an Apache Sling Rendering Farm
 

Recently uploaded

Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Karmanjay Verma
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfAarwolf Industries LLC
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...BookNet Canada
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessWSO2
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentMahmoud Rabie
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...amber724300
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - AvrilIvanti
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFMichael Gough
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxfnnc6jmgwh
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneUiPathCommunity
 

Recently uploaded (20)

Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#Microservices, Docker deploy and Microservices source code in C#
Microservices, Docker deploy and Microservices source code in C#
 
Landscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdfLandscape Catalogue 2024 Australia-1.pdf
Landscape Catalogue 2024 Australia-1.pdf
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
Transcript: New from BookNet Canada for 2024: BNC SalesData and LibraryData -...
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Accelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with PlatformlessAccelerating Enterprise Software Engineering with Platformless
Accelerating Enterprise Software Engineering with Platformless
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Digital Tools & AI in Career Development
Digital Tools & AI in Career DevelopmentDigital Tools & AI in Career Development
Digital Tools & AI in Career Development
 
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
JET Technology Labs White Paper for Virtualized Security and Encryption Techn...
 
Français Patch Tuesday - Avril
Français Patch Tuesday - AvrilFrançais Patch Tuesday - Avril
Français Patch Tuesday - Avril
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
All These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDFAll These Sophisticated Attacks, Can We Really Detect Them - PDF
All These Sophisticated Attacks, Can We Really Detect Them - PDF
 
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptxGenerative AI - Gitex v1Generative AI - Gitex v1.pptx
Generative AI - Gitex v1Generative AI - Gitex v1.pptx
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
WomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyoneWomenInAutomation2024: AI and Automation for eveyone
WomenInAutomation2024: AI and Automation for eveyone
 

RESTful Web Applications with Apache Sling

  • 1. Bertrand Delacrétaz Senior Developer, R&D, Day Software, now part of Adobe Apache Software Foundation Member and Director http://grep.codeconsult.ch - twitter: @bdelacretaz - bdelacretaz@apache.org ApacheCon NA 2010, Atlanta slides revision: 2010-11-03 1 RESTful web applications with Apache Sling
  • 2. SlingRestful WebApps everything is content JCRAPI The Java Content Repository Tree of nodes and properties JSR-170, JSR-283 URLs map to resources, not commands Text, images, media, configurations, code, binary OSGi bundles, etc... RESTful Web
  • 6. Apache SlingApplications layer for JCR repositories «any» scripting languagescript == servlet OSGi-basedpowerful default servlets resource-based powered by
  • 7. storage components OSGi framework (Apache Felix) JCR content repository javascript JSP Ruby Velocity etc.. debugger WebDAV server Felix OSGi console browserfilesystem JCR API HTTP resource resolution custom servlets and components JSR 223 scripting servlet/script resolution standard servlets content administration UI Apache Sling architecture Apache Sling
  • 9. SlingRestful WebApps Bertrand Delacretaz Great for modularity Fosters better structured code Dynamic services and plugins Tooling needs to improve, but usable OSGi skills? - OSGi way of thinking is new... Asynchronous startup can be problematic if using declarative services OSGi? Appdevelopers, don’tworry!
  • 10. What can you do with Sling?
  • 11. Next-generation RESTful kernel for permeable, social, personal and remixable collaboration/ learning environment. See http://sakaiproject.org/case-studies
  • 12. idium.no - full- service hosted CMS integrated with CRM. Autoscales on Amazon EC based on JCR clustering and Sling event support.
  • 13. BIG websites Multi-channel + mobile Customer Engagement Management powered by e-commerce Web Content Management www.day.com Digital Assets Management Content Applications Platform CQ5
  • 14. Sling blog 46 lines of code http://x42.ch/05.40.01
  • 15. SlingRestful WebApps Bertrand Delacretaz # POST to Sling curl -F title=hi http://localhost:8888/foo -> 200 OK # GET created node in json format curl http://localhost:8888/foo.tidy.json { "jcr:primaryType": "nt:unstructured", "title": "hi" } POST parametersset nodeproperties Sling POST Servlet: create content Zerosetup!
  • 16. SlingRestful WebApps Bertrand Delacretaz <form method="POST"> Title: <input type="text" name="title"/> Text: <textarea name="text"></textarea> <input type="submit" value="save"/> <input type="hidden" name=":redirect" value="*"/> </form> Formfields drivethe contentmodel HTML form for editing
  • 17. SlingRestful WebApps Bertrand Delacretaz <script src="/system/sling.js"></script> <form method="POST"> ...(as in step 1)... </form> <!-- set form fields to current node values --> <script>Sling.wizard();</script> InstantCRU(D) sling.js: initializes form fields
  • 18. SlingRestful WebApps Bertrand Delacretaz <ul> <li> <a href="/content/blog/*">[Create post]</a> </li> <script> var posts = Sling.getContent("/content/blog", 2); for(var post in posts) { document.write( "<li><a href=’” + post + "'>" + posts[post].title + "</a></li>"); } </script> </ul> sling.js: generate navigation
  • 19. more at http://x42.ch/05.40.01 we got a blog! html form + Sling wizard() + Sling.getContent()
  • 22. SlingRestful WebApps Bertrand Delacretaz Slingbucks use case #1: order coffee App displays order form with configurable options. Customer indicates their name, options, submits order. App generates hard to guess order ID. App redisplays order for confirmation (use- case #2).
  • 23. SlingRestful WebApps Bertrand Delacretaz Slingbucks use case #2: confirm order App redisplays order form. Customer either modifies and recalculates price, or confirms order.
  • 24. SlingRestful WebApps Bertrand Delacretaz Slingbucks use case #3: process order Order moves to the private Slingbucks employees area. App displays a list of confirmed orders. Employee delivers order and deletes it from list.
  • 25. SlingRestful WebApps Bertrand Delacretaz OO design: Highlight names to find objects App displays order form with configurable options. Customer indicates their name, options, submits order. App redisplays order for confirmation (use- case #2). Justkidding;-) Everythingis CONTENT
  • 26. SlingRestful WebApps Bertrand Delacretaz Slingbucks resources design New order form: http://slingbucks.com/public/orders.html Order editing and confirmation (example): http://slingbucks.com/public/orders/54494da6029.html Price of an order: Same but ending with .price.html selector List of confirmed orders: http://slingbucks.com/private/confirmed.html Obvioussecurity/privacy Namedresources MeaningfulURLs
  • 27. SlingRestful WebApps Bertrand Delacretaz Slingbucks demo browser-friendly RESTful operations POST to orders/ POST with orderConfirmed POST to order resource
  • 28. SlingRestful WebApps Bertrand Delacretaz Geeks order coffee with curl... What else? $ curl -D - -F "customerName=Bob The Geek" -F sling:resourceType=slingbucks/order -F lastModified="" -F opt_coffeetype=capuccino -F opt_size=medium -F opt_sugar=raw -F opt_cup=rosewood http://admin:admin@localhost:8080/content/slingbucks/public/orders/ HTTP/1.1 201 Created Location: /slingbucks/public/orders/117936075d4de452cbba5b468 Naturally Hackable(TM) AddorderConfirmed fieldtoconfirm,as seeninconfirmform
  • 29. SlingRestful WebApps Bertrand Delacretaz Coffee node content $ curl http://localhost:8080/content/slingbucks/public/orders/ fad01d62f50aaca54209ae14c9505e3b.tidy.json { "opt_size": "small", "customerName": "Anonymous Coffee Drinker", "opt_coffeetype": "espresso", "opt_sugar": "none", "sling:resourceType": "slingbucks/order", "opt_cup": "plastic", "lastModified": "Mon Nov 01 2010 18:31:01 GMT+0100", "jcr:primaryType": "nt:unstructured" } Out-oftheboxJSON representation
  • 31. SlingRestful WebApps Bertrand Delacretaz Hypermedia? Self-documenting? <link rel="slingbucks/options" href="/content/slingbucks/readonly/ options.tidy.infinity.json"/> ... <form method="POST" action="/content/slingbucks/public/orders/" ... <select name="opt_coffeetype"> <options> <option value="espresso">Espresso</option> <option value="capuccino">Capuccino</option> <option value="macchiato">Macchiato</option> </select> ... public/orders.html form provides all required «API» info.
  • 32. SlingRestful WebApps Bertrand Delacretaz Slingbucks code: order ID generation // Just provide an OSGi service that implements NodeNameGenerator @Component @Service public class HexNodeNameGenerator implements org.apache.sling.servlets.post.NodeNameGenerator { ... public String getNodeName( SlingHttpServletRequest request, String parentPath, ...) { if(SlingbucksConstants.ORDERS_PATH.equals(parentPath)) { return computeHardToGuessNodeName(); } return null; } }
  • 33. SlingRestful WebApps Bertrand Delacretaz Slingbucks code: move confirmed orders 1/2 @Component public class ConfirmedOrdersObserver implements EventListener, Runnable { @Reference private SlingRepository repository; /** Called by OSGi framework when component starts */ protected void activate(ComponentContext context){ session = repository.loginAdministrative(null); om = session.getWorkspace().getObservationManager(); String path = "/content/slingbucks/orders"; om.addEventListener(this, Event.PROPERTY_CHANGED | Event.PROPERTY_ADDED, path...); }
  • 34. SlingRestful WebApps Bertrand Delacretaz Slingbucks code: move confirmed orders 2/2 @Component public class ConfirmedOrdersObserver implements EventListener, Runnable { ... code from page 1 public void onEvent(EventIterator it) { while (it.hasNext()) { if(path.endsWith(«orderConfirmed») { ... note property change and ... if confirmed move node later ... using session.getWorkspace().move(srcPath, destPath); } }
  • 35. SlingRestful WebApps Bertrand Delacretaz Slingbucks «code»: initial content for options src/main/resources/SLING-CONTENT/content/slingbucks/readonly/options.json: "fields" : { "coffeetype" : { "jcr:title" : "Coffee type", "espresso" : { "jcr:title" : "Espresso", "jcr:description" : "The Italian job", "priceOffset" : 2.20 }, "capuccino" : { "jcr:title" : "Capuccino", "jcr:description" : "The one with cream on top", "priceOffset" : 3.40 } }, "size" : { "jcr:title" : "Size", "small" : { "jcr:title" : "Small", "jcr:description" : "1dl", "priceFactor" : 1 }, "large" : { "jcr:title" : "Large", "jcr:description" : "5dl", "priceFactor" : 2 } }, LoadedbySlingas nodes/properties whenOSGibundle isloaded
  • 36. SlingRestful WebApps Bertrand Delacretaz Slingbucks code: content -> options form src/main/resources/SLING-CONTENT/apps/slingbucks/options/options.esp: <% // Make sure current node has a "fields" subnode, // and visit it (duck typing content!) if(currentNode["fields"]) { var fields = currentNode["fields"]; for(i in fields) { var f = fields[i]; // If field has a jcr:title property, we can use it if(f["jcr:title"]) { %> // Generate HTML <select> for our field <select name="<%= fieldName %>"> <options> <% for(j in f) { var opt = f[j]; if(opt["jcr:title"]) { %> <option value="<%= j %>"><%= opt["jcr:title"] %></option> <% } } %> ... // Set appropriate resource type on created coffee order // and let Sling set lastModified property <input type="hidden" name="sling:resourceType" value="slingbucks/order"/> <input type="hidden" id="lastModified" name="lastModified" value=""/> Server-side Javascript
  • 37. SlingRestful WebApps Bertrand Delacretaz Slingbucks LOC Java code: 250 171 src/main/java/org/apache...ConfirmedOrdersObserver.java 57 src/main/java/org/apache...HexNodeNameGenerator.java 28 src/main/java/org/apache...SlingbucksConstants.java HTML representation scripts: 250 2 /apps/slingbucks/common/head.esp 15 /apps/slingbucks/confirmed/confirmed.esp 47 /apps/slingbucks/options/options.esp 25 /apps/slingbucks/order/backoffice.esp 58 /apps/slingbucks/order/order.esp 58 /apps/slingbucks/order/price.esp 32 /apps/slingbucks/orders/orders.esp Initial content: 85 73 /content/slingbucks/readonly/options.json 6 /content/slingbucks/private.json 6 /content/slingbucks/public.json Style etc: 43 38 /apps/slingbucks/common/slingbucks.css 5 /apps/slingbucks/common/slingbucks.js
  • 38. SlingRestful WebApps Bertrand Delacretaz Content-driven app: new field $ cat /tmp/logo.json { "jcr:title": "Cup Logo", "slingbucks": { "priceFactor": 1, "jcr:title": "Slingbucks", }, "apache": { "priceFactor": 1.5, "jcr:title": "Apache Software Foundation", }, "swissflag": { "priceFactor": 4.5, "jcr:title": "Swiss flag", } } curl -F:operation=import -F:contentType=json -F:contentFile=@/ tmp/logo.json http://admin:admin@127.0.0.1:8080/content/ slingbucks/readonly/options/fields/logo RESTful reconfiguration!
  • 39. SlingRestful WebApps Bertrand Delacretaz Slingbucks next steps Security: Setup ACL on /public, /readonly, /private. All done. Scalability: Built-in. No HTTP sessions. Cache-friendly. RESTful. End-to-end testing: Easy using HTTP/JSON and HTTP/HTML scenarios.
  • 40. SlingRestful WebApps Bertrand Delacretaz That was not too hard, was it? Code online soon, stay tuned to twitter @bdelacretaz or Sling mailing lists
  • 41. SlingRestful WebApps RESTful apps with Sling Built-in RESTful content creation/ editing URLs map to resources, not commands Easy to plugin scripts, (OSGi-based) servlets and extensions. RESTful Web
  • 43. This slide deck is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3 license. Copyright (C) 2010, Bertrand Delacretaz