cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KOZLOV Roman <>
Subject Session attribute change within aggregation
Date Tue, 02 Apr 2002 16:11:22 GMT

Is it possible in Cocoon 2.01 to set session attribute within
aggregation so that the change would be in a first part (xsp) and next
part could use the new value of the changed attribute. It seems that the
new value is not available for the rest parts of aggregation within the
same request.
If it is true, then how is it possible to make a branch comparing a
request parameter's value with some session attribute's value?
In particular, I'd like to store some parameter as a session attribute
and if it is not changed then read query results stored as DOM in a
session before, otherwise update query results. My xsp part of
aggregation is the following:

<?xml version="1.0" encoding="ISO-8859-1"?>
     String idList = (String)<xsp-request:get-parameter name="idList"
     String idListOld = (String)<session:get-attribute name="idList"
     String isChanged = (idList.equals(idListOld))?"no":"yes";





The second part of aggregation calls the following via cocoon://

<map:match pattern="read_filtered_results">
  <map:match type="sessionstate" pattern="yes">
      <map:parameter name="attribute-name" value="isChanged"/>
      <!-- Update filtered result -->
      <map:generate src="cocoon://read_query_results"/>
      <map:serialize type="xml"/>
  <!-- if idList is not changed try to read stored filtered result -->
  <map:match type="sessionstate" pattern="**">
      <map:parameter name="attribute-name" value="filtered_results"/>
      <!-- Read filtered result if it was already stored -->
      <map:generate src="data/null.xml"/>
      <map:transform type="readDOMsession">
          <map:parameter name="dom-name" value="filtered_results"/>
          <map:parameter name="trigger-element" value="null"/>
          <map:parameter name="position" value="in"/>
      <map:serialize type="xml"/>
  <!-- Create filtered result if it was not stored before -->
  <map:generate src="cocoon://read_query_results"/>
  <map:serialize type="xml"/>

So the problem is that after changing idList parameter I have to call
the aggregating pipeline twice (i.e. to make two requests from browser
with the same idList parameter) to get an updated query result.

Thank you very much for any advice.

Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message