portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Setera, Craig" <Craig.Set...@Kingland.com>
Subject RE: Please Help: Howto Expire RSS Portlets Programmatically?
Date Wed, 16 Jan 2002 16:36:24 GMT
Thanks for the tip.  That worked.  I extended the FileWatchExpire class and
provided a means to set it to expired explicitly.  

My concern here is that it seems the FileWatchExpire should have worked
correctly as well.  The file on the disk certainly changed.  I can't say
that I've gotten my head around enough of the code yet to truly understand
what is going wrong, but it does seem messed up.  Can somebody take a look
at this?


-----Original Message-----
From: David Sean Taylor [mailto:david@bluesunrise.com]
Sent: Tuesday, January 15, 2002 1:39 AM
To: Jetspeed Developers List
Subject: Re: Please Help: Howto Expire RSS Portlets Programmatically?

Are you using the RSSPortlet or NewRSSPortlet?
I believe you should be using the new.

To control the expiration,  override the getExpire() method.

----- Original Message -----
From: "Setera, Craig" <Craig.Setera@Kingland.com>
To: "Jetspeed Developers List" <jetspeed-dev@jakarta.apache.org>
Sent: Monday, January 14, 2002 2:29 PM
Subject: Please Help: Howto Expire RSS Portlets Programmatically?

> Hello all,
> I asked about this once before, but received no response.  Not sure if
> people just don't know the answer or if my original request was missed.
> Hopefully it was the latter and my asking again won't be too much of a
> bother.
> My company is busy building things around the excellent Jetspeed 1.3a2
> release of the portal.  We have built a number of "local" OCS content
> that are managed on the local disk.  In addition, we have built a very
> simple content management front-end to add content to the OCS/RSS stream.
> We would like to be able to flush all of the affected RSS portlets
> immediately following an update to one of the RSS files such that the next
> load of the portlet will show the new/removed items.  Unfortunately, I
> seem to get this to work.  I've coded up the following in hopes of
> the changed portlet, but it doesn't seem to work for some reason.
> /**
>  * Flush the cached version of the portlet that wraps
>  * the specified RSS content stream.
>  */
> protected void flushRssPortlet(String rss) {
> // Get access the the portlet factory service
> ServiceBroker serviceBroker = TurbineServices.getInstance();
> PortletFactoryService portletFactory =
> (PortletFactoryService)
> serviceBroker.getService(PortletFactoryService.SERVICE_NAME);
> // Look up the portlet in the factory
> Portlet portlet = null;
> try {
> portlet = portletFactory.getPortlet(rss);
> } catch (PortletException e) {
> // munch
> }
> // If we found it, pull its cache key and remove
> // it from the caches
> if (portlet != null) {
> // First, clear the disk cache
> String diskCacheURL = portlet.getPortletConfig().getURL();
> JetspeedDiskCache.getInstance().refresh(diskCacheURL);
> // Then the portlet cache
> if (portlet instanceof Cacheable) {
> String cacheKey = ((Cacheable) portlet).getHandle();
> // OK.  We have the cache key now.  Remove from the
> // portlet cache
> PortletCache.removeCacheable(cacheKey);
> }
> }
> }
> Part of this *may* be due to the fact that the FileWatcherExpire object
> not seem to be intialized when the portlet is initially created.
> Unfortunately, even forcing the expire object to be created/initialized
> didn't fix things.
> Can anyone offer any insights or thoughts on how to solve this?  I have
> out of ideas and could really use some help.
> Thanks,
> Craig
> Craig Setera
> Sun Certified Java Programmer/Developer/Web Component Developer
> Senior Software Architect, Kingland Systems Corporation
> --
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:   <mailto:jetspeed-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:jetspeed-dev-help@jakarta.apache.org>

View raw message