cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gou...@osmosis.gr
Subject Re: ESQL update and select statements in the same map:match problem
Date Wed, 25 Feb 2004 19:46:43 GMT

this is what i try to do:

<map:match pattern="xml/get.Design">
<map:select type="request-parameter">
    <map:parameter name="parameter-name" value="update_point"/>
    <map:when test="true">
        <map:aggregate element="data" type="noncaching">
                <map:part src="cocoon:/xml/exec.update_point" strip-root="yes"/>   
                                 
                <map:part src="cocoon:/xml/exec.design" strip-root="yes" type="noncaching"/>
        </map:aggregate>                            
    </map:when>
    <map:otherwise>
        <map:generate src="cocoon:/xml/exec.design"/>
    </map:otherwise>
</map:select>
<map:transform src="stylesheets/elements2rolenames.xsl"/>
<map:serialize type="xml"/>
</map:match>


i use the same pipeline to retrieve and update my data

this match just check if updated data are posted, and if yes call an 
update xsp and then ask for content from db

othewise just ask for content from db

the problem is that when updated data are posted exec.update_point (that 
call an xsp, put the data in db) but exec.design dont get the updated data

what i'm trying to do is to have one form to view and update 

any hint?

--stavros


On Wed, 25 Feb 2004, Christopher Painter-Wakefield wrote:

> 
> 
> 
> 
> I don't know anything about the internal workings of the map:aggregate, but
> I would guess it is not waiting for the first part to complete before
> opening a connection for the second part.  This would make sense, for
> performance reasons, and there is no particular reason for cocoon to expect
> the parts to be dependent on each other.  So I don't think it is
> necessarily a bug, nor a caching mechanism, just that map:aggregate doesn't
> imply sequential processing.
> 
> Just curious, should the map:aggregate have an "element" attribute
> specifying the root element for the combined output?  Also, what does
> "strip-root='yes'" do?  I couldn't find it in the documentation
> (http://cocoon.apache.org/2.1/userdocs/concepts/sitemap.html#Aggregating).
> 
> You could probably make things sequential (and still achieve aggregation)
> by using either a cinclude transformer, or even more simply by using an
> XSLT transform step with the document() function, e.g.,
> ...
> <xsl:template match="output-of-update-point">
>       <new-root>
>             <xsl:copy-of select="."/>
>             <xsl:copy-of select="document('cocoon:/xml/exec.get_point')"/>
>       </new-root>
> </xsl:template>
> ...
> 
> with a sitemap like
> <map:generate src="cocoon:/xml/exec.update_point"/>
> <map:transform src="aggregate-get-point.xsl"/>
> 
> or some such.
> 
> -Christopher
> 
> 
> 
> |---------+---------------------------->
> |         |           gounis@osmosis.gr|
> |         |                            |
> |         |           02/25/2004 01:56 |
> |         |           PM               |
> |         |           Please respond to|
> |         |           users            |
> |         |                            |
> |---------+---------------------------->
>   >--------------------------------------------------------------------------------------------------------------|
>   |                                                                                 
                            |
>   |       To:       users@cocoon.apache.org                                         
                            |
>   |       cc:                                                                       
                            |
>   |       Subject:  ESQL update and select statements in the same map:match problem 
                            |
>   >--------------------------------------------------------------------------------------------------------------|
> 
> 
> 
> 
> 
> hi people
> 
> i have the folow code :
> 
> <map:aggregate>
>              <map:part src="cocoon:/xml/exec.update_point"
> strip-root="yes"/>
>              <map:part src="cocoon:/xml/exec.get_point" strip-root="yes"/>
> </map:aggregate>
> 
> where i call 2 .xsp
> 
> 1. update_point.xsp
> where i update a record in my database
> 
> 2. get_point.xsp
> where i get the updated record
> 
> the problem is that this aggregation update the database record (i have
> check the content) but generate output (get_point) with the before update
> values
> 
> is this a caching mechanism case, is it possible to bypass this problem or
> it's just a bug?
> 
> 
> --stavros
> 
> 
> 
> ---------------------------------------------------------------------
> 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


Mime
View raw message