You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Nick Airey <ni...@ihavemoved.com> on 2002/06/06 14:26:48 UTC

cinclude problem in "shared" pipelines

Hello everyone, 

I have a problem with the way I am using the cinclude transformer, as
follows. 

I have 2 pages, A and B, each on a pipeline. Each page is a simple xml
file, then the cinclude transformer, then an xslt and a serializer to
html.

Here is the input xml for page A:

<?xml version="1.0"?>
<page xmlns:cinclude="http://apache.org/cocoon/include/1.0" type="A">
  <cinclude:include src="cocoon:/roles"/>
  <cinclude:include src="cocoon:/user"/>
  <cinclude:include src="cocoon:/cart"/>
</page>

Page B is very similar. You can see that 3 pipelines are called and
included together. 



The "cart" pipeline (representing a shopping cart) itself consists of a
file similar to the above

<?xml version="1.0"?>
<page xmlns:cinclude="http://apache.org/cocoon/include/1.0">
  <cinclude:include src="cocoon:/categories"/>
  <cinclude:include src="cocoon:/multiservices"/>
  <cinclude:include src="cocoon:/rawcart"/>
</page>

The included "rawcart" pipeline is a custom generator which holds the
user's shopping cart selections. The "cart" pipeline gets these three
pieces, includes them and then does an xsl transformation, before
serialising to xml.


Here is the problem:

Suppose page A is being displayed (its a select-your-order page). The
user POSTs some cart updates and is redirected to page B (eg a
confirm-your-order page). Page B is rendered correctly, because when the
"rawcart" generator is accessed, it indicates that it is out of date,
and so its generate() method runs. Everything is fine for page B. Page A
is not rendered, as the user has changed pages.

Now lets assume that the user wants to go back to page A (ie. to change
the order). Now the "rawcart" pipeline correctly indicates that its data
has not changed since the last generate(). Nothing else has changed, so
the "cart" pipeline says it also doesn't need regeneration. So
eventually, the previously cached pipeline for page A is displayed -
which is out of date - showing the page as it was before the user
selected "page B".

One way around this is always to regenerate "rawcart", but this seems
like an unsatisfactory solution, as the extra xslt (part of the "cart"
pipeline) has to run when it's not really required. 


Obviously the core of the problem is that two pipelines are sharing a
third one. 

Any suggestions to get around this?


Kind regards,
Nick




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