A new action for having all the comment of classes and methods of SmallWiki:
Also there were some mistakes on all the action-related wiki. Lukas and I have changed it for using the registration mechanism instead of changing directly the class Page.
I would be very very pleased if I have some comments/english correction/code reviewing...
Alexandre Bergel http://www.iam.unibe.ch/~bergel
> I did a pass on all the how to and I'm worried about the use of
We could avoid this using a second visitor implementing #acceptPage:
and #acceptFolder. This is necessary because these messages are already
implemented for a different purpose in VisitorRenderHtmlLight.
NewVisitor new visit: action structure
self displayFolderStatistic: structure
self displayPageStatistic: structure
> Alex I really think that we need to have a document explaining the
> design of SmallWiki, can you ask lukas his pictures so that we can
> have a document for the next lecture.
Unfortunately I did not got very far with the documentation that I
should write one day. Although there are some class-comments in the
most important classes as WikiItem, Action, HtmlWriteStream, Structure,
is available on: http://kilana:9090/HowTos/AddinganewVisitor/
I deal mainly with visitors.
The example is how to build a statistic component showing how many children a folder has, or how many characters a page contains.
Smallwiki is really cool!
Alexandre Bergel http://www.iam.unibe.ch/~bergel
> I'm trying to implement a LikePagesAction for pages, that will list
> all the pages that start and end with the same words as a current
> pages. But i don't know how to collect all the pages in a folder from
> a children page ...
Inside the action write something list this:
structure parent children collect: [ :child |
structure. "the structure the action is executed on"
structure parent. "the parent folder of the structure the action is
structure parent children. "the children of the parent folder ..."
Alexandre, I replay this mail e-mail to the mailing-lists as others are
probably also interested in those questions.
> I would like to play with resource, but I am stop by some issues:
> - What Mimetype means?
The mime-type describes the type of a file in a platform independent
manner. The browser needs this information to know how to display the
If you like to know more about the internals of the http-protocol I
suggest to read the standard-documentation. There you will find also
references to documents about the mime-type standard:
Hypertext Transfer Protocol -- HTTP/1.1
> - and Embedding?
This i-var is a boolean telling the renderer ...
true: to try to embed the resource in the document
false: to make a link to the resource.
Note that current browser only support to embed images, videos and
sound into a web-pages. For pdf- and other binary-files, a link will be
This is something that will go away in one of the next versions. I
think it should be the responsibility of the InternalLink and not of
the Resource itself to decide about the link generation. Implementing
this I was a bit lacy, you see ;-)
> - how could I see all the files attached to a resource (within the
> web browser)?
Only one file can be attached to a given resource. To find out all the
pages using a resource you start a visitor:
visitor := VisitorReferences startAt: server root to: myResource.
visitor collection inspect.
Those references are calculated automatically in the class
TemplateStructuresReferences for the currently browsed page. The
standard wiki-layout displays this data below the actions, if there are
> - If I load an image, how could I see it?
If you want to include an image into your page:
1. create a page and create a new link
2. create a resource from that link
3. edit the resource and upload your image
4. going back to your page should display your resource
> I have tried to upload a binary file (such as a .pdf file), but I
> could not manage to download it afterward (by clicking on the
> reference of the resource).
So I assume that your browser doesn't send the mime-type when
uploading. That is :-( and therefor you have to set the mime-type
> I have put the mime type applica/x-zip-comp but it doesn't effect
The mime-type you give is not a valid one. Use the following one for a
pdf-files and it should work:
For further reference see:
> But anyway, just having a method such as:
> defaultFullName := self defaultFilename, '.im'.
> s := Filename defaultDirectory filenamesMatching: defaultFullName.
> s isEmpty not ifTrue: [ s first renameTo: (defaultFullName, '.old')].
> snapshotAs: self filename
> thenQuit: false
> What do you think? Should I update Smallwiki with this modification?
Sure, just go on! I have to do some c-pointer-arithmetic-exercises
right now, so there will be no conflict with SmallWiki StORE ;-)
>>> 2--How could we manage to upgrade Smallwiki by keeping all the pages
>>> A simple solution would be to use a SIXX storage, upgrading the
>>> and reloading the SIXX XML file.
>> Just load the new release from StORE while Smallwiki is running!
>> Everything should update and run just fine.
> Wow, store is really great :-)
This is a feature of Smalltalk ;-)