cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <gkossakow...@apache.org>
Subject Re: AW: own widget
Date Thu, 08 Nov 2007 15:13:15 GMT
Michel Erard pisze:
> Hi Grzegorz, 
>  
> yes, I think for this example your right, perhabs it's enough when I add a new xslt.
But when this is not enough, how I add a widget?

Let's assume you want to create widget named MyOwnWidget, then you will need to:
1. Implement MyOwnWidget class extending o.a.c.forms.formmodel.AbstractWidgetAbstractWidget
2. Implement complementary classes to the first one responsible for handling definition of
widget:
MyOwnWidgetDefinition (extending AbstractWidgetDefinition or similar) and
MyOwnWidgetDefinitionBuilder (extending AbstractWidgetDefinitionBuilder).
3. Register your own widget (see [1]).
4. Write your own JX macros for your widget similar to standard macros (see [2]).
5. Write your own XSLT file for styling your own widget.
6. Integrate everything together. (consists of adding few imports so your macros and xsls
are visible).

May seem like a lot of work but in a fact most of this steps are really simple. For example,
for the
most of widgets classes implementing them are really straightforward as they inherit everything
from
abstract classes.

Before you start to implement anything new I think it would be a good idea to evaluate all
existing
widgets and their varations (different styling) so you are not going to waste your time if
simpler
solution exists.

I hope that helps a little.

[1]
http://svn.apache.org/repos/asf/cocoon/branches/cocoon-forms-1.0.0/cocoon-forms-impl/src/main/resources/META-INF/cocoon/avalon/cocoon-forms.xconf
[2]
http://svn.apache.org/repos/asf/cocoon/branches/cocoon-forms-1.0.0/cocoon-forms-impl/src/main/resources/org/apache/cocoon/forms/generation/jx-macros.xml

-- 
Grzegorz Kossakowski
Committer and PMC Member of Apache Cocoon
http://reflectingonthevicissitudes.wordpress.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message