The document discusses JCR (Java Content Repository), which defines a standard API for accessing content in a content repository. It introduces μjax, which is an AJAX implementation that uses a JCR-compliant content repository in the backend. μjax allows for simple reading and writing of content to the repository via JavaScript. The document provides examples of using μjax to read, write, add and list content and encourages developers to try it out using Adobe CRX.
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. 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.”
?
10. 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.”
?
11. Best of both worlds.
database fi les yste m
content repositor y
12. Best of both worlds.
database fi les yste m
hier-
integ archi
rity structu
re es
read streams
tx query write locking
access
control
multi-
value g
un-
versionin
structured “full- sort obser-
text” order vation
content repositor y
23. Introducing µjax
JCR
the other side
de
ve
h a lope
t r
“i want to build webapps”
me
d)
(d a v i
24. Introducing µjax
JCR
the other side
de
ve
h a lope
t r
“i want to build webapps”
me
d)
(d a v i
25. Introducing µjax
JCR
the other side
de
ve
h a lope
t r
“i want to build webapps”
me
d)
(d a v i
26. Introducing µjax
JCR
de
ve
h a lope
t r
a rs )
me ( l silve
r
µjax
27. Introducing µjax
JCR
de
ve
h a lope
t r
a rs )
me ( l silve
r
µjax
very simple
projection:
fits the bill
28. Introducing µjax
JCR
de
ve
h a lope
t r
a rs )
me ( l silve
r
µjax
very simple
projection: “usecas
fits the bill driven
e”
29. Introducing µjax
I browser & ujax.js
reading: json & resource GET’s
writing: form-POST & GET
s s
J2EE Web
Server
3
2
Browser I
2 UjaxServlet.java
translating requests
to JCR calls
3 JCR Compliant
Content Repository
30. Introducing µjax
I browser & ujax.js
reading: json & resource GET’s
writing: form-POST & GET
s s
J2EE Web
Server
3
2
Browser I
very simple js A 2 UjaxServlet.java
translating requests
read content, FoPI to to JCR calls
rms
to write conten
t 3 JCR Compliant
Content Repository
31. Introducing µjax
I browser & ujax.js
reading: json & resource GET’s
writing: form-POST & GET
s s
J2EE Web
Server
3
2 handles all the h
particularly se
eavy lifting,
curity
Browser I 16 t
ons
very simple js A 2 UjaxServlet.java
translating requests
read content, FoPI to to JCR calls
rms
to write conten
t 3 JCR Compliant
Content Repository
34. simple write example
tle>
examp le</ti
write
simple
<html> itle>rjax: OSTquot;>
<hea d><t hod=quot;P
y> aquot; met
d><bod ion=quot;/mydat
</hea m act
or -->
<f <!-- title > equot; />
/h2
<h2>Title< textquot; name =quot;Titl
=quot;
<input type ion -->
pt ionquot;>
<!-- descri on</h2> script
ti quot;De
<h2>Descrip s=quot;5quot; name=
ow
<textarea r
area>
</text -->
olor
<!-- c r</h2>
<h2>Colo orquot;>
e=quot;Col redquot;>red
<select nam alue=quot;
v >green
<option lue=quot;greenquot;
<option va
</select>
write me!
http://localhost:7402/firs
tsteps/1_write.html
rm>
</
</body
fo
>
>
</html
35. simple read example
title>
mple</
ad exa
simple re
<html> itle>rjax:
<t
<head>
</head
> cript
ax.jsquot;></s
<body> pt src=quot;/rj +'quot;>';
<scr i ataquot;); +node.Color
(quot;/myd :'
<s cri pt> getContent round-color
=Rjax. backg
va r node div style=quot;
v='< ;
var di .write(div)
nt
docume >
pt
</scri ript> Title)
;
2><sc e(node.
<h cument.writ
d o
></h2> ion);
</script t> script
rip de.De
<p><sc nt.write(no
docume p>
pt></
</scri
div>
</
read me!
http://localhost:7402/firs
tsteps/2_read.html
</body
</html
>
>
36. add new entry
itle>
ple</t
y exam
w entr
add ne
<html> itle>rjax:
<t
<head> body> es/*quot; taquot;>
/entri art/form-da
>< mydata p
</head m action=quot;/ type=quot;multi
or nc
<f od=quot;POSTquot; e
meth
lequot; />
tle </h2> quot; name=quot;Tit
<h2>Ti ype=quot;text
<input t tarea>
></tex
2> ptionquot;
cription</h ame=quot;Descri
<h2>Des rows=quot;5quot; n
<textarea
/h2>
<h2> Color< =quot;Colorquot;>
e red
<select nam alue=quot;redquot;> green
v quot;>
<option alue=quot;green
v
<option
</select>
agequot;/>
add new
http://localhost:7402/firststeps/3_addnew.html
age</h2> equot; name=quot;Im
<h2>Im ype=quot;fil
<inp ut t
nput t
ype=quot;s
ubmitquot;
></p>
><i
<p
form>
</
>
</body
>
</html
37. list entries itle>
ple</t
s exam
list entrie
<html> itle>rjax: ;
<head>
<t riesquot;)
ata/ent
[...] (quot;/myd
t> .getC ontent
<scrip ntries=Rjax
var e
pt>
</scri quot;>');
olor+'
<div> ntry.C
t> r ies) { lor:'+e
<scrip ar a in ent s[a]; und-co
ackgro h3>');
for (v ntry=entrie iv style=quot;b le+'</
var e .write('<d +entry.Tit
nt >' );
docume .write('<h2 Description
nt y.
docume .write(entr
nt
docume
ge) {
ry.Ima
if(ent
[...] } ove='
ax:rem
; ies?rj
/div>') mydata/entr
ite('< quot;/
cum ent.wr e('<a href=
list entries
do .writ
document move</a>');
re
http://lo +a+'quot;>
calhost:7
402/first
steps/4_l
ist.html
} > ew</a>
pt tmlquot;>add n
</scri quot;3_addnew.h
f=
<a hre
</div>
>
</body