A new action for having all the comment of classes and methods of SmallWiki:
http://kilana.unibe.ch:9090/HowTos/
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
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.iam.unibe.ch/~bergel
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
Hi all,
i just found a nice way to use a real editor like emacs for a Wiki.
I have installed the w3m emacs mode (http://emacs-w3m.namazu.org/), so i have the
emacs power with the power of w3m that typeset HTML as plain text.
It works nice with SmallWiki.
--
Serge Stinckwich -< ) multiagent.com
Université de Caen>CNRS UMR 6072>GREYC>MAD /~\ squeak.orghttp://www.iutc3.unicaen.fr/serge/ (/ | zope.org
Smalltalkers do: [:it | All with: Class, (And love: it)] _|_/ debian.org
> I did a pass on all the how to and I'm worried about the use of
> isKindOf:
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.
VisitorRendererHtmlLight>>acceptTemplateStatistic: aTemplate
NewVisitor new visit: action structure
NewVisitor>>acceptFolder: aStructure
self displayFolderStatistic: structure
NewVisitor>>acceptPage: aStruture
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,
...
Lukas
--
Lukas Renggli
http://renggli.freezope.org
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
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
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 |
... ].
Additional information:
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 ..."
HTH
Lukas
--
Lukas Renggli
http://renggli.freezope.org
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
resource.
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
http://www.ietf.org/rfc/rfc2616.txt
> - 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
generated instead.
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
any references.
> - 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
Cheers
Lukas
--
Lukas Renggli
http://renggli.freezope.org
> 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
manually.
> I have put the mime type applica/x-zip-comp but it doesn't effect
> anything...
The mime-type you give is not a valid one. Use the following one for a
pdf-files and it should work:
application/pdf
For further reference see:
http://www.asahi-net.or.jp/en/guide/cgi/mimetype.html
Cheers
Lukas
--
Lukas Renggli
http://renggli.freezope.org
> But anyway, just having a method such as:
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
> =-=
> privateSnapshotImage
> defaultFullName := self defaultFilename, '.im'.
> s := Filename defaultDirectory filenamesMatching: defaultFullName.
> s isEmpty not ifTrue: [ s first renameTo: (defaultFullName, '.old')].
>
> ObjectMemory
> 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
>>> stuff,
>>> 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 ;-)
Lukas
--
Lukas Renggli
http://renggli.freezope.org