You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Doug Chestnut <dh...@virginia.edu> on 2006/06/27 10:26:32 UTC

[1.4] publication specific source cache?

The SourceCacheImpl class uses the source uri for a key to the cached 
object.  I believe that I have run into problems with this in the past 
with templated publications.
fallback://config/ac/usecase-policies.xml can refer to a number of 
different files depending upon the publication from which it is being 
used, but it is used for the key to the cached object in 
SourceCacheImpl.  This has the potential to produce unexpected results.

Should the SourceCache objects be publication specific (key of something 
like {pub}:fallback://config/ac/usecase-policies.xml)?  I guess we could 
also just use the absolute url as a key for the cached object. Or 
perhaps I am missing something and just need some sleep.

--Doug

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


Re: [1.4] publication specific source cache?

Posted by Doug Chestnut <dh...@virginia.edu>.

Doug Chestnut wrote:
> 
> 
> Andreas Hartmann wrote:
> 
>> Doug Chestnut wrote:
>>
>>> The SourceCacheImpl class uses the source uri for a key to the cached 
>>> object.  I believe that I have run into problems with this in the 
>>> past with templated publications.
>>> fallback://config/ac/usecase-policies.xml can refer to a number of 
>>> different files depending upon the publication from which it is being 
>>> used, but it is used for the key to the cached object in 
>>> SourceCacheImpl.  This has the potential to produce unexpected results.
>>
>>
>>
>> Yes, I guess you're right.
>>
>>> Should the SourceCache objects be publication specific (key of 
>>> something like {pub}:fallback://config/ac/usecase-policies.xml)?  I 
>>> guess we could also just use the absolute url as a key for the cached 
>>> object.
>>
>>
>>
>> IMO the absolute URL approach is more appropriate for SoC reasons.
>> The problem with the {pub}:fallback:// approach is that the actual
>> URL might change (e.g. when a formerly missing file is added to the
>> current publication), so the fallback resolving has to happen each
>> time the source is requested.
>>
>> Thanks for the pointer, would you mind filing a bug or even fix it?
>> It would be great to have a unit test to verify the problem and
>> its solution.
> 
> Sure, I will give it a try. (unit test / fix)
Well, I couldn't produce any problems with the SourceCache.  It still 
seems suspect to me though.

Anyway, I forgot that the problems that I have experienced in the past 
have been related to the use-store parameter being set to true and using 
xsl:include and xsl:import elements with hrefs utilizing fallback or 
template-fallback sources 
(http://lenya.apache.org/1_4/reference/publication-templating/index.html#XSLT+Include+and+Import).

I use this patch to fix:
<xconf 
xpath="/cocoon/component[@role='org.apache.excalibur.xml.xslt.XSLTProcessor/xalan']" 
remove="/cocoon/component[@role='org.apache.excalibur.xml.xslt.XSLTProcessor/xalan']/parameter[@name='use-store']">

     <parameter name="use-store" value="false"/>

</xconf>



> 
> --Doug
> 
>>
>> -- Andreas
>>
>>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lenya.apache.org
> For additional commands, e-mail: dev-help@lenya.apache.org
> 

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


Re: [1.4] publication specific source cache?

Posted by Doug Chestnut <dh...@virginia.edu>.

Andreas Hartmann wrote:
> Doug Chestnut wrote:
> 
>> The SourceCacheImpl class uses the source uri for a key to the cached 
>> object.  I believe that I have run into problems with this in the past 
>> with templated publications.
>> fallback://config/ac/usecase-policies.xml can refer to a number of 
>> different files depending upon the publication from which it is being 
>> used, but it is used for the key to the cached object in 
>> SourceCacheImpl.  This has the potential to produce unexpected results.
> 
> 
> Yes, I guess you're right.
> 
>> Should the SourceCache objects be publication specific (key of 
>> something like {pub}:fallback://config/ac/usecase-policies.xml)?  I 
>> guess we could also just use the absolute url as a key for the cached 
>> object.
> 
> 
> IMO the absolute URL approach is more appropriate for SoC reasons.
> The problem with the {pub}:fallback:// approach is that the actual
> URL might change (e.g. when a formerly missing file is added to the
> current publication), so the fallback resolving has to happen each
> time the source is requested.
> 
> Thanks for the pointer, would you mind filing a bug or even fix it?
> It would be great to have a unit test to verify the problem and
> its solution.
Sure, I will give it a try. (unit test / fix)

--Doug

> 
> -- Andreas
> 
> 

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


Re: [1.4] publication specific source cache?

Posted by Andreas Hartmann <an...@apache.org>.
Doug Chestnut wrote:
> The SourceCacheImpl class uses the source uri for a key to the cached 
> object.  I believe that I have run into problems with this in the past 
> with templated publications.
> fallback://config/ac/usecase-policies.xml can refer to a number of 
> different files depending upon the publication from which it is being 
> used, but it is used for the key to the cached object in 
> SourceCacheImpl.  This has the potential to produce unexpected results.

Yes, I guess you're right.

> Should the SourceCache objects be publication specific (key of something 
> like {pub}:fallback://config/ac/usecase-policies.xml)?  I guess we could 
> also just use the absolute url as a key for the cached object.

IMO the absolute URL approach is more appropriate for SoC reasons.
The problem with the {pub}:fallback:// approach is that the actual
URL might change (e.g. when a formerly missing file is added to the
current publication), so the fallback resolving has to happen each
time the source is requested.

Thanks for the pointer, would you mind filing a bug or even fix it?
It would be great to have a unit test to verify the problem and
its solution.

-- Andreas


-- 
Andreas Hartmann
Wyona Inc.  -   Open Source Content Management   -   Apache Lenya
http://www.wyona.com                      http://lenya.apache.org
andreas.hartmann@wyona.com                     andreas@apache.org


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