[For Lukas and Steph] Last time with Gabriela we have coded together the Page visited component. We get stuck because we put a method such as:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Page>>accept: aVisitor
aVisitor acceptPage: self.
(self template propertyAt: #visitedPages) addPage: self
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
The result was the component reference all the pages of the wiki, even if we display it or not.
I understood why. A page is not only visited by a rendered visitor, by also by VisitorReferences.
So, a code something like works:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Page>>accept: aVisitor
aVisitor acceptPage: self.
(aVisitor isKindOf: VisitorRenderer) ifTrue: [
(self template propertyAt: #visitedPages) addPage: self]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Okay, now I have some questions:
1- What is the meaning of VisitorReferences,
2- What is the meaning of TemplateReferences
The both question are nearly the same, but I do not have so much time to dive in the code.
My guess is it is needed for the saving mechanism...
and the last one:
3- A page should get a reference so the component for being referenced when visited. In the previous code "self template" return the __root__ of the template structure. So, our first idea was to add a property in the root for referencing the component. But, we need to modify such method. And I admit it is not homogenous :-)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
defaultTemplate
| ans v |
ans := TemplateRoot
child: (TemplateContainerRows new
add: (TemplateStringTitleWiki new);
add: (TemplateContainerColumns new
add: (TemplateStructuresPath new);
add: (TemplateHeatBox new);
yourself);
add: (TemplateContainerColumns new
add: (TemplateContainerRows new
add: (TemplateActionsCustom new);
add: (TemplateStructuresReferences new);
add: (v := TemplateVisitedPages new);
yourself);
add: (TemplateContainerRows new
add: (TemplateStringTitleAction new);
add: (TemplateStringContent new);
yourself);
yourself);
add: (TemplateStringAbout new);
yourself).
ans propertyAt: #visitedPages put: v. "<=======Here a new line !!!!"
^ ans
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Lukas, tell me what do you think about this way for letting a page to access a component...
I think it is not bad...
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.iam.unibe.ch/~bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi,
I have added a new type of storage that is much faster than the one
using SIXX. Of course the SIXX serialization could be optimized and it
could be done in a background thread, but still it seems to be not very
efficient.
It is amazing: Saving the image costs less than a second on my machine,
even with a wiki that has got thousands of pages and several folders
with copies of my presentation.
To enable the new storage execute the following code
server storage: ImageStorage new.
and a file called "smallwiki.im" in your image-directory will be
generated every half an hour if something changed. Of course the
storage-type might be swapped on the fly (hot-swap).
Alexander told me that the XML-file of the running server is already
over 1 MB. And I have my concerns that the VW XML-parser is able to
handle very such large files to read it in. Therefore I think dumping
the image scales far better and is more save, as it simpler and has
been working for years now.
Cheers
Lukas
--
Lukas Renggli
http://renggli.freezope.org
Hi Janko,
first of all: Thank you very much for your help!
>> 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.
2. We want to stay independent of any external library. So
web-servers, storage, etc. should be pluggable in our wiki.
> 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?
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?
Thanks again for your help
Lukas
--
Lukas Renggli
http://renggli.freezope.org
Hi Janko,
as you know from past discussions, I am developing a new Smalltalk-Wiki
using Swazoo as web-server. Stéphane Ducasse is starting a lecture the
next week about Smalltalk using the Wiki as code-base for extensions
developed by the students. So what we need urgently now is to get a
public Server running.
Unfortunately we experience some very strange problems with Swazoo: We
are using a Linux box with VisualWorks 7 as server and there seems to
be a problem to connect the server from certain machines. For localhost
and some other external machines it works perfectly.
So what we thought about first, is that it could be an internal problem
of the network of the university (firewall, subnet, ...). But that does
not seem to be the case, as when we set up Apache on the same machine
and port we are able to connect perfectly from anywhere.
What I am doing to start the server is basically the following:
server := Swazoo.HTTPServer new.
server addSite: self defaultWikiSite.
server port: 8080.
server ip: '*'.
server start.
We are unsure about the message #ip: that is not documented anywhere.
To what kind of value should it be set? Or is there a completely
different problem we don't see? Your help is really appreciated!
Thanks a lot in a
Lukas
--
Lukas Renggli
http://renggli.freezope.org
Hi janko
As you know now we are building a really really cool wiki on top of
Swazoo. Now I have doubt that
the problem comes from swazoo but from our admin people. My main
problem is that I'm null in network
so I cannot help there to know if the port is open or not.
Have you experienced problems with Swazoo not listening well? which
tests should we run to help you evaluating our problem?
I have based all our lecture on SmallWiki so if SmallWiki does not work
we are fucked.
The lecture starts next week and I do not know what to do.
Alex will dive into Swazoo to check from where the problem is coming
Stef
Prof. Dr. Stéphane DUCASSE (ducasse(a)iam.unibe.ch)
http://www.iam.unibe.ch/~ducasse/
"if you knew today was your last day on earth, what would you do
different? ... especially if,
by doing something different, today might not be your last day on
earth" Calvin&Hobbes
"The best way to predict the future is to invent it..." Alan Kay.
Open Source Smalltalks: www.squeak.org,
www.gnu.org/software/smalltalk/smalltalk.html
Free books for Universities at
http://www.esug.org/sponsoring/promotionProgram.html
Free Online Book at www.iam.unibe.ch/~ducasse/FreeBooks.html
Hi everybody,
I cleaned up the two examples we have so far. Make sure that you have a
working SmallWiki in your image and then load the following extension
packages from StORE.
SmallWiki Glossary
Example how to create a completely new component with
a new action to render its html-view and a visitor to collect
some data in the wiki.
SmallWiki Presentation
This example shows how to create a wiki using smalltalk
code. There is also a special rendering-visitor for the big
fonts and navigation controls. Note that you won't actually
be able to use this package as you need the images of my
slides on your machine.
More examples are expected to come soon ;-)
Cheers
Lukas
--
Lukas Renggli
http://renggli.freezope.org
Lukas Renggli <renggli(a)student.unibe.ch> wrote:
> Hi all,
>
> The new template-system is now ready to use. Unfortunately I had no
> time to write tests yet. It was quite a lot of work to do.
>
> Another drawback is that there is no web-interface to change the
> rendering and template-properties anymore.
No big deal. I like the easy to use Smalltalk text interface you give
below.
> But one can easily do it
> from the workspace. Just to give you an idea how to use it, I have
> attached a dump of my workspace at the end of the e-mail.
>
I'm really awaiting a first alpha or beta release!
-- Hannes
>
> "server"
> server := SmallWiki.SwazooServer startOn: 8080.
> server root: server defaultRoot.
> server stop.
>
> "storage"
> server storage: SIXXStorage new.
> server storage: ImageStorage new.
>
> "designs"
>
> "basic"
> server root renderer: VisitorRendererHtml.
> server root template: VisitorRendererHtml defaultTemplate.
>
> "light"
> server root renderer: VisitorRendererHtmlLight.
> server root template: VisitorRendererHtmlLight defaultTemplate.
>
> "wiki works"
> server root renderer: VisitorRendererHtmlWikiWorks.
> server root template: VisitorRendererHtmlWikiWorks defaultTemplate.
>
> "options"
> HtmlWriteStream prettyPrint: false.
> HtmlWriteStream prettyPrint: true.
>
> --
> Lukas Renggli
> http://renggli.freezope.org
Hi all,
The new template-system is now ready to use. Unfortunately I had no
time to write tests yet. It was quite a lot of work to do.
Another drawback is that there is no web-interface to change the
rendering and template-properties anymore. But one can easily do it
from the workspace. Just to give you an idea how to use it, I have
attached a dump of my workspace at the end of the e-mail.
Stef: Could you tell me, when I should come for the presentation on
Monday?
Cheers
Lukas
--
"server"
server := SmallWiki.SwazooServer startOn: 8080.
server root: server defaultRoot.
server stop.
"storage"
server storage: SIXXStorage new.
server storage: ImageStorage new.
"designs"
"basic"
server root renderer: VisitorRendererHtml.
server root template: VisitorRendererHtml defaultTemplate.
"light"
server root renderer: VisitorRendererHtmlLight.
server root template: VisitorRendererHtmlLight defaultTemplate.
"wiki works"
server root renderer: VisitorRendererHtmlWikiWorks.
server root template: VisitorRendererHtmlWikiWorks defaultTemplate.
"options"
HtmlWriteStream prettyPrint: false.
HtmlWriteStream prettyPrint: true.
--
Lukas Renggli
http://renggli.freezope.org
Hi Roel,
there is really something wrong with the SIXX-bundle as VW is unable to
load it into a fresh image. I tried now almost an hour to get it
running, but I always get the same error when loading in a new image:
Warning: Package "SIXX-VW" cannot be loaded.
The following classes cannot be loaded because their
environment is not in the image nor in the package
being loaded:
SixxPortableUtil (environment path: Root.Smalltalk.Sixx)
Color (environment path: Root.Smalltalk.Sixx)
Do you have any idea, what the problem could be?
Thanks for your help,
Lukas
--
Lukas Renggli
http://renggli.freezope.org
Hello
When I load SmallWiki, VW asks me with release of SIXX I want. If I select 3.0 I get the following:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Warning: Package "SIXX-VW" cannot be loaded.
The following classes cannot be loaded because their environment is not in the image nor in the package being loaded:
SixxPortableUtil (environment path: Root.Smalltalk.Sixx)
Color (environment path: Root.Smalltalk.Sixx)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
So, I use the 2.0 release. As fas as I have seen, it doesn't make any difference...
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Bergel Alexandre http://www.iam.unibe.ch/~bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.