How to Implement a Website

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

How to Implement a Website

Richard Eng
Hi. I'm a Seaside/Smalltalk newbie. I've studied a number of tutorials and I've read quite a few blogs about Seaside. But I am still puzzled about how to implement a traditional website consisting of a number of webpages that are linked together (eg, homepage linked to "about us", homepage linked to "products", homepage linked to "contact us", etc.). You navigate these webpages by clicking on the various menu selections. But how do you implement that in Seaside?
 
Do you create a component for each webpage with its own renderContentOn: message? If so, how do you invoke a webpage component when you click on one of the menu anchors (eg, html anchor callback: [???] with: 'about us'.). Is this even the correct approach using Seaside?
 
Please forgive my newbie ignorance.
 
Thanks,
Richard

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

Lukas Renggli
> Do you create a component for each webpage with its own renderContentOn:
> message? If so, how do you invoke a webpage component when you click on one
> of the menu anchors (eg, html anchor callback: [???] with: 'about us'.). Is
> this even the correct approach using Seaside?

You will have a hard time building a traditional web site with
Seaside. Seaside's target is building dynamic Web Application. It is
possible though.

The Pier Content Management System that is built on top of Seaside and
available from SqueakMap allows you to compose such a site, without
writing a single line of code.

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

Richard Eng
I thought one of the advantages of Seaside was being able to do away with
HTML templates and to generate HTML programmatically. If a particular
webpage consists of a mix of HTML (from the traditional website) and a
dynamic web app, are you supposed to generate HTML just for this webpage?
How do you get your website to serve up *both* the traditional webpages and
the Seaside app? (I saw a blog that explained how to setup a virtual http
host and a Seaside server in Apache2, but I am unclear about the mechanism
by which traditional webpages and the dynamic app coexist.)

Thanks,
Richard

----- Original Message -----
From: "Lukas Renggli" <[hidden email]>
To: "Seaside - general discussion" <[hidden email]>
Sent: Friday, June 29, 2007 1:14 AM
Subject: Re: [Seaside] How to Implement a Website


>> Do you create a component for each webpage with its own renderContentOn:
>> message? If so, how do you invoke a webpage component when you click on
>> one
>> of the menu anchors (eg, html anchor callback: [???] with: 'about us'.).
>> Is
>> this even the correct approach using Seaside?
>
> You will have a hard time building a traditional web site with
> Seaside. Seaside's target is building dynamic Web Application. It is
> possible though.

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

Lukas Renggli
> I thought one of the advantages of Seaside was being able to do away with
> HTML templates and to generate HTML programmatically.

Yes, but programmatic HTML generation does not scale for static web
site, in my opinion. For dynamic web applications this is clearly an
advantage.

> If a particular
> webpage consists of a mix of HTML (from the traditional website) and a
> dynamic web app, are you supposed to generate HTML just for this webpage?

Pier was designed for that. It allows to combine static XHTML
(generated from a simple wiki syntax or using plain XHTML) and dynamic
Seaside components. I might be biased here, as I am the author of
Pier.

> How do you get your website to serve up *both* the traditional webpages and
> the Seaside app? (I saw a blog that explained how to setup a virtual http
> host and a Seaside server in Apache2, but I am unclear about the mechanism
> by which traditional webpages and the dynamic app coexist.)

There are certainly other possibilities. Basically you can use the
following expression to emit some static blocks of XHTML. I know of
very few use-cases though.

   html html: '<div>...</div>'

Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

RE: How to Implement a Website

Sebastian Sastre-2
In reply to this post by Richard Eng
Hi Richard,

        a couple of threads ago ("Best way to embedding Seaside in static
HTML?") was discussed about exactly this concern you have, may you want to
take a look at it.

        With Seaside the html is always a consequence of your Seaside
application so you will have to forget the approach of using it as a cause
(of a page). Also the experience of developing those applications will be *a
lot* like developing desktop applications (developing the causes of the
html). That is one of the key advantages of Seaside because it will be
tempting you (developer) to deploy desktop like applications that run in web
browsers.

        Said that, you can allways do "static windows" on desktop
applications. In seaside you can do that making components that render it's
content in the canvas. The problem of this is that is not *that* efficient
nor escalable as an apache serving files.

        To make the static efficient you can manage apache to serve static
content (html files and even resources like jpg, png, etc) and embbed (or
redirect) when proper your Seaside application (that you may want it look
the same with CSS).

        There is a blog post in the blog of Boris that will give you
technical details on how this is archieved (mostly apache conf stuff).

        Hope this helps, cheers,

Sebastian Sastre


> -----Mensaje original-----
> De: [hidden email]
> [mailto:[hidden email]] En nombre
> de Richard K Eng II
> Enviado el: Viernes, 29 de Junio de 2007 08:02
> Para: Seaside - general discussion
> Asunto: Re: [Seaside] How to Implement a Website
>
> I thought one of the advantages of Seaside was being able to
> do away with HTML templates and to generate HTML
> programmatically. If a particular webpage consists of a mix
> of HTML (from the traditional website) and a dynamic web app,
> are you supposed to generate HTML just for this webpage?
> How do you get your website to serve up *both* the
> traditional webpages and the Seaside app? (I saw a blog that
> explained how to setup a virtual http host and a Seaside
> server in Apache2, but I am unclear about the mechanism by
> which traditional webpages and the dynamic app coexist.)
>
> Thanks,
> Richard
>
> ----- Original Message -----
> From: "Lukas Renggli" <[hidden email]>
> To: "Seaside - general discussion"
> <[hidden email]>
> Sent: Friday, June 29, 2007 1:14 AM
> Subject: Re: [Seaside] How to Implement a Website
>
>
> >> Do you create a component for each webpage with its own
> renderContentOn:
> >> message? If so, how do you invoke a webpage component when
> you click on
> >> one
> >> of the menu anchors (eg, html anchor callback: [???] with:
> 'about us'.).
> >> Is
> >> this even the correct approach using Seaside?
> >
> > You will have a hard time building a traditional web site with
> > Seaside. Seaside's target is building dynamic Web Application. It is
> > possible though.
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

Richard Eng
Okay, as a Seaside/Squeak newbie, please forgive my stupid questions...

How do I embed or redirect to a Seaside app from within static html content?
I tried to find Boris' blog post concerning this but I was unsuccessful.

I looked at "Best way to embedding Seaside in static HTML?" but the iframe
technique seems problematic. The rest of the thread is over my head.

Is there not a "best practice" recommendation for how to mix static html and
Seaside components together? This would seem to me to be a common (the most
common!) way to develop a website. As I understand it, you want static html
to be served up by Apache for performance reasons, and Seaside for the
actual application (business logic).

And you want the Seaside app embedded within the static html content so that
you have a consistent look and feel for the entire website. This has to be
the canonical architecture for a website/web app, doesn't it?

Thanks.

Regards,
Richard


On 6/29/07 8:18 AM, "Sebastian Sastre" <[hidden email]> wrote:

> Hi Richard,
>
> a couple of threads ago ("Best way to embedding Seaside in static
> HTML?") was discussed about exactly this concern you have, may you want to
> take a look at it.
>
> With Seaside the html is always a consequence of your Seaside
> application so you will have to forget the approach of using it as a cause
> (of a page). Also the experience of developing those applications will be *a
> lot* like developing desktop applications (developing the causes of the
> html). That is one of the key advantages of Seaside because it will be
> tempting you (developer) to deploy desktop like applications that run in web
> browsers.
>
> Said that, you can allways do "static windows" on desktop
> applications. In seaside you can do that making components that render it's
> content in the canvas. The problem of this is that is not *that* efficient
> nor escalable as an apache serving files.
>
> To make the static efficient you can manage apache to serve static
> content (html files and even resources like jpg, png, etc) and embbed (or
> redirect) when proper your Seaside application (that you may want it look
> the same with CSS).
>
> There is a blog post in the blog of Boris that will give you
> technical details on how this is archieved (mostly apache conf stuff).
>
> Hope this helps, cheers,
>
> Sebastian Sastre
>
>
>> -----Mensaje original-----
>> De: [hidden email]
>> [mailto:[hidden email]] En nombre
>> de Richard K Eng II
>> Enviado el: Viernes, 29 de Junio de 2007 08:02
>> Para: Seaside - general discussion
>> Asunto: Re: [Seaside] How to Implement a Website
>>
>> I thought one of the advantages of Seaside was being able to
>> do away with HTML templates and to generate HTML
>> programmatically. If a particular webpage consists of a mix
>> of HTML (from the traditional website) and a dynamic web app,
>> are you supposed to generate HTML just for this webpage?
>> How do you get your website to serve up *both* the
>> traditional webpages and the Seaside app? (I saw a blog that
>> explained how to setup a virtual http host and a Seaside
>> server in Apache2, but I am unclear about the mechanism by
>> which traditional webpages and the dynamic app coexist.)
>>
>> Thanks,
>> Richard
>>
>> ----- Original Message -----
>> From: "Lukas Renggli" <[hidden email]>
>> To: "Seaside - general discussion"
>> <[hidden email]>
>> Sent: Friday, June 29, 2007 1:14 AM
>> Subject: Re: [Seaside] How to Implement a Website
>>
>>
>>>> Do you create a component for each webpage with its own
>> renderContentOn:
>>>> message? If so, how do you invoke a webpage component when
>> you click on
>>>> one
>>>> of the menu anchors (eg, html anchor callback: [???] with:
>> 'about us'.).
>>>> Is
>>>> this even the correct approach using Seaside?
>>>
>>> You will have a hard time building a traditional web site with
>>> Seaside. Seaside's target is building dynamic Web Application. It is
>>> possible though.
>>
>> _______________________________________________
>> Seaside mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
>
> _______________________________________________
> Seaside mailing list
> [hidden email]
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

Jimmie Houchin-3
Richard Eng wrote:

> Okay, as a Seaside/Squeak newbie, please forgive my stupid questions...
>
> How do I embed or redirect to a Seaside app from within static html content?
> I tried to find Boris' blog post concerning this but I was unsuccessful.
>
> I looked at "Best way to embedding Seaside in static HTML?" but the iframe
> technique seems problematic. The rest of the thread is over my head.
>
> Is there not a "best practice" recommendation for how to mix static html and
> Seaside components together? This would seem to me to be a common (the most
> common!) way to develop a website. As I understand it, you want static html
> to be served up by Apache for performance reasons, and Seaside for the
> actual application (business logic).
>
> And you want the Seaside app embedded within the static html content so that
> you have a consistent look and feel for the entire website. This has to be
> the canonical architecture for a website/web app, doesn't it?
[snip]

I too think this would be a nice feature.

It seems that it would be nice to be able to generate an html page which
could be served by Apache or web server of choice which contains the
static html (parts) of a web page with possibly a JS controller for
making the call and inserting the dynamic (Seaside) parts.

This would seeming help in a couple of ways. Offloading truly static
pieces to a high performance web server, static html, images, css, etc.
But allow the truly dynamic web app part to be seaside. This would
seemingly help performance of a Seaside site, and provide a potentially
reasonable way to implement a RESTful/bookmarkable interface to a
Seaside site.

I am not yet learned enough to understand all the implications, if and
where it would limit are cause problems in a Seaside web app. Or to
implement a best practices way of doing this. But I am interesting in
learning.

I believe this is a good discussion to have. If there are issues or
problems cause by such an idea, hopefully they will be disclosed. If not
maybe an implementation come for at some point in the future.

Just some thoughts.

Jimmie
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

Boris Popov, DeepCove Labs (SNN)
In reply to this post by Richard Eng
Re: [Seaside] How to Implement a Website

First rule of seaside club is to never optimize prematurely. Second rule of seaside club is to never optimize prematurely. In all seriousness one can already serve all resources with a plain web server, just dump them to disk when deploying and change resource URL on your root component to that location. Works great and let's you develop without apache, manage all files in source control system of choice etc.

Bookmarkable URLs are also possible, but its hard to get into much detail on a small keyboard, but there was plenty of talk on the list about it just a little while ago.

What I'm hinting at is this. Try to implement what you want in seaside and then check if you need to go the static route or not. Chances are you'll save yourself a lot of work :)

Cheers!

-Boris
(Sent from a BlackBerry)

----- Original Message -----
From: [hidden email] <[hidden email]>
To: Seaside - general discussion <[hidden email]>
Sent: Sun Jul 01 18:34:43 2007
Subject: Re: [Seaside] How to Implement a Website

Richard Eng wrote:
> Okay, as a Seaside/Squeak newbie, please forgive my stupid questions...
>
> How do I embed or redirect to a Seaside app from within static html content?
> I tried to find Boris' blog post concerning this but I was unsuccessful.
>
> I looked at "Best way to embedding Seaside in static HTML?" but the iframe
> technique seems problematic. The rest of the thread is over my head.
>
> Is there not a "best practice" recommendation for how to mix static html and
> Seaside components together? This would seem to me to be a common (the most
> common!) way to develop a website. As I understand it, you want static html
> to be served up by Apache for performance reasons, and Seaside for the
> actual application (business logic).
>
> And you want the Seaside app embedded within the static html content so that
> you have a consistent look and feel for the entire website. This has to be
> the canonical architecture for a website/web app, doesn't it?
[snip]

I too think this would be a nice feature.

It seems that it would be nice to be able to generate an html page which
could be served by Apache or web server of choice which contains the
static html (parts) of a web page with possibly a JS controller for
making the call and inserting the dynamic (Seaside) parts.

This would seeming help in a couple of ways. Offloading truly static
pieces to a high performance web server, static html, images, css, etc.
But allow the truly dynamic web app part to be seaside. This would
seemingly help performance of a Seaside site, and provide a potentially
reasonable way to implement a RESTful/bookmarkable interface to a
Seaside site.

I am not yet learned enough to understand all the implications, if and
where it would limit are cause problems in a Seaside web app. Or to
implement a best practices way of doing this. But I am interesting in
learning.

I believe this is a good discussion to have. If there are issues or
problems cause by such an idea, hopefully they will be disclosed. If not
maybe an implementation come for at some point in the future.

Just some thoughts.

Jimmie
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside


_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

Lukas Renggli
In reply to this post by Jimmie Houchin-3
> It seems that it would be nice to be able to generate an html page which
> could be served by Apache or web server of choice which contains the
> static html (parts) of a web page with possibly a JS controller for
> making the call and inserting the dynamic (Seaside) parts.

Nice idea.

Attached you find a ZIP Archive that embeds a Seaside application into
a static HTML site. For now it only handles links. Whenever a link is
clicked it triggers a XmlHttpRequest in the background. If anybody
wants to use form elements, this has to be implemented first.
Obviously, Ajax stuff should be avoided in the application.

Cheers,
Lukas

PS: If you want to try the attached code you need to make sure that
you serve static HTML and the Seaside application from the same
server, in my case I have the static files at
http://localhost/resources/seaside.html and the Seaside application is
served from http://localhost/seaside/examples/counter. This is
necessary because of security restrictions in Web Browsers.

--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

Lukas Renggli
Ehh, and the zip archive is here ...

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

seaside.zip (32K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

cbeler
In reply to this post by Lukas Renggli
Hi,

cool stuff :)

Just tried it on seasidehosting...  first display is ok but hitting
links doesn't refresh...

http://cdrick.seasidehosting.st/resources/seaside.html
http://cdrick.seasidehosting.st/resources/seasidemulti.html

first Get is ok, but then when hitting links, it appends _k and _s to
seaside.html instead of seaside/examples/counter (I think)...

GET http://cdrick.seasidehosting.st/seaside/examples/counter 
(77ms)prototype.js (line 1044)
GET
http://cdrick.seasidehosting.st/resources/seaside.html?_k=DKyPjZxx&_s=ZHJrwnwfWIgbMwzl&1 
(43ms)
GET
http://cdrick.seasidehosting.st/resources/seaside.html?_k=DKyPjZxx&_s=ZHJrwnwfWIgbMwzl&1 
(42ms)

Have I something wrong ?

Thanks

Cédrick

>
> Nice idea.
>
> Attached you find a ZIP Archive that embeds a Seaside application into
> a static HTML site. For now it only handles links. Whenever a link is
> clicked it triggers a XmlHttpRequest in the background. If anybody
> wants to use form elements, this has to be implemented first.
> Obviously, Ajax stuff should be avoided in the application.
>
> Cheers,
> Lukas
>
> PS: If you want to try the attached code you need to make sure that
> you serve static HTML and the Seaside application from the same
> server, in my case I have the static files at
> http://localhost/resources/seaside.html and the Seaside application is
> served from http://localhost/seaside/examples/counter. This is
> necessary because of security restrictions in Web Browsers.

Hi,
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

Lukas Renggli
> cool stuff :)

Attached you find a version of the JavaScript that also handles basic
forms. Still far from perfect, but it sort of works with most apps
now.

> Just tried it on seasidehosting...  first display is ok but hitting
> links doesn't refresh...

You need to make sure that the Seaside application generates full
absolute URLs. Else Web Browsers silently drop the requests because of
security concerns. In your case you need to specify
'cdrick.seasidehosting.st' as the server hostname in the config of
your application.

HTH,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

seaside.js (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to Implement a Website

Jimmie Houchin-3
In reply to this post by Lukas Renggli
Lukas Renggli wrote:

>> It seems that it would be nice to be able to generate an html page which
>> could be served by Apache or web server of choice which contains the
>> static html (parts) of a web page with possibly a JS controller for
>> making the call and inserting the dynamic (Seaside) parts.
>
> Nice idea.
>
> Attached you find a ZIP Archive that embeds a Seaside application into
> a static HTML site. For now it only handles links. Whenever a link is
> clicked it triggers a XmlHttpRequest in the background. If anybody
> wants to use form elements, this has to be implemented first.
> Obviously, Ajax stuff should be avoided in the application.

Thanks Lukas,

I'll look at giving it a try later, hopefully this evening.

Jimmie
_______________________________________________
Seaside mailing list
[hidden email]
http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside