The Revenge of the Weblog: Agile Java Webdevelopment
-
Upload
david-nuescheler -
Category
Technology
-
view
3.096 -
download
0
description
Transcript of The Revenge of the Weblog: Agile Java Webdevelopment
![Page 1: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/1.jpg)
The Revenge of the Weblog in 15 minutes.Agile Web Development - Part 2
Bertrand Delacrétaz & David NueschelerDay SoftwareSubmission ID: 3140
![Page 2: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/2.jpg)
Bertrand Delacrétaz Senior [email protected]
Bertrand DelacrétazMember of the Board / [email protected]
![Page 3: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/3.jpg)
David Nuescheler Chief Technology [email protected]
David NueschelerJackrabbit Committer / [email protected]
David NueschelerJSR-170 Spec [email protected]
![Page 4: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/4.jpg)
obpqof`qba
R håçï=óçìê=eqji=C=g~î~ëÅêáéíe~îÉ=~=î~ÖìÉ=ÅçåÅÉéí=çÑ=~=“`çåíÉåí=oÉéçëáíçêóÒ=~åÇ=“obpqÒ
![Page 5: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/5.jpg)
The Revenge of the BlogAgile Web Development
The Web vs. JCR - Intro
Rewind: Blog in 15
Rebuttal: What about... ?
![Page 6: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/6.jpg)
The Revenge of the BlogAgile Web Development
The Web vs. JCR - Intro
Rewind: Blog in 15
Rebuttal: What about... ?
![Page 7: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/7.jpg)
What’s JCR?
`çåíÉåí=oÉéçëáíçêó=Ñçê=g~î~qj=íÉÅÜåçäçÖó=^mfpéÉÅJiÉ~ÇWa~ó=pçÑíï~êÉpí~íìëW=cáå~ä=oÉäÉ~ëÉ=NTJàìåJOMMR
gpoJNTM
bñéÉêí=dêçìéW
![Page 8: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/8.jpg)
bñéÉêí=dêçìéW
gpoJNTM gpoJOUP
`çåíÉåí=oÉéçëáíçêó=Ñçê=g~î~qj=íÉÅÜåçäçÖó=^mf=îOKMpéÉÅJiÉ~ÇWa~ó=pçÑíï~êÉpí~íìëW=mìÄäáÅ=oÉîáÉï=`äçëÉÇ=ëÉéJOMMT
What’s JCR?
![Page 9: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/9.jpg)
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.” ?
![Page 10: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/10.jpg)
Best of both worlds.
data base filesystem
content repository
read
write
hier-archiesstreams
locking accesscontrol
integrity structure
tx query
un-structured“full-text” sort
orderversion
ingobser-vation
multi-value
![Page 11: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/11.jpg)
- Reality Check -
Task: Write a JSP snippet that lists “documents” in a “folder”.”
What’s JCR?
![Page 12: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/12.jpg)
What’s JCR?- Reality Check -
Task: Write a JSP snippet that lists “documents” in a “folder”.”
<%childCount = node.getContentCount();for(int i=0;i<childCount;i++) { IContent child = node.getContent(i); Property title = child.getPropertyByName("Title"); %><%= title.getValue() %><br/><%}%>
<%LAPI_DOCUMENTS documents
= new LAPI_DOCUMENTS(session);
LLValue childTable = new LLValue();
documents.ListObjects(volumeID, folderID,
null, null, LAPI_DOCUMENTS.PERM_SEE, chi
ldTable);
Enumeration children = childTable.enumerateValue
s();
while(children.hasMoreElements()) {
LLValue child = (LLValue)e.nextElement()
;
String title = child.toString("Name");
%><%= title %><br/><%
}%>
<%fndocs = new IFnObjSetDualProxy( fnfolder.getContents(idmFolderContent.idmFolderContentDocument));
int numDocs = fndocs.getCount();for (int i = 1; i <= numDocs; i++) {
IFnDocumentDual fndoc = new IFnDocumentDualProxy(fndocs.getItem(new Integer(i)));
IFnPropertiesDual propset = fndoc.getProperties();
IFnPropertyDual idmTitleProp = propset.getItem("Title");
String title = idmTitleProp.getValue();
%><%= title %><br/><% if (comCleanup) { cleaner.release(fndoc); }}%>
<%IDocuments documents =
new IDocumentsProxy(binder.getDocuments());
documents.cache();
int documentCount = documents.getCount();
for (int i = 0; i<documentCount; i++) {
document = new IDocumentProxy(docume
nts.getItemByIndex(i));
String title = document.getTitle()
%><%= title %><br/><%
}%>
<%PageIterator children = page.getPages();while (children.hasNext()) { Page child = children.nextPage(); Container toplevel = child.getContent(); Atom title = toplevel.getAtom("Title"); %><%= title %><br /><%}%>
+800
<%NodeIterator children = node.getNodes();while (children.hasNext()) { Node child = children.nextNode(); Property title = child.getProperty("Title"); %><%= title %><br /><%}%>
JCR API
![Page 13: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/13.jpg)
Java Standardization
![Page 14: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/14.jpg)
Known compliant Repositories
Apache Jackrabbit Oracle XML DBExo
ECMS PlatformMicrosoft
Sharepoint OpenText Livelink
Day CRX IBM FileNet P8 Xythos Repository Alfresco ECM Vignette V7
Interwoven Repository IBM CM EMC Documentum
How many
RDBMS vendors
do you need?+hundreds of TCKsregistered
* *
*
*
* using third party connector
*
![Page 15: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/15.jpg)
Sourcemix Sourcemix
Percussion Rhythmix Lutece
Portal
QuickWCM WCMS
Jahia Framework
Hippo CMS
InfoQ Online CommunityNuxeo ECM
Sakai E-learning
TYPO3 v5.0 WCMGX WebManager
Exo ECMS Platform
Liferay Enterprise Portal
Artifactory Maven Proxy
IBM FileNet WebSiteManagerApache James
medic-2-medic mapofmedicine
Day Communiqué WCMS
Apache Tapestry
Day Communique Collab
QSLabs ComplianceApache
Cocoon
Alfresco ECMSApache Sling
Mindquarry Collaboration
Day Communique DAMmagnolia WCMS
JBoss Portal
Some known JCR Applications
Sun OpenPortal Interface 21
Spring Framework
Fast Enterprise SearchOracle PortalBEA Portal
![Page 16: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/16.jpg)
JCR - Weatherforcast-5°
2008 2009-8°
2010-12°
![Page 17: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/17.jpg)
JCR: Yours truly
REST over JCR
REST -> Roy T. Fielding
released y2k162 pages
v1.0 released 2005
+300 pages
![Page 18: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/18.jpg)
JCR
functionally broad
well designedlong term
strategicheavy duty16 tons
stable & durable
The Problem:
![Page 19: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/19.jpg)
JCR
me
short-sighted...easily confused
developer hat
hacklazy
“i want to build webapps” the o
ther
side
functionally broad
well designedlong term
strategicheavy duty16 tons
stable & durable
The Problem:
![Page 20: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/20.jpg)
The Silver bullet:)
JCR
me (david)
developer hat
very simple projection: fits the bill
sling
silver
![Page 21: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/21.jpg)
Apache Sling
sling.js & .jst“the artist formerly
known as”:
jax
JCR backed ReST-Webkit(OSGI, OCM , ...)
contains
jsprubyscala
groovyesp...
![Page 22: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/22.jpg)
I2
3
Browser
J2EE WebServer
browser & sling.jsreading: json & resource GET’swriting: form-POSTs & GETs
Sling Servletstranslating requests to JCR calls
JCR CompliantContent Repository
I
2
3very simple js API to read content, Forms to write content
handles all the heavy lifting, particularly security16 tons
![Page 23: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/23.jpg)
It’s the web, baby!URLs matter.
.../product.jsp?id=12346
Mistake 1:Addressing the “Script”Mistake 2:.jsp? What the heck?
Mistake 3:Passing in “this”
![Page 24: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/24.jpg)
Repository
Reclaiming the web.Sling URL decomposition.
/cars/audi/s4.details.html
Content Repository Path...selects a particular script
![Page 25: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/25.jpg)
“Data First!”JCR supports “structure first” aswell. (but that’s missing point)
![Page 26: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/26.jpg)
The Revenge of the BlogAgile Web Development
The Web vs. JCR - Intro
Rewind: Blog in 15
Rebuttal: What about... ?
![Page 27: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/27.jpg)
The Revenge of the BlogAgile Web Development
The Web vs. JCR - Intro
Rewind: Blog in 15
Rebuttal: What about... ?
![Page 28: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/28.jpg)
Getting ready...
download and installtest & mount as a drive
![Page 29: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/29.jpg)
hello, world.
drag, drop, donehttp://localhost:7402/apps/firststeps/0_hello.html
<html>
<head><title>s
ling:hello, wo
rld</title>
</head>
<body><h2>hell
o, world</h2>
</body>
</html>
![Page 30: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/30.jpg)
simple write example
write me!http://localhost:7402/apps/firs
tsteps/1_write.html
<html>
<head><title>s
ling: simple w
rite example</
title>
</head><body>
<form action="
/content/first
steps" method=
"POST">
<!-- title -->
<h2>Title</h2>
<input type="t
ext" name="Tit
le" />
<!-- descripti
on -->
<h2>Descriptio
n</h2>
<textarea rows
="5" name="Des
cription">
</te
xtarea>
<!-- color -->
<h2>Color</h2>
<select name="
Color">
<option value=
"red">red
<option value=
"green">green
</select>
</form>
</body>
</html>
![Page 31: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/31.jpg)
simple read example
read me!http://localhost:7402/apps/firststeps/2_read.html
<html>
<head><title>s
ling: simple r
ead example</t
itle>
</head>
<body>
<script src
="/system/slin
g.js"></script
<script>
var node=Sl
ing.getContent
("/content/fir
ststeps");
var div='<d
iv style="back
ground-color:'
+node.Color+'"
>';
document.wr
ite(div);
</script>
<h2><script>
document.write
(node.Title);
</script></h2>
<p><script>
document.write
(node.Descript
ion);
</script></p>
</div>
</body>
</html>
![Page 32: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/32.jpg)
add newhttp://localhost:7402/apps/firststeps/3_addnew.html
add new entry
<html>
<head><title>s
ling: add new
entry example<
/title>
</head><body>
<form action="
/content/first
steps/entries/
*"
method="PO
ST" >
<h2>Title</h2>
<input type="t
ext" name="Tit
le" />
<h2>Descriptio
n</h2>
<textarea rows
="5" name="Des
cription"></te
xtarea>
<h2>Color</h2>
<select name="
Color">
<option value=
"red">red
<option value=
"green">green
</select>
<p><input type
="submit"></p>
</form>
</body>
</html>
![Page 33: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/33.jpg)
list entries
list entrieshttp://localhost:7402/apps/firststeps/4_list.html
<html>
<head><title>s
ling: list ent
ries example</
title>
[...]
<script>
var entries=Sl
ing.getContent
("/content/fir
ststeps/entrie
s", 2);
</script>
<div>
<script>
for (var a i
n entries) {
var entry=ent
ries[a];
document.
write('<div st
yle="backgroun
d-color:'+entr
y.Color+'">');
document.
write('<h2>'+e
ntry.Title+'</
h3>');
document.
write(entry.De
scription);
if(entry.
Image) {
[...]
}
document.
write('</div>'
);
document.
write('<a href
="4_list.html"
onclick=
”ujax.removeCo
ntent(\'/mydat
a/entries/\'+a
+'\'">
remove</
a>');
}
</script>
<a href="3_add
new.html">add
new</a>
</div>
</body>
![Page 34: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/34.jpg)
resource oriented urlshttp://localhost:7402/content/firststeps.list.html
templates
[...]
<%= currentNod
e.Title %>
[...]
<script>
Sling.wizard()
;
</script>
[...]
! ! Rjax.wizard();
! </script>
![Page 35: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/35.jpg)
Transform “TheServerSide.com” into JCR backed Content App.
TheServerSide.com as a content Application.
- goals -
»»NO TOOLS!(well texteditor & browser ;) )
No Server-Side
Execution
But...
![Page 36: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/36.jpg)
Buddy coding:
Beer for
Bug.
![Page 37: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/37.jpg)
The Revenge of the BlogAgile Web Development
The Web vs. JCR - Intro
Rewind: Blog in 15
Rebuttal: What about... ?
![Page 38: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/38.jpg)
The Revenge of the BlogAgile Web Development
The Web vs. JCR - Intro
Rewind: Blog in 15
Rebuttal: What about... ?
![Page 39: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/39.jpg)
What about Security?
JCR
this is not JDBC!
![Page 40: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/40.jpg)
What about Security?
I2
3
Browser
J2EE WebContainer
Sling
JCRAuthentication & Authorization happens here.collects
credentials (pluggable)
![Page 41: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/41.jpg)
What about... Back button & Bookmarks?
✓
![Page 42: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/42.jpg)
What about... Browser (in-)compatibility?
...not scary enough?
should work with
NN2.03B & IE3.0
(’95 & ‘96)
![Page 43: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/43.jpg)
What about... Accessibility?
![Page 44: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/44.jpg)
What about... Performance?
CPU
TraditionalServer Model
JSTModel
Bring your ownCPU...
![Page 45: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/45.jpg)
What about... Performance?
Bandwidth samplethread view
TraditionalServer Model
JSTModel
39k JS for Layout
2k HTML 30k HTML
Caching“presentation
+ logic”...
![Page 46: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/46.jpg)
✓
I
“good urls”
2
just content
✓
3
traverse
✓
What about... SEO?
![Page 47: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/47.jpg)
RSS, Google Sitemaps, ...
JST only works with HTML
reminder:you still have
a server
![Page 48: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/48.jpg)
![Page 49: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/49.jpg)
If you remember only 2 things.visit us: dev.day.comregister for JCR Cup 2008Make your next Application a Content Application
2
Ivisit us
at our booth
![Page 50: The Revenge of the Weblog: Agile Java Webdevelopment](https://reader034.fdocuments.us/reader034/viewer/2022052619/55621d87d8b42ac6588b4648/html5/thumbnails/50.jpg)
Thanks.