cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Upayavira ...@upaya.co.uk>
Subject Re: Woody Populate Form with xsp (flow)
Date Fri, 07 Nov 2003 21:37:07 GMT
JD Daniels wrote:

>I was wondering if it was possible to load an xsp pipeline instead of a
>source xml file..
>
>ex.
>// parse the document to a DOM-tree
>var document = loadDocument("forms/test.xml");
>
>// bind the document data to the form
>form.load(document);
>form.showForm("display-pipeline");
>
>Change to:
>
>// Load DOM-tree From Xsp
>
var uri = "context://formdata.xsp?id=" + cocoon.request.get("id");

var resolver = 
cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE);
var source = resolver.resolve(uri);
var parser = 
cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMParser.ROLE);
var document = 
parser.parseDocument(Packages.org.apache.cocoon.components.source.SourceUtil.getInputSource(source));

form.load(document);

Now that's me taking a bit of a leap - never done it before, but I think 
it should work.To explain:
1) Convert your xsp uri into a source using a source resolver
2) Parse that source into a DOM object
3) Load that DOM object into your form.

Hope it works!

Regards, Upayavira

>// bind the document data to the form
>form.load(document);
>form.showForm("display-pipeline");
>
>
>JD
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>



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


Mime
View raw message