• Like
Webtuesday Zurich
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.

Webtuesday Zurich


content repository, jsr-170, jsr-283, jcr, ajax, apache sling, jackrabbit

content repository, jsr-170, jsr-283, jcr, ajax, apache sling, jackrabbit

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 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
  • 6. What’s JCR? gpoJNTM `çåíÉåí=oÉéçëáíçêó=Ñçê= g~î~qj=íÉÅÜåçäçÖó=^mf péÉÅJiÉ~ÇW a~ó=pçÑíï~êÉ pí~íìëW= cáå~ä=oÉäÉ~ëÉ=NTJàìåJOMMR bñéÉêí=dêçìéW
  • 7. What’s JCR? gpoJNTM gpoJOUP `çåíÉåí=oÉéçëáíçêó=Ñçê= g~î~qj=íÉÅÜåçäçÖó=^mf=îOKM péÉÅJiÉ~ÇW a~ó=pçÑíï~êÉ pí~íìëW= mìÄäáÅ=oÉîáÉï=`äçëÉÇ=ëÉéJOMMT bñéÉêí=dêçìéW
  • 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
  • 13. Java Standardization JSR-283 Public Review Ballot ro ved app
  • 14. Java Standardization
  • 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
  • 17. JCR - Weatherforcast 2008 -5° 2009 -8° 2010 -12°
  • 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 )
  • 29. Getting ready... download a nd install test & mount as a drive
  • 30. hello, world. le> rld</tit ello, wo <h tml> >sling:h <title <head> > > rld</h2 </head 2>hello, wo <h <body> > </body > </html drag, drop, done http://localhost:7402/ apps/firststeps/0_hell o.html
  • 31. simple write example itle> exam ple</t le write STquot;> > <html itle>sling : simp method=quot;PO <t first stepsquot; <head> body> ntent/ >< /co </head rm action=quot; --> fo itle < <!-- t e</h2> equot; /> tl name =quot;Titl <h2>Ti ype=quot;textquot; t > <input cription -- onquot;> !-- des ption</h2> =quot;Descripti < >Descri name <h2 ws=quot;5quot; rea ro <texta rea> a </text or --> ol <!-- c r</h2> lo quot;> <h2>Co name=quot;Color edquot;>red t quot;r <selec tion value= reenquot;>green op quot;g < tion value= op < > ct </sele > </form > </body write me! > </html irststeps/1_write.html http://localhost:7402/apps/f
  • 32. simple read example itle> exam ple</t simpl e read <html> tle>sling: <ti <head> ipt > g.jsquot;></scr </head m/slin squot;); <body> src=quot;/syste t/firststep lor+'quot;>'; <s cript nt(quot;/conten r:'+node.Co <scr ipt> ng.ge tConte ground-colo de=Sli style=quot;back var no '<div v= ; var di .write(div) nt docume > pt </scri cript> tle); h2 ><s (node.Ti < ument.write doc </h2> n); </s cript> t> riptio rip e.Desc <p><sc t.write(nod n docume /p> t>< </scrip /div> < > </body read me! http://localhost:7402/apps /firststeps/2_read.html </html >
  • 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>
  • 35. templates %> [. ..] tNode.Title <%= curren [...] t> <scrip .wizard(); Sling pt> </scri [...] w izard(); ! Rja x. ! </script> resource or ! http://l iented urls ocalhost :7402/co ntent/fi rststeps .list.ht ml
  • 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
  • 40. Buddy coding: eer for B Bug.
  • 41. DEMO Content-Centric Infrastructure
  • 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
  • 43. Q&A Content-Centric Infrastructure
  • 44. Thank you for your attention Content-Centric Infrastructure