I think what you want is some type of template format where your static content really is the template and then you just use your servlet to make your dynamic content.  I have not looked at chetta but that might be a good thing to look at.  Also we have been working on our template system which simply takes a statice html page and lets you substiture varaible in it from a dictonary.  Really very simple to use, I could give you the code to look at if you are interested
 
Jose



-------- Original Message --------
Subject: [Webware-discuss] How-to include static HTML + TaskKit Q.
From: "deelan" <[EMAIL PROTECTED]>
Date: Thu, July 17, 2003 7:22 am
To: "Webware discuss" <[EMAIL PROTECTED]>

hi there,

i'm writing a simple blog system with python to learn the language and
the webware framework. i've figured out most of the basic things, and
now i'm moving to more advanced stuff.

i was wondering what is the best way to include static contents in a
webware servlet. consider this situation: tipically a blog sidebar
contains a list of things that do not need to get updated frequently
(blog rolls wih a "last updated" date, a calendar, recent photos--just
to name a few).

i thought to update this things on a, say, daily basis via taskkit.
a tipical blog roll (example here: http://simon.incutio.com/)
generation task  would be:

* read a db table and fetch a service like weblogs.com with a list
of blogs of interest
* parse weblogs.com output and build an HTML <ul> list with blog title
and "last updated" value
* write HTML snippet to disk

so, at every page request webware just include such static
HTML list  in the servlet output instead to compute a possibly
lengthly operation.

i've seen that Page has an includeURL() method, where URL is the URL
for another servlet, not a file. correct? of course i could
add something like to my WeblogPage object:

def includeFile(self, fname)
  included = file(fname, 'r')
  s = included.read()
  return s

to include an arbitrary file, but i would like to known how
you would solve this problem.

thanks in advance.

later,
deelan

PS: from the taskkit docs it's not clear to me how
to specify frequency for a task (say twice a day), once
a week and so on.






-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the
same time. Free trial click here: http://www.vmware.com/wl/offer/345/0
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss
------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ Webware-discuss mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to