You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark H <ma...@markhorgan.com> on 2003/10/14 14:42:27 UTC

Setting up binding in an Action in Woody

I'm trying to get Woody working with JDO in an action but I'm not sure of
the code to setup the binding, I've looked at the code in woody2.js and made
an attempt to do it in Java but I get a ClassCastException at line * below.
Anybody got code for this?

Thanks,
Mark

Binding binding=getBinding(aBindingURI);
binding.loadFormFromModel(aForm, model);

...

	private Binding getBinding(String aBindingURI) throws Exception {
		BindingManager bindingManager = null;
		Source source = null;
		SourceResolver resolver = null;
		try {
			bindingManager =(BindingManager)manager.lookup(BindingManager.ROLE);
			* resolver = (SourceResolver)manager.lookup(SourceResolver.ROLE);
			source = resolver.resolveURI(aBindingURI);
			return bindingManager.createBinding(source);
		} catch (Exceptione e){
			throw e;
		} finally {
			if (source != null)
				resolver.release(source);
			manager.release(bindingManager);
			manager.release(resolver);
		}
	}



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


Re: Setting up binding in an Action in Woody

Posted by Bruno Dumon <br...@outerthought.org>.
On Tue, 2003-10-14 at 14:42, Mark H wrote:
> I'm trying to get Woody working with JDO in an action but I'm not sure of
> the code to setup the binding, I've looked at the code in woody2.js and made
> an attempt to do it in Java but I get a ClassCastException at line * below.
> Anybody got code for this?

This may be because you're importing the wrong "SourceResolver" (there's
one in Cocoon and one in Excalibur).

For example code, check the class BindingWoodyApple.java (in the apples
block).

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Re: Setting up binding in an Action in Woody

Posted by Antonio Gallardo <ag...@agsoftware.dnsalias.com>.
Mark H dijo:
> I'm trying to get Woody working with JDO in an action but I'm not sure
> of the code to setup the binding, I've looked at the code in woody2.js
> and made an attempt to do it in Java but I get a ClassCastException at
> line * below. Anybody got code for this?

Yep. Take a look at the OJB block from the CVS. there is a example using
Woody+Flow+OJB(JDO).

Best Regards,

Antonio Gallardo.




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