* How do I create a LaTex-Document with the content of a SmallWiki?
Which expression do I have to evaluate?
- load the bundle SmallWiki Examples
- in the SmallWiki workspace inspect server root and navigate to the
page you want to turn into latex (currently the visitors do not support
rendering a whole wiki at once, but this could be changed easily)
- inspect one of the following the expression in the evaluation-pane:
(VisitorRendererLatex render: self) contents
VisitorRendererLatex render: self on: aStream
* How do I create one large XHTML file with the content of a SmallWiki?
This is basically the same as above, you just have to use
VisitorRendererHtml instead. It is not needed to load the
examples-bundle as this functionality is provided by the core-system
already. Support for rendering multiple pages is also missing
right-now, there was no need to do this up-to now (calling super
acceptFolder: aFolder in VisitorRendererHtml>>acceptFolder: aFolder
should change this behaviour, but will most certainly break the wiki,
so it is probably a better idea to create a new subclass).
--
Lukas Renggli
http://renggli.freezope.org
Hi Hannes,
please post you questions, comments, bug-reports, etc. to the SmallWiki
mailing-list so everybody is able to join the discussion and profit
from the answers ...
> Als ich vor 10 Tagen von der Elfenbeinküste zurückkam war ich
> begeistert zu sehen, dass Chris und Stephen SmallWiki auch auf Squeak
> portiert haben. Ich habe eben zur Zeit all mein Zeugs in Squeak und
> kann es mir zeitlich einfach nicht leisten mich noch auf VisualWorks
> einzulassen auch wenn das technisch nicht mal so schwierig ist,
> organisatorisch und zeitlich eben dann schon ....
I tried the Squeak-Port too and it is great to see all the tests pass.
Thanks a lot to Chris and Stephen! Unfortunately there seem to be a
problem when submitting the login-form in my image, probably just
because I did not take a fresh one ...
Keep in mind that when replying to questions I am always referring to
the VisualWorks implementation. As I am taking a lot of lectures at
university and as I am working on different other Smalltalk projects
too I will concentrate my energy onto the main-platform of SmallWiki
solely; but obviously this shouldn't be no problem as the
implementations should be the same ;) ...
> Das hat mich dazu geführt drei Fragen in der FAQ zu notieren
> http://kilana.unibe.ch:9090/SmallWiki/FAQ/
I've added the answers to those questions to the FAQ:
* After installing SmallWiki - how do I get access to the example
actions?
Go to your favorite web-browser and browse to the structure you want to
execute your action on. If the action is not listed at the top right
corner you might want to try to execute it manually by adding/replacing
the action-parameter to the url:
http://localhost:8080/?action=MyExampleActionClassName.
In order to make your (new) action appear automatically, you have to
make sure the following conditions are set:
-An action should return a title on the class-side, else it is
considered to be abstract and not displayed anywhere.
-An action should not throw an exception during evaluating
#executePermissions, else it is not evaluated as some permissions are
considered to be missing.
-An action has to register to the structures it is able to handle: Page
registerAction: MyExampleActionClassName
-Last but not least, you should add the action to the current template
using the template-editor.
* Which export formats are available at the moment? Can I export the
wiki text into plain text files?
Right now there is no plain-text renderer (visitor) implemented and it
is left to the reader to implement one ;) ... Actually it is very easy
to do something like this, you might get an idea when looking at the
existing renderers: HTML (VisitorRendererHtml), Wiki
(VisitorRendererWiki) or Latex (VisitorRendererLatex).
* If I begin using SmallWiki today in a productive environment, will it
be possible to upgrade to the next versions and keep the data without
too much effort?
Yep, in fact I am doing this with http://kilana.unibe.ch:9090 since
this spring and never got troubles updating the code. Basically you
have to do the following:
-save the current image: server storage snapshot
-stop the storage thread by evaluating: server storage: nil
-stop the web-server by evaluating (most of the time not even
necessary): server stop
-connect to StORE and load updates
-run the tests to see if nothing got broken
-start the web-server by evaluating (if you have stopped it): server
start
-browse to your wiki and check if everything is still there (if
something is broken, you still have your old image!)
-start the storage thread by evaluating: server storage: ImageStorage
new
-save the current image: server storage snapshot
> Als ersten kleines Bsp. möchte ich konkret das Glossar (ca. 200
> linguistische Fachbegriffe), die wir im Swahili-Kurs verwenden über
> das SmallWiki editieren lassen
>
> Swahili-Kurs:
> http://www.unizh.ch/spw/afrling/aliswahili/yal/matini/90/aswi-01.html
>
> Glossar
> http://www.unizh.ch/spw/afrling/aliswahili/yal/matini/00/U00sar-
> ec07.html
>
> Bei Swahili kommt man mit nur-ASCII klar.
A glossary of linguistic expressions seem to be an interesting project
to use SmallWiki for.
> Ich möchte also das SmallWiki als kollaborativen Editor für einfache
> HTML-Texte (später auch zwischen Afrika und Europa) verwenden; wichtig
> ist für mich der Import und Export der Dateien.
What you could do is to write a visitor rendering the content of a page
as plain-text. Then you add an action to provide the output of that
page as a download. So finally you have a link on every-page, where you
are be able to download those generated files ...
> Was ist bereits eingebaut und aus Benutzersicht einfach zugänglich?
There is no such a thing yet, but I am doing the documentation using a
latex-visitor, what is probably very similar to your needs. Although I
don't use the latex-visitor yet to generate files from within
SmallWiki-Pages, but instead I parse and generate the documentation
using the class- and method-comments of my code. However it is simple
to add an action to use that visitor to export wiki-pages from within
SmallWiki, if you like I can come up with an (almost no lines-of-code)
example ...
> Wenn ich ein SmallWiki-Image (inkl. VM) auf einem Memory-Stick
> jemanden weitergebe: Wie kann er den Inhalt importieren / exportieren?
Sure, you can pass around SmallWiki-Images like any other Smalltalk
image, run it on different platforms, etc.
> Übrigends: Eure Arbeit (Berner) nehme ich als herausragendes Bsp. im
> Squeak-Bereich wahr von seriöser Arbeit. Ich habe bisher wenig
> sauberes Design und auch die Doku dazu gesehen. Dein Paper gefällt
> mir, wenn es auch noch etwas knapp ist. Ich schätze Euren Gesamtansatz
> sehr.
Thanks, I am glad to hear that ...
Cheers,
Lukas
--
Lukas Renggli
http://renggli.freezope.org
> From: Hannes Hirzel <hannes.hirzel.squeaklist(a)bluewin.ch>
> Newsgroups: gmane.comp.lang.smalltalk.squeak.general
> Subject: Re: [ANN] Squeak People
> Date: Thu, 13 Nov 2003 21:03:18 +0000
> Reply-To: The general-purpose Squeak developers
> list<squeak-dev(a)lists.squeakfoundation.org>
>
> [...]
>
> As a summary: I was away for some time and I'm surprised and excited
> to find Squeak in such a good shape!!! It is amazing what one finds on
> SqueakMap. Today I set up a SmallWiki site; it was extremly easy. It
> is exciting to have a wiki I can easily transfer from a Mac to a PC
> with basically nil setup and and configuration efforts. And the whole
> wiki is a real object (one root, composite pattern).
>
> [...]
--
Lukas Renggli
http://renggli.freezope.org
an idea for security in SmallWiki look at the
http://people.suqeakfoundation.org/
Stef
Begin forwarded message:
> From: "Andreas Raab" <andreas.raab(a)gmx.de>
> Date: Jeu nov 13, 2003 13:02:02 Europe/Zurich
> To: "'The general-purpose Squeak developers list'"
> <squeak-dev(a)lists.squeakfoundation.org>
> Subject: RE: [ANN] Squeak People
> Reply-To: The general-purpose Squeak developers list
> <squeak-dev(a)lists.squeakfoundation.org>
>
> Hi,
>
>> I agree with Stephane, what is the intention of this thing?
>
> I guess Cees' intention is simply to experiment with "just another"
> approach
> to community sites. Couple of things I like about it (and why I think
> it's
> going to be successful):
> * It's really simple to use and very intuitive
> * It has a model of trust which seems really nice[*]
> * It is very clean in its presentation and simple to read for anyone
> new to
> Squeak
>
> [*] If the trust model works out I could imagine that we use
> authorizations
> derived from the site - e.g., something like "for the front page you
> have to
> be certified journeyman or higher". Doing this would (I think) almost
> immediately block any of the abuse we see on the Swiki today.
>
>> And why not wait for the results of the November task force
>> before opening another space for discussion?
>
> TFNR has (in my understanding) very different goals. The site can be
> used to
> discuss some of these but other than this I don't see any overlap
> whatsoever. Do you?
>
>> Such a thing could be a nice thing for a task force who works
>> on a specific project; but at the moment this context is missing
>> ... why not enhance the existing processes?
>
> Not sure I understand this. Personally, I think the site _is_ an
> enhancement
> of the existing processes.
>
> Cheers,
> - Andreas
>
>
>
Hi Anthony,
thanks a lot for reporting those nasty mistakes. I've corrected them
and put an updated version of the documentation on our server:
http://www.iam.unibe.ch/~scg/smallwiki/smallwiki.pdf
Cheers,
Lukas
On Wednesday, Nov 12, 2003, at 13:59 Europe/Zurich, Anthony Labarre
wrote:
> Good afternoon,
>
> I am a student at the ULB, attending Roel Wuyts' course on software
> engineering, and we currently have to work on SmallWiki extensions, so
> I began by reading your document entitled "SmallWiki Collaborative
> Content Management", especially chapter 4. I noticed two errors
> (little mistakes, but nonetheless errors) I thought you would
> appreciate being told about :
>
> 1) page 39 : instead of : "http://localhost:8080/?action=ActionInfo",
> it should be: "http://localhost:8080/?action=InfoAction"
> 2) page 39 : there's an 'a' missing in 'initialize' ("InfoAction
> class>>initilize", last code snippet at the bottom of the page)
>
> Have a nice day,
> A.
--
Lukas Renggli
http://renggli.freezope.org
Hi,
Here is the example for why to put the <div> inside the <td> tags (I
tried it on Safari and Internet Explorer on Mac and on both the margin
option is not taken into consideration for the <td> tag):
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<style type="text/css">
<!--
.cellDiv {
margin: 20px;
background-color: #FFAAAA;
}
td {
margin: 20px;
background-color: #AAAAFF;
border: 1px solid black;
}
-->
</style>
<head>
<title>Girba Test</title>
</head>
<body>
<table border="0">
<tr>
<td>table cells as in SmallWiki</div></td>
<td>some cell</td>
</tr><tr>
<td>some cell</td>
<td>some cell</td>
</tr>
</table>
<table border="0" cellspacing="0">
<tr>
<td><div class="tableCell">table cells with a div</div></td>
<td><div class="tableCell">some cell</div></td>
</tr><tr>
<td><div class="tableCell">some cell</div></td>
<td><div class="tableCell">some cell</div></td>
</tr>
</table>
</body>
</html>
On Tuesday, Nov 11, 2003, at 07:52 Europe/Zurich, Lukas Renggli wrote:
> Hi,
>
> these are some things that I missed or left out yesterday:
>
> Tudor Girba <girba(a)iam.unibe.ch>:
>
>> 1. In the morning I manage to have a table by putting | (now it does
>> not seem to work anymore). I saw that the <td> has no tags inside,
>> therefore it is not possible to have padding or margin css options
>> for the text in a cell. I suggest to have a <div class="tableCell">
>> there.
>
> What about overloading the table-tags? This has the same effect as if
> I put a <div class="tableCell"> into every cell, right?
Doru.
--
Tudor Adrian Girba Software Composition Group
(www.iam.unibe.ch/~girba) University of Bern, Switzerland
"Problem solving efficiency grows with the abstractness level
of problem understanding."
Our "evolution customer", Heinz Richner, wrote:
>
> It would actually be good to have no lines, this would simply require
> that the column spacing can be controlled and enhanced
>
Is this possible?
> Thanks, I don't worry about the changes due to your experiments, I am
> rather interested in the evolution of the smallwicki over time.
>
:-)
Markus
> http://evolution.unibe.ch
>
> Heinz RICHNER
> Institute of Zoology - Evolutionary Ecology
> University of Bern, Baltzerstr.6
> CH-3012 Bern, Switzerland
>
> Tel 0041 31 631 3009 (S.Maurer, secretary)
> Fax 0041 31 631 3008
Hi David,
as there was no SmallWiki meeting today I am giving the code-review I
prepared using e-mail else it gets out-dated. If you have any
questions, please ask.
- Get rid of #isKindOf:
- Don't emit html-tags manually using "html text: '<b>Role:</b>'" as
this does not allow to render to another output format. Furthermore the
b-tag is depreciated and won't validate for HTML4 or XHTML. Either use
"html strong: 'Role:'" or much better "html spanClass: 'label' with:
'Role:'" instead.
- Don't emit html-characters manually using "html text: '&nsbsp;'" as
this does not allow to render to another output format. Use "html
space" instead.
- It is much simpler to use "html cssClass: 'label'" instead of "html
attributeAt: 'class' put: 'label'".
- Please don't use JavaScript, as it does not work on my machine
even-tough I have enabled it. It is easily possible to replace it with
server-side logic.
- Don't return associations of strings in AdminAction
class>>defaultMenu with tile and the url-postfix, but the actions
classes. All actions in SmallWiki are able to return their title and
know much better how to build their action-url than your code does.
- The class name of AdminAttachments doesn't seem to match what the
action is actually doing.
- AdminAttachments class>>generate_id: should be renamed to
AdminAttachments class>>generateId: as the underscore is not portable
to other Smalltalk dialects.
- Furthermore AdminAttachments class>>generate_id: should be moved to
Structure as it has nothing to do with the action-class and basically
works on a structure.
- Last but not least, you shouldn't need to use AdminAttachments
class>>generate_id: at all. As far as I understand you are building and
parsing this id to identify structures within a wiki. If you use
hidden-fields it is possible to pass objects from one action to the
other and you do not have to deal with strings, this is much simpler
and cleaner.
- I haven't implemented the read-accessor of User>>password
intentionally, because it is planned to store the password as a
hash-value instead of plain-text later on. This is a security issue to
have the password accessible like that and to render it when editing
users. It is the responsibility of the user-class to validate the
user-password using the message #validatePassword: and it should not be
accessible form outside.
- The following sections are some things that are basically reported by
SmallLint or things that I think could have been written simpler. I've
not tested the code I am suggesting, but it should work more or less:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Structure>>rolesIncludes: aRole
"check if a role is contained in a roles collection"
roles notNil ifTrue: [^roles includes: aRole].
^false
==>
Structure>>rolesIncludes: aRole
^roles notNil and: [ roles includes: aRole ]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Structure>>roleWithName: aRoleName
"returns a role with certain name"
self rolesDo: [:role | role name = aRoleName ifTrue: [^role]].
^nil
==>
Structure>>roleWithName: aString
self roles
detect: [ :each | each name = aString ]
ifNone: [ nil ]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Structure>>selfAndAllChildren
"return all children and their children.... as collection
- at this point: just return self in a collection "
| collection |
(collection := OrderedCollection new) add: self.
^collection
==>
Structure>>withChildren
^OrderedCollection with: self
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
X>>foo
X bar
==>
X>>foo
self class bar
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AdminAction class>>defaultSeparator
"return the default string separator
- this seperator is used to generate the input fields of the
form"
^String new writeStream tab contents
==>
AdminAction class>>defaultSeparator
^String with: Character tab
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
AdminAction>>cutStructure: aStructureToDelete ofSelfAndChildrenOf:
aStructure
"cut the indicated structure out of the tree, if the paste destination
was not in its subtree"
| errorStream myParents |
errorStream := String new writeStream.
myParents := aStructure parents copy.
(myParents includes: aStructureToDelete)
ifFalse:
[self deleteStructure: aStructureToDelete OfSelfAndChildrenOf: self
server root]
ifTrue:
[errorStream
nextPutAll: '--> Paste of ''';
nextPutAll: aStructureToDelete title;
nextPutAll: ''' was ok, but can not cut: destination is
sub-structure of the element to be pasted!'.
self error: errorStream contents]
==>
AdminAction>>cutStructure: aStructureToDelete ofSelfAndChildrenOf:
aStructure
...
self error: (String streamContents: [ :stream |
stream nextPutAll: ' ... ])
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
CharacterArray>>asArrayOfSubstrings
"split the string at its seperators and return array with substrings"
| first last collection |
collection := OrderedCollection new.
last := 0.
[first := self findFirst: [:char | char isSeparator not]
startingAt: last + 1.
first ~= 0]
whileTrue:
[last := (self
findFirst: [:char | char isSeparator]
startingAt: first) - 1.
last < 0 ifTrue: [last := self size].
collection add: (self copyFrom: first to: last)].
^collection asArray
==>
CharacterArray>>asArrayOfSubstrings
^self runsSatisfying: [ :each | each isSeparator ]
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Cheers,
Lukas
--
Lukas Renggli
http://renggli.freezope.org
Hi,
these are some things that I missed or left out yesterday:
Tudor Girba <girba(a)iam.unibe.ch>:
> 1. In the morning I manage to have a table by putting | (now it does
> not seem to work anymore). I saw that the <td> has no tags inside,
> therefore it is not possible to have padding or margin css options for
> the text in a cell. I suggest to have a <div class="tableCell"> there.
What about overloading the table-tags? This has the same effect as if I
put a <div class="tableCell"> into every cell, right?
> 2. Also, the head line of the table has an extra <b> tag. I suggest to
> replace it with another <div class="tableHeader">, so that we do not
> overload the <b> tag.
Where exactly have you seen that <b> tag? It should definitely go away
(as explained in the other mail) ...
> Stéphane Ducasse <ducasse(a)iam.unibe.ch>:
>
>> Apparently it is:
>> On the wiki root page I tried to add the */FolderTest* but I got
>> unable to get non-local structure :)
>
> It is only possible to create new structures on-line (from within the
> page) when using simple links without any slashes (e.g. *FolderTest*).
Actually I decided to write the on-line creation of new structures like
this, because else I would have needed to implement a different look-up
to get the parent of the ling-string (or done some other dirty tricks).
Of course it is possible to add that feature ...
Btw, David, when loading your enhancements my test
StructureTests>>testRoles breaks, what is something that should usually
not happen. Another problem is that loading your code makes SmallWiki
suddenly behave very restrictive with permission, e.g. it is not
possible to view or edit any page without logging-in.
Cheers,
Lukas
--
Lukas Renggli
http://renggli.freezope.org