Quick Upload

Loading...
Flash Player 9 (or above) is needed to view slideshows. We have detected that you do not have it on your computer.To install it, go here
Post to Twitter Post to Twitter
Share on Facebook
Myspace Hi5 Friendster Xanga LiveJournal Facebook Blogger Tagged Typepad Freewebs BlackPlanet gigya icons
SlideShare is now available on LinkedIn. Add it to your LinkedIn profile.

Cocoon Blocks CocoonGT2006

From danielfagerstrom, 6 months ago Add as contact

Talk given at Cocoon GT 2006

153 views | 0 comments | 0 favorites | 1 downloads | 0 embeds (Stats)

Categories

Technology

Groups/Events

Embed in your blog options close
Embed (wordpress.com) Exclude related slideshows Embed in your blog

More Info

This slideshow is Public
Total Views: 153 on Slideshare: 153 from embeds: 0
Flagged as inappropriate Flag as inappropriate

Flag as inappropriate

Select your reason for flagging this slideshow as inappropriate.

If needed, use the feedback form to let us know more details.

Slideshow Transcript

  1. Slide 1: Cocoon Blocks Daniel Fagerström danielf@nada.kth.se
  2. Slide 2: Same talk as last year? • Changed architecture 3 times since last time and rewritten the implementation a couple of times • The latest incarnation is based on the Spring framework and the servlet set of APIs • What I will describe is now part of Cocoon 2.2
  3. Slide 3: Motivation • Plugin architecture • Webapp reuse • Isolated internals in the blocks • Simplify using Cocoon together with other Servlet frameworks
  4. Slide 4: Overview • The big picture • Architecture – Focus on the webapp reuse part – Examples • Current state and next steps
  5. Slide 5: Blocks • A plugin architecture is needed • Designed by Stefano and the rest of the community 4+ years ago • Compile time blocks for a few years, but no external contracts • Several prototypes the last 1.5 years • Essentially back compatible, a new integration level: package and reuse applications
  6. Slide 6: What is a block? • A packaged application (or part) containing: – Libraries and resources – Components – Webapp functionality • Configurable at deploy time • Might depend on other blocks • Isolated internals (only partly in 2.2)
  7. Slide 7: What is a Block? Servlets Exported Used components components Components Classes,resources
  8. Slide 8: Deployment architecture Blocks repository Blocks (Maven 2) Deployment service Blocks Cocoon platform discovery
  9. Slide 9: Block Architecture • Built upon Spring and Maven • A block is a Maven module – Packaging format – Components – Servlet(s) – Resources – Libraries
  10. Slide 10: Block structure myblock/ META-INF/ legacy/ components.xconf # Avalon conf properties/ component.properties spring/ components.xml # Spring conf (incl block servlet) COB-INF/ # webapp resources sitemap.xmap # block sitemap resources/ ... org/apache/cocoon/myblock/ # classes foo.class ...
  11. Slide 11: Components in blocks • Exported to and managed in a global Spring container • Now the component configurations are copied from the blocks to the global Spring configuration by cocoon:deploy • Reading the configuration from the block would be preferable
  12. Slide 12: Webapps in blocks • As usual • Spring managed Servlets • Adds – Call servlets (sitemaps) in connected blocks – Use block deploy time attributes – Extend blocks (with polymorphism)
  13. Slide 13: Block architecture Spring container /editor / Block Servlets Dispatcher Servlet Configured in web.xml
  14. Slide 14: Based on the Servlet API • No new API • The BlockServlet is a Spring managed Servlet that sets up a minimal Servlet container for an embeded Servlet (e.g. SitemapServlet) • Block properties --> Servlet init params • Block connections --> named dispatchers • Can be used with any servlet, nothing Cocoon specific
  15. Slide 15: Wiring blog Uses editor: cmsURL: http://mycms.com/... myeditor myblog Extends super: mountPath: /blog/danielf/
  16. Slide 16: BlockServlet configuration <beans xmlns=\"http://www.springframework.org/schema/beans\"> <bean id=\"org.apache.cocoon.blocks.blog\" class=\"org.apache.cocoon.blocks.BlockServlet\"> <property name=\"mountPath\" value=\"/test1\"/> <property name=\"blockServletClass\" value=\"org.apache.cocoon.sitemap.SitemapServlet\"/> <property name=\"properties\"> <map> <entry key=\"cmsURL\" value=\"http://mycms.com/test\"/> </map> </property> <property name=\"connections\"> <map> <entry key=\"editor\" value-ref=\"org.apache.cocoon.blocks.editor\"/> </map> </property> </bean> </beans>
  17. Slide 17: Deployment configuration # blog.properties ## configure the blog block org.apache.cocoon.blog.properties.cmsURL= http://mycvs.com/danielf org.apache.cocoon.blog.connections.editor= com.mycms.myeditor ## configure my extended version com.mycms.myblog.mountPath= /blog/danielf com.mycms.myblog.connections.super= org.apache.cocoon.blog
  18. Slide 18: Block protocol block:/foo.xml – root sitemap in current block block:./bar.xml – current sitemap in current block (not yet) block:editor:/foo.xml – root sitemap in editor block block:super:/foo.xml – root sitemap in extended block
  19. Slide 19: Block properties, paths {block-property:cmsURL} - Block property in sitemap (input module) {cmsURL} - Block property in component configuration {block-path:myblog:/start} --> /blog/danielf/start - “Absolutizes” block protocol URIs to mounted URIs, used in link transformer
  20. Slide 20: Sitemap polymorphism blog “skin.xsl”  read “skin.xsl” Extends Empty myblog “skin.xsl”
  21. Slide 21: Sitemap polymorphism blog “skin.xsl”  read “skin.xsl” Extends Override myblog “skin.xsl”  “skin.xsl” read “myskin.xsl”
  22. Slide 22: Sitemap polymorphism blog “skin.xsl”  read “skin.xsl” “*.xml”  generate “{1}” transform “block:/skin.xsl” serialize Extends myblog “skin.xsl”  “start.xml” read “myskin.xsl”
  23. Slide 23: Scenario • Download blog block • Deploy with parameters (or use default) – Test • Create empty extension (Maven archetype) – Test • Override some default or example rule – Test • …
  24. Slide 24: Summary Blocks gives us: • Binary application packages – Classes & resources – Components – Webapp functionality • Parameterizable applications • Reusability by extension • Dependency handling between applications
  25. Slide 25: Current state • Implementation in Cocoon 2.2 • Stabilize it, use it for the samples
  26. Slide 26: Next steps • 3.0 – OSGi based – Uses ”official” Spring-OSGI bridge – class loader isolation – partial hot plugablillity