cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Quenot <...@anyware-tech.com>
Subject Re: "Reset" cachingURI coplet
Date Thu, 26 May 2005 07:30:48 GMT
* Philippe Guillard:

> I'm  looking  for some  idea/solution  to  refresh a  cachingURI
> coplet content after a form in portal has been submitted. Then a
> user  going to  other  tabs and  going back  would  not see  the
> "success" page again.

Here is what we do:

showForm()
doNotCacheCopletResponse(copletId);
cocoon.sendPage("success-page");

And here is the magic function:

function doNotCacheCopletResponse(copletId)
{
  cocoon.log.debug("doNotCacheCopletResponse:  coplet="+copletId);

  var service = cocoon.getComponent(org.apache.cocoon.portal.PortalService.ROLE);
  var profileManager = service.getComponentManager().getProfileManager();
  var coplet = profileManager.getCopletInstanceData(copletId);
  // tells the coplet not to cache the his content
  // Note : this code comes from CachingURICopletAdapter
  coplet.setAttribute(org.apache.cocoon.portal.coplet.adapter.impl.CachingURICopletAdapter.DO_NOT_CACHE,
"true");
}

This prevents caching for the success page.

HTH,
-- 
Jean-Baptiste Quenot
Systèmes d'Information
ANYWARE TECHNOLOGIES
Tel : +33 (0)5 61 00 52 90
Fax : +33 (0)5 61 00 51 46
http://www.anyware-tech.com/

Mime
View raw message