Cocoon Blocks ApacheCon US 2005

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Cocoon Blocks ApacheCon US 2005 - Presentation Transcript

    1. Cocoon Blocks Daniel Fagerström [email_address]
    2. Motivation
      • Cocoon is great but …
      • Monolithic
        • Huge download
        • Complicated configuration
        • Steep threshold
        • Few third party applications and components
        • ” Classloading hell”
    3. Blocks
      • A plugin architecture is needed
      • Designed by Stefano and the rest of the community 3+ years ago
      • Compile time blocks for a few years, but no external contracts
      • Much work and discussion, but less progress until the last half year
      • Essentially back compatible, a new integration level: package and reuse applications
    4. Overview
      • The big picture
      • Architecture
        • Examples
      • Current state and next steps
    5. What is a block?
      • A packaged application (or part) containing:
        • Libraries and resources
        • Components
        • Sitemap functionality
      • Configurable at deploy time
      • Might depend on other blocks
      • Isolated internals
    6. What is a Block? Classes,resources Components Sitemap Export packages Import packages Registered services Used services
    7. Deployment architecture Cocoon platform Blocks Blocks repository (Maven 2) Blocks discovery Deployment service
    8. Block Architecture
      • Built upon OSGi (same as Eclipse 3+)
      • A block is an OSGi bundle
        • Class loader isolation
        • Packaging format
        • Services
        • Security
        • Hot deployment possible
    9. OSGi
    10. OSGi
      • Standardized, component oriented, computing environment for networked services
      • Since 1998
      • 100+ members
      • R4
      • 10+ implementations
      • Smart phones, home automation, BMW 5, Eclipse
    11. OSGi Overview
      • Secure execution environment
      • Bundles (applications)
      • Life cycle management
      • Service architecture
      • Standard services
    12. Bundles
      • Applications
      • JAR containing
        • Compiled code
        • Resources
        • JARs that the code depend on
        • Meta information – manifest.mf
    13. Class sharing
      • Import-Package
      • DynamicImport-Package
      • Export-Package
      • Bundle-Classpath
    14. Activator OSGi Framework Activator BundleCtx Activator BundleCtx
    15. Life cycle
    16. Manifest.mf Manifest-Version: 1.0 Bundle-Name: cocoon_servlet Bundle-Version: 1.0.0 Bundle-Description: Cocoon servlet bundle Bundle-Vendor: Apache Bundle-DocURL: http://cocoon.apache.org Bundle-ContactAddress: http://cocoon.apache.org Bundle-Activator: org.apache.cocoon.service.servlet.impl.Activator Bundle-Category: servlet Import-Package: javax.servlet,javax.servlet.http, org.apache.cocoon.servlet, org.osgi.framework,org.osgi.service.http, org.osgi.service.log,org.osgi.util.tracker
    17. Blocks
    18. Block structure
      • myblock/
      • META-INF/
      • MANIFEST.MF # bundle manifest
      • BLOCK-INF/
      • block.xml # block configuration
      • myblock.xconf # exported components
      • classes/
      • lib/
      • src/
      • sitemap.xmap # block sitemap
      • resources/
      • ...
    19. Block configuration
      • <block xmlns=&quot;http://apache.org/cocoon/blocks/cob/1.0&quot;
      • id=&quot;http://cocoon.apache.org/blocks/blog-123&quot;>
      • <name>blog</name>
      • <sitemap src=&quot;sitemap.xmap&quot;/>
      • <components>
      • <include src=&quot;blog.xconf&quot;/>
      • </components>
      • <properties>
      • <property name=“cmsURL&quot;>
      • <default>http://mycms.com/test</default>
      • </property>
      • </properties>
      • <requirements>
      • <requires
      • interface=&quot;http://cocoon.apache.org/blocks/editor/1.0&quot;
      • name=“editor&quot;/>
      • </requirements>
      • </block>
    20. Wiring blog editor: myeditor myblog super: cmsURL: http://mycms.com/... Uses Extends mountPath: /blog/danielf/
    21. wiring.xml
      • <wiring xmlns=&quot;http://apache.org/cocoon/blocks/wiring/1.0&quot;>
      • <block id=&quot;blog-123&quot; location=&quot;file:/blocks/blog-1.4.jar&quot;>
      • <connections>
      • <connection name=&quot;editor&quot; block=&quot;editor-234&quot;/>
      • </connections>
      • <properties>
      • <property name=&quot;cmsURL“
      • value=&quot;http://mycms.com/danielf/&quot;/>
      • </properties>
      • </block>
      • <block id=&quot;editor-234&quot; location=&quot;file:/blocks/editor-1.4.jar&quot;/>
      • <block id=&quot;myblog-345&quot; location=&quot;file:/blocks/myblog/&quot;>
      • <mount path=&quot;/blog/danielf/&quot;/>
      • <connections>
      • <connection name=&quot;super&quot; block=&quot;blog-123&quot;/>
      • </connections>
      • </block>
      • </wiring>
    22. Components in blocks
      • Components only available from the own block and connected blocks
    23. Component bridge Cocoon component manager Cocoon component manager OSGi service
    24. Sitemaps in blocks
      • As usual
      • Adds
        • Call sitemaps in connected blocks
        • Use block deploy time attributes
        • Extend blocks (with polymorphism)
    25. Block architecture Blocks /editor / wiring.xml settings Http Service Cocoon Servlet Webapp
    26. Block protocol
      • block:/foo.xml
      • – root sitemap in current block
      • block:./bar.xml
      • – current sitemap in current block
      • block:editor:/foo.xml
      • – root sitemap in editor block
      • block:super:/foo.xml
      • – root sitemap in extended block
    27. 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
    28. Sitemap polymorphism blog myblog Extends “ skin.xsl” “ skin.xsl”  read “skin.xsl” Empty
    29. Sitemap polymorphism blog myblog Extends “ skin.xsl” “ skin.xsl”  read “skin.xsl” Override “ skin.xsl”  read “myskin.xsl”
    30. Sitemap polymorphism blog myblog Extends “ start.xml” “ skin.xsl”  read “skin.xsl” “ *.xml”  generate “{1}” transform “block:/skin.xsl” serialize “ skin.xsl”  read “myskin.xsl”
    31. Scenario
      • Download blog block
      • Deploy with parameters (or use default)
        • Test
      • Create empty extension (Maven archetype)
        • Test
      • Override some default or example rule
        • Test
    32. Summary
      • Blocks gives us:
      • Binary application packages
        • Classes & resources
        • Components
        • Sitemap functionality
      • Parameterizable applications
      • Reusability by extension
      • Dependency handling between applications
    33. Current state
      • Cocoon runs under OSGi
      • Sitemap blocks works
      • Component bridge implemented
      • Above parts are not yet integrated
      • Maven 2 build on its way
    34. Next steps
      • 2.2
        • Binary distribution of all blocks in M2 repository
        • Blocks architecture in experimental version, without OSGi
      • 3.0
        • OSGi based
        • class loader isolation
        • partial hot plugablillity

    + Daniel FagerstromDaniel Fagerstrom, 2 years ago

    custom

    496 views, 0 favs, 0 embeds more stats

    Talk given at ApacheCon US 2005.

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 496
      • 496 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 2
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories