cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andreas Hartmann (JIRA)" <>
Subject [jira] Updated: (COCOON-2166) Enable caching of IncludeTransformer if not all includes could be resolved
Date Sun, 10 Feb 2008 23:33:07 GMT


Andreas Hartmann updated COCOON-2166:

    Attachment: patch-issue2166-2.txt

Provide an alternative computeStatus() method for MultiSourceValidity which doesn't use the
source resolver to check the validity against new sources, but checks the single sub-validities
of this source against the sub-validities of the new MultiSourceValidity. This should also
work for checks against closed sources which don't have a resolver anymore (resolver is set
to null in close()).

> Enable caching of IncludeTransformer if not all includes could be resolved
> --------------------------------------------------------------------------
>                 Key: COCOON-2166
>                 URL:
>             Project: Cocoon
>          Issue Type: Improvement
>          Components: * Cocoon Core
>    Affects Versions: 2.1.12-dev (Current SVN)
>            Reporter: Andreas Hartmann
>         Attachments: patch-issue2166-2.txt, patch-issue2166.txt
> About the context: In Lenya, we have a couple of modules, which are basically directories.
A module directory can include an optional menu.xml file. The Lenya GUI menubar is an aggregation
of all these menu.xml files, with some postprocessing. The same mechanism is used for the
i18n catalogue - modules can provide i18n catalogues for their GUIs.
> We use the IncludeTransformer to assemble the menu XML, ignoring the non-existing menus
using <i:fallback/>. It looks basically like this:
>   <xsl:forEach select="lenya:module">
>     <i:include src="cocoon:/menu-xml/module/{@name}.xml">
>       <i:fallback/>
>     </i:include>
>   </xsl:forEach>
> This is extremely fast if all modules contain menu.xml files, because the aggregated
XML is cached. But if some of the includes can't be resolved, nothing is cached. This causes
up to 50% more request processing time, so it has quite a big impact on the Lenya GUI performance
> I tracked the source of the behaviour down to the MultiSourceValidity class. As soon
as one of the sources has no validity (IIUC this happens if a FileSource doesn't exist), the
whole MultiSourceValidity becomes invalid:
>   public void addSource(Source src) {
>       if (this.uris != null) {
>           SourceValidity validity = src.getValidity();
>           if (validity == null) {
>               /* The source has no validity: this will be
>                  always be invalid. */
>               this.uris = null;
> From my POV it would be better to ignore the non-existing sources, and check their existence
when the validity is computed the next time. I.e. MultiSourceValidity.isValid() would return
UNKNOWN, and isValid(newValidity) -> computeStatus() would check if newValidity provides
a validity for the formerly missing source.
> Do you think this behaviour would be reasonable? If yes, I'd try to implement it, preferrably
with test cases to avoid regressions. 

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message