logo       

Re: About a templating for **Static*** dummy web page: msg#00107

lang.smalltalk.squeak.seaside

Subject: Re: About a templating for **Static*** dummy web page

In Aida/Web there is simple "templating": you just insert a special tag in your static page and this tag calls Aida's dynamic generation code.

Simple example is a counter on the bottom of every page:

<AIDA PageCounter currentCount>

Because Aida servers static pages too, every page is first parsed for above AIDA tag. When it is found, appropriate object is called to return a HTML chunk.

Not a full templating, but just enough for most of needs. If you need more, it is much better to switch to fully dinamically generated web pages anyway.

I hope someone got some ideas what to do next :)

Janko

stephane ducasse wrote:
Thanks goran

I was thinking that I would get the stream contents and produce a static independent html file since
I cannot run any thing on the server (I cannot even access via ftp -- do not laugth).

Stef

On 8 janv. 06, at 23:53, goran@xxxxxxxxx wrote:

Hi fellas!

Cees De Groot <cdegroot@xxxxxxxxx> wrote:

Stephen Pair used to have a simple SSP package, I don't know where
it's gone... Apart from that, HV2 is probably the easiest thing
available, but not templating, it generates HTML in pretty much the
same fashion as Seaside.

On 1/8/06, stephane ducasse <stephane.ducasse@xxxxxxx> wrote:

So I would like to know if there is a simple templating package for
***purely static
dead with no objects plain HTML*** web pages.
Is HttpView2 such kind of beast?


HttpView2 is very simple and yes, IMHO it is such a beast - but it has
no included template mechanism currently. But hey - this is Smalltalk,
so it is a very small problem - and below is a link to a simple class
for templating.

With HV2 you would just do these things:

1. Create a subclass of HVTransientView.

2. Add a method called #default (in method category "urls" - important!)
and make it return something that responds to #asHttpResponse. In fact,
HTML in a String works just fine. You can use my MacroProcessor class if
you want to have something ASP-ish or whatever tickles your fancy. See:
http://squeak.krampe.se/MacroProc-gk.cs.gz

And then just do:

MyClass startOn: <port>

Done. :)

For other "pages" just implement other methods in the method category
"urls" - their name is the URL, like #hello would be
http://localhost:<port>/hello

regards, Göran
_______________________________________________
Seaside mailing list
Seaside@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
Seaside@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


--
Janko Mivšek
Svetovalec za informatiko
EraNova d.o.o.
Ljubljana, Slovenija
www.eranova.si
tel: 01 514 22 55
faks: 01 514 22 56
gsm: 031 674 565


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise