You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Brian McCallister <br...@apache.org> on 2004/01/15 04:46:42 UTC
Woody & Flow Events
This seems like it should be obvious, but I haven't found docs for it,
nor figured it out from the examples -- how can I start execution of a
flow script with a form submission using woody and flow (not a Java
action listener)
Take for example the fairly common occurrence -- a site you can
navigate around that presents a login box on every page that you can
access at any time. The submission of the form starts a flow of
execution, it is not in the middle of one.
I can see a possibility for action callbacks in the form definition,
but then I cannot figure out how to access the form (to transform it)
without using form.showForm(...) to display a pipeline for the form.
Is there a secret I haven't found for doing this?
-Brian
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Woody & Flow Events
Posted by Brian McCallister <mc...@forthillcompany.com>.
Thank you! Will dig in as soon as I get to my desk =)
-Brian
On Jan 15, 2004, at 5:15 AM, Marc Portier wrote:
>
>
> Brian McCallister wrote:
>
>> To follow, up, i have had no success using the location attribute in
>> the form:
>> <wt:form-template action=""
>> location="getAttribute($session,'clockout-form')"> (action blanked to
>> remove continuation for testing)
>> and setting the form in the session from flow as:
>> cocoon.session.setAttribute("clockout-form", new
>> Form("forms/timeTrackerClockOut.xml"));
>> Or variations thereupon. I have confirmed that the form is set, but
>> the particular error with the above code is:
>> org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
>> org.xml.sax.SAXException: Object returned by expression
>> "getAttribute($session,'clockout-form')" is not a Woody Form.
>> Help?
>
> again enlighten yourself by digging woody2.js
>
> inside showForm you will find some:
>> bizData[Packages.org.apache.cocoon.woody.transformation.WoodyPipelineC
>> onfig.WOODY_FORM] = this.form;
>
> which is in fact equivalent to:
>> bizData['woody-form'] = this.form;
>
>
> which means that not 'this' should be passed into the bizdata, but
> rather the actual Java Form class, which is wrapped inside the
> JavaScript object
>
>
> so pls try the .form variant:
>
>> var myForm = new Form("forms/timeTrackerClockOut.xml")
>> cocoon.session.setAttribute("clockout-form", myForm.form);
>
>
> HTH,
> -marc=
>
>> -Brian
>> On Jan 14, 2004, at 10:46 PM, Brian McCallister wrote:
>>> This seems like it should be obvious, but I haven't found docs for
>>> it, nor figured it out from the examples -- how can I start
>>> execution of a flow script with a form submission using woody and
>>> flow (not a Java action listener)
>>>
>>> Take for example the fairly common occurrence -- a site you can
>>> navigate around that presents a login box on every page that you can
>>> access at any time. The submission of the form starts a flow of
>>> execution, it is not in the middle of one.
>>>
>>> I can see a possibility for action callbacks in the form definition,
>>> but then I cannot figure out how to access the form (to transform
>>> it) without using form.showForm(...) to display a pipeline for the
>>> form.
>>>
>>> Is there a secret I haven't found for doing this?
>>>
>>> -Brian
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>
> --
> Marc Portier http://outerthought.org/
> Outerthought - Open Source, Java & XML Competence Support Center
> Read my weblog at http://blogs.cocoondev.org/mpo/
> mpo@outerthought.org mpo@apache.org
>
>
> ---------------------------------------------------------------------
> 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
Re: Woody & Flow Events
Posted by Marc Portier <mp...@outerthought.org>.
Brian McCallister wrote:
> To follow, up, i have had no success using the location attribute in the
> form:
>
> <wt:form-template action=""
> location="getAttribute($session,'clockout-form')"> (action blanked to
> remove continuation for testing)
>
> and setting the form in the session from flow as:
>
> cocoon.session.setAttribute("clockout-form", new
> Form("forms/timeTrackerClockOut.xml"));
>
> Or variations thereupon. I have confirmed that the form is set, but the
> particular error with the above code is:
>
> org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
> org.xml.sax.SAXException: Object returned by expression
> "getAttribute($session,'clockout-form')" is not a Woody Form.
>
> Help?
>
again enlighten yourself by digging woody2.js
inside showForm you will find some:
> bizData[Packages.org.apache.cocoon.woody.transformation.WoodyPipelineConfig.WOODY_FORM] = this.form;
which is in fact equivalent to:
> bizData['woody-form'] = this.form;
which means that not 'this' should be passed into the bizdata, but
rather the actual Java Form class, which is wrapped inside the
JavaScript object
so pls try the .form variant:
> var myForm = new Form("forms/timeTrackerClockOut.xml")
> cocoon.session.setAttribute("clockout-form", myForm.form);
HTH,
-marc=
> -Brian
>
> On Jan 14, 2004, at 10:46 PM, Brian McCallister wrote:
>
>> This seems like it should be obvious, but I haven't found docs for it,
>> nor figured it out from the examples -- how can I start execution of a
>> flow script with a form submission using woody and flow (not a Java
>> action listener)
>>
>> Take for example the fairly common occurrence -- a site you can
>> navigate around that presents a login box on every page that you can
>> access at any time. The submission of the form starts a flow of
>> execution, it is not in the middle of one.
>>
>> I can see a possibility for action callbacks in the form definition,
>> but then I cannot figure out how to access the form (to transform it)
>> without using form.showForm(...) to display a pipeline for the form.
>>
>> Is there a secret I haven't found for doing this?
>>
>> -Brian
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
--
Marc Portier http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/mpo/
mpo@outerthought.org mpo@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: Woody & Flow Events
Posted by Brian McCallister <mc...@forthillcompany.com>.
To follow, up, i have had no success using the location attribute in
the form:
<wt:form-template action=""
location="getAttribute($session,'clockout-form')"> (action blanked to
remove continuation for testing)
and setting the form in the session from flow as:
cocoon.session.setAttribute("clockout-form", new
Form("forms/timeTrackerClockOut.xml"));
Or variations thereupon. I have confirmed that the form is set, but the
particular error with the above code is:
org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
org.xml.sax.SAXException: Object returned by expression
"getAttribute($session,'clockout-form')" is not a Woody Form.
Help?
-Brian
On Jan 14, 2004, at 10:46 PM, Brian McCallister wrote:
> This seems like it should be obvious, but I haven't found docs for it,
> nor figured it out from the examples -- how can I start execution of a
> flow script with a form submission using woody and flow (not a Java
> action listener)
>
> Take for example the fairly common occurrence -- a site you can
> navigate around that presents a login box on every page that you can
> access at any time. The submission of the form starts a flow of
> execution, it is not in the middle of one.
>
> I can see a possibility for action callbacks in the form definition,
> but then I cannot figure out how to access the form (to transform it)
> without using form.showForm(...) to display a pipeline for the form.
>
> Is there a secret I haven't found for doing this?
>
> -Brian
>
>
>
> ---------------------------------------------------------------------
> 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
Re: Woody & Flow Events
Posted by Marc Portier <mp...@outerthought.org>.
Brian McCallister wrote:
> This seems like it should be obvious, but I haven't found docs for it,
> nor figured it out from the examples -- how can I start execution of a
> flow script with a form submission using woody and flow (not a Java
> action listener)
>
> Take for example the fairly common occurrence -- a site you can navigate
> around that presents a login box on every page that you can access at
> any time. The submission of the form starts a flow of execution, it is
> not in the middle of one.
>
> I can see a possibility for action callbacks in the form definition, but
> then I cannot figure out how to access the form (to transform it)
> without using form.showForm(...) to display a pipeline for the form.
>
> Is there a secret I haven't found for doing this?
>
the secret is inside the woody2.js file where the showForm() is written
down:
when not using the showForm (since your form instance doesn't exist yet
in the flowscript at the time it needs to process the request, right)
you will need to call form.process yourself
just have a look inside that code, and ask more if things are not clear.
Alternatively: since the separate 'login' doesn't seem to be part of
your flow in any way, (but rather a session-level state change) you
might consider just using Woody's HandleFormSubmitAction.
(IIRC the samples should have an example of how to do that)
regards,
-marc=
> -Brian
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
--
Marc Portier http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
Read my weblog at http://blogs.cocoondev.org/mpo/
mpo@outerthought.org mpo@apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org