Hi folks,
I'm about to take off on vacation for a couple of weeks, and I thought I'd say something about Seaside 2.0 before I go. I had hoped to release a decent preview before I left (and before ESUG), but it doesn't look like that's going to happen. But I'll tell you where we're at with it:
- Seaside 2.0 will be a full reimplementation. A primary goal is to loosen up the paradigm and support a wider set of styles than the strict component/template model enforced by current versions. To achieve this, it's structured in a series of small layers. If you use all of the layers, you get something fairly similar to the current framework; however, you can choose to dump the top layers and go off in a completely different direction if you prefer. I'm actually quite curious to see if anyone does this.
- The core layers are implemented and basically stable. I've been calling them, as a unit, "Borges". These include session management, html rendering with an event/callback system for forms and links, and a component system with snapshotting, embedding, and #callPage: similar to current versions of Seaside. What Borges doesn't include is any kind of high level presentation layer. However, it's an interesting base to play with, and would also be a good thing to start with for those interested in ports to other Smalltalks. Adventurous folk can get a snapshot from http://beta4.com/squeak/aubergines/source/Borges.st . There's not that much in the way of examples, but I'd be very interested in hearing comments from anyone who has time to play around with it. As for documentation, there's some information on the implementation at http://beta4.com/squeak/aubergines/docs/seaside/borges.html, but it is *not* intended for end users - it has more detail about the lower layers than most people will want, and doesn't cover components at all.
- We're currently doing a lot of experimentation with presentation layers. Although a templating system is in the works, the interesting stuff (for me anyway) has been in programmatic specification of interfaces - last weekend, for example, Julian and I hacked out a Tk-like layout manager for HTML tables, and I've been playing with somewhat Morphic-like view classes for listboxes and such. We've also been playing around with web-based interface builders, using forms to specify connections between components and templates. These tools will eventually become "Marquez", the top half of Seaside 2, but right now they're totally in flux.
I look forward to comments from y'all...
Cheers, Avi
Hi all, I'm testing Seaside and I found it very powerfull and easy to use. However I have a couple of questions.
Here I go:
1) If I have: Test>html ^'<img src="image.gif">'
where should I put the file "image.gif" to get it displayed on the browser ?
2) I have a jsp/asp background (and a little of zope) and I found that is much easier to write html code outside Squeak. Is there a way to use file based templates ? (I saw the class IAFileTemplate but I couldn't figure out how to use it).
Thanks, Pablo.-
PS 1: Sorry for my English, it's not my natural language. PS 2: I'm looking forward to see Seaside 2 !!
Pablo Iaria wrote:
Hi all, I'm testing Seaside and I found it very powerfull and easy to use. However I have a couple of questions.
Here I go:
If I have: Test>html ^'<img src="image.gif">'
where should I put the file "image.gif" to get it displayed on the
browser ?
you have to set the "Document Root" in the config-page. Enter the directory where your images are located. Then you can you have to use <img src="resource/image.gif">
(note the "resource/").
- I have a jsp/asp background (and a little of zope) and I found that is
much easier to write html code outside Squeak. Is there a way to use file based templates ? (I saw the class IAFileTemplate but I couldn't figure out how to use it).
sorry, never looked at it.
Cheers,
felix
Pablo Iaria wrote:
Hi all, I'm testing Seaside and I found it very powerfull and easy to use. However I have a couple of questions.
Here I go:
If I have: Test>html ^'<img src="image.gif">'
where should I put the file "image.gif" to get it displayed on the
browser ?
The easiest thing to do is:
html ^ '<img src="resource/image.gif">'
and then set a Document Root in the config page for your app. resource/* triggers an action that looks up the document root and pulls the file in from that directory.
- I have a jsp/asp background (and a little of zope) and I found that is
much easier to write html code outside Squeak. Is there a way to use file based templates ? (I saw the class IAFileTemplate but I couldn't figure out how to use it).
Yup, in your component, overide #template something like this:
template template ifNil: [template := IAFileTemplate new file: 'foo.html'. self addHandlers]. ^ template
Avi changed the handler stuff while I was on vacation and I've been working on Seaside 2 since I got back but I *think* that's right.
Thanks, Pablo.-
PS 1: Sorry for my English, it's not my natural language.
Seems pretty darn good to me :)
PS 2: I'm looking forward to see Seaside 2 !!
So are we! ;)
Hi Pablo,
I have not used Seaside for a while, the following tips could have changed with recent version of Seaside.
If I have: Test>html ^'<img src="image.gif">'
where should I put the file "image.gif" to get it displayed on the
browser ?
- You must have a static content server (Comanche is able to do this) - You must configure the "Document Root" of your application in Seaside to point to your static content server.
- I have a jsp/asp background (and a little of zope) and I found that
is much easier to write html code outside Squeak. Is there a way to use file based templates ? (I saw the class IAFileTemplate but I couldn't figure out how to use it).
In your component define the following method:
template ^ IAFileTemplate new file: 'toto.html'; bindWith: [:t | self addBindingsTo: t]
Alain Fischer wrote:
Hi Pablo,
I have not used Seaside for a while, the following tips could have changed with recent version of Seaside.
Indeed they have a little. You must not have seen my reply yet but I'll comment a little more here on the differences for those who care.
If I have: Test>html ^'<img src="image.gif">'
where should I put the file "image.gif" to get it displayed on the
browser ?
- You must have a static content server (Comanche is able to do this)
- You must configure the "Document Root" of your application in Seaside to point to your static content server.
This is a little outdated. In Seaside 0.93 we used a URL as the document root and if you made an img tag dynamic (@src="..." instead of src="...") then it would prepend the URL of the document root to the image name. As of 0.94, though, image tags do not need to be dynamic, they work be noticing the "resource/" portion of the URL and looking up the Document Root which is now a filesystem path. Note that this trick also work with <a href="resource/foo">Link to foo</a>
- I have a jsp/asp background (and a little of zope) and I found that is
much easier to write html code outside Squeak. Is there a way to use file based templates ? (I saw the class IAFileTemplate but I couldn't figure out how to use it).
In your component define the following method:
template ^ IAFileTemplate new file: 'toto.html'; bindWith: [:t | self addBindingsTo: t]
Again, this code works in 0.93 but is slightly different with 0.94.x
#bindWith: is no longer used and a call to #addHandlers is used instead of #addBindingsTo:. Also, the template is stored in an instvar and should be created only when the instvar is nil. The instvar gets set to nil whenever the template needs to be flushed (with a file template, basically only if you change the #addHandlers method). IAFileTemplate itself implements a check to see whether the file on disk has changed since it was last loaded and reloads it if necessary.
Julian
Thanks a lot for answering !
Unfortunately it didn't works as expected....
I have a html file with: <html> <body> <mytestcomponent sea:id="testing"></mytestcomponent> </body> </html>
I set the "Document Root" property with the file path and I added the "template" method you told me earlier but I got the "MessageNotUnderstood: children" message.
Am I doing something wrong ? or this feature is not working any more ?
Thanks, Pablo.-
----- Original Message ----- From: "Julian Fitzell" julian@beta4.com To: seaside@lists.squeakfoundation.org Sent: Tuesday, August 13, 2002 4:45 PM Subject: Re: [Seaside] Newbie questions
Alain Fischer wrote:
Hi Pablo,
I have not used Seaside for a while, the following tips could have
changed
with recent version of Seaside.
Indeed they have a little. You must not have seen my reply yet but I'll comment a little more here on the differences for those who care.
If I have: Test>html ^'<img src="image.gif">'
where should I put the file "image.gif" to get it displayed on
the
browser ?
- You must have a static content server (Comanche is able to do this)
- You must configure the "Document Root" of your application in Seaside to point to your static content server.
This is a little outdated. In Seaside 0.93 we used a URL as the document root and if you made an img tag dynamic (@src="..." instead of src="...") then it would prepend the URL of the document root to the image name. As of 0.94, though, image tags do not need to be dynamic, they work be noticing the "resource/" portion of the URL and looking up the Document Root which is now a filesystem path. Note that this trick also work with <a href="resource/foo">Link to foo</a>
- I have a jsp/asp background (and a little of zope) and I found that
is
much easier to write html code outside Squeak. Is there a way to use
file
based templates ? (I saw the class IAFileTemplate but I couldn't figure out how to use it).
In your component define the following method:
template ^ IAFileTemplate new file: 'toto.html'; bindWith: [:t | self addBindingsTo: t]
Again, this code works in 0.93 but is slightly different with 0.94.x
#bindWith: is no longer used and a call to #addHandlers is used instead of #addBindingsTo:. Also, the template is stored in an instvar and should be created only when the instvar is nil. The instvar gets set to nil whenever the template needs to be flushed (with a file template, basically only if you change the #addHandlers method). IAFileTemplate itself implements a check to see whether the file on disk has changed since it was last loaded and reloads it if necessary.
Julian
julian@beta4.com Beta4 Productions (http://www.beta4.com)
Seaside mailing list Seaside@lists.squeakfoundation.org http://lists.squeakfoundation.org/listinfo/seaside
Hi Pablo,
Pablo Iaria wrote:
Thanks a lot for answering !
Unfortunately it didn't works as expected....
I have a html file with:
<html> <body> <mytestcomponent sea:id="testing"></mytestcomponent> </body> </html>
I set the "Document Root" property with the file path and I added the "template" method you told me earlier but I got the "MessageNotUnderstood: children" message.
changing the method to:
template template ifNil: [template := IAFileTemplate new file: 'foo.html'; model: self. self addHandlers]. ^ template
worked for me. (model: self is used in IAPage>>template)
Cheers,
felix
Am I doing something wrong ? or this feature is not working any more ?
Thanks, Pablo.-
Felix Franz wrote:
Hi Pablo,
Pablo Iaria wrote:
Thanks a lot for answering !
Unfortunately it didn't works as expected....
I have a html file with:
<html> <body> <mytestcomponent sea:id="testing"></mytestcomponent> </body> </html>
I set the "Document Root" property with the file path and I added the "template" method you told me earlier but I got the "MessageNotUnderstood: children" message.
changing the method to:
template template ifNil: [template := IAFileTemplate new file: 'foo.html'; model: self. self addHandlers]. ^ template
worked for me. (model: self is used in IAPage>>template)
Yup, you got it exactly right... I was modifying code from an older example and missed that change...
But, in the process of testing to find that I've found another problem... If you modify a file-based template then you get errors when it gets reloaded until you start a new session... I'm looking to see if I can find a fix.
Julian
Julian Fitzell wrote:
Felix Franz wrote:
Hi Pablo,
Pablo Iaria wrote:
Thanks a lot for answering !
Unfortunately it didn't works as expected....
I have a html file with:
<html> <body> <mytestcomponent sea:id="testing"></mytestcomponent> </body> </html>
I set the "Document Root" property with the file path and I added the "template" method you told me earlier but I got the "MessageNotUnderstood: children" message.
changing the method to:
template template ifNil: [template := IAFileTemplate new file: 'foo.html'; model: self. self addHandlers]. ^ template
worked for me. (model: self is used in IAPage>>template)
Yup, you got it exactly right... I was modifying code from an older example and missed that change...
But, in the process of testing to find that I've found another problem... If you modify a file-based template then you get errors when it gets reloaded until you start a new session... I'm looking to see if I can find a fix.
Actually, I think a cleaner way to do this would be to override buildTemplate:
buildTemplate template _ IAFileTemplate new file: 'c:\foo\bar.html'; model: self. self addHandlers.
It also seems that I was wrong and it does not use the document root so you should give a full path to the template. As you can see no one much has been using this lately :) I do think it's an important feature though.
I've filed bug #106 (http://bugs.beta4.com/view_bug_advanced_page.php?f_id=0000106) about the reloading problems.
That said, I am in the process of working on templates and stuff in Seaside 2. If anyone has any suggestions about how confiuration for paths for templates, etc should work I'd be happy to hear them.
Obvious options are:
1) always give a full path to a template 2) always put them in a teplates/ folder in the squeak dir or something 3) something else? Templates are associated with a component more than an application so configuring it in the application config app (like the document root) doesn't make a whole lot of sense.
Julian
seaside@lists.squeakfoundation.org