Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Javapolis 2007: AJAX meets JCR

4,192 views

Published on

Javapolis 2007 session. Introducing microjax

Published in: Technology
  • Be the first to comment

Javapolis 2007: AJAX meets JCR

  1. 1. Kickstarting the Java Content Repository AJAX meets JCR
  2. 2. obpqof`qba R håçï=óçìê=eqji=C=g~î~ëÅêáéí e~îÉ=~=î~ÖìÉ=ÅçåÅÉéí=çÑ=~= “`çåíÉåí=oÉéçëáíçêóÒ www.javapolis.com
  3. 3. Speaker’s Qualifications 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 www.javapolis.com
  4. 4. Overall Presentation Goal Learn how JCR and Ajax allow for very agile application development. www.javapolis.com
  5. 5. Kickstarting JCR AJAX meets JCR What’s JCR (elevator pitch) jax Introducing silve r Weblog in 15minutes www.javapolis.com
  6. 6. Kickstarting JCR AJAX meets JCR What’s JCR (elevator pitch) jax Introducing silve r Weblog in 15minutes www.javapolis.com
  7. 7. What’s JCR? gpoJNTM `çåíÉåí=oÉéçëáíçêó=Ñçê= g~î~qj=íÉÅÜåçäçÖó=^mf péÉÅJiÉ~ÇW a~ó=pçÑíï~êÉ pí~íìëW= cáå~ä=oÉäÉ~ëÉ=NTJàìåJOMMR bñéÉêí=dêçìéW www.javapolis.com
  8. 8. What’s JCR? gpoJOUP gpoJNTM `çåíÉåí=oÉéçëáíçêó=Ñçê= g~î~qj=íÉÅÜåçäçÖó=^mf=îOKM péÉÅJiÉ~ÇW a~ó=pçÑíï~êÉ pí~íìëW= mìÄäáÅ=oÉîáÉï=`äçëÉÇ=ëÉéJOMMT bñéÉêí=dêçìéW www.javapolis.com
  9. 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.” ? www.javapolis.com
  10. 10. Best of both worlds. s ys t e m file data base hier- archi integ es re rity structu read streams tx access write locking query control multi- value oning versi obser- un-structured “full-text” sort vation order content repo sit or y
  11. 11. What’s JCR? - Reality Check - Task: Write a JSP snippet that lists “ documents” in a “folder”” . www.javapolis.com
  12. 12. What’s JCR? - Reality Check - <% ); PI_DOCUMENTS(session <% TS documents = new LA childCount = node.getConten LAPI_DOCUMEN tCount(); new LLValue(); LLValue childTable = for(int i=0;i<childCount;i , ++) { s(volumeID, folderID documents.ListObject JCR API IContent child = node.getCo E, childTable); PI_DOCUMENTS.PERM_SE ntent(i); null, null, LA Property title = child.getP .enumerateValues(); ropertyByName(quot;Titlequot;); children = childTable %><%= title.getValue() %><b Enumeration r/><% reElements()) { Task: Write a JSP snippet that while(children.hasMo } )e.nextElement(); lue child = (LLValue <% %> <% LLVa ring(quot;Namequot;); ng <% tle = child.toSt fndocs ti Stri NodeIterator children = node.getNodes(); = new PageIterator% %><%= title %><br/>< children = page.getPages(); IFnObj SetDua fnfold <<< lPr while (children.hasNex int nu while (children.hasNext()) { er.get Conten oxy( t()) { lists “ documents” in a “folder”” . } mDocs = 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 om title = to umentD At e Property title = child.getProperty(quot;Titlequot;); ++) { t ntDo plevel.getAtom(quot;Titlequot; ua new IF nDocum l fndoc = cume ); %><%= title nt));r /><% %><b entDua IFnPro %><%= title %><br /><% lPr } pe IFnPro rtiesDual pr oxy(fndocs.g %> pe et o String rtyDual idmT pset = fndoc Item(new In } te . i title = idmT tleProp = pr getPropertie ger(i))); %><%= title itlePr op.get opset.getIte s(); %> %> if (co mClean <br/><% cuments()); Value( m(quot;Tit lequot;); entsProxy(binder.getDo up) { <% ); s = new IDocum cleane IDocuments document r.rele } ase(fn doc); documents.cache(); } (); documents.getCount t documentCount = %> in { cumentCount; i++) ItemByIndex(i)); r (int i = 0; i<do roxy(documents.get fo umentP document = new IDoc ment.getTitle() String title = docu ><% %><%= title %><br/ +800 } %> www.javapolis.com
  13. 13. What’s JCR? - Functional Elevator Pitch - obser- sql tx locking versioning vation opt ion al level 2 write, import, access control level 1 read, export, query www.javapolis.com
  14. 14. Java Standardization ase:d rele mi inal cted Review Ballot JSR-283 Public fe exp 2008 ved ro pp a www.javapolis.com
  15. 15. Java Standardization www.javapolis.com
  16. 16. 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 * * any ors ow mvendd? HSe DBMou ne R do y +hund Interwoven rs regiede of TCKs IBM CM EMC Documentum Repository st red www.javapolis.com
  17. 17. 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 www.javapolis.com
  18. 18. JCR - Weatherforcast -5° -8° -12° 2009 2010 2008 www.javapolis.com
  19. 19. Kickstarting JCR AJAX meets JCR What’s JCR (elevator pitch) jax Introducing silve r Weblog in 15minutes www.javapolis.com
  20. 20. Kickstarting JCR AJAX meets JCR What’s JCR (elevator pitch) jax Introducing silve r Weblog in 15minutes www.javapolis.com
  21. 21. Introducing jax Apache Sling JCR b ac ReST- ked (OSGI devkit , OCM subtract osgi , ...) subtract ocm microsling contains microjax jax www.javapolis.com
  22. 22. Introducing jax JCR longterm stable &durable well designed duty heavy strategic 16 t ons functionally broad www.javapolis.com
  23. 23. Introducing jax 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 www.javapolis.com
  24. 24. Introducing jax JCR de ve lop er ha t av id) me (d silve r µjax very simple pro jection: fits the bill www.javapolis.com
  25. 25. Introducing jax I browser & ujax.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 I Browser 16 t ons 2 MicrojaxServlet.java very simple js A translating requests PI to read content, Fo to JCR calls rms to write conten 3 JCR Compliant t Content Repository
  26. 26. Introducing jax “Data First!” JCR s uppor “stru ts cturef aswe irst” (but t ll. hat’s mi ssing point ) www.javapolis.com
  27. 27. DEMO
  28. 28. Getting ready... test & mount as a drive download a nd install www.javapolis.com
  29. 29. hello, world. le> d</tit rl lo, wo l html> tle>ujax:he < ti head>< 2> < rld</h > </head 2>hello, wo h body>< < > </body > </html drag, drop, done http://localhost:7402/ apps/firststeps/0_hell o.html www.javapolis.com
  30. 30. simple write example title> mple</ e exa e writ Tquot;> d=quot;POS simpl <html> itle>ujax: metho tepsquot; <t irsts <head> body> tent/f /con >< </head rm action=quot; --> fo tle < quot; /> !-- ti </h2> quot;Title < name= tle <h2>Ti ype=quot;textquot; t > <input cription -- ionquot;> s !-- de iption</h2> e=quot;Descript < >Descr nam s=quot;5quot; <h2 a row extare a> t < extare </t r --> - colo h2> !- < >Color</ rquot;> =quot;Colo redquot;>red <h2 name select ion value=quot; eenquot;>green < quot;gr opt < tion value= op <> ct </sele > </form write me! > </body > </html irststeps/1_write.html tp://localhost:7402/apps/f ht www.javapolis.com
  31. 31. simple read example title> mple</ d exa le rea simp <html> itle>ujax: <t <head> ript quot;></sc ead> ax.js </h squot;); jax/uj ststep olor+'quot;>'; > quot;/u ody t/fir src= <b conten or:'+node.C script nt(quot;/ < ript> ax.getConte kground-col <sc bac =uj r node div style=quot; va ='< ar div write(div); v nt. docume > pt </scri cript> le); de.Tit s h2>< (no < ument.write doc h2> ipt></ ion); </scr ript> script e.De <p><sc t.write(nod n docume /p> pt>< </scri </div> > </body read me! > </html http://localhost:7402/apps /firststeps/2_read.html www.javapolis.com
  32. 32. add new entry tle> le</ti examp entry new /*quot; x: add ntries ml> uja ht < eps/e itle> irstst ead><t dy> tent/f <h ad><bo ction=quot;/con </he form a < od=quot;POSTquot; > meth equot; /> =quot;Titl /h2> name tle< <h2>Ti ype=quot;textquot; ea> t textar input nquot;></ < riptio /h2> quot;Desc tion< escrip s=quot;5quot; name= h2>D < xtarea row te < h2> olor</ quot;Colorquot;> h2>C d < lect name= ue=quot;redquot;>re een quot;>gr se val < option alue=quot;green < tion v op <> ct </sele </p> bmitquot;> e=quot;su add new ut typ p <p><in > </form tml http://localhost:7402/apps/firststeps/3_addnew.h > </body > </html www.javapolis.com
  33. 33. list entries itle> ple</t exam ntries 2); e : list iesquot;, l> >ujax /entr <htm <title tsteps <head> /firs ontent t(quot;/c [...] Conten .get t> <scrip ntries=ujax var e pt> </scri '); or+'quot;> y.Col <div> '+entr { olor: ries) t> ound-c ; <scrip ar a in ent es[a]; ackgr for (v entry=entri iv style=quot;b le+'</h3>') Tit '<d var write( h2>'+entry. on); nt. docume .write('< pti Descri y. nt docume .write(entr nt docume ){ .Image ry if(ent [...] } ''quot;> /'+a+ >'); tmlquot; '</div tries ist.h write( a href=quot;4_l '/mydata/en nt. docume .write('< ent( veCont nt docume =”ujax.remo k onclic a>'); list entries </ remove http://lo calhost:7 </a> 402/apps/ }> dd new firststep mlquot;>a s/4_list. t /scrip 3_addnew.ht html < f=quot; <a hre </div> > </body > </html www.javapolis.com
  34. 34. templates %> .Title ..] tNode [. curren <%= [...] t> <scrip wizard(); ujax. pt> </scri [...] rd(); w iza x. ! Rja ! ript> </sc resource or ! iented urls http://l ocalhost :7402/co ntent/fi rststeps .list.ht ml www.javapolis.com
  35. 35. Kickstarting JCR AJAX meets JCR What’s JCR (elevator pitch) jax Introducing silve r Weblog in 15minutes www.javapolis.com
  36. 36. Kickstarting JCR AJAX meets JCR What’s JCR (elevator pitch) jax Introducing silve r Weblog in 15minutes www.javapolis.com
  37. 37. Weblog in 15 minutes - goals - - seen before? ...a bunch of forms & a datamodel. - something (almost) useable www.javapolis.com
  38. 38. Weblog in 15 minutes - goals - Confession I am not a Blogger . www.javapolis.com
  39. 39. Weblog in 15 minutes - goals - Confession I am not a Blogger . cchi’s azzo ano m type” stef “lino www.javapolis.com
  40. 40. Weblog in 15 minutes - goals - » » Transform “Stefano’s Linotype” into a jax and JCR backed Blog. LS! TOtOitor & NO ll tex ed (we owser ;) ) br ...but an audience full of buddy co ders www.javapolis.com
  41. 41. DEMO
  42. 42. If you remember only 2 thing. I dev.day.com Download CRX and play with ujax. keep an eye on “ apache sling” 2 ly! ious ser www.javapolis.com
  43. 43. Q&A View JavaPolis talks @ www.parleys.com
  44. 44. Thank you for your attention

×