cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 4641] New: - Design of Source interface precludes implementation of CachingCIncludeTransformer
Date Mon, 05 Nov 2001 13:15:18 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4641>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4641

Design of Source interface precludes implementation of CachingCIncludeTransformer

           Summary: Design of Source interface precludes implementation of
                    CachingCIncludeTransformer
           Product: Cocoon 2
           Version: 2.1alpha CVS
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: core
        AssignedTo: cocoon-dev@xml.apache.org
        ReportedBy: maciejka@tiger.com.pl


I had already posted this to the cocoon-dev list, but as I have got no response 
I submit it as a bug.

I think that there is a deign flow in Source interface, which precludes
implementation of important class of caching transformers.

I would like to start explanation of what is wrong with case of 
CachingCIncludeTransformer but everything below holds for whole class 
of "caching including transformers".

How caching CachingCIncludeTransformer works? 

When it comes to checking validity of CachingCIncludeTransformer step,
generation/transformation steps before CIncludeTransformer are valid (otherwise
cached pipeline would have had been discarded already), so list of sources to
include in new pipeline is the same as in old one. Then to validate include
transformation it is necessary to validate sources from that list. Sources
alongside validity information are contained in validity object of cached
pipeline.

General pattern that some information from previous pipeline steps is kept in
validity object, and used during evaluation of validity may be applied to other
including transformers. SQLTransformer variant being one of examples.

Example usage:

x.xml:
<?xml version="1.0"?>
<x/>

y.xml:
<?xml version="1.0"?>
<z xmlns:cinclude="http://apache.org/cocoon/include/1.0">
  <cinclude:include src="cocoon://x.xml" />  
</z>

sitemap.xmap:
...
   <map:match pattern="x.xml">
     <map:generate src="x.xml"/>
     <map:serialize type="xml"/>       
   </map:match>

   <map:match pattern="z.xml">
     <map:generate src="y.xml"/>
     <map:transform type="cinclude"/>
     <map:serialize type="xml"/>       
   </map:match>

cocoon://z.xml:
<?xml version="1.0"?>
<z>
  <x/>  
</z>

So far everything works, x.xml is included into z.xml, if x.xml changes z.xml
reflects the change.

Where is the problem?

Problems starts when something like this is added to the sitemap:
   <map:match pattern="w.xml">
     <map:generate src="cocoon://z.xml"/>
     <map:serialize type="xml"/>       
   </map:match>

Changes in x.xml are still reflected in z.xml but not in w.xml. Why?

Pipeline w.xml uses FileGenerator which generates validity information from
inputSource.getLastModified():

    public CacheValidity generateValidity() {
        if (this.inputSource.getLastModified() != 0) {
            return new
            TimeStampCacheValidity(this.inputSource.getLastModified());
        }
        return null;
    }

In this case inputSource is an instance of SitemapSource which calculates
getLastModified as a hash of string representation of validity objects of
relevant pipeline. Than when validity of generation step of w.xml is evaluated
simply two hashes of validity objects are compared. It works if it is true that
isValid() method is equivalent to comparing hashes validity objects. It does not
hold for IncludeCacheValidity.

How to repair it? 

It is necessary to make accessible to FileGenerator validity
information about SitemapSource object?

P.S.: I volunteer to make and test changes, as soon as solution is agreed.

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


Mime
View raw message