You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Jean-Christophe Kermagoret <jc...@openbluelab.org> on 2007/06/15 19:07:23 UTC
How to import cocoon-forms-sample in a new created block architecture
Hello,
I followed http://cocoon.zones.apache.org/daisy/cdocs/g2/g2/g1/1291.html
about creating blocks and connecting them.Everything works correctly and
that's great.
I'm now trying to integrate cocoon-forms-sample, so I updated
rcl.properties with :
com.mycompany.myBlock2.block%classes-dir=../../blocks/cocoon-forms/cocoon-forms-impl/target/classes
com.mycompany.myBlock2.block%classes-dir=../../blocks/cocoon-forms/cocoon-forms-sample/target/classes
and integrated cocoon-forms-sample in pom.xml dependencies.
I then execute :
mvn clean cocoon:rcl
and launch jetty through eclipse.
I then have the following error :
[ERROR] ContextLoader - Context initialization failed
<org.springframework.beans.factory.BeanDefinitionStoreException: Unable
to read Avalon configuration from
'resource://org/apache/cocoon/cocoon.xconf'.; nested exception is
org.apache.avalon.framework.configuration.ConfigurationException: Unable
to create class for component with role
org.apache.cocoon.forms.validation.WidgetValidatorBuilder/assert with
class:
org.apache.cocoon.forms.validation.impl.AssertValidatorBuilder>org.springframework.beans.factory.BeanDefinitionStoreException:
Unable to read Avalon configuration from
'resource://org/apache/cocoon/cocoon.xconf'.; nested exception is
org.apache.avalon.framework.configuration.ConfigurationException: Unable
to create class for component with role
org.apache.cocoon.forms.validation.WidgetValidatorBuilder/assert with
class: org.apache.cocoon.forms.validation.impl.AssertValidatorBuilder
Caused by:
org.apache.avalon.framework.configuration.ConfigurationException: Unable
to create class for component with role
org.apache.cocoon.forms.validation.WidgetValidatorBuilder/assert with
class: org.apache.cocoon.forms.validation.impl.AssertValidatorBuilder
Any ideas ?
My goal is to integrate cocoon modules according my needs. Is it the way
to do it with C22 ?
JC
--
Jean-Christophe Kermagoret
Technological leader
OpenBlueLab : http://www.openbluelab.org
Re: How to import cocoon-forms-sample in a new created block architecture
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Jean-Christophe Kermagoret pisze:
> But block portal works well. The only problem comes from the fact you
> can't access it directly. I don't see for which reason this may be
> related to the way forms are managed. Any ideas or pointers ?
It's not related to the way forms itself are managed but how forms' block is managed. You can't access portal samples by using
/blocks/cocoon-portal-sample because all block/* URLs are handled by DispatcherServlet from servlet-service-fw, see [1]:
<servlet-mapping>
<servlet-name>DispatcherServlet</servlet-name>
<url-pattern>/blocks/*</url-pattern>
</servlet-mapping>
It means that only blocks that are configured (converted) to use servlet-serfice-fw functionality will be available at block/* address.
Of course you can still use map:mount construct to mount a cocoon-portal-sample at any location you like as you already tried. It's our goal
to have all blocks converted and retain <map:mount/> for back-compatibility. I'm going to prepare some docs for servlet-service-fw and will
discuss <map:mount/> there.
> I read the thread above and I will update portal block if necessary.
I would appreciate your help with conversion process.
>>> The other problem is related to dojo-resources param that seems to be
>>> absent from the forms-field-styling.xsl. Maybe it is provided through
>>> a use-request-parameters alike ? Anyway, by just adding the
>>> <xsl:param name="dojo-resource" select="'resource/external/dojo/'"/>,
>>> it works again.
>>
>> Where do you have to put it?
> At the top of forms-field-styling.xsl. I will provide a patch.
Create an issue on JIRA, thanks.
--
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/
Re: How to import cocoon-forms-sample in a new created block architecture
Posted by Jean-Christophe Kermagoret <jc...@openbluelab.org>.
Grzegorz Kossakowski a écrit :
> Hi Jean-Christophe,
>
> Jean-Christophe Kermagoret pisze:
>> I finally succeeded in adding forms and portal blocks in my webapp,
>> but the behavior is not homogeneous.
>
> Good to hear that, what was the problem with RCL?
No more problem with RCL :-) After svn, cleaning and recompiling,
everything seems to be ok. The error about AsserBuilderError disappeared.
I tried to add context definition in servlet-service but it generated
error. I didn't see the contexts were automatically available and could
be called directly.
>
>> For example, when adding cocoon-forms-sample, I can access it to
>> :8888/cocoon-forms-sample. But, when adding cocoon-portal-sample, I
>> can't access it the same way (:8888/cocoon-portal-sample). I neet to
>> use a pipeline like the one in
>> cocoon-webapp/.../samples/sitemap.xmap, I mean :
>>
>> <map:match pattern="cocoon-portal-sample/**">
>> <map:mount uri-prefix="cocoon-portal-sample"
>> src="blockcontext:/cocoon-portal-sample/"/>
>> </map:match>
>
> The differance between cocoon-forms-sample and cocoon-portal-sample is
> that the former has been converted to use servlet-service-fw and
> latter not. The convertion has been performed mainly by Felix so I'm
> not sure why portal has been left untouched.
> Felix, can you comment on this?
>
> Jean I think that conversion (and making portal samples up-to-date
> with recent changes to forms) should not be that hard to do. You can
> see how it was done in other blocks in commits archives. Do you think
> you would be able to do it and provide us a patch? If you want few
> more details about conversion process, see:
> http://thread.gmane.org/gmane.text.xml.cocoon.devel/73204
But block portal works well. The only problem comes from the fact you
can't access it directly. I don't see for which reason this may be
related to the way forms are managed. Any ideas or pointers ?
I read the thread above and I will update portal block if necessary.
>
>> The other problem is related to dojo-resources param that seems to be
>> absent from the forms-field-styling.xsl. Maybe it is provided through
>> a use-request-parameters alike ? Anyway, by just adding the
>> <xsl:param name="dojo-resource" select="'resource/external/dojo/'"/>,
>> it works again.
>
> Where do you have to put it?
At the top of forms-field-styling.xsl. I will provide a patch.
>
>> Finally, does anybody know why this different behavior occurs ?
>
> Hope that helps a little bit.
>
Yes, it helps.
JC
--
Jean-Christophe Kermagoret
Technological leader
OpenBlueLab : http://www.openbluelab.org
Re: How to import cocoon-forms-sample in a new created block architecture
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Hi Jean-Christophe,
Jean-Christophe Kermagoret pisze:
> I finally succeeded in adding forms and portal blocks in my webapp, but
> the behavior is not homogeneous.
Good to hear that, what was the problem with RCL?
> For example, when adding cocoon-forms-sample, I can access it to
> :8888/cocoon-forms-sample. But, when adding cocoon-portal-sample, I
> can't access it the same way (:8888/cocoon-portal-sample). I neet to use
> a pipeline like the one in cocoon-webapp/.../samples/sitemap.xmap, I mean :
>
> <map:match pattern="cocoon-portal-sample/**">
> <map:mount uri-prefix="cocoon-portal-sample"
> src="blockcontext:/cocoon-portal-sample/"/>
> </map:match>
The differance between cocoon-forms-sample and cocoon-portal-sample is that the former has been converted to use
servlet-service-fw and latter not. The convertion has been performed mainly by Felix so I'm not sure why portal has been
left untouched.
Felix, can you comment on this?
Jean I think that conversion (and making portal samples up-to-date with recent changes to forms) should not be that hard
to do. You can see how it was done in other blocks in commits archives. Do you think you would be able to do it and
provide us a patch? If you want few more details about conversion process, see:
http://thread.gmane.org/gmane.text.xml.cocoon.devel/73204
> The other problem is related to dojo-resources param that seems to be
> absent from the forms-field-styling.xsl. Maybe it is provided through a
> use-request-parameters alike ? Anyway, by just adding the <xsl:param
> name="dojo-resource" select="'resource/external/dojo/'"/>, it works again.
Where do you have to put it?
> Finally, does anybody know why this different behavior occurs ?
Hope that helps a little bit.
--
Grzegorz Kossakowski
Re: How to import cocoon-forms-sample in a new created block architecture
Posted by Jean-Christophe Kermagoret <jc...@openbluelab.org>.
I finally succeeded in adding forms and portal blocks in my webapp, but
the behavior is not homogeneous.
For example, when adding cocoon-forms-sample, I can access it to
:8888/cocoon-forms-sample. But, when adding cocoon-portal-sample, I
can't access it the same way (:8888/cocoon-portal-sample). I neet to use
a pipeline like the one in cocoon-webapp/.../samples/sitemap.xmap, I mean :
<map:match pattern="cocoon-portal-sample/**">
<map:mount uri-prefix="cocoon-portal-sample"
src="blockcontext:/cocoon-portal-sample/"/>
</map:match>
The other problem is related to dojo-resources param that seems to be
absent from the forms-field-styling.xsl. Maybe it is provided through a
use-request-parameters alike ? Anyway, by just adding the <xsl:param
name="dojo-resource" select="'resource/external/dojo/'"/>, it works again.
Finally, does anybody know why this different behavior occurs ?
JC
Reinhard Poetz a écrit :
> Jean-Christophe Kermagoret wrote:
>> Hi,
>> I want to use RCL because I need to make modifications in CForms
>> block. And RCL seems the good way to do it.
>>
>> Maybe I'm wrong ?
>
> No, I don't think so. Unfortunatly I haven't had time to try it myself
> yet but I will give it a shot myself this week.
>
> Here two hints, what _could_ be wrong with your configuration:
>
> - the block name must be the name of the forms-samples block
> - add the forms-samples block to the dependencies section of your custom
> block before you run "mvn cocoon:rcl"
>
--
Jean-Christophe Kermagoret
Technological leader
OpenBlueLab : http://www.openbluelab.org
Re: How to import cocoon-forms-sample in a new created block architecture
Posted by Reinhard Poetz <re...@apache.org>.
Jean-Christophe Kermagoret wrote:
> Hi,
> I want to use RCL because I need to make modifications in CForms block.
> And RCL seems the good way to do it.
>
> Maybe I'm wrong ?
No, I don't think so. Unfortunatly I haven't had time to try it myself yet but I
will give it a shot myself this week.
Here two hints, what _could_ be wrong with your configuration:
- the block name must be the name of the forms-samples block
- add the forms-samples block to the dependencies section of your custom
block before you run "mvn cocoon:rcl"
--
Reinhard Pötz Independent Consultant, Trainer & (IT)-Coach
{Software Engineering, Open Source, Web Applications, Apache Cocoon}
web(log): http://www.poetz.cc
--------------------------------------------------------------------
Re: How to import cocoon-forms-sample in a new created block architecture
Posted by Jean-Christophe Kermagoret <jc...@openbluelab.org>.
Hi,
I want to use RCL because I need to make modifications in CForms block.
And RCL seems the good way to do it.
Maybe I'm wrong ?
JC
Grzegorz Kossakowski a écrit :
> Jean-Christophe Kermagoret pisze:
>> Hello,
>> I followed
>> http://cocoon.zones.apache.org/daisy/cdocs/g2/g2/g1/1291.html about
>> creating blocks and connecting them.Everything works correctly and
>> that's great.
>>
>> I'm now trying to integrate cocoon-forms-sample, so I updated
>> rcl.properties with :
>>
>> com.mycompany.myBlock2.block%classes-dir=../../blocks/cocoon-forms/cocoon-forms-impl/target/classes
>>
>> com.mycompany.myBlock2.block%classes-dir=../../blocks/cocoon-forms/cocoon-forms-sample/target/classes
>>
>>
>> and integrated cocoon-forms-sample in pom.xml dependencies.
>>
>> I then execute :
>> mvn clean cocoon:rcl
>>
>> and launch jetty through eclipse.
>>
>> I then have the following error :
>> <snip/> Any ideas ?
>>
>> My goal is to integrate cocoon modules according my needs. Is it the
>> way to do it with C22 ?
>
> I have not tried to run it myself but before I do that I would like to
> know why do you want to run cocoon-forms-sample with RCL?
>
--
Jean-Christophe Kermagoret
Technological leader
OpenBlueLab : http://www.openbluelab.org
Re: How to import cocoon-forms-sample in a new created block architecture
Posted by Grzegorz Kossakowski <gk...@apache.org>.
Jean-Christophe Kermagoret pisze:
> Hello,
> I followed http://cocoon.zones.apache.org/daisy/cdocs/g2/g2/g1/1291.html
> about creating blocks and connecting them.Everything works correctly and
> that's great.
>
> I'm now trying to integrate cocoon-forms-sample, so I updated
> rcl.properties with :
>
> com.mycompany.myBlock2.block%classes-dir=../../blocks/cocoon-forms/cocoon-forms-impl/target/classes
>
> com.mycompany.myBlock2.block%classes-dir=../../blocks/cocoon-forms/cocoon-forms-sample/target/classes
>
>
> and integrated cocoon-forms-sample in pom.xml dependencies.
>
> I then execute :
> mvn clean cocoon:rcl
>
> and launch jetty through eclipse.
>
> I then have the following error :
> <snip/>
> Any ideas ?
>
> My goal is to integrate cocoon modules according my needs. Is it the way
> to do it with C22 ?
I have not tried to run it myself but before I do that I would like to know why do you want to run cocoon-forms-sample with RCL?
--
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/