cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Warrell.Harr...@westsussex.gov.uk
Subject Re: Question on using CForms with XSLT and aggregation
Date Wed, 26 Apr 2006 08:05:17 GMT
Hi,

I followed the tutorial at 
http://cocoon.apache.org/2.1/userdocs/flow/tutor.html

As I understand it, you should introduce a javascript function :-

function whatever()
{

.....

  cocoon.sendPage("success.jx", {"random" : random, "guess" : guess, 
"guesses" : guesses} );
}

which calls sendPage with the variables you want. It seems to me that you 
are bypassing this crucial stage by intercepting the continuation in your 
pipeline e.g :-
<map:match pattern="continuePipe/**">
  <!-- To aggregate a JX Continuation -->
    <map:call continuation="{1}"/>

  <map:serialize type="xml" />
</map:match>

This seems to be the real value of using continuations because all of your 
form flow can now be managed in a single simple javascript source file 
rather than dispersed throughout your xhtml and sitemap.

I think if you take a look at the tutorial and use the sendPage stuff you 
should be OK,

Regards


Warrell Harries | IT Services, West Sussex County Council | Location: 
Northleigh House
Office: +44 (0) 1243-756837 | Email: warrell.harries@westsussex.gov.uk




Edward Elhauge <ee@uncanny.net> 
26/04/2006 03:15
Please respond to
users@cocoon.apache.org


To
users@cocoon.apache.org
cc

Subject
Question on using CForms with XSLT and aggregation






Hi,

I'm hoping someone can set me straight on this. I must be missing a
crucial concept in getting this to work.

My question is eventually going to be:
    Any idea on how to get the continuation to pass through an XSLT?

I've had applications working for the last few years that use Cocoon
Aggregation and XSLT. Recently I updated to Cocoon 2.1.8 and moved all
of them from JSP to XSP.

I'm working on processing Forms using the CForms Jx toolkit. So far
so good. I've got the form validating and changing state, etc.

Now I want to run the Jx output through the existing XSLT pipeline to
integrate it into our application. I've figured out how to get the
initial form through the pipeline, but when I applied the same pattern
to the continuation, I get an error.

Here's a fragment of my sitemap.xmap:

============== START ==============

<!-- ==== Internal pipelines ==== -->

<map:pipeline internal-only="true">

<map:match pattern="formPipe/**">
  <!-- To aggregate a JX Form -->
  <map:call function="{1}_js"/>

  <map:serialize type="xml" />
</map:match>

<map:match pattern="continuePipe/**">
  <!-- To aggregate a JX Continuation -->
    <map:call continuation="{1}"/>

  <map:serialize type="xml" />
</map:match>

</map:pipeline>

<!-- ==== Jx Forms ==== -->

<map:pipeline>
  <map:match pattern="*.frm">
    <map:aggregate element="portalPage">
      <map:part src="Wrap/menu.xml" element="portalMenuElement" />
      <map:part src="cocoon:/formPipe/{1}" element="aggregate1Element" />
    </map:aggregate>

    <map:transform type="xslt" src="Xsl/PortalAggregate.xsl" />
    <map:transform type="xslt" src="Xsl/BioAppExpand.xsl">
      <map:parameter name="appName" value="CultureCollection"/>
    </map:transform>

    <map:serialize type="html" />
  </map:match>
</map:pipeline>

<map:pipeline>
  <map:match pattern="*.continue">
    <map:aggregate element="portalPage">
      <map:part src="Wrap/menu.xml" element="portalMenuElement" />
      <map:part src="cocoon:/continuePipe/{1}.continue" 
element="aggregate1Element" />
    </map:aggregate>

    <map:transform type="xslt" src="Xsl/PortalAggregate.xsl" />
    <map:transform type="xslt" src="Xsl/BioAppExpand.xsl">
      <map:parameter name="appName" value="CultureCollection"/>
    </map:transform>

    <map:serialize type="html" />
  </map:match>
</map:pipeline>

============== END ==============

When I hit the URL:
    http://.../DebugForm/OrderCulture.frm
I get exactly what I want and the output passed through the XSLT pipeline.

When I press the Submit button on that form, it generates a URL along this 
pattern:
    http://.../DebugForm/557e6250263d345a505a514e5b426a7944343600.continue

Which gets picked up by the *.continue aggregator, but then fails
in the internal continue-pipe pipeline with an
Invalid Continue ID error:
    org.apache.cocoon.components.flow.InvalidContinuationException: The 
continuation ID 557e6250263d345a505a514e5b426a7944343600.continue is 
invalid.

Any idea on how to get the continuation to pass through an XSLT?
-- 
        Edward Elhauge <ee@uncanny.net>
"I want to be a person like somebody else once was." -- Peter Handke 
"Kasper"

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




-- 
This e-mail and any attachments are confidential and intended solely for 
the persons addressed. If it has come to you in error please reply to 
advise us but you should not read it, copy it, show it to anyone else nor 
make any other use of its content.   West Sussex County Council takes 
steps to ensure e-mails and attachments are virus-free but you should 
carry out your own checks before opening any attachment. 
Mime
View raw message