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.&nbsp; I have not looked at chetta but that might be a good thing to look at.&nbsp; 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.&nbsp; Really very simple to use, I could give you the code to look at if you are interested<br>
&nbsp;<br>
Jose<BR><BR><br>
<BLOCKQUOTE style="PADDING-LEFT: 8px; MARGIN-LEFT: 8px; BORDER-LEFT: blue 2px solid"><BR>-------- Original Message --------<BR>Subject: [Webware-discuss] How-to include static HTML + TaskKit Q.<BR>From: "deelan" &lt;deelan@...&gt;<BR>Date: Thu, July 17, 2003 7:22 am<BR>To: "Webware discuss" &lt;webware-discuss@...&gt;<BR><BR>hi there,<BR><BR>i'm writing a simple blog system with python to learn the language and <BR>the webware framework. i've figured out most of the basic things, and<BR>now i'm moving to more advanced stuff.<BR><BR>i was wondering what is the best way to include static contents in a <BR>webware servlet. consider this situation: tipically a blog sidebar <BR>contains a list of things that do not need to get updated frequently <BR>(blog rolls wih a "last updated" date, a calendar, recent photos--just <BR>to name a few).<BR><BR>i thought to update this things on a, say, daily basis via taskkit.<BR>a tipical blog roll (example here: http://simon.incutio.com/)<BR>generation task &nbsp;would be:<BR><BR>* read a db table and fetch a service like weblogs.com with a list<BR>of blogs of interest<BR>* parse weblogs.com output and build an HTML &lt;ul&gt; list with blog title <BR>and "last updated" value<BR>* write HTML snippet to disk<BR><BR>so, at every page request webware just include such static<BR>HTML list &nbsp;in the servlet output instead to compute a possibly<BR>lengthly operation.<BR><BR>i've seen that Page has an includeURL() method, where URL is the URL<BR>for another servlet, not a file. correct? of course i could<BR>add something like to my WeblogPage object:<BR><BR>def includeFile(self, fname)<BR>&nbsp; included = file(fname, 'r')<BR>&nbsp; s = included.read()<BR>&nbsp; return s<BR><BR>to include an arbitrary file, but i would like to known how<BR>you would solve this problem.<BR><BR>thanks in advance.<BR><BR>later,<BR>deelan<BR><BR>PS: from the taskkit docs it's not clear to me how<BR>to specify frequency for a task (say twice a day), once<BR>a week and so on.<BR><BR><BR><BR><BR><BR><BR>-------------------------------------------------------<BR>This SF.net email is sponsored by: VM Ware<BR>With VMware you can run multiple operating systems on a single machine.<BR>WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the<BR>same time. Free trial click here: http://www.vmware.com/wl/offer/345/0<BR>_______________________________________________<BR>Webware-discuss mailing list<BR>Webware-discuss@...<BR>https://lists.sourceforge.net/lists/listinfo/webware-discuss </BLOCKQUOTE>

Thanks, you helped me figure out the problem restarting after my kill
command. I killed the AppServer pid rather than the ThreadedAppServer
pid.
Roger Haase
--- Gary Perez <swampxiix@...> wrote:
> I have the same problem on a daily basis. My method to restart the
> AppServer is to check the appserverpid.txt file in the runtime
> directory (not the Webware/WebKit) directory, and kill that PID.
> Then,
> "./AppServer &" to start again. I wrote a Python script that will
> either read that PID file and kill it, or parse the output of "ps
> aux"
> and kill the appropriate PIDs. I can give that to you if you want.
> You
> can do it through WebKit, if desired, but should do so through the
> OneShot.cgi adapter, in case you need to restart the server after
> it's
> gone to lunch.
>
> This probably doesn't solve your problem, but I hope it helps a bit.
> -Gary
>
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

The rc script is where?
Roger haase
--- Ian Bicking <ianb@...> wrote:
> The WebKit/webkit rc script doesn't have this problem, though you'll
> have to put the paths in yourself. It's the best way to start the
> AppServer when you're not doing development.
>
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

I too am on the make my own blog bandwagon.
For this type of information you have many choices
Easy: Use Cheetah to render your pages,
Somthing like:
#cache timer='30m', id='cache1'
<ul>
#for $blog in $blogroll
<li><a href="$blog.url">$blog.title</a></li>
#end for
</ul>
#end cache
Flexable
Cache it in yout module, use a module level variable to hold the data
and use TaskKit to update it.
I would not store this type of info to disk.
Another option is to write the entire blog page to disk as an HTML page
(how often does that update?) and then use Webware as a 404 handler to
generate pages on the fly or update them as needed.
-Aaron
deelan wrote:
> 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
> Webware-discuss@...
> https://lists.sourceforge.net/lists/listinfo/webware-discuss
--
-Aaron
http://www.MetroNY.com/
"I don't know what's wrong with my television set. I was getting
C-Span and the Home Shopping Network on the same station.
I actually bought a congressman."
- Bruce Baum

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.

I have the same problem on a daily basis. My method to restart the
AppServer is to check the appserverpid.txt file in the runtime
directory (not the Webware/WebKit) directory, and kill that PID. Then,
"./AppServer &" to start again. I wrote a Python script that will
either read that PID file and kill it, or parse the output of "ps aux"
and kill the appropriate PIDs. I can give that to you if you want. You
can do it through WebKit, if desired, but should do so through the
OneShot.cgi adapter, in case you need to restart the server after it's
gone to lunch.
This probably doesn't solve your problem, but I hope it helps a bit.
-Gary
On Wednesday, July 16, 2003, at 09:42 PM, Roger Haase wrote:
> Hi,
>
> I am practicing the installation and running of my Webware app on a
> dedicated remote hosted linux server with ssh and WebMin access.
>
> A starting assumption is the way to start the AppServer is to ssh in
> and start it in the normal manner and then disconnect, leaving it
> running. Per the docs, I should be able to start another ssh session
> and issue a:
> ./AppServer stop
>
> This fails in the "stop" function of AppServer.py trying to:
>
> pidfile = os.path.join(os.path.dirname(__file__),"appserverpid.txt")
>
> ...which points to the WebKit directory.
>
> The problem seems to be the "recordPID" method of AppServer.py stored
> the PID in the mycontext directory:
>
> pidfile = open(os.path.join(self._serverSidePath,
> "appserverpid.txt"),"w")
>
>
> I was testing with the 8.0 release; the CVS version of AppServer.py
> seems to have some code changes but the directory mismatch appears to
> persist. I think the mycontext directory is the right place for the PID
> file to be stored, but the "stop" function (as I understand it) doesn't
> have a way to find the mycontext directory ("stop" is called from the
> "main" function in ThreadedAppServer.py).
>
>
> Using the "admin" function to stop the AppServer is probably an easy
> way around this, but I understand the recommendation is to disable the
> admin functions for production sites. I tried the kill method as well,
> but that doesn't seem to shut down cleanly and I was unable to restart
> the AppServer without rebooting.
>
> Any suggestions?
>
> Roger Haase

The WebKit/webkit rc script doesn't have this problem, though you'll
have to put the paths in yourself. It's the best way to start the
AppServer when you're not doing development.
On Wed, 2003-07-16 at 20:42, Roger Haase wrote:
> Hi,
>
> I am practicing the installation and running of my Webware app on a
> dedicated remote hosted linux server with ssh and WebMin access.
>
> A starting assumption is the way to start the AppServer is to ssh in
> and start it in the normal manner and then disconnect, leaving it
> running. Per the docs, I should be able to start another ssh session
> and issue a:
> ./AppServer stop
>
> This fails in the "stop" function of AppServer.py trying to:
>
> pidfile = os.path.join(os.path.dirname(__file__),"appserverpid.txt")
>
> ...which points to the WebKit directory.
>
> The problem seems to be the "recordPID" method of AppServer.py stored
> the PID in the mycontext directory:
>
> pidfile = open(os.path.join(self._serverSidePath,
> "appserverpid.txt"),"w")
>
>
> I was testing with the 8.0 release; the CVS version of AppServer.py
> seems to have some code changes but the directory mismatch appears to
> persist. I think the mycontext directory is the right place for the PID
> file to be stored, but the "stop" function (as I understand it) doesn't
> have a way to find the mycontext directory ("stop" is called from the
> "main" function in ThreadedAppServer.py).
>
>
> Using the "admin" function to stop the AppServer is probably an easy
> way around this, but I understand the recommendation is to disable the
> admin functions for production sites. I tried the kill method as well,
> but that doesn't seem to shut down cleanly and I was unable to restart
> the AppServer without rebooting.
>
> Any suggestions?
>
> Roger Haase
>
>
>
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
>
>
> -------------------------------------------------------
> 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
> Webware-discuss@...
> https://lists.sourceforge.net/lists/listinfo/webware-discuss

Hi,
I am practicing the installation and running of my Webware app on a
dedicated remote hosted linux server with ssh and WebMin access.
A starting assumption is the way to start the AppServer is to ssh in
and start it in the normal manner and then disconnect, leaving it
running. Per the docs, I should be able to start another ssh session
and issue a:
./AppServer stop
This fails in the "stop" function of AppServer.py trying to:
pidfile = os.path.join(os.path.dirname(__file__),"appserverpid.txt")
...which points to the WebKit directory.
The problem seems to be the "recordPID" method of AppServer.py stored
the PID in the mycontext directory:
pidfile = open(os.path.join(self._serverSidePath,
"appserverpid.txt"),"w")
I was testing with the 8.0 release; the CVS version of AppServer.py
seems to have some code changes but the directory mismatch appears to
persist. I think the mycontext directory is the right place for the PID
file to be stored, but the "stop" function (as I understand it) doesn't
have a way to find the mycontext directory ("stop" is called from the
"main" function in ThreadedAppServer.py).
Using the "admin" function to stop the AppServer is probably an easy
way around this, but I understand the recommendation is to disable the
admin functions for production sites. I tried the kill method as well,
but that doesn't seem to shut down cleanly and I was unable to restart
the AppServer without rebooting.
Any suggestions?
Roger Haase
__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

Community

Help

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

I agree to receive quotes, newsletters and other information from sourceforge.net and its partners regarding IT services and products. I understand that I can withdraw my consent at any time. Please refer to our Privacy Policy or Contact Us for more details