You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Simon Hutchinson <si...@misgl.com> on 2004/05/06 15:07:37 UTC
Issue with portal-html-eventlink and navigation
Hi,
As part of a portal we are working on I have written a coplet, whose
initial uri invokes a flow script using the following matcher
<map:match pattern="coplet">
<map:call function="handleForm">
<map:parameter name="function" value="assistance"/>
<map:parameter name="form-definition"
value="resources/form/assistance.xml"/>
<map:parameter name="form-definition-2"
value="resources/form/choosepriority.xml"/>
</map:call>
<map:serialize type="xml"/>
</map:match>
The first stage of my flowscript displays a cform until it is valid
(including some custom validation) before displaying a second form, "page2"
while (true) {
form.showForm("assistance-display-pipeline");
if (validatePage1(form)) {
break;
}
}
form2 = new Form(page2);
using the portal-html-eventlink transformer the form action for my
initial cform "assistance-display-pipeline" is transformed from the
#{$continuation/id to the correct event link info.
This all works perfectly and the flowscript is re-entered at the correct
point upon submission, however if I navigate away from the page and then
go back the events are no longer valid and submission of my form does
nothing.
Such navigation must be allowed for our implementation.
My approach has been to not use the portal-html-eventlink transformer,
instead having the form submit for my initial form include the
continuation id as follows
action="http://localhost:8888/assistance-1c79274d633b7230648d232d4a2c771b16305c6c"
This is then matched in my root sitemap as follows.
<map:match pattern="assistance-*">
<!-- tell assistance to resume from the continuation -->
<map:act type="portal-object-model">
<map:parameter name="copletId" value="Assistance-1"/>
<map:parameter name="portalName" value="portal"/>
</map:act>
<map:act type="portal-set-data">
<map:parameter name="attributes/touch" value="0"/>
<map:parameter name="temporaryAttributes/application-uri"
value="cocoon:{global:root}/coplets/assistance/{1}.continue?{request:queryString}"/>
</map:act>
<map:redirect-to uri="cocoon://portal"/>
</map:match>
This tells my coplet to get its data by setting its uri to eventually
re-enter my flowscript with the correct continuation id.
Please note that I am having to include the queryString from my initial
form submit as otherwise the request data never makes it back into the flow.
At this point (although not very elegantly) my issue with navigating
away and invalidating portal events is resolved.
Sorry if all this seems like too much background but I am coming to my
point.
The problem is that everything works well providing that my form submits
using a http GET method, as the data from the query string can be
obtained and appended to the coplet uri ie
cocoon:{global:root}/coplets/assistance/{1}.continue?{request:queryString}
However due to the amount of data that might need to be sent to the
server I need to use the POST method.
This is where my hack fails as I cant seem to find away to make all this
request data available when my new coplet uri is loaded.
The result has been that although the flowcript is re-entered at the
correct point, none of the initial request data (ie the values of my
cform widgets) is available and therefore
form.showForm("assistance-display-pipeline")
simply displays the empty form with validation errors.
Therefore my problem can be summarised as follows;
I need a way to allow a user to navigate away from page X but
in such a way that when page X is returned to, a form can be submitted
via a POST method such that a flow continuation can be rentered with all
the POST data available.
does anybody have any suggestions ?
Thanks
SI
--
Merlin Information Systems Limited,
Merlin House, Gawcott Road, Buckingham, United Kingdom. MK18 1TN
Tel: +44 (0) 1280 824331 Fax: +44 (0) 1280 824112
http://www.misgl.com
Provider of IT Services and Online Portal Support Services.
Confidentiality:
The information contained in this email (including any attachments) is confidential and is intended solely for the use of the named addressee. Access, copying or re-use of the information in it by any other person is not authorised. If you are not the intended recipient, please notify us immediately by telephone or by e-mail to admin@misgl.com
*** This mail has been scanned for viruses ***
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org