Non CMS WebApps.
Using JCR, REST and AJAX.




David Nuescheler
CTO / Day Software




Technology Presentation     1
David Nuescheler
                                                                                 JSR-170 Spec Lead
      ...
RESTRICTED

R   Know your HTML & Javascript
    Have a vague concept of a “Content
    Repository” and “REST”
Content beyond CMS
                   Web Development




What’s JCR (elevator pitch)
REST meets JCR meets Ajax        sil...
Content beyond CMS
                   Web Development




What’s JCR (elevator pitch)
REST meets JCR meets Ajax        sil...
What’s JCR?
         JSR-170

Content Repository for
JavaTM technology API
Spec-Lead:
Day Software
Status:
Final Release 1...
What’s JCR?
                   JSR-283
         JSR-170

Content Repository for
JavaTM technology API v2.0
Spec-Lead:
Day ...
What’s JCR?
“The API should be a standard,
implementation independent, way to
access content bi-directionally on a
granula...
Best of both worlds.
                                                   le s ys te m
                     data base       ...
JCR?
       What’s Check -
         - Reality




Task: Write a JSP snippet that
lists “
      documents” in a “folder””
 ...
JCR?
                                          What’s Check -
   <%                                                       ...
What’s JCR?
         - Functional Elevator Pitch -


                       obser-
sql                              tx
   ...
Java Standardization

     83 Public Review Ballot
JSR-2



                              ved
                           p...
Java Standardization
Known compliant Repositories
                                                               * using third party connector
...
Some known JCR Applications

                                                                                Fast
 BEA Por...
JCR - Weatherforcast
       -5°          -8°          -12°
             2009         2010
2008
Content beyond CMS
                   Web Development




What’s JCR (elevator pitch)
REST meets JCR meets Ajax        sil...
Content beyond CMS
                   Web Development




What’s JCR (elevator pitch)
REST meets JCR meets Ajax        sil...
REST over JCR


               REST -> Roy T. Fielding


                                                       ly
       ...
The Problem:
           JCR
         longterm
     stable &durable
well designed duty
            heavy
 strategic        ...
The Problem:

                                                                                       JCR
                 ...
The Silver bullet:

                                                             JCR
 de
      ve
           lop
         ...
JCR b
                     Apache Sling
         ac
  ReST- ked
(OSGI Webkit
     , OCM
           , ...)

               ...
I   browser & sling.js
     reading: json & resource GET’s
     writing: form-POST & GET
                         s      s...
It’s the web, baby!
        URLs matter  .

.../product.jsp?id=12346

                            Mistake 2:
      Mistake...
Reclaiming the web.
                     Sling URL decomposition.
                   /cars/audi/s4.details.html

         ...
“Data First!”
       JCR s
   “stru upports
            cturef
                   irst”
(but t aswel
                l.
  ...
Getting ready...




                           test & mount as a drive
download a
          nd install
hello, world.


                                                                                            itle>
        ...
simple write example
                                                                                                     ...
simple read example

                                                                                                     ...
add new entry

                                                                                                           ...
list entries
                                                                                                 le>
        ...
templates
                                                                         le %>
                                 ...
Content beyond CMS
                   Web Development




What’s JCR (elevator pitch)
REST meets JCR meets Ajax        sil...
Content beyond CMS
                   Web Development




What’s JCR (elevator pitch)
REST meets JCR meets Ajax        sil...
:
   entially
Ess
         d
   e-builas a
  R”
“TSS++ t app.
 conten
TheServerSide.com as a content
         Application.
                 - goals -



                                       ...
Buddy coding:


      er for
    Be .
       Bug
DEMO




Content-Centric Infrastructure
If you remember only 2 things.
I visit us: dev.day.com                      &
                                        ooth...
Q&A




Content-Centric Infrastructure
Thank you for your
                                     attention




Content-Centric Infrastructure
Upcoming SlideShare
Loading in …5
×

Non Cms For Web Apps

2,784 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,784
On SlideShare
0
From Embeds
0
Number of Embeds
66
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Non Cms For Web Apps

  1. 1. Non CMS WebApps. Using JCR, REST and AJAX. David Nuescheler CTO / Day Software Technology Presentation 1
  2. 2. David Nuescheler JSR-170 Spec Lead jsr-170-comments@jcp.org David Nuescheler hief Technology Officer C david.nuescheler@day.com David Nuescheler Jackrabbit Committer / Member uncled@apache.org Content-Centric Infrastructure 2
  3. 3. RESTRICTED R Know your HTML & Javascript Have a vague concept of a “Content Repository” and “REST”
  4. 4. Content beyond CMS Web Development What’s JCR (elevator pitch) REST meets JCR meets Ajax silve r Building TSS as a Content App
  5. 5. Content beyond CMS Web Development What’s JCR (elevator pitch) REST meets JCR meets Ajax silve r Building TSS as a Content App
  6. 6. What’s JCR? JSR-170 Content Repository for JavaTM technology API Spec-Lead: Day Software Status: Final Release 17-jun-2005 Expert Group:
  7. 7. What’s JCR? JSR-283 JSR-170 Content Repository for JavaTM technology API v2.0 Spec-Lead: Day Software Status: Public Review Closed sep-2007 Expert Group:
  8. 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. 9. Best of both worlds. le s ys te m data base fi hie archir- integ es re rity structu read streams tx access write locking query control multi- value g sionin ver obser- un-structured “full-text” sort vation order content repo sit or y
  10. 10. JCR? What’s Check - - Reality Task: Write a JSP snippet that lists “ documents” in a “folder”” .
  11. 11. JCR? What’s Check - <% TS(session); <% nts = new LAPI_DOCUMEN LAPI_DOCUMENTS docume childCount = node.getContent - Reality Count(); ; new LLValue() LLValue childTable = for(int i=0;i<childCount;i ++) { folderID, stObjects(volumeID, JCR API IContent child = node.getC childTable); ontent(i); uments.Li doc I_DOCUMENTS.PERM_SEE, null, null, LAP Property title = child.get numerateValues(); PropertyByName(quot;Titlequot;); = childTable.e Enumeration children %><%= title.getValue() %>< br/><% { en.hasMoreElements()) } while(childr ment(); = (LLValue)e.nextEle <% LLValue child %> <% ng(quot;Namequot;); toStri String <% le = child. fndocs tit NodeIterator children = node.getNodes(); = new Pag %><br/><% IFnObj title eIterator children = page.getP %><%= Se int nu fnfolder.get tDualProxy( ages(); while (children.hasNe while (children.hasNext()) { Task: Write a JSP snippet that xt()) { } mDocs Conten = fndo ts(idm for (i Page child = children. cs. Fo nt i = %> nextPage(); 1; i < getCount(); lderContent. Node child = children.nextNode(); Container toplevel = = numD idmFol child.getContent(); IFnDoc ocs; i derCon m title = top um Ato new IF entDual fndo Property title = child.getProperty(quot;Titlequot;); ++) { tent level.getAtom(quot;Titlequot; %><%= Document))br />< ); nDocum c= title %>< ; entDua % IFnPro lists “ documents” in a “folder”” . %><%= title %><br /><% lProxy } pertie (fndoc sDual IFnPro s.get pro %> pe String rtyDual idmT pset = fndoc Item(new In } teger( .getPr itlePr title %><%= i))); o o = idmT itlePr p = propset. perties(); title %> %><br/ if (co op.get getIte cuments()); ><% mCle Value( m(quot;Tit lequot; umentsProxy(binder.getDo cleane anup) { <% ); oc documents = new ID ); r.rele IDocuments } ase(fn doc); documents.cache(); } nt(); = documents.getCou int documentCount %> ntCount; i++) { ByIndex(i)); docume for (int i = 0; i< (documents.getItem new IDocumentProxy document = ment.getTitle() String title = docu r/><% %><%= title %><b } %>
  12. 12. What’s JCR? - Functional Elevator Pitch - obser- sql tx locking versioning vation optio nal level 2 write, import, access control level 1 read, export, query
  13. 13. Java Standardization 83 Public Review Ballot JSR-2 ved pro ap
  14. 14. Java Standardization
  15. 15. Known compliant Repositories * using third party connector * * Exo Microsoft Apache Jackrabbit Oracle XML DB OpenText Livelink ECMS Platform Sharepoint * Day CRX IBM FileNet P8 Xythos Repository Alfresco ECM Vignette V7 * * ny maendors How S v ed? M RDBo you ne +hund d Interwoven rs regiede of TCKs IBM CM EMC Documentum Repository st red
  16. 16. Some known JCR Applications Fast BEA Portal Oracle Portal Enterprise Search Sun JBoss Portal Interface 21 OpenPortal Day Communique Spring Framework DAM magnolia WCMS Day Communique Apache Sling Collab Mindquarry Alfresco ECMS Collaboration Apache Tapestry QSLabs Apache Day Communiqué Compliance Cocoon WCMS IBM FileNet medic-2-medic WebSiteManager Artifactory Apache James mapofmedicine Maven Proxy Exo TYPO3 ECMS Platform GX WebManager v5.0 WCM InfoQ Hippo Liferay Nuxeo ECM Online Community CMS Enterprise Portal Jahia Sakai Framework E-learning Percussion QuickWCM Rhythmix Sourcemix WCMS Lutece Sourcemix Portal
  17. 17. JCR - Weatherforcast -5° -8° -12° 2009 2010 2008
  18. 18. Content beyond CMS Web Development What’s JCR (elevator pitch) REST meets JCR meets Ajax silve r Building TSS as a Content App
  19. 19. Content beyond CMS Web Development What’s JCR (elevator pitch) REST meets JCR meets Ajax silve r Building TSS as a Content App
  20. 20. REST over JCR REST -> Roy T. Fielding ly JCR: Yours tru 005 ased 2 1.0 rele rele a v 0 pages sed y +30 162 p 2k ages
  21. 21. The Problem: JCR longterm stable &durable well designed duty heavy strategic 16 t ons functionally broad
  22. 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 strategic lazy 16 t ons functionally broad short-sighted h ...easily coack nfused
  23. 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. 24. JCR b Apache Sling ac ReST- ked (OSGI Webkit , OCM , ...) jsp groovy ... esp contains ruby scala erly istnform art “the know as”: jax sling.js & .jst
  25. 25. I browser & sling.js reading: json & resource GET’s writing: form-POST & GET s s J2EE Web Server 3 handles all the h e lifting, particula avy 2 rly security I Browser 16 t ons 2 Sling Servlets very simple js A translating requests read content, FoPI to to JCR calls r to write contenms 3 JCR Compliant t Content Repository
  26. 26. It’s the web, baby! URLs matter . .../product.jsp?id=12346 Mistake 2: Mistake 1 Mistake 3: : Addressing the .jsp? What the heck? Passing in “this” “Script”
  27. 27. Reclaiming the web. Sling URL decomposition. /cars/audi/s4.details.html ...selects a Content Repository epository Path R particular scrip t
  28. 28. “Data First!” JCR s “stru upports cturef irst” (but t aswel l. hat’s mi ssing point )
  29. 29. Getting ready... test & mount as a drive download a nd install
  30. 30. hello, world. itle> rld</t lo, wo ng:hel ml> i <ht tle>sl ad><ti <he /h2> world< ad> </he ello, ><h2>h <body > </body > </html drag, drop, done http://localhost:7402/ apps/firststeps/0_hell o.html
  31. 31. simple write example le> e</tit exampl rite mple w STquot;> od=quot;PO ng: si ml> quot; meth >sli <ht <title teps firsts <head> body> ntent/ /co >< </head rm action=quot; --> <fo le > t tlequot; / !-- ti < >Title</h2> tquot; name=quot;Ti ex h2 < put type=quot;t --> on in < - descripti /h2> nquot;> riptio ption< name=quot;Desc !- < cri h2>Des =quot;5quot; < xtarea rows e t < extarea> </t -> olor - <!-- c r</h2> > o Colorquot; h2>Col d < lect name=quot; ue=quot;redquot;>re een >gr <se val quot; quot;green option < tion value= op <> ect /sel < /form> < > </body write me! ml> </ht firststeps/1_write.html http://localhost:7402/apps/
  32. 32. simple read example itle> ple</t d exam rea simple html> tle>sling: < <ti <head> pt </scri g.jsquot;> head> lin </ quot;); stem/s tsteps >'; <body> pt src=quot;/sy t/firs de.Color+'quot; nten i (quot;/co olor:'+no <scr ontent t> c <scrip =Sling.getC background- e=quot; ode var n '<div styl v= ; var di .write(div) nt docume > pt </scri cript> ); .Title h2><s .write(node < ument doc 2> pt></h ); iption </scri ript> .Descr (node p><sc < ument.write c do t></p> /scrip < /div> < > </body read me! l> </htm http://localhost:7402/apps/ firststeps/2_read.html
  33. 33. add new entry le> e</tit exampl entry d new /*quot; ng: ad ntries ml> li <ht itle>s teps/e <t rsts <head> body> ent/fi quot;/cont ad>< = </he action <form POSTquot; > =quot; method quot; /> quot;Title h2> itle</ textquot; name= h2>T < put type=quot; > xtarea quot;></te <in ption 2> Descri ion</h script =quot;5quot; name=quot; h2>De < xtarea rows te < 2> lor</h quot;> <h2>Co name=quot;Color edquot;>red e=quot;r ect en nquot;>gre sel n valu < <optio value=quot;gree option <> t /selec > tquot;></p < quot;submi pe= add new put ty <p><in /form> < l http://localhost:7402/apps/firststeps/3_addnew.htm > </body l> </htm
  34. 34. list entries le> e</tit exampl tries ist en 2); riesquot;, ing: l ml> ps/ent <ht e>sl <titl tste t/firs <head> conten nt(quot;/ [...] tConte ing.ge ipt> <scr Sl tries= var en pt> </scri ; +'quot;>') .Color entry <div> lor:'+ es) { cript> a in entri [a]; und-co <s ackgro ar es ; for (v entry=entri iv style=quot;b le+'</h3>') .Tit '<d ar te( v ry >'+ent nt.wri ); docume .write('<h2 Description . t y n docume .write(entr ument doc { mage) ntry.I if(e [...] > a+''quot; } ; div>') _list.htmlquot; entries/'+ ('</ .write data/ ef=quot;4 cument rite('<a hr ntent('/my do veCo nt.w docume =”ujax.remo k onclic a>'); list entries </ remove http://lo calhost:7 w</a> 402/apps/ }> add ne firststep htmlquot;> s/4_list. ipt </scr quot;3_addnew. html f= <a hre </div> > </body
  35. 35. templates le %> [...] entNode.Tit rr <%= cu ] [... t> <scrip .wizard(); ing Sl t> /scrip < [...] ; ) izard( Rjax.w !! script> ! </ resource or iented urls http://l ocalhost :7402/co ntent/fi rststeps .list.ht ml
  36. 36. Content beyond CMS Web Development What’s JCR (elevator pitch) REST meets JCR meets Ajax silve r Building TSS as a Content App
  37. 37. Content beyond CMS Web Development What’s JCR (elevator pitch) REST meets JCR meets Ajax silve r Building TSS as a Content App
  38. 38. : entially Ess d e-builas a R” “TSS++ t app. conten
  39. 39. TheServerSide.com as a content Application. - goals - » » Transform “TheServerSide.com” into a jax and JCR backed Content App. OLS! O TeOteditor & N ll t x (we owser ;) ) br
  40. 40. Buddy coding: er for Be . Bug
  41. 41. DEMO Content-Centric Infrastructure
  42. 42. If you remember only 2 things. I visit us: dev.day.com & ooth at b h side c register for JCR Cup 2008 fire Make your next Application a 2 Content Application
  43. 43. Q&A Content-Centric Infrastructure
  44. 44. Thank you for your attention Content-Centric Infrastructure

×