Steve -- Not sure if I understand the question, but Ive had problems with FileServerPortlet and the PortletExpirationManager not correctly expiring resources.
I assume thats what your talking about.
For a quick work around, simply dont use the FileServerPortlet, write your own portlet such as shown below. You may notice that this simple example is not exactly optimized, it simply goes out and gets the file for each and every request.
 
public class DirectFilePortlet extends AbstractPortlet
{
 
    public ConcreteElement getContent() {
 
        String htmlPage;
        ClearElement element;
  String url = "file:/c:/path/yourfile.html";
        try {
            htmlPage = getURL(url);
            element = new ClearElement( htmlPage );
            this.setContent( element );
 
        } catch (Exception ex) {
            String message = "DirectFilePortlet: Could not include the following URL:  " + url + " : " + ex.getMessage();
            Log.error( message, ex );
            return new StringElement( message );
        }
 
        return element;
   
    }
 
    /**
    @author <a href="
mailto:[EMAIL PROTECTED]">Kevin A. Burton</a>
    @version $Id: FileServerPortlet.java,v 1.19 2000/05/22 21:19:56 burton Exp $
    */
    private String getURL(String url) throws IOException {
 
        int CAPACITY = 1024;
 
        InputStream is = new URL( url ).openStream();
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();
 
        //now process the InputStream...
        byte[] bytes = new byte[CAPACITY];
 
        int readCount = 0;
        while( ( readCount = is.read( bytes )) > 0 ) {
                         
            buffer.write( bytes, 0, readCount);
        }
 
        is.close();
 

        return buffer.toString();
 
    }
 
}
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of sbelt
Sent: Monday, November 06, 2000 3:05 PM
To: JetSpeed
Subject: Re: Website and Documentation

Do you (or anyone) know how to override the cacheing mechanism? I have modified the FileServerPortlet so that it will pass the turbine userid/password to the target URL (using post method). I am trying to retrieve personal task-list information in the portlet. For some reason, I cannot get around the cache so that I get the first user's list on all subsequent instances.
 
Any help/direction is appreciated.
 
Steve B.
----- Original Message -----
Sent: Monday, November 06, 2000 2:51 PM
Subject: RE: Website and Documentation

Writing a portlet is easy. Just extend AbstractPortlet, override getContent(), wrap your content in an ECS element and return it. Thats about it.
Or extend one of the existing implementations such as FIleServerPortlet. Look at the code, its well-written and very easy to understnd.
 
Make sure to define your portlet in the portlet registry (portletregistry.psml), and reference that definition in your portlet markup file i.e. (default.psml).  For another user, reference the portlet definition in the corresponding portlet markup file i.e. turbine.psml
( I believe the config files change their names with the latest builds...)
 
The online docs aren't that bad....read them and the Turbine docs. Its important to understand how Turbine works with Jetspeed.
 
Ive written a 29 page (and growing) Developers Guide for Jetspeed 1.2b1. Im not sure if I should post it out here, it may be uncool with the 'learn by doing' ethic here.
 
The mailing list archives are at http://java.apache.org - but I still havent figured out how to search the whole archive....
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Northam, Eric
Sent: Monday, November 06, 2000 12:44 PM
To: Jetspeed (E-mail)
Subject: Website and Documentation

Is there currently any effort to create documentation or update the website? There is a good install guide for tomcat that keeps popping up in the mailing list that would be very good to include on the install page. The website also desperately needs to have a how to guide on how to create and deploy a portlet. I'm willing to help with the install guide, but I still haven't figured out how create and deploy a portlet. ( in particular which non class files are used and where are they located?) I also can't seem to find a link to this mailing list or the archives on the website.
 
Eric

Reply via email to