Apidays New York 2024 - The value of a flexible API Management solution for O...
Webtuesday Zurich
1. WebTuesday: µjax in 30 minutes.
apache sling
(...?!)
Lars Trieloff .... “me” instead
Product Manager
Day Software
Technology Presentation 1
2. David Nuescheler
JSR-170 Spec Lead
jsr-170-comments@jcp.org
David Nuescheler Chief Technology Officer
david.nuescheler@day.com
David Nuescheler
Jackrabbit Committer / Member
uncled@apache.org
Content-Centric Infrastructure 2
3. obpqof`qba
R håçï=óçìê=eqji=C=g~î~ëÅêáéí
e~îÉ=~=î~ÖìÉ=ÅçåÅÉéí=çÑ=~=
“`çåíÉåí=oÉéçëáíçêóÒ=~åÇ=“obpqÒ
4. WebTuesday: Sling in 30
Web Development
What’s JCR (elevator pitch)
REST meets JCR meets Ajax silve
r
Building TSS as a Content App
5. WebTuesday: Sling in 30
Web Development
What’s JCR (elevator pitch)
REST meets JCR meets Ajax silve
r
Building TSS as a Content App
8. What’s JCR?
“The API should be a standard,
implementation independent, way to
access content bi-directionally on a
granular level to a
content repository.” ?
9. Best of both worlds.
data base file s ys t e m
hier-
integ archi
rity
structu
re es
read streams
tx write
access
query locking control
multi-
value
un-structured obser- versioning
“full-text” sort vation
order
content repo sit or y
10. JCR
What’s Check - ?
- Reality
Task: Write a JSP snippet that
lists “
documents” in a “folder””
.
11. <%
childCount = node.getConten
for(int i=0;i<childCount;i
tCount();
++) {
<% JCR
What’s Check - ?
LAPI_DOCUMEN
- Reality
TS documents = new LA
LLValue childTable =
PI_DOCUMENTS(session
new LLValue();
s(volumeID, folderID
,
);
documents.ListObject
JCR API
IContent child = node.getCo E, childTable);
Property title = child.getP
ntent(i);
null, null, LA PI_DOCUMENTS.PERM_SE
ropertyByName(quot;Titlequot;); .enumerateValues();
%><%= title.getValue() %><b Enumeration children = childTable
r/><% reElements()) {
} while(children.hasMo )e.nextElement();
%> <% <% LLVa lue child = (LLValue
ring(quot;Namequot;);
fndocs Stri ng <% tle = child.toSt
ti
= new
fnfold
IFnObj NodeIterator children = node.getNodes();
SetDua
PageIterator%
%><%= title %><br/>< children = page.getPages();
int nu lPr while (children.hasNex
er.get
while (children.hasNext()) {
Conten oxy(
Task: Write a JSP snippet that
mDocs } t()) {
for (i = fndo ts(idm Page child = children
nt i = cs. Fo %> .nextPage();
1; i < getCount(); lderContent.
Node child = children.nextNode(); Container toplevel =
IFnDoc = numD idmFol child.getContent();
umentD ocs; i derCon om title = to
At e
new IF
IFnPro
ua
Property title = child.getProperty(quot;Titlequot;);
nDocum l fndoc =
entDua
++) { t ntDo
cume plevel.getAtom(quot;Titlequot;
%><%= title nt));r /><%
%><b
);
lists “
documents” in a “folder””
.
pe lPr
%><%= title %><br /><%
IFnPro rtiesDual pr oxy(fndocs.g
pe o et
}
%>
String rtyDual idmT pset = fndoc Item(new In
%><%= title
title
} i . te
= idmT tleProp = pr getPropertie ger(i)));
itlePr
op.get opset.getIte s();
if (co %>
mClean <br/><%
up) {%> <% Value(
); m(quot;Tit
lequot;); entsProxy(binder.getDo
cuments());
cleane s = new IDocum
} r.rele
ase(fn IDocuments document
} doc); documents.cache();
();
documents.getCount
%> in t documentCount = {
cumentCount; i++) ItemByIndex(i));
fo r (int i = 0; i<do umentP roxy(documents.get
document = new IDoc
ment.getTitle()
String title = docu
><%
%><%= title %><br/
}
%>
+800
12. What’s JCR?
- Functional Elevator Pitch -
sql locking obser- tx versioning
vation
opt ion al
level 2 write, import,
access
control
read, export,
level 1
query
15. Known compliant Repositories
* using third party connector
* *
Exo Microsoft
Apache Jackrabbit Oracle XML DB ECMS Platform Sharepoint OpenText Livelink
*
Day CRX IBM FileNet P8 Xythos Repository Alfresco ECM Vignette V7
* *
any ors
ow mvendd?
H S e
Interwoven +hund DBMou ne
R do y
r s
Repository IBM CM EMC Documentum regiede of TCKs
st
16. Some known JCR Applications
Fast
BEA Portal Sun Oracle Portal Enterprise Search
JBoss Portal Interface 21
OpenPortal
Day Communique Spring Framework
magnolia WCMS DAM
Apache Sling Day Communique
Alfresco ECMS Mindquarry Collab
Collaboration Apache Tapestry
QSLabs
Apache Compliance Day Communiqué
Cocoon WCMS IBM FileNet
Artifactory medic-2-medic WebSiteManager
Apache James Maven Proxy mapofmedicine
Exo
ECMS Platform TYPO3
GX WebManager v5.0 WCM
InfoQ Hippo Liferay
Nuxeo ECM Online Community CMS Enterprise Portal
Jahia Sakai
Percussion Framework E-learning
Rhythmix QuickWCM Sourcemix
WCMS Lutece Sourcemix
18. WebTuesday: Sling in 30
Web Development
What’s JCR (elevator pitch)
REST meets JCR meets Ajax silve
r
Building TSS as a Content App
19. WebTuesday: Sling in 30
Web Development
What’s JCR (elevator pitch)
REST meets JCR meets Ajax silve
r
Building TSS as a Content App
20. REST over JCR
REST -> Roy T. Fielding
ly
JCR: Yours tru
2005
rele a 1.0 r
v ele ased
sed y +300 pages
162 p 2k
ages
21. The Problem:
JCR
longterm
stable &durable
well designed duty
heavy
strategic 16 t
ons
functionally broad
22. The Problem:
JCR
longterm
the other side
stable &durable
de
ve
lop
er
ha
t
well designed
“i want to build webapps”
heavy duty
me
lazy strategic 16 t
ons
short-sighted functionally broad
h
...easily coack
nfused
23. The Silver bullet:
JCR
de
ve
lop
er
ha
t
av id)
me (d
silve
r
sling
very simple pro
jection:
fits the bill
24. JCR b
ac
ReST- ked
(OSGI Webkit
, OCM
Apache Sling
, ...)
jsp
groovy
... esp contains
ruby
scala ormerly
r st f
e antiwn as”:
“th k o
sling.js & .jst jax
25. I browser & sling.js
reading: json & resource GET’s
writing: form-POST & GET
s s
J2EE Web
Server
3
handles all the h
eavy
2 lifting, particul
arly
security
Browser I 16 t
ons
very simple js A
PI to
2 Sling Servlets
translating requests
read content, Fo to JCR calls
to write contenrms
t 3 JCR Compliant
Content Repository
26. It’s the web, baby!
URLs matter .
.../product.jsp?id=12346
Mistake 1 : Mistake 2: Mistake 3:
Addressing the .j
“Script”sp? What the heck? Passing in “this”
27. Reclaiming the web.
Sling URL decomposition.
/cars/audi/s4.details.html
Content ...selects a
Repository epository Path
R particular scrip
t
28. “Data First!”
JCR s
“stru uppor
cturef ts
(but t aswe irst”
hat’s
mi
ll.
ssing
point
)
33. add new entry
le>
xample</tit
new entry e
>
<html itle>sling : add es/*quot;
t steps /entri
<head>< ody> ntent /first
</h ead><b action=quot;/co
form
< od=quot;POSTquot; >
meth />
le</h 2> ame=quot; Titlequot;
h2>Tit pe=quot;textquot; n
< put ty area>
<in
ionquot;></text
iption</h2> e=quot;Descript
h2 >Descr ows=quot;5quot; nam
< xtarea r
te
<
</h2>
h2 >Color e=quot;Colorquot;> >red
< lect nam quot;redquot;
<se n value= reenquot;>green
<optio value=quot;g
option
< >
ct
</sele ></p>
pe=quot;submitquot;
add new
http://localhost:7402/apps/firststeps/3_addnew.html
<
</form
p><in
>
put ty
>
</body
>
</html
34. list entries
le>
xampl e</tit
t ent ries e 2);
<htm l> >slin g: lis s/entriesquot;,
<title ststep
<head> conten
t/fir
[...] nt(quot;/
t> g.ge tConte
<scrip ntries=Slin
var e
pt>
</scri or+'quot;>
');
<div> y.Col
t> ries)
{
olor: '+entr
<scrip ar a in ent es[a]; ackgr ound-c ;
for (v entry=entri iv style=quot;b le+'</h3>')
var '<d Tit
nt. write( h2>'+entry. on);
docume .write('< Descri
pti
nt y.
docume .write(entr
nt
docume
){
ry.Image
if(ent
[...] }
''quot;>
'</div
>');
ist.h tmlquot; tries/'+a+
nt. write( a href=quot;4_l '/mydata/en
docume .write('< ent(
nt veCont
docume =”ujax.remo
k
onclic a>');
http://lo
list entries
calhost:7
remove
</
402/apps/
} > </a>
firststep
s/4_list. t mlquot;>add new
html </scrip 3_addnew.ht
f=quot;
<a hre
v>
36. WebTuesday: Sling in 30
Web Development
What’s JCR (elevator pitch)
REST meets JCR meets Ajax silve
r
Building TSS as a Content App
37. WebTuesday: Sling in 30
Web Development
What’s JCR (elevator pitch)
REST meets JCR meets Ajax silve
r
Building TSS as a Content App
38. Essentially:
builds a
Re- ” a
SS++ t app.
“T ten
con
39. TheServerSide.com as a content
Application.
- goals -
»
» Transform “TheServerSide.com” into
a jax and JCR backed Content App.
TOtOitor &LS!
NO ll tex ed
(we owser ;) )
br
42. If you remember only 2 things.
I visit us: dev.day.com th & t
boo cha
register for JCR Cup 2008 fireside
2 Make your next Application a
Content Application