cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robby Pelssers" <robby.pelss...@ciber.com>
Subject how-to create a form widget instance from within java
Date Wed, 16 Sep 2009 15:51:27 GMT
Hi all,

 

Like I've mentioned before on this list, I'd like to do as much as
possible from within java instead of flowscript... 

 

So I started looking at how form.js takes care of creating a
formdefinition/form.  

 

I configured my packageSearcher as follows:

 

 

  <bean id="packageSearcher"
class="com.nxp.spider2.parametricsearch.cforms.ObjectSearcherImpl">

    <constructor-arg ref="packageSelector"/>

    <constructor-arg ref="org.apache.cocoon.forms.FormManager"/>    

  </bean>

 

 

The constructor of this class looks like the snippet below:

 

0     public ObjectSearcherImpl(SearchableObjectSelector
searchableObjectSelector, FormManager formManager) {

1           this.searchableObjectSelector = searchableObjectSelector;

2

3           try {

4                 this.form =
formManager.createForm("cocoon://formdefinition");

5           } catch (Exception e) {

6                 e.printStackTrace();

7           }

8           

9           //this.form = form;

10          this.selectedProperties = new ArrayList<String>();

11          initialize();

12    }

 

 

I run each time in an exception on line 4:

org.apache.cocoon.forms.FormsException: Could not resolve form
definition URI. at [FormManager] - cocoon://formdefinition

 

While in flowscript I use the same sourceURI and it does work properly:

 
cocoon.load("servlet:forms:/resource/internal/flow/javascript/Form.js");

  this.form = new Form("cocoon://formdefinition");

 

Can anybody point me out to why this does not work? And perhaps give me
any clues on how to create a Form instance in java?

 

Ps... I also tried with a hardcoded URI
http://localhost:8888/parametricsearch/formdefinition but that did not
work as well.

 

Thx in advance,

Robby Pelssers


Mime
View raw message