Configuration with VisualWorks?

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

Configuration with VisualWorks?

Roland Hochmuth
Seaside Users, I've just started out with Seaside and Smalltalk. I'm  
using VisualWorks 7.4. I've had no problems downloading Seaside and  
running the examples or even adding new apps/components to the pre-
configured seaside web site. So far, I'm very impressed!!! Initially,  
I had the site automatically created by the AAADocumentation class.

What I would like to do now is create my own WEB site with it's own  
root directory, not in the $(VISUAL_WORKS_HOME)/web/examples  
directory, but I'm missing something on how to configure this. I've  
gone through the VW WEB development example and created a new web  
site by modifying webtools.ini and creating a foo-site.ini, but I'm  
not able to connect this up to Seaside. So then I tried another  
approach to creating a new site, by borrowing code from  
AAADocumentation and changing these around a little to create a new  
WEB site, but all I can display is the readme.html in the browser,  
which is the default home page.

So I guess I'm looking for possibly a little explanation or cookbook  
on how to get going. Does anyone have any pointers or suggestions?

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

Re: Configuration with VisualWorks?

Michel Bany-3

On 05 Mar 2006, at 00:32 , Roland Hochmuth wrote:

Seaside Users, I've just started out with Seaside and Smalltalk. I'm using VisualWorks 7.4. I've had no problems downloading Seaside and running the examples or even adding new apps/components to the pre-configured seaside web site. So far, I'm very impressed!!! Initially, I had the site automatically created by the AAADocumentation class.

What I would like to do now is create my own WEB site with it's own root directory, not in the $(VISUAL_WORKS_HOME)/web/examples directory, but I'm missing something on how to configure this. I've gone through the VW WEB development example and created a new web site by modifying webtools.ini and creating a foo-site.ini, but I'm not able to connect this up to Seaside. So then I tried another approach to creating a new site, by borrowing code from AAADocumentation and changing these around a little to create a new WEB site, but all I can display is the readme.html in the browser, which is the default home page.

So I guess I'm looking for possibly a little explanation or cookbook on how to get going. Does anyone have any pointers or suggestions?

Here is a first small recipee.

1) Create your site root directory
for instance /mysite

2) Add a file to your root directory
for instance /mysite/mysite.ini
this file contains the parameters for the site
see default-site.ini for an example
see also documentation for possible options and their meanings
(WebAppDevGuide.pdf), mainly chapter 5

You may want to define a logical name like this
go = servlet/SeasideServlet

The environment parameter is for the namespace, probably
environment = Seaside

3) Add a line at end of webtools.ini in the VW Web folder
to link the site name to the file above
assuming the site name is "abcd" :
abcd = /mysite/mysite.ini

4) If VisualWorks is already running, navigate to http://localhost:8008
that will take you to the web server configuration page
select the "Manage Server" tab
click "Reset Server" to force re-read webtools.ini
or start your VW image

5) Navigate to your new site
if you defined the logical name, the url is shorter :

6) If you prefer shorter urls
You may want to try with the parcel named SeasideShortPath
located in the BonusPack folder
Then navigate to

HTH
Michel.





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

Configuration with VisualWorks?

Roland Hochmuth
Hi Michel, Thank you for your very detailed reply. I think I'm almost  
there. I've gone through your instructions and created a WEB site.  
However, when I enter

     http://localhost:8008/abcd/servlet/SeasideServlet/myapp

nothing appears until I go to

         http://localhost:8008/abcd/servlet/SeasideServlet/config

and use "add entry point".

What I've done in VW is create a new package and namespace. In the  
new namespace I've created a new class that inherits from WAComponent  
and added the method "canBeRoot"

So then I toggled halos on the .../config WEB page and discovered  
that the "config" page was displaying the component  
WADispatcherEditor. And sure enough, looking at renderContentOn for  
class WADispatcherEditor I see that addEntryPoint is a callback. So  
it t looks like WADispatcherEditor is just a WAComponent too. Very  
cool! I could continue to manually enter my sites using the config  
page, but now I'm wondering how WADispatcherEditor got bootstrapped  
and why my application didn't just show up as opposed to  
WADispatcherEditor which was somehow connected to the "config" page.  
I'm thinking that if I wanted to just have my app "appear" rather  
than being manually entered at "config" then I should just invoke  
addEntryPoint from the initialize method in the new application  
component. Also, I guess that class SeasideServlet dispatches to  
WADispatcherEditor somehow, but I don't see the connection right now.

Any more suggestions or pointers as to what I should look at and what  
the preferred method is?

Regards --Roland

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

Re: Configuration with VisualWorks?

Michel Bany-3

On 07 Mar 2006, at 07:47 , Roland Hochmuth wrote:

> Hi Michel, Thank you for your very detailed reply. I think I'm  
> almost there. I've gone through your instructions and created a WEB  
> site. However, when I enter
>
>     http://localhost:8008/abcd/servlet/SeasideServlet/myapp
>
> nothing appears until I go to
>
>         http://localhost:8008/abcd/servlet/SeasideServlet/config
>
> and use "add entry point".
>
> What I've done in VW is create a new package and namespace. In the  
> new namespace I've created a new class that inherits from  
> WAComponent and added the method "canBeRoot"
>

If you want to avoid the "add entry point" manual step and do it  
programmatically,
you need to add the #initialize *class* method to the root component  
of your app

        initialize
                self registerAsApplication: 'myapp'.

After you saved the #initialize method, make sure you manually  
initialize the root
component class using the Class menu in the RB (=System Browser).  
Note that
you only need to perform the manual class initialization just once :  
next time the
class is loaded into the image the class initialization will be  
automatic.


> So then I toggled halos on the .../config WEB page and discovered  
> that the "config" page was displaying the component  
> WADispatcherEditor. And sure enough, looking at renderContentOn for  
> class WADispatcherEditor I see that addEntryPoint is a callback. So  
> it t looks like WADispatcherEditor is just a WAComponent too. Very  
> cool! I could continue to manually enter my sites using the config  
> page, but now I'm wondering how WADispatcherEditor got bootstrapped  
> and why my application didn't just show up as opposed to  
> WADispatcherEditor which was somehow connected to the "config"  
> page. I'm thinking that if I wanted to just have my app "appear"  
> rather than being manually entered at "config" then I should just  
> invoke addEntryPoint from the initialize method in the new  
> application component. Also, I guess that class SeasideServlet  
> dispatches to WADispatcherEditor somehow, but I don't see the  
> connection right now.
>

You should be able to verify that the WADispatcherEditor class does  
register
itself in its #initialize class method. That will surely make  
everything clear to you.
Note that you are allowed to register the same component as the root  
component
for many different applications, with different names.

You may want to place a breakpoint at the beginning of  
SeasideServlet>>handle:response:
and use the debugger to find out how the dispatching is done.

Enjoy,
Michel.

> Any more suggestions or pointers as to what I should look at and  
> what the preferred method is?
>
> Regards --Roland
>
> _______________________________________________
> 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