Lukas Renggli piše:
Hi Janko,
first of all: Thank you very much for your help!
Always here :) I really like to join fragmented Smalltlak forces, and on
web fornt I can help a bit ..
server := Swazoo.HTTPServer new.
server addSite: self defaultWikiSite.
server port: 8080.
server ip: '*'.
server start.
Swazoo philosophy is a bit different as you start above. You first
make a new Site, configure host: ip: port: combination, and then
start it. This will start appropriate HTTPServer automatically. This
also makes possible to run many wikis on the same Swazoo server, and
not only wikis, you can run other resources (like AIDASite) in
parallel. Very usefull for hosting a lot of sites on the same server.
Admins love that :)
Ok, I see! This is something like the virtual host configuration of
Apache. The reason why we start and configure swazoo from code and do
not use the configuration file is the following:
1. SmallWiki should be running out of the box, just by loading
the source from StORE. We do not want that people have to
modify external files before they are able to run it.
Agree a lot. I also drop configuration files from new AIDA/Web.
2. We want to stay independent of any external library. So
web-servers, storage, etc. should be pluggable in our wiki.
Here I do not agree. This is ok for standalone Wiki but no for a Wiki as
part of entire site, which is my ideal.
My ideal soluion would therefore be:
- create a new Site
- add it to SiteRegistry (SwazooServer in new, not yet released Swazoo)
- add SwazooWiki (as subclass of Resource) to above site
If you compose your Wiki that way, I can use it in AIDA/Web straight away!
So, in my new AIDA/Web with integrated Swazoo I
start a thing that way:
site := AIDASite new name:'eranova';
host: 'www.eranova.si' ip: 'mici-web.eranova.si' port: 80.
SwazooServer singleton addSite: site.
SwazooServer startSite: 'eranova'
So AIDASite is a subclass of Site, I think. Until now I did use
Resource as superclass for my SwazooWikiSite. Do you think I should
change this?
Probably yes, because Site holds SiteIndentifier (host:ip:port:
combination) for virtual sites. But I recommend to go in a way above,
that is, to subclass a Resource (CompositeResource?) with SwazooWiki and
add it to a Site, which is created first of course.
The main problem is that I parse and analyze the url all by myself.
Actually I do not care if there are additional path elements before.
But when overriding the message #answerTo: of the Site-class it does
not work! Do I have to change something else?
You can make your own Url resolution if you want in your Wiki resource.
That way I did my new AIDA/Web, which also have its own url resolution.
Overriding answerTo: should work, just be carefull to return a proper
HTTPResponse.
Janko
Thanks again for your help
Lukas
--
Janko Mivsek
Systems Architect
EraNova d.o.o.
Ljubljana, Slovenia
http://www.eranova.si