You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by pguillard <pg...@soociety.com> on 2004/12/02 17:25:17 UTC

Re: Invalidate cachingURI coplet cache

Hi all,

New try for my question because it was badly expressed and i tried further:
I know it's possible to invalidate the cachingURIcoplet cache "manually" 
in flow:
I found this class : 
org.apache.cocoon.portal.coplet.adapter.impl.CachingURICopletAdapter
and this method :
void  setCacheInvalid(CopletInstanceData coplet)

But i don't know how i could get the CopletInstanceData. Does anybody 
know how to use method like getCopletInstanceData  for example,  from  
some  "manager" class please?
thanks in advance,

Phil

pguillard wrote:

> Hi all,
>
> Question1:
> I know it's possible to invalidate the cachingURI coplet cache 
> "manually" from within flow, xsp or action but don't know how, here is 
> where i am in flow:
> function reset_cache() {
>        var cidmanager = 
> Packages.org.apache.cocoon.portal.profile.impl.CopletInstanceDataManager(); 
>
>        var mycoplet = new 
> Packages.org.apache.cocoon.portal.coplet.adapter.impl.CachingURICopletAdapter(); 
>
>        var cid = cidmanager.getCopletInstanceData("test-1")
>        mycoplet.setCacheInvalid(cid);        }   Question2: Is this 
> strategy correct ?
> - I plan to use this to invalidate cachingURI coplet cache after a 
> form has been submitted, then the user going back to this portal-tab 
> will see the coplet refreshed with the form again
> - Some users may update things that will change the content of other 
> coplets (not concerning their profile and without having to login 
> again), i assume i should also invalidate the cache for that coplets / 
> that users in order to view these coplets updated.
>
> Regards,
> Phil
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


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


Re: Invalidate cachingURI coplet cache

Posted by pguillard <pg...@soociety.com>.
Thanks a lot Nick. You gave me everything.
( However i'm Java beginner and blocked with Avalon ServiceManager to 
get Portal Service and hope to find soon:-))

Phil

Nick Goupinets wrote:

> Hi Phil,
>
> Here are a few hints:
>
> 1.
> http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=109774039000438&w=2
>
> It talks about layout, but once you understand that, it's easy to get 
> it working for coplet instance data.
>
> 2.
> // for portal service
> service = (PortalService)manager.lookup(PortalService.ROLE);
>
> // for component manager
> PortalComponentManager componentManager = service.getComponentManager();
>
> // for profile manager
> ProfileManager profileManager = componentManager.getProfileManager();
>
> You will probably need the new GroupBasedProfileManager (GBPM) 
> instead. GBPM has getCopletInstaceData method. I think that's what you 
> wanted.
>
> Sincerely,
> Nick
>
> pguillard wrote:
>
>> Hi all,
>>
>> New try for my question because it was badly expressed and i tried 
>> further:
>> I know it's possible to invalidate the cachingURIcoplet cache 
>> "manually" in flow:
>> I found this class : 
>> org.apache.cocoon.portal.coplet.adapter.impl.CachingURICopletAdapter
>> and this method :
>> void  setCacheInvalid(CopletInstanceData coplet)
>>
>> But i don't know how i could get the CopletInstanceData. Does anybody 
>> know how to use method like getCopletInstanceData  for example,  
>> from  some  "manager" class please?
>> thanks in advance,
>>
>> Phil
>>
>> pguillard wrote:
>>
>>> Hi all,
>>>
>>> Question1:
>>> I know it's possible to invalidate the cachingURI coplet cache 
>>> "manually" from within flow, xsp or action but don't know how, here 
>>> is where i am in flow:
>>> function reset_cache() {
>>>        var cidmanager = 
>>> Packages.org.apache.cocoon.portal.profile.impl.CopletInstanceDataManager(); 
>>>
>>>        var mycoplet = new 
>>> Packages.org.apache.cocoon.portal.coplet.adapter.impl.CachingURICopletAdapter(); 
>>>
>>>        var cid = cidmanager.getCopletInstanceData("test-1")
>>>        mycoplet.setCacheInvalid(cid);        }   Question2: Is this 
>>> strategy correct ?
>>> - I plan to use this to invalidate cachingURI coplet cache after a 
>>> form has been submitted, then the user going back to this portal-tab 
>>> will see the coplet refreshed with the form again
>>> - Some users may update things that will change the content of other 
>>> coplets (not concerning their profile and without having to login 
>>> again), i assume i should also invalidate the cache for that coplets 
>>> / that users in order to view these coplets updated.
>>>
>>> Regards,
>>> Phil
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>> For additional commands, e-mail: users-help@cocoon.apache.org
>>>
>>>
>>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>


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


Re: Invalidate cachingURI coplet cache

Posted by Nick Goupinets <ng...@openskysolutions.ca>.
Hi Phil,

Here are a few hints:

1.
http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=109774039000438&w=2

It talks about layout, but once you understand that, it's easy to get it 
working for coplet instance data.

2.
// for portal service
service = (PortalService)manager.lookup(PortalService.ROLE);

// for component manager
PortalComponentManager componentManager = service.getComponentManager();

// for profile manager
ProfileManager profileManager = componentManager.getProfileManager();

You will probably need the new GroupBasedProfileManager (GBPM) instead. 
GBPM has getCopletInstaceData method. I think that's what you wanted.

Sincerely,
Nick

pguillard wrote:
> Hi all,
> 
> New try for my question because it was badly expressed and i tried further:
> I know it's possible to invalidate the cachingURIcoplet cache "manually" 
> in flow:
> I found this class : 
> org.apache.cocoon.portal.coplet.adapter.impl.CachingURICopletAdapter
> and this method :
> void  setCacheInvalid(CopletInstanceData coplet)
> 
> But i don't know how i could get the CopletInstanceData. Does anybody 
> know how to use method like getCopletInstanceData  for example,  from  
> some  "manager" class please?
> thanks in advance,
> 
> Phil
> 
> pguillard wrote:
> 
>> Hi all,
>>
>> Question1:
>> I know it's possible to invalidate the cachingURI coplet cache 
>> "manually" from within flow, xsp or action but don't know how, here is 
>> where i am in flow:
>> function reset_cache() {
>>        var cidmanager = 
>> Packages.org.apache.cocoon.portal.profile.impl.CopletInstanceDataManager(); 
>>
>>        var mycoplet = new 
>> Packages.org.apache.cocoon.portal.coplet.adapter.impl.CachingURICopletAdapter(); 
>>
>>        var cid = cidmanager.getCopletInstanceData("test-1")
>>        mycoplet.setCacheInvalid(cid);        }   Question2: Is this 
>> strategy correct ?
>> - I plan to use this to invalidate cachingURI coplet cache after a 
>> form has been submitted, then the user going back to this portal-tab 
>> will see the coplet refreshed with the form again
>> - Some users may update things that will change the content of other 
>> coplets (not concerning their profile and without having to login 
>> again), i assume i should also invalidate the cache for that coplets / 
>> that users in order to view these coplets updated.
>>
>> Regards,
>> Phil
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 

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