My colleague has an application [a rather old application written as we learned WebObjects with much that is embarrassing in the cruel light of our current skills] which occasionally is called on to display a report that can take considerable computation as it grinds through various nested WORepetitions -- in a worst case, about 45 seconds of elapsed time. The data for the report is already in memory so no EO operations are happening during this, just lots of rattling round and round in WOComponents.

We're looking at various options -- improve the Java code, generate the reports off-line as static HTML, etc.

The option I'm looking at is to render this report under the operation of a WOLongResponse. I've not used this class before, so I looked at Apple's example and wrote a trivial example of my own to get a sense of how it operates. What I'm stuck on though is whether it is possible to generate a web page during a WOLongResponse with something like:


public class Slow extends WOLongResponsePage {

   public Slow(WOContext context) {
      super(context);
   }

   @Override
   public Object performAction() {
      WOComponent    calcPage = pageWithName(Calc.class.getName());
      WOContext      calcCntx = calcPage.context();
return calcPage.generateResponse().contentString(); // may take a long time
   }

   @Override
   public WOComponent refreshPageForStatus(Object o) {
      return this;
   }

   @Override
   public WOComponent pageForResult(Object result) {
      WOComponent   donePage = pageWithName(Done.class.getName());
      donePage.takeValueForKey(result, "result");
      return donePage;
   }

   @Override
public void appendToResponse(WOResponse aResponse, WOContext aContext) {
      setRefreshInterval(3);
      super.appendToResponse(aResponse, aContext);
   }
}


I'm clearly confused because this doesn't work -- the generateResponse() method call fails with a null pointer exception.

The Calc component is simply:

   <wo:WORepetition count = "20">x </wo:WORepetition>

I'd appreciate some help. I have this horrible suspicion that I'm making this more complicated than is required .. Thanks, Gavin
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to