advertisement

Cocoon Blocks ApacheCon US 2005

50 %
50 %
advertisement
Information about Cocoon Blocks ApacheCon US 2005

Published on May 18, 2008

Author: danielfagerstrom

Source: slideshare.net

Description

Talk given at ApacheCon US 2005.
advertisement

Cocoon Blocks Daniel Fagerström [email_address]

Motivation Cocoon is great but … Monolithic Huge download Complicated configuration Steep threshold Few third party applications and components ” Classloading hell”

Cocoon is great but …

Monolithic

Huge download

Complicated configuration

Steep threshold

Few third party applications and components

” Classloading hell”

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

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

Overview The big picture Architecture Examples Current state and next steps

The big picture

Architecture

Examples

Current state and next steps

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

A packaged application (or part) containing:

Libraries and resources

Components

Sitemap functionality

Configurable at deploy time

Might depend on other blocks

Isolated internals

What is a Block? Classes,resources Components Sitemap Export packages Import packages Registered services Used services

Deployment architecture Cocoon platform Blocks Blocks repository (Maven 2) Blocks discovery Deployment service

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

Built upon OSGi (same as Eclipse 3+)

A block is an OSGi bundle

Class loader isolation

Packaging format

Services

Security

Hot deployment possible

OSGi

OSGi Standardized, component oriented, computing environment for networked services Since 1998 100+ members R4 10+ implementations Smart phones, home automation, BMW 5, Eclipse

Standardized, component oriented, computing environment for networked services

Since 1998

100+ members

R4

10+ implementations

Smart phones, home automation, BMW 5, Eclipse

OSGi Overview Secure execution environment Bundles (applications) Life cycle management Service architecture Standard services

Secure execution environment

Bundles (applications)

Life cycle management

Service architecture

Standard services

Bundles Applications JAR containing Compiled code Resources JARs that the code depend on Meta information – manifest.mf

Applications

JAR containing

Compiled code

Resources

JARs that the code depend on

Meta information – manifest.mf

Class sharing Import-Package DynamicImport-Package Export-Package Bundle-Classpath

Import-Package

DynamicImport-Package

Export-Package

Bundle-Classpath

Activator OSGi Framework Activator BundleCtx Activator BundleCtx

Life cycle

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

Blocks

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/ ...

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/

...

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>

<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>

Wiring blog editor: myeditor myblog super: cmsURL: http://mycms.com/... Uses Extends mountPath: /blog/danielf/

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>

<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>

Components in blocks Components only available from the own block and connected blocks

Components only available from the own block and connected blocks

Component bridge Cocoon component manager Cocoon component manager OSGi service

Sitemaps in blocks As usual Adds Call sitemaps in connected blocks Use block deploy time attributes Extend blocks (with polymorphism)

As usual

Adds

Call sitemaps in connected blocks

Use block deploy time attributes

Extend blocks (with polymorphism)

Block architecture Blocks /editor / wiring.xml settings Http Service Cocoon Servlet Webapp

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

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

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

{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

Sitemap polymorphism blog myblog Extends “ skin.xsl” “ skin.xsl”  read “skin.xsl” Empty

Sitemap polymorphism blog myblog Extends “ skin.xsl” “ skin.xsl”  read “skin.xsl” Override “ skin.xsl”  read “myskin.xsl”

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”

Scenario Download blog block Deploy with parameters (or use default) Test Create empty extension (Maven archetype) Test Override some default or example rule Test …

Download blog block

Deploy with parameters (or use default)

Test

Create empty extension (Maven archetype)

Test

Override some default or example rule

Test



Summary Blocks gives us: Binary application packages Classes & resources Components Sitemap functionality Parameterizable applications Reusability by extension Dependency handling between applications

Blocks gives us:

Binary application packages

Classes & resources

Components

Sitemap functionality

Parameterizable applications

Reusability by extension

Dependency handling between applications

Current state Cocoon runs under OSGi Sitemap blocks works Component bridge implemented Above parts are not yet integrated Maven 2 build on its way

Cocoon runs under OSGi

Sitemap blocks works

Component bridge implemented

Above parts are not yet integrated

Maven 2 build on its way

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

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

Add a comment

Related pages

ApacheCon US 2005: Sessions - Apache Software Foundation

ApacheCon US 2005 Sessions. ... T16 Taming Apache Cocoon: ... Monday, 12 December 2005; 08:45: PL01 Opening Plenary: 09:00:
Read more

ApacheCon US 2005: Speakers - ApacheCon - the official ...

... Cocoon Blocks. ... Carsten is a member of the Cocoon and the Portals PMC and is playing a major role in the ... ApacheCon US 2005 San ...
Read more

ApacheCon - Apache DB Project - Welcome!

ApacheCon US 2007 was held in Atlanta, ... ApacheCon US 2005 was held in San Diego, ... Torsten's entry integrates Derby with Cocoon.
Read more

Apache Forrest: Events

Upcoming events. ApacheCon US 2009 ... Apache Cocoon Get-Together 2007 ... ApacheCon US 2005 (10-14 December)
Read more

News and Status - XML at The Apache Foundation

ApacheCon US 2005 ... Committers should feel free to update these pages with relevant news about their projects. ... Check us out. Cocoon 2.0.3 released ...
Read more

ASF Event Pictures - Apache Software Foundation

Event Pictures. Home ... ApacheCon US 2005. 1: Tags: apachecon2005 pages 1 2 ... Tags: cocoon,amsterdam pages 1 2 (78) ApacheCon US 2006. 1: ...
Read more