cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Windler Burri, Sarah" <sarah.wind...@id.ethz.ch>
Subject Re: Fragment Extractor and Cache in V2.1.4
Date Wed, 14 Apr 2004 08:40:28 GMT
Hi Joerg
According to your advice, I have done the debugging: I 'm hoping it's
well written.
Sarah

Assumption: The parameter for the sitemap is an ip address:
172.20.112.10 (a) and 10.1.1.1 (b)

Case 1: (without xsl and extractor)
   <map:match pattern="index.html">
     <map:act type="form-validator">
        <map:parameter name="descriptor"
                       value="context://cpustat/docs/descriptor.xml"/>
        <map:parameter name="validate" value="ip"/>
        <map:generate type="serverpages" src="docs/result.xsp"/>
        <map:serialize type="xml"/>           
     </map:act> 

Data result for a:
<?xml version="1.0" encoding="ISO-8859-1"?>
<document xmlns:xsp="http://apache.org/xsp"
xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1"
xmlns:esql="http://apache.org/cocoon/SQL/v2">
    <header>
      <title>CPU Auslastung Resultat</title>
      <bar name="Home" value="/"/>
      <bar name="New Request" value="
index.html?ip=172.20.112.10&amp;begin=1&amp;end=0">      
      </bar>
   </header>
   <s1>
     <graph host=" 172.20.112.10" timestamp=" Wed, Apr 14, 2004 -
08:33:40 " units=" 144" main-units=" 12" sub-units=" 12">
   (...)

Data result for b:
 <?xml version="1.0" encoding="ISO-8859-1"?>
<document xmlns:xsp="http://apache.org/xsp"
xmlns:xspdoc="http://apache.org/cocoon/XSPDoc/v1"
xmlns:esql="http://apache.org/cocoon/SQL/v2">
    <header>
      <title>CPU Auslastung Resultat</title>
      <bar name="Home" value="/"/>
      <bar name="New Request" value="
index.html?ip=10.1.1.1&amp;begin=1&amp;end=0">       
      </bar>
   </header>
   <s1>         
     <graph host=" 10.1.1.1" timestamp=" Wed, Apr 14, 2004 - 08:34:36 "
units=" 144" main-units=" 12" sub-units=" 12">
(...)

Statement: The output of the xsp generator are according to the
parameters different.

Case 2: (with xsl and without fragment extractor)
     <map:act type="form-validator">
        <map:parameter name="descriptor"
                       value="context://cpustat/docs/descriptor.xml"/>
        <map:parameter name="validate" value="ip"/>
        <map:generate type="serverpages" src="docs/result.xsp"/>
        <map:transform src="stylesheets/cpustat-xml2svg.xsl"/>
        <map:serialize type="xml"/>           
     </map:act>

Data result for a:
(...)
<svg:svg xmlns:svg="http://www.w3.org/2000/svg"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMinyMin
meet" height="450" width="640"><svg:defs><svg:g id="title"><svg:text
transform="scale(1,-1)" style="text-anchor:end;stroke-width:0.5;"
y="-305" x="450">Generated at:  Wed, Apr 14, 2004 - 08:55:55  Device:
172.20.112.10</svg:text></svg:g>
(...)

Data result for b:
(...)
<svg:svg xmlns:svg="http://www.w3.org/2000/svg"
xmlns:esql="http://apache.org/cocoon/SQL/v2"
xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMinyMin
meet" height="450" width="640"><svg:defs><svg:g id="title"><svg:text
transform="scale(1,-1)" style="text-anchor:end;stroke-width:0.5;"
y="-305" x="450">Generated at:  Wed, Apr 14, 2004 - 08:56:21  Device:
10.1.1.1</svg:text></svg:g>
(...)

Statement: The output after the xsl stylesheet are different.

Case 3: (with xsl and with extractor)
   <map:match pattern="index.html">
     <map:act type="form-validator">
        <map:parameter name="descriptor"
                       value="context://cpustat/docs/descriptor.xml"/>
        <map:parameter name="validate" value="ip"/>
        <map:generate type="serverpages" src="docs/result.xsp"/>
        <map:transform src="stylesheets/cpustat-xml2svg.xsl"/>
        <map:transform type="extractor"/>
        <map:transform src="stylesheets/fragment-extractor.xsl"/>
        <map:serialize type="xml"/>           
     </map:act>

Data result for a:
(...)
<img xmlns:fe="http://apache.org/cocoon/fragmentextractor/2.0"
border="0" src="svg-images/4a889b3ec2b547ba.jpg"/> 
(...)

Data result for b:
(...)
<img xmlns:fe="http://apache.org/cocoon/fragmentextractor/2.0"
border="0" src="svg-images/4a889b3ec2b547ba.jpg"/>
(...)

Statement: the fragment-id of the images are the same and also the
graphic output!



On 13.04.2004 20:15, Windler Burri, Sarah wrote:

              Hi
              Last year we have built some very nice network
applications with the
              help of Cocoon V2.0.3. Thank you very much for this
wonderful software.
              I'd like to upgrade to Cocoon V2.1.4, but a problem has
emerged:
              The fragment extractor generates the first image in the
right way, but
              all following images have the data of the first one. The
'esql'-part
              works all right.
              In the mail archive I saw other programmers had the same
problem.
              <map:pipeline type="noncaching"> did not resolve the
problem. I moved
              from <map:action-set> to <map:action>, but this was not a
help too.
              Now, is it the cache of Cocoon or the
FragmentExtractor.java class?


        It's not the FragmentExtractor as this component - once
configured - is cached
        and always valid. The javadoc says: "if the input is valid the
output is valid
        as well." This is because the output will always be the same if
the input is
        always the same.

        Now this means you have to look on the input of the
FragmentExtractor - or in
        other words on the components infront of it. For the stylesheet
it's obviously
        the same as for the FragmentExtractor (valid input => valid
output), so only
        XSP remains - and here my knowledge nearly ends, others might be
of more help
        for you, but let me try.

        Per default an XSP is not cacheable - what is a bit strange when
reading your
        observations, or do you have made your XSP cacheable? At least
for each
        different xsp output you need to return a different key in
getKey() and for
        each output instance there is additionally a validity, which
determines the
        ... yeah ... validity of the cache entry.

        It's probably more obvious when explaining it with the file
generator: the
        @src is the key, each file is an output instance and has its own
cache
        validity. The validity is determined by the lastmodified value.

        For more info on this have a look on the Cacheable XSP sample:
        http://127.0.0.1:8888/samples/blocks/xsp/java/cacheable
        the wiki:
        http://wiki.cocoondev.org/Wiki.jsp?page=XSPCachingWithCocoonHEAD
        and the official documentation:
        http://cocoon.apache.org/2.1/userdocs/concepts/caching.html


        Hopefully this helps, but I really wonder why your XSP is
cacheable and
        pipeline noncaching does not help. Maybe it's not a problem of
the caching
        itself, but the FragmentExtractor is not reset correctly. Can
you test it with
        the log transformer by adding it before the FragmentExtractor
and after it. If
        the output is the same for different inputs something is indeed
wrong.

        Joerg

---
ETH Zuerich
Informatikdienste/Kommunikation
Sarah Windler                       phone:+41 1 632 35 43
ETH Zentrum RZ G 22                   fax:+41 1 632 12 25
Clausiustrasse 59
CH-8092 Zuerich
 

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


Mime
View raw message