cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Ziegeler" <cziege...@s-und-n.de>
Subject RE: CachingURICoplet and Flowscript / CForms
Date Thu, 25 Mar 2004 08:43:15 GMT
Jon Evans wrote:
> 
> function show(form) {
>      populate(form);
>      form.showForm("display-pipeline");
>      saveToDB(form);
> 
>    cocoon.sendPage("success-pipeline");
>      reset();
>   }
> 
> function reset() {
>      // this is pseudo code remember!
>      thisCoplet.reset();
>      thisCoplet.clearCache();
>      // Now the next time this coplet is displayed,
>      // it will be generated from scratch as if it
>      // had never been displayed before
>   }
> 
If the cache entry for a coplet is valid or not is stored as an
attribute on the coplet. If you set the attribute "cacheValidity"
to "0", the cache becomes invalid.
So, all you have to do is:
function reset() {
    this.coplet.setAttribute("cacheValidity", "0");
}
and hopefully this should work :)

> 
> 
> Also, I'm still looking for a code snippet that would let me 
> do this from my flowscript:
> 
> var myValue = thisCoplet.get("attributes/myValue");
>   // where myValue is defined in my copletdata/portal.xml file
> 
I think you have two choices, you can use the coplet input module
in flow script or you can go the "long way home" and get the
profile manager and from the profile manager the coplet instance.
You can have a look at the AbstractCopletTransformer that exactly
does this in Java.

HTH
Carsten


Mime
View raw message