0
Julien Viet Esprit 19 th  of June 2010
About me <ul><li>1974 / Born </li></ul><ul><li>1980 / Basic (Apple IIe)  </li></ul><ul><li>1987 / STOS (Atari 520 ST) </li...
<ul><li>JBoss Application Server </li></ul><ul><li>JBoss Portal </li></ul><ul><li>eXo Portal </li></ul><ul><li>GateIn </li...
GateIn and above <ul><li>GateIn 3.0 released in March 2010 </li></ul><ul><li>GateIn 3.1 scheduled for June 2010 </li></ul>...
Standards, features and technologies Standards & Features GateIn Portal JBoss eXo Identity integration WSRP Model Object f...
Major features <ul><li>Aggregation via Portlet and Gadget </li></ul><ul><li>Rich User Interface </li></ul><ul><li>Java Con...
Content aggregation <ul><li>Based on standards and specifications </li></ul><ul><ul><li>Portlet 2.0/ GateIn Portlet Contai...
Portal development <ul><li>Portlet bridges </li></ul><ul><ul><li>JSF (JSR 301) </li></ul></ul><ul><ul><li>Struts 1 & Strut...
Portal model Users Admins Classic Root John Mary Demo Group Site Portal Site User Site GateIn Executive Board Home Nav Sit...
GateIn Tools and Frameworks <ul><li>Chromattic </li></ul><ul><ul><li>An advanced Java Content Repository to Object mapping...
Java Content Repository
What’s wrong with? <ul><li>public void print(Node node) throws RepositoryException { </li></ul><ul><li>String typeName = n...
JCR by nature is not type safe <ul><li>public void print( Node  node)  throws RepositoryException  { </li></ul><ul><li>Str...
OO progtamming provides type safety <ul><li>public void print(File file) { </li></ul><ul><li>if (file instanceof Document)...
Chromattic <ul><li>Provides a type safe object model for JCR  </li></ul><ul><li>Use Java 5 annotation </li></ul><ul><li>En...
Chromattic concepts Chromattic Session build() Chromattic Builder Chromattic Chromattic classes Meta Model Objects open() ...
Entity life cycle <ul><li>ChromatticSession provides support for interacting with objects life cycle </li></ul>Transient P...
Chromattic classes generation based on APT Class loading Compiler File.java File_Chromattic.java File.class File_Chromatti...
Property mapping <ul><li>Java types are mapped to JCR property types </li></ul><ul><ul><li>String as JCR String </li></ul>...
Multivalued property mapping <ul><li>JCR types can be multivalued and are mapped either to native array type and java.util...
Relationship types <ul><li>Four kinds of relationship </li></ul><ul><ul><li>Hierarchic: the default one </li></ul></ul><ul...
Collection mapping <ul><li>Unordered collection </li></ul><ul><ul><li>Collection<File> getChildren() </li></ul></ul><ul><l...
JCR multiple inheritance support <ul><li>@MixinType(name=“votes”) </li></ul><ul><li>public abstract class Votes { </li></u...
Parameter type and generics inheritance <ul><li>public abstract class Container<T> { </li></ul><ul><li>@OneToMany </li></u...
Eventing <ul><li>The session provides eventing for state changes </li></ul><ul><ul><li>Entity life cycle changes </li></ul...
Roadmap <ul><li>Detached/attached entities </li></ul><ul><li>Type safe query builder </li></ul><ul><li>Bean validation int...
CRaSH <ul><li>Considers the JCR tree as its file system </li></ul><ul><li>Basic adminisration </li></ul><ul><li>Test JCR q...
CRaSH components Shell Engine Commands Connectors Telnet Args4j Groovy JCR Connector SSH SCP
Command <ul><li>Written as a Groovy script </li></ul><ul><ul><li>Easy to add new commands </li></ul></ul><ul><ul><li>Found...
Groovy integration: property access <ul><li>// Iterate over the properties </li></ul><ul><li>Node.eachProperty({ property ...
Groovy integration: node child access <ul><li>// Iterates over the children </li></ul><ul><li>def count = 0; </li></ul><ul...
GateIn Frameworks <ul><li>Chromattic and CRaSH are powerful tools for building applications on top of GateIn </li></ul><ul...
Upcoming SlideShare
Loading in...5
×

GateIn Frameworks

3,353

Published on

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

No Downloads
Views
Total Views
3,353
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
3
Comments
0
Likes
8
Embeds 0
No embeds

No notes for slide

Transcript of "GateIn Frameworks"

  1. 1. Julien Viet Esprit 19 th of June 2010
  2. 2. About me <ul><li>1974 / Born </li></ul><ul><li>1980 / Basic (Apple IIe) </li></ul><ul><li>1987 / STOS (Atari 520 ST) </li></ul><ul><li>1989 / MC 68000 (Amiga 500) </li></ul><ul><li>1994 / Saturn (HP48) </li></ul><ul><li>1996 / C (PC) </li></ul><ul><li>1997 / Java 1.1.4 </li></ul><ul><li>2002 / Joined JBoss </li></ul><ul><li>2005 / JBoss Portal 2.0 </li></ul><ul><li>2006 / Red Hat buys JBoss $350M </li></ul><ul><li>2008 / Joined eXo </li></ul><ul><li>2009 / eXo + JBoss </li></ul><ul><li>2010 / GateIn 3.0 </li></ul><ul><li>… </li></ul>
  3. 3. <ul><li>JBoss Application Server </li></ul><ul><li>JBoss Portal </li></ul><ul><li>eXo Portal </li></ul><ul><li>GateIn </li></ul><ul><li>Chromattic </li></ul><ul><li>Reflext </li></ul><ul><li>Wikbook </li></ul><ul><li>CRaSH </li></ul>Open Source experience
  4. 4. GateIn and above <ul><li>GateIn 3.0 released in March 2010 </li></ul><ul><li>GateIn 3.1 scheduled for June 2010 </li></ul><ul><li>eXo Social 1.0 </li></ul><ul><li>eXo WCM 2.0 </li></ul><ul><li>eXo KS 2.0 </li></ul><ul><li>eXo Platform 1.0 </li></ul>
  5. 5. Standards, features and technologies Standards & Features GateIn Portal JBoss eXo Identity integration WSRP Model Object for Portal Gadget Server Portlet Container JBoss Identity eXo JCR / WebDAV Chromattic (JCR / Object) JBoss WS WebUI JSR 286 Portlet Java Content Repository Remote Portlets Rich UI Portal / Portlet Opensocial Gadgets Portlet Bridge / Richfaces Rest / JAX-RS
  6. 6. Major features <ul><li>Aggregation via Portlet and Gadget </li></ul><ul><li>Rich User Interface </li></ul><ul><li>Java Content Repository </li></ul><ul><li>Internationalization / RTL </li></ul><ul><li>Management </li></ul><ul><li>Identity integration (Database, LDAP) </li></ul><ul><li>SSO integration (SSO, CAS, OpenSSO) </li></ul>
  7. 7. Content aggregation <ul><li>Based on standards and specifications </li></ul><ul><ul><li>Portlet 2.0/ GateIn Portlet Container </li></ul></ul><ul><ul><li>OpenSocial Gadgets / Shindig </li></ul></ul>
  8. 8. Portal development <ul><li>Portlet bridges </li></ul><ul><ul><li>JSF (JSR 301) </li></ul></ul><ul><ul><li>Struts 1 & Struts 2 </li></ul></ul><ul><ul><li>Apache Tapestry </li></ul></ul><ul><ul><li>Apache Wicket </li></ul></ul><ul><li>Portlet frameworks </li></ul><ul><ul><li>Spring MVC Portlet </li></ul></ul><ul><ul><li>Grails Portlet </li></ul></ul>
  9. 9. Portal model Users Admins Classic Root John Mary Demo Group Site Portal Site User Site GateIn Executive Board Home Nav SiteMap homepage Pages sitemap
  10. 10. GateIn Tools and Frameworks <ul><li>Chromattic </li></ul><ul><ul><li>An advanced Java Content Repository to Object mapping framework </li></ul></ul><ul><li>CRaSH </li></ul><ul><ul><li>A shell for Java Content Repository </li></ul></ul><ul><li>Open source under the LGPL license </li></ul><ul><li>Hosted on Google Code </li></ul>
  11. 11. Java Content Repository
  12. 12. What’s wrong with? <ul><li>public void print(Node node) throws RepositoryException { </li></ul><ul><li>String typeName = node.getPrimaryType().getName(); </li></ul><ul><li>if (typeName.equals(“nt:file”)) { </li></ul><ul><li>Node content = node.getNode(“jcr:content”); </li></ul><ul><li>String mimeType = “”; </li></ul><ul><li>if (content.hasProperty(“mimeType”) </li></ul><ul><li>mimeType = content.getProperty(“mimeType”).getString(); </li></ul><ul><li>System.out.println(“File” + node.getName() + “:” + mimeType); </li></ul><ul><li>} else if (typeName.equals(“nt:folder)) { </li></ul><ul><li>System.out.println(“Folder “ + node.getName()); </li></ul><ul><li>Iterator i = node.getNodes(); </li></ul><ul><li>while (i.hasNext()) { </li></ul><ul><li>Node child = (Node)i.next(); </li></ul><ul><li>print(node); </li></ul><ul><li>} else { </li></ul><ul><li>throw new IllegalArgumentException(“print should not be called with the node type ” + typeName); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  13. 13. JCR by nature is not type safe <ul><li>public void print( Node node) throws RepositoryException { </li></ul><ul><li>String typeName = node.getPrimaryType().getName(); </li></ul><ul><li>if ( typeName.equals(“nt:file”) ) { </li></ul><ul><li>Node content = node.getNode(“jcr:content”) ; </li></ul><ul><li>String mimeType = “”; </li></ul><ul><li>if ( content.hasProperty (“mimeType”) </li></ul><ul><li>mimeType = content. getProperty(“mimeType”).getString() ; </li></ul><ul><li>System.out.println(“File” + node.getName() + “:” + mimeType); </li></ul><ul><li>} else if ( typeName.equals(“nt:folder) ) { </li></ul><ul><li>System.out.println(“Folder “ + node.getName()); </li></ul><ul><li>Iterator <?> i = node.getNodes(); </li></ul><ul><li>while (i.hasNext()) { </li></ul><ul><li>Node child = (Node) i.next(); </li></ul><ul><li>print(node); </li></ul><ul><li>} else { </li></ul><ul><li>throw new IllegalArgumentException(“print should not be called with the node type ” + typeName); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  14. 14. OO progtamming provides type safety <ul><li>public void print(File file) { </li></ul><ul><li>if (file instanceof Document) { </li></ul><ul><li>String mimeType = file.getContent().getMimeType(); </li></ul><ul><li>System.out.println(“File “ + file.getName() + “ “ + mimeType; </li></ul><ul><li>else { </li></ul><ul><li>Folder folder = (Folder)file; </li></ul><ul><li>System.out.println(“Folder “ + folder.getName(); </li></ul><ul><li>for (File child : folder.getChildren()) </li></ul><ul><li>print(child); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  15. 15. Chromattic <ul><li>Provides a type safe object model for JCR </li></ul><ul><li>Use Java 5 annotation </li></ul><ul><li>Enable development of rich models </li></ul><ul><li>Integrates well with Java language with the use of Java Collection and Generics </li></ul><ul><li>Advanced features like support for JCR multiple inheritance </li></ul><ul><li>Integrates at the Java compiler level via the Java Annotation Processor Tools (APT) </li></ul><ul><li>Generation of node type definitions </li></ul>
  16. 16. Chromattic concepts Chromattic Session build() Chromattic Builder Chromattic Chromattic classes Meta Model Objects open() JCR Node type defs Java classes
  17. 17. Entity life cycle <ul><li>ChromatticSession provides support for interacting with objects life cycle </li></ul>Transient Persistent Removed Chromattic Session create() destroy() persist() insert()
  18. 18. Chromattic classes generation based on APT Class loading Compiler File.java File_Chromattic.java File.class File_Chromattic.class Class<File> Class<File_Chromattic> APT <<extends>>
  19. 19. Property mapping <ul><li>Java types are mapped to JCR property types </li></ul><ul><ul><li>String as JCR String </li></ul></ul><ul><ul><li>Integer/int/Long/long as JCR Long </li></ul></ul><ul><ul><li>Boolean/boolean as JCR Boolean </li></ul></ul><ul><ul><li>Float/float/Double/double as JCR Double </li></ul></ul><ul><ul><li>java.util.Date as JCR Calendar </li></ul></ul><ul><ul><li>InputStream as JCR Binary </li></ul></ul><ul><li>Java enum type mapped to JCR String type </li></ul>
  20. 20. Multivalued property mapping <ul><li>JCR types can be multivalued and are mapped either to native array type and java.util.List java type </li></ul>@Property int[] getIntArray(); @Property Integer[] getIntegerArray(); @Property List<Integer> getIntegerList();
  21. 21. Relationship types <ul><li>Four kinds of relationship </li></ul><ul><ul><li>Hierarchic: the default one </li></ul></ul><ul><ul><li>Reference and path provides support for JCR references </li></ul></ul><ul><ul><li>Embedded enable mapping for super type and mixin </li></ul></ul>
  22. 22. Collection mapping <ul><li>Unordered collection </li></ul><ul><ul><li>Collection<File> getChildren() </li></ul></ul><ul><li>Ordered collection based on JCR node order </li></ul><ul><ul><li>List<File> getChildren() </li></ul></ul><ul><li>Associative collection </li></ul><ul><ul><li>Map<String, File> getChildren() </li></ul></ul>
  23. 23. JCR multiple inheritance support <ul><li>@MixinType(name=“votes”) </li></ul><ul><li>public abstract class Votes { </li></ul><ul><li>public abstract int getVoteCount(); </li></ul><ul><li>public abstract void setVoteCount(int count); </li></ul><ul><li>} </li></ul><ul><li>@PrimaryType(name=“nt:file”) </li></ul><ul><li>public abstract class Document { </li></ul><ul><li>@OneToOne(type = RelationshipType.EMBEDDED) </li></ul><ul><li>@Owner </li></ul><ul><li>public abstract Votes getVotes(); </li></ul><ul><li>} </li></ul>
  24. 24. Parameter type and generics inheritance <ul><li>public abstract class Container<T> { </li></ul><ul><li>@OneToMany </li></ul><ul><li>public abstract Collection<T> getChildren(); </li></ul><ul><li>} </li></ul><ul><li>@PrimaryType(name=“nt:folder”) </li></ul><ul><li>public abstract class Directory extends Container<File> { </li></ul><ul><li>} </li></ul><ul><li>@PrimaryType(name=“identities”) </li></ul><ul><li>public abstract class IdentityContainer<I extends IdentityObject> extends Container<I> { </li></ul><ul><li>} </li></ul>
  25. 25. Eventing <ul><li>The session provides eventing for state changes </li></ul><ul><ul><li>Entity life cycle changes </li></ul></ul><ul><ul><li>State changes (properties) </li></ul></ul><ul><li>Enables dependency injection integration </li></ul>public class InjectingListener implements LifeCycleListener { public created(Object o) { if (o instanceof FrameworkObject) { ((FrameworkObject)o).setFramework(framework); } } … }
  26. 26. Roadmap <ul><li>Detached/attached entities </li></ul><ul><li>Type safe query builder </li></ul><ul><li>Bean validation integration </li></ul><ul><li>Object versioning </li></ul><ul><li>Property map filtering </li></ul><ul><ul><li>Map<String, Integer> getIntProperties(); </li></ul></ul><ul><li>More flexible enum mapping </li></ul>
  27. 27. CRaSH <ul><li>Considers the JCR tree as its file system </li></ul><ul><li>Basic adminisration </li></ul><ul><li>Test JCR queries </li></ul>
  28. 28. CRaSH components Shell Engine Commands Connectors Telnet Args4j Groovy JCR Connector SSH SCP
  29. 29. Command <ul><li>Written as a Groovy script </li></ul><ul><ul><li>Easy to add new commands </li></ul></ul><ul><ul><li>Found in WEB-INF/groovy/commands </li></ul></ul><ul><li>Annotated with Args4j </li></ul><ul><ul><li>Describe switches and arguments </li></ul></ul>
  30. 30. Groovy integration: property access <ul><li>// Iterate over the properties </li></ul><ul><li>Node.eachProperty({ property -> out.print(property.name);}; </li></ul><ul><li>// This code </li></ul><ul><li>def foo = null; </li></ul><ul><li>if (node.hasProperty(‘foo)) { </li></ul><ul><li>foo = node.getProperty(‘foo’).getString(); </li></ul><ul><li>} </li></ul><ul><li>// Can be replaced by </li></ul><ul><li>foo = node.foo; </li></ul><ul><li>// </li></ul><ul><li>foo = node[‘foo’]; </li></ul>
  31. 31. Groovy integration: node child access <ul><li>// Iterates over the children </li></ul><ul><li>def count = 0; </li></ul><ul><li>node.each({ node -> count++; }) </li></ul><ul><li>// This code </li></ul><ul><li>def foo = null; </li></ul><ul><li>If (node.hasNode(‘foo’) { </li></ul><ul><li>foo = node.getNode(‘foo); </li></ul><ul><li>} </li></ul><ul><li>// can be replaced by </li></ul><ul><li>foo = node.foo; </li></ul><ul><li>// Or </li></ul><ul><li>foo = node[‘foo’]; </li></ul>
  32. 32. GateIn Frameworks <ul><li>Chromattic and CRaSH are powerful tools for building applications on top of GateIn </li></ul><ul><li>http://www.gatein.org </li></ul><ul><li>http://chromattic .googlecode.com </li></ul><ul><li>http://crsh.googlecode.com </li></ul>
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×