C�dric Vidal wrote:
Hi,

I'm new to this list, so please excuse me if I where to ask a silly or
already answered question.

Welcome to the list. A great resource is the mailing list archives - they're linked from the Cocoon site and documentation, but you can find them at http://marc.theaimsgroup.com along with other spots.

I'm in the process of upgrading my cocoon 2.0.4 app to cocoon 2.1 and I
have a problem with new Validity objects.

I want one of my XSP pages to be valid for 1 minute. The object
DeltaTimeCacheValidity which I used in cocoon 2.0.4 now seems to be
deprecated in cocoon 2.1. I looked in the repository and saw that the
CacheValidity contract had been replaced by Excalibur's SourceValidity
contract.

Actually, the classes really moved to the Excalibur project so others could use them. Converting in this case is really easy.
First of all, DeltaTimeCacheValidity defined three constructors:
DeltaTimeCacheValidity(long minutes)
DeltaTimeCacheValidity(long minutes, long seconds)
DeltaTimeCacheValidity(long minutes, long seconds, long milliseconds)


its successor org.apache.excalibur.source.impl.validity.ExpiresValidity defines just one:
ExpiresValidity(long milliseconds)


Next, the method
  public long generateKey()
is now
  public Serializable getKey()

and
  public CacheValidity generateValidity()
is now
  public org.apache.excalibur.source.SourceValidity getValidity()

That's it. Let me know if you need more help implementing the change but hopefully it looks pretty trivial to you. The example of the cacheable xsp uses another option where a CacheValidity to SourceValidity adaptor/factory is used. It's just as easy to make the change correctly though, and I think the xsp should get changed to reflect the new method without the complication it uses.

I then found the object
org.apache.cocoon.transformation.helpers.ExpiresValidity which seemed to
fill my needs, but it has been removed from the repository before the
release of cocoon 2.1 stable and the last CVS log says:
"Make the store to use for the caching-cinclude element configurable,
remove obsolete class"

Ignore this class and the message. It's not relevant to your use case. ...

What's more, in local.build.properties, I have excluded deprecated
classes.

Well, the quickest solution is to not exclude them - if you just want to move on right away. But it'll be much better to just make this simple update.


Geoff


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to