You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andre Juffer <aj...@sun3.oulu.fi> on 2008/02/17 13:22:47 UTC

[C2.2]: Forms block

More questions about blocks, in particular the forms block.

I am trying to get a form going that worked very fine with C2.1, 
according to the migration guide at 
http://cocoon.apache.org/2.2/blocks/forms/1.0/1351_1_1.html

The first step required a change in 
src/main/resources/META-INF/cocoon/spring/servlet-service.xml

which currently now looks exactly like:

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:servlet="http://cocoon.apache.org/schema/servlet"
   xsi:schemaLocation="http://www.springframework.org/schema/beans 
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
   http://cocoon.apache.org/schema/servlet 
http://cocoon.apache.org/schema/servlet/cocoon-servlet-1.0.xsd">

   <bean id="com.tribc.sopas.sops.service" 
class="org.apache.cocoon.sitemap.SitemapServlet">
     <servlet:context mount-path="/sops" context-path="blockcontext:/sops/">
       <servlet:connections>
         <entry key="ajax" value-ref="org.apache.cocoon.ajax.impl.servlet"/>
         <entry key="forms" 
value-ref="org.apache.cocoon.forms.impl.servlet"/>
       </servlet:connections>
     </servlet:context>
   </bean>

</beans>

So far so good. I made a change in one flow script, adding:
cocoon.load("servlet:forms:/resource/internal/flow/javascript/Form.js"); 
and some adjustment in the sitemap, again following the migration 
guidelines. I have no means to test this all because of the following.

The addition in servlet-service.xml requires the existence of other 
beans with refs "org.apache.cocoon.ajax.impl.servlet" and 
"org.apache.cocoon.forms.impl.servlet". These do not exist and 
consequently 'mvn jetty:run' utterly fails with the message:

Caused by: org.springframework.beans.factory.BeanCreationException: 
Error creating bean with name 'com.tribc.sopas.sops.service': Cannot 
resolve reference to bean 'org.apache.cocoon.ajax.impl.servlet' while 
setting bean property 'connections' with key [TypedStringValue: value 
[ajax], target type [null]]; nested exception is 
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean 
named 'org.apache.cocoon.ajax.impl.servlet' is defined

Is it expected that one must include all these beans definitions your 
self in some application-context.xml? Also, must one include the 
dependencies on the forms blocks into a pom.xml yourself.

I don't mind to add all of this of course, but this is not very clear 
from the documentation. It is cumbersome though.

Thanks,
Andre



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


Re: [C2.2]: Forms block

Posted by Andre Juffer <aj...@sun3.oulu.fi>.
Reinhard Poetz wrote:
> Andre Juffer wrote:
>> 
> yes, you have to add the forms block as a dependency yourself. Since the 
> forms block has a dependency on the ajax block you don't have to add it 
> yourself then.  (see 
> http://repo1.maven.org/maven2/org/apache/cocoon/cocoon-forms-impl/1.0.0-RC1/cocoon-forms-impl-1.0.0-RC1.pom) 
> 
> 
>> I don't mind to add all of this of course, but this is not very clear 
>> from the documentation. It is cumbersome though.
> 
> Feel free to add your comments or even better to improve the docs when 
> you think that things are unclear or incomplete.
> 

I am happy to do so whenever I get this all under control. In any case, 
the error disappeared as soon as forms block dependency was explicitly 
added to pom.xml.

Thanks,
Andre.

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


Re: [C2.2]: Forms block

Posted by Reinhard Poetz <re...@apache.org>.
Andre Juffer wrote:
> More questions about blocks, in particular the forms block.
> 
> I am trying to get a form going that worked very fine with C2.1, 
> according to the migration guide at 
> http://cocoon.apache.org/2.2/blocks/forms/1.0/1351_1_1.html
> 
> The first step required a change in 
> src/main/resources/META-INF/cocoon/spring/servlet-service.xml
> 
> which currently now looks exactly like:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <beans xmlns="http://www.springframework.org/schema/beans"
>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>   xmlns:servlet="http://cocoon.apache.org/schema/servlet"
>   xsi:schemaLocation="http://www.springframework.org/schema/beans 
> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
>   http://cocoon.apache.org/schema/servlet 
> http://cocoon.apache.org/schema/servlet/cocoon-servlet-1.0.xsd">
> 
>   <bean id="com.tribc.sopas.sops.service" 
> class="org.apache.cocoon.sitemap.SitemapServlet">
>     <servlet:context mount-path="/sops" context-path="blockcontext:/sops/">
>       <servlet:connections>
>         <entry key="ajax" value-ref="org.apache.cocoon.ajax.impl.servlet"/>
>         <entry key="forms" 
> value-ref="org.apache.cocoon.forms.impl.servlet"/>
>       </servlet:connections>
>     </servlet:context>
>   </bean>
> 
> </beans>
> 
> So far so good. I made a change in one flow script, adding:
> cocoon.load("servlet:forms:/resource/internal/flow/javascript/Form.js"); 
> and some adjustment in the sitemap, again following the migration 
> guidelines. I have no means to test this all because of the following.
> 
> The addition in servlet-service.xml requires the existence of other 
> beans with refs "org.apache.cocoon.ajax.impl.servlet" and 
> "org.apache.cocoon.forms.impl.servlet". These do not exist and 
> consequently 'mvn jetty:run' utterly fails with the message:
> 
> Caused by: org.springframework.beans.factory.BeanCreationException: 
> Error creating bean with name 'com.tribc.sopas.sops.service': Cannot 
> resolve reference to bean 'org.apache.cocoon.ajax.impl.servlet' while 
> setting bean property 'connections' with key [TypedStringValue: value 
> [ajax], target type [null]]; nested exception is 
> org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean 
> named 'org.apache.cocoon.ajax.impl.servlet' is defined
> 
> Is it expected that one must include all these beans definitions your 
> self in some application-context.xml? Also, must one include the 
> dependencies on the forms blocks into a pom.xml yourself.

yes, you have to add the forms block as a dependency yourself. Since the forms 
block has a dependency on the ajax block you don't have to add it yourself then. 
  (see 
http://repo1.maven.org/maven2/org/apache/cocoon/cocoon-forms-impl/1.0.0-RC1/cocoon-forms-impl-1.0.0-RC1.pom)

> I don't mind to add all of this of course, but this is not very clear 
> from the documentation. It is cumbersome though.

Feel free to add your comments or even better to improve the docs when you think 
that things are unclear or incomplete.

-- 
Reinhard Pötz                            Managing Director, {Indoqa} GmbH
                           http://www.indoqa.com/en/people/reinhard.poetz/

Member of the Apache Software Foundation
Apache Cocoon Committer, PMC member, PMC Chair        reinhard@apache.org
_________________________________________________________________________

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