From squeak at skalarsoft.com Fri Apr 1 07:04:27 2005 From: squeak at skalarsoft.com (Andreas Gerdes) Date: Fri, 01 Apr 2005 07:04:27 +0200 Subject: problems with saving on Squeak? In-Reply-To: <6c073d041584606d8211eed323292258@iam.unibe.ch> References: <6c073d041584606d8211eed323292258@iam.unibe.ch> Message-ID: <424CD65B.30409@skalarsoft.com> St?phane, yes, there are some problems with the Squeak port, but they are solvable, as you can see on the german Squeak site (http://www.squeak-ev.de), which saves OK (snapshot storage). But "solvable" for me did not mean to change code, it concerns playing around with the process browser, in which some of the processes keep hanging around after setting storage to nil or forcing a manual snapshot... until today, I never really investigated on this - and I'm not sure if I could - since I always got it to run. Regards Andreas ----------------------------- Andreas Gerdes, Cologne, Germany skalarsoft.com ----------------------------- st?phane ducasse schrieb: > Hi > > I would like to know whether the user of the squeak port of SmallWiki one > got problems with the snaphost mechanism? > > We got some problem with the SmallWiki one we were using for > squeakfoundation > and I want to know if this is a problem of SmallWiki one or of the > Squeak Port. > > Also if VW users have problems this would be a usefull information for us. > > Stef > > From renggli at iam.unibe.ch Sat Apr 2 10:44:33 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 2 Apr 2005 10:44:33 +0200 Subject: No subject Message-ID: > Avi suggested I talk with you - I've been using SmallWiki as a base for > a Wiki system that allowed editing the Wiki pages based on paragraphs > in the page rather than whole pages. this is definitely something that fits perfectly into the SmallWiki 2 model: it is just a matter of writting a different document editor and putting the user information into the parse-nodes of the document. I am right now concentrating on the core functionality like the security and the storage model. Unfortunately SmallWiki 2 isn't ready in lots of areas yet. Cheers, Lukas > Hi Lukas! > > Avi suggested I talk with you - I've been using SmallWiki as a base for > a Wiki system that allowed editing the Wiki pages based on paragraphs > in the page rather than whole pages. > > The reasons are so that it is easier to see what data on a page is old > and what is new, it shows who edited what part of the wiki page last, > and versions would be kept by paragraph as well. > > Editing small wiki pages, or wikis without a lot of content wouldn't > see much benefit, but for wikis like the Squeak one on minnow, it would > be very useful. Also, with wiki page editing, you typically find what > you want to edit twice - once in the rendered page as you read it, then > find it again in the editor pane ;-) > > I think this would alleviate that. > > Anyway, Avi thought it might be something (the concept anyway) that > could fit into SmallWiki2.... > > Any thoughts or ideas? > > thanks! -- Lukas Renggli http://www.lukas-renggli.ch From Fritsche.Markus at gmx.net Sun Apr 3 13:14:16 2005 From: Fritsche.Markus at gmx.net (Markus Fritsche) Date: Sun, 03 Apr 2005 13:14:16 +0200 Subject: Adding a anonymous-editable substructure to a SmallWiki Message-ID: <424FD008.4050602@gmx.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi! I want to add a 'Comments' page to my Wiki where anonymous users can edit the page; I thought I could do it with the code on the bottom, but when I hit the Comments-page as anonymous, I only have the usual anonymous-menu. Btw., I'm using SmallWiki on Squeak. Regards, Markus | anonymousRole s commentRole cpage | s _ SWKom allInstances first. commentRole _ SWBasicRole name: 'anonymous'. commentRole add: SWPage permissionEdit. commentRole add: SWPage permissionAdd. anonymousRole := s roles detect: [ :each | ~ each name = 'anonymous' ]. commentRole permissions addAll: anonymousRole permissions. cpage _ (s root children detect: [ :each | each id = 'comments' ]). cpage roles: (OrderedCollection with: commentRole) - -- http://reauktion.de/archer/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCT9AIRiRItLFyH5gRAgNTAKCJDDEZJ478ZKmIyJ0x9X2Nl50glACcCupD vp6IkAWRAanbfEXWU1ubXXg= =1MWc -----END PGP SIGNATURE----- From renggli at iam.unibe.ch Sun Apr 3 14:37:15 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sun, 3 Apr 2005 14:37:15 +0200 Subject: Adding a anonymous-editable substructure to a SmallWiki In-Reply-To: <424FD008.4050602@gmx.net> References: <424FD008.4050602@gmx.net> Message-ID: Hi Markus, I do not fully understand what you want to do, but there are several things you need to setup that an action appears in the menu: - the action has to return a label on the class side: MyAction class>>title ^'My Action Label' - the action has to be register to the structure: Page registerAction: MyAction - the permissions of the action have to be set, as you did in your example code Then you should be able to add your action as admin trough the config interface Admin > Components > Actions and it should automatically appear. Of course you can always test your action without doing anything mentioned above by directly typing the action into the url: .../page?action=MyAction I hope this helped. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From Fritsche.Markus at gmx.net Sun Apr 3 20:40:47 2005 From: Fritsche.Markus at gmx.net (Markus Fritsche) Date: Sun, 03 Apr 2005 20:40:47 +0200 Subject: SWSmilie rendering Message-ID: <425038AF.6000008@gmx.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I just noted that the SWSmilie lacks a proper alt=""-tag, where would I have to alter that? Regards, Markus - -- http://reauktion.de/archer/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD4DBQFCUDivRiRItLFyH5gRAtwKAKCOLLpPxztX0f+SR/Vj5rWiOjWVCACYzRL2 k5aN8VcS+9TvmxMpp/93WA== =PTB2 -----END PGP SIGNATURE----- From Fritsche.Markus at gmx.net Sun Apr 3 20:52:17 2005 From: Fritsche.Markus at gmx.net (Markus Fritsche) Date: Sun, 03 Apr 2005 20:52:17 +0200 Subject: SWSmilie rendering In-Reply-To: <425038AF.6000008@gmx.net> References: <425038AF.6000008@gmx.net> Message-ID: <42503B61.1000002@gmx.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Markus Fritsche wrote: found it myself... I change SWHtmlWriteStream like this: image: anUrlString ~ self attributeAt: 'alt' put: (anUrlString findTokens: $/) last. ~ self attributeAt: 'src' put: anUrlString. ~ self tag: 'img' - -- http://reauktion.de/archer/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCUDthRiRItLFyH5gRAmb7AJ4u5fWfs7PDtTNctVjpXGc0C5rbFwCeNM00 1voUYlYflUe97qza/wZkGqM= =Z8q+ -----END PGP SIGNATURE----- From Fritsche.Markus at gmx.net Sun Apr 3 21:05:06 2005 From: Fritsche.Markus at gmx.net (Markus Fritsche) Date: Sun, 03 Apr 2005 21:05:06 +0200 Subject: Adding a anonymous-editable substructure to a SmallWiki In-Reply-To: References: <424FD008.4050602@gmx.net> Message-ID: <42503E62.7060203@gmx.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Lukas Renggli wrote: | Hi Markus, | | I do not fully understand what you want to do, but there are | several things you need to setup that an action appears in the | menu: Well, I did not want to make an own custom action set, I just wanted to add a Comment-Subpage to each commentable page which should be editable by an user with the anonymous role, while the rest of the should stay closed... Regards, Markus - -- http://reauktion.de/archer/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCUD5iRiRItLFyH5gRAsLtAKCUS9JBtbhFRe5iIhcNpxH6R1RBDACgiuA8 raZQtXJFnXvOi/P981KQ1u8= =l+83 -----END PGP SIGNATURE----- From renggli at iam.unibe.ch Sun Apr 3 23:01:59 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sun, 3 Apr 2005 23:01:59 +0200 Subject: Adding a anonymous-editable substructure to a SmallWiki In-Reply-To: <42503E62.7060203@gmx.net> References: <424FD008.4050602@gmx.net> <42503E62.7060203@gmx.net> Message-ID: <4f2a47d878c0c06b3eaead8c26da8c03@iam.unibe.ch> > | I do not fully understand what you want to do, but there are > | several things you need to setup that an action appears in the > | menu: > > Well, I did not want to make an own custom action set, I just wanted > to add a Comment-Subpage to each commentable page which should be > editable by an user with the anonymous role, while the rest of the > should stay closed... Okay, now I understand, but I don't really get your code snipped. What you basically have to do is to remove the edit and add permissions from the anonymous role in your SWKom, to stop anonymous editing of pages per default. And then you put a copy of the anonymous role into the comment pages, where you add the edit and add permissions again. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From Fritsche.Markus at gmx.net Mon Apr 4 00:42:37 2005 From: Fritsche.Markus at gmx.net (Markus Fritsche) Date: Mon, 04 Apr 2005 00:42:37 +0200 Subject: SWSmilie rendering In-Reply-To: <42503B61.1000002@gmx.net> References: <425038AF.6000008@gmx.net> <42503B61.1000002@gmx.net> Message-ID: <4250715D.4040208@gmx.net> Markus Fritsche wrote: > image: anUrlString > ~ self attributeAt: 'alt' put: (anUrlString findTokens: $/) last. > ~ self attributeAt: 'src' put: anUrlString. > ~ self tag: 'img' Bad idea ;-) -- http://reauktion.de/archer/ From rbb at techgame.net Mon Apr 4 04:36:04 2005 From: rbb at techgame.net (Brian Brown) Date: Sun, 3 Apr 2005 20:36:04 -0600 (MDT) Subject: In-Reply-To: References: Message-ID: <50354.70.56.242.116.1112582164.squirrel@www.teuton.org> >> Avi suggested I talk with you - I've been using SmallWiki as a base for >> a Wiki system that allowed editing the Wiki pages based on paragraphs >> in the page rather than whole pages. > > this is definitely something that fits perfectly into the SmallWiki 2 > model: it is just a matter of writting a different document editor and > putting the user information into the parse-nodes of the document. > Excellent! I will simply wait and work with the SmallWiki 2 system when it is more ready for public consumption. > I am right now concentrating on the core functionality like the > security and the storage model. Unfortunately SmallWiki 2 isn't ready > in lots of areas yet. > Sure :-) Also, I wasn't suggesting that I wanted you to implement it; I was asking if the SmallWiki 2 system was a viable platform for this kind of a system, and it seems that is perfect. Thanks much! Brian > Cheers, > Lukas > From Fritsche.Markus at gmx.net Tue Apr 5 08:47:16 2005 From: Fritsche.Markus at gmx.net (Markus Fritsche) Date: Tue, 05 Apr 2005 08:47:16 +0200 Subject: Bug in SWTemplateBodyMenu? Message-ID: <42523474.7030606@gmx.net> -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi! When I added a menu to my wiki and set it's preference to always show the whole structure beginning from the wiki root (via the CompenentEditor). An edit of the entry page results in an infinite recursion of deepCopy; as far as I can tell, the new page created gets a copy of the preferences, and with this special preference turned on, there's a reference loop which causes the recursion... Kind regards, Markus - -- http://reauktion.de/archer/ -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (MingW32) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFCUjR0RiRItLFyH5gRAtj0AKCOjxpsXoYo68DaDw5bTZHXzrmVwgCfQrOO GQ5fE0W38fumFbIK28hbbkA= =Sv1U -----END PGP SIGNATURE----- From andreas.raab at gmx.de Fri Apr 8 23:00:23 2005 From: andreas.raab at gmx.de (Andreas Raab) Date: Fri, 08 Apr 2005 14:00:23 -0700 Subject: Some newbie questions Message-ID: <4256F0E7.6070609@gmx.de> Hi - I just started to use SmallWiki and ran into a number of issues. Since I couldn't immediately find the answers in the available documentation I thought I'd ask here - but feel free to point me to appropriate resources. Here we go: a) I get an error "Unauthorized to execute the requested action." when I use the following sentence: The above will print as "Far:[a TestVariable(nil)]" where "Far[...]" indicates that the object is not living on the current island. Presumably this is because SmallWiki interprets [...] as a Smalltalk block but then, it appears as if using something like: =[ = Transcript cr; show: 'Hello World'. =] is perfectly fine. Q: What are the rules for using [...]? How does one escape from the Smalltalk block interpretation if that is needed? b) When I use preformatted code like this: = onValueChanged = = self mumble. The part will not be shown in the rendering. Fine, that's probably because looks like an HTML-tag, so let's change this to: = onValueChanged = <on: valueChanged> = self mumble. This looks good when rendered, but once the page is being edited again, it will revert (!) to using <> instead of < and > and thus, when saved the line vanishes in a puff of HTML-logic. Q: Is this a known bug? Or is there something I'm doing wrong? c) It looks like IE has significant problems rendering some of the CSS properly. The most annoying part seems to be the header where the separators are just dropped. For example, check out www.seaside.st with both IE and Firefox; you will see something like: Firefox: Seaside/Tutorial View|Contents|Changes|Search IE: Seaside Tutorial View Contents Changes Search Q: Is there *any* known workaround for this problem? To me, the resulting pages look like garbage in IE without the separators. d) If one tries to print, say http://www.seaside.st/Documentation/GeneratingHTML/ the result is pretty much garbage regardless of browser used. Firefox will only print a single page; IE will do page breaks in the middle of text lines and both will cut off part of the page. Q: Is this an issue with the CSS used or with Smallwiki? Are there strategies in Smallwiki or CSS to address this problem? e) The Seaside Smallwiki at www.seaside.st has a nice little navigation bar on the left which I would like to use too. Q: Is this a standard feature of Smallwiki? If so, how does one use it? If not, who do I have to bug to get the code? ;-) That's all for now. If you guys have an FAQ I think these might be worthwhile entries to put there - I'm almost certain other people will run into the same issues. Cheers, - Andreas From renggli at iam.unibe.ch Sat Apr 9 02:06:06 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 9 Apr 2005 02:06:06 +0200 Subject: Some newbie questions In-Reply-To: <4256F0E7.6070609@gmx.de> References: <4256F0E7.6070609@gmx.de> Message-ID: Hi Andreas, > Q: What are the rules for using [...]? How does one escape from the > Smalltalk block interpretation if that is needed? use \[ and \] to escape the block-characters. Generally the backslash can be used to escape any of the wiki tokens like \*, \+, \=, ... > This looks good when rendered, but once the page is being edited > again, it will revert (!) to using <> instead of < and > and > thus, when saved the line vanishes in a puff of HTML-logic. > > Q: Is this a known bug? Or is there something I'm doing wrong? Yes, this is a known problem. I don't know of a proper solution, maybe one could try to double encode the text in text-areas. However I am not sure, if there is a propre way to do this? > c) It looks like IE has significant problems rendering some of the CSS > properly. The most annoying part seems to be the header where the > separators are just dropped. For example, check out www.seaside.st > with both IE and Firefox; you will see something like: > > Q: Is there *any* known workaround for this problem? To me, the > resulting pages look like garbage in IE without the separators. The only workaround I know of is not to use CSS for :before and :after selectors and to render the vertical bars manually in the XHTML. Of course this is less flexible to adapt to different layouts, but should works in most browsers. Or maybe it is enough to define the margins between the entries slightly bigger? > http://www.seaside.st/Documentation/GeneratingHTML/ the result is > pretty much garbage regardless of browser used. Firefox will only > print a single page; IE will do page breaks in the middle of text > lines and both will cut off part of the page. > > Q: Is this an issue with the CSS used or with Smallwiki? Are there > strategies in Smallwiki or CSS to address this problem? Indeed, this is strange problem with the CSS of seaside.st, I have to talk with the designer ;-) It works perfectly with the default CSS coming with SmallWiki, have a look at http://kilana.unibe.ch/ Maybe for printing you want to define a different CSS anyway? > e) The Seaside Smallwiki at www.seaside.st has a nice little > navigation bar on the left which I would like to use too. > > Q: Is this a standard feature of Smallwiki? If so, how does one use > it? If not, who do I have to bug to get the code? ;-) This is the Menu-Component: Log in as admin, go to Template > Templates and add the template Menu. Configure the look of the newly added component in Template > Settings. Attached you'll find the settings we are using on seaside.st to get the desired effect. -------------- next part -------------- A non-text attachment was scrubbed... Name: Picture 1.pdf Type: application/pdf Size: 15552 bytes Desc: not available Url : http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20050409/3bdd40bc/Picture1.pdf -------------- next part -------------- Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From andreas.raab at gmx.de Sat Apr 9 08:14:14 2005 From: andreas.raab at gmx.de (Andreas Raab) Date: Fri, 08 Apr 2005 23:14:14 -0700 Subject: Some newbie questions In-Reply-To: References: <4256F0E7.6070609@gmx.de> Message-ID: <425772B6.4090607@gmx.de> Hi - >> Q: What are the rules for using [...]? How does one escape from the >> Smalltalk block interpretation if that is needed? > > use \[ and \] to escape the block-characters. Generally the backslash > can be used to escape any of the wiki tokens like \*, \+, \=, ... Yes, that works but the escape will be eaten just like what happens with the <> vs. < and > when you edit the page again. >> This looks good when rendered, but once the page is being edited >> again, it will revert (!) to using <> instead of < and > and >> thus, when saved the line vanishes in a puff of HTML-logic. >> >> Q: Is this a known bug? Or is there something I'm doing wrong? > > Yes, this is a known problem. I don't know of a proper solution, maybe > one could try to double encode the text in text-areas. However I am not > sure, if there is a propre way to do this? Not knowing the least bit about Smallwiki I wonder how this effect happens in the first place - considering that it does happen with all browsers I tried and that it does happen both for tags as well as backslash escapes it seems as if there is a problem in the way Smallwiki stores the data. If Smallwiki stores the "raw" (escaped) data this shouldn't happen, but even if it stores the actual characters escaping those for editing should not be a big issue. Considering that I want to use Smallwiki for Tweak documentation which will include lots of and even more [yaddaya] I cannot imagine having to fix all of these every time I save a page. How do other people deal with this problem? Seaside for example - I would expect that there are plenty of situations where at least blocks are used and so this issue should show up in similar ways. >> http://www.seaside.st/Documentation/GeneratingHTML/ the result is >> pretty much garbage regardless of browser used. Firefox will only >> print a single page; IE will do page breaks in the middle of text >> lines and both will cut off part of the page. >> >> Q: Is this an issue with the CSS used or with Smallwiki? Are there >> strategies in Smallwiki or CSS to address this problem? > > Indeed, this is strange problem with the CSS of seaside.st, I have to > talk with the designer ;-) It works perfectly with the default CSS > coming with SmallWiki, have a look at http://kilana.unibe.ch/ > > Maybe for printing you want to define a different CSS anyway? I will say that I know next to nothing about CSS - but knowing that it isn't an intrinsic SmallWiki issue is the important part. >> e) The Seaside Smallwiki at www.seaside.st has a nice little >> navigation bar on the left which I would like to use too. >> >> Q: Is this a standard feature of Smallwiki? If so, how does one use >> it? If not, who do I have to bug to get the code? ;-) > > This is the Menu-Component: Log in as admin, go to Template > Templates > and add the template Menu. Configure the look of the newly added > component in Template > Settings. Attached you'll find the settings we > are using on seaside.st to get the desired effect. Thanks! This is very useful. Cheers, - Andreas From ducasse at iam.unibe.ch Sat Apr 9 11:02:25 2005 From: ducasse at iam.unibe.ch (=?ISO-8859-1?Q?st=E9phane_ducasse?=) Date: Sat, 9 Apr 2005 11:02:25 +0200 Subject: Some newbie questions In-Reply-To: <425772B6.4090607@gmx.de> References: <4256F0E7.6070609@gmx.de> <425772B6.4090607@gmx.de> Message-ID: <4214dd57b5e868b1edb496a0e740333a@iam.unibe.ch> Andreas Lukas has been rewriting SmallWiki from scratch soon we hope to have a alpha version. Now **in Squeak** we do have problem with Squeak and SmallWiki one and may be this will be the same in SmallWiki two. The mechanism of saving the image (which works perfectly since more than two year with VW and we did really crazy things with the image such as loading code breaking SmallWiki one and other ugly code that lukas fixed) since to stop working in Squeak and we do not know why since this is really difficult to reproduce and chase. You can see in the archive at impara I guess the email I sent around to ask whether people noticed this problem, and they did and we do not know what to do. So apparently on semaphore got blocked and SqueakSmallWiki stops to save. Now for SW2 we hope to have (at least the architecture is in place) a changeset list mechanism). Stef On 9 avr. 05, at 8:14, Andreas Raab wrote: > Hi - > >>> Q: What are the rules for using [...]? How does one escape from the >>> Smalltalk block interpretation if that is needed? >> use \[ and \] to escape the block-characters. Generally the backslash >> can be used to escape any of the wiki tokens like \*, \+, \=, ... > > Yes, that works but the escape will be eaten just like what happens > with the <> vs. < and > when you edit the page again. > >>> This looks good when rendered, but once the page is being edited >>> again, it will revert (!) to using <> instead of < and > and >>> thus, when saved the line vanishes in a puff of HTML-logic. >>> >>> Q: Is this a known bug? Or is there something I'm doing wrong? >> Yes, this is a known problem. I don't know of a proper solution, >> maybe one could try to double encode the text in text-areas. However >> I am not sure, if there is a propre way to do this? > > Not knowing the least bit about Smallwiki I wonder how this effect > happens in the first place - considering that it does happen with all > browsers I tried and that it does happen both for tags as well as > backslash escapes it seems as if there is a problem in the way > Smallwiki stores the data. If Smallwiki stores the "raw" (escaped) > data this shouldn't happen, but even if it stores the actual > characters escaping those for editing should not be a big issue. > > Considering that I want to use Smallwiki for Tweak documentation which > will include lots of and even more [yaddaya] I cannot > imagine having to fix all of these every time I save a page. > > How do other people deal with this problem? Seaside for example - I > would expect that there are plenty of situations where at least blocks > are used and so this issue should show up in similar ways. > >>> http://www.seaside.st/Documentation/GeneratingHTML/ the result is >>> pretty much garbage regardless of browser used. Firefox will only >>> print a single page; IE will do page breaks in the middle of text >>> lines and both will cut off part of the page. >>> >>> Q: Is this an issue with the CSS used or with Smallwiki? Are there >>> strategies in Smallwiki or CSS to address this problem? >> Indeed, this is strange problem with the CSS of seaside.st, I have to >> talk with the designer ;-) It works perfectly with the default CSS >> coming with SmallWiki, have a look at http://kilana.unibe.ch/ >> Maybe for printing you want to define a different CSS anyway? > > I will say that I know next to nothing about CSS - but knowing that it > isn't an intrinsic SmallWiki issue is the important part. > >>> e) The Seaside Smallwiki at www.seaside.st has a nice little >>> navigation bar on the left which I would like to use too. >>> >>> Q: Is this a standard feature of Smallwiki? If so, how does one use >>> it? If not, who do I have to bug to get the code? ;-) >> This is the Menu-Component: Log in as admin, go to Template > >> Templates and add the template Menu. Configure the look of the newly >> added component in Template > Settings. Attached you'll find the >> settings we are using on seaside.st to get the desired effect. > > Thanks! This is very useful. > > Cheers, > - Andreas > From renggli at iam.unibe.ch Sat Apr 9 11:08:40 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 9 Apr 2005 11:08:40 +0200 Subject: Some newbie questions In-Reply-To: <425772B6.4090607@gmx.de> References: <4256F0E7.6070609@gmx.de> <425772B6.4090607@gmx.de> Message-ID: <86936f3a6cc88f5166f0c3d22adb31d8@iam.unibe.ch> >>> Q: What are the rules for using [...]? How does one escape from the >>> Smalltalk block interpretation if that is needed? >> use \[ and \] to escape the block-characters. Generally the backslash >> can be used to escape any of the wiki tokens like \*, \+, \=, ... > > Yes, that works but the escape will be eaten just like what happens > with the <> vs. < and > when you edit the page again. I can't reproduce eaten \* with the latest SmallWiki 1 engine. In Safari it is possible to fix the eaten > and < by double escaping the contents of textareas. However I don't know and I don't have the time right now to test, if there are any unwanted side-effects. Tell me if the following code is of any help? HtmlTextArea>>textAreaWithValue: aString callback: aBlock self attributeAt: 'name' put: (self registerFormCallback: aBlock). self tag: 'textarea' do: [ self encode: (self encode: aString with: self attributeEscapeTable on: self) with: self attributeEscapeTable on: self ] keepTight: true. > Not knowing the least bit about Smallwiki I wonder how this effect > happens in the first place - considering that it does happen with all > browsers I tried and that it does happen both for tags as well as > backslash escapes it seems as if there is a problem in the way > Smallwiki stores the data. If Smallwiki stores the "raw" (escaped) > data this shouldn't happen, but even if it stores the actual > characters escaping those for editing should not be a big issue. SmallWiki stores a parsed tree of objects representing the page, there is no escaped data in there. Meaning that having a document hello > and \* *bla* gives something like Document new add: (Paragraph new Text with: 'hello'; yourself); add: (Paragraph new Text with: '> and *'; yourself); add: (Paragraph new InternalLink with: 'bla'; yourself); yourself. Note that the * are saved as plain string, changing the parser and visitor allows to implement a different wiki-syntax without modifying the model. Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Sat Apr 9 11:46:34 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 9 Apr 2005 11:46:34 +0200 Subject: Some newbie questions In-Reply-To: <3d837cccb606a2d5c64581fad4ed0752@t-online.de> References: <4256F0E7.6070609@gmx.de> <425772B6.4090607@gmx.de> <4214dd57b5e868b1edb496a0e740333a@iam.unibe.ch> <3d837cccb606a2d5c64581fad4ed0752@t-online.de> Message-ID: Hi, > can you say a rough estimate whan you want to reach a beta ? I want to > reorganize my Smallwiki and don't want to do things twice if it is > only a matter of a couple of months.... we are now using an early alpha version of SmallWiki 2 in the Advanced Design Lecture here at the University of Bern. The students are working on different parts of SmallWiki and we try to improve the engine with their feedback. If you like to satisfy your curiosity I suggest that you browser the lecture homepage [1], download the SmallWiki 2 image [2] and browse the presentation slides [3]. Note that big and important parts, like the security and persistence, are not yet fished! [1] http://www.iam.unibe.ch/~scg/Teaching/AdvancedLabs/index.html [2] http://www.iam.unibe.ch/~scg/Teaching/AdvancedLabs/swimages/sw2.zip [3] http://www.lukas-renggli.ch/smallwiki/slides/intro.pdf > And because of beeing implemented in Seaside, it should run also on > squeak ? Yes, I moved the main development branch to Squeak, read about this decision in the mailing list archive. As you probably noticed, SmallWiki 2 is described in itself. This means that there are meta-models [3] for most parts of the wiki. I'm currently working on an improved model of the layout engine. The idea would be that a wiki is composed from different primitive Seaside components, e.g. to display the menu, the login status, the current path and the actual contents. In SmallWiki 1 we had the templates that were composed statically, in SmallWiki 2 I want to use a meta-document to describe the look of a page: *+Heading+* | *+Menu+* | *+Path+* | *+Search+* | *+Contents+* Powered by *SmallWiki* Heading, Menu, Path and Search are all links to primitive Seaside components, the + means that they will be embedded and not linked into the resulting page. Contents is the embedded document. So my rendering visitor will walk over this meta-document and build the whole web-page. When reaching the 'contents' it will jump from the meta-level to the document level of the page currently displayed. Does this all make sense? Any ideas where to put that meta-document information? I am currently not quite sure where to store it ... Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From hnbeck at t-online.de Sat Apr 9 12:03:29 2005 From: hnbeck at t-online.de (Hans N Beck) Date: Sat, 9 Apr 2005 12:03:29 +0200 Subject: Some newbie questions In-Reply-To: References: <4256F0E7.6070609@gmx.de> <425772B6.4090607@gmx.de> <4214dd57b5e868b1edb496a0e740333a@iam.unibe.ch> <3d837cccb606a2d5c64581fad4ed0752@t-online.de> Message-ID: <87466d0c6d6153572b35040510248bd6@t-online.de> Hi, Am 09.04.2005 um 11:46 schrieb Lukas Renggli: > If you like to satisfy your curiosity I suggest that you browser the > lecture homepage [1], download the SmallWiki 2 image [2] and browse > the presentation slides [3]. Note that big and important parts, like > the security and persistence, are not yet fished! > > [1] http://www.iam.unibe.ch/~scg/Teaching/AdvancedLabs/index.html > [2] http://www.iam.unibe.ch/~scg/Teaching/AdvancedLabs/swimages/sw2.zip > [3] http://www.lukas-renggli.ch/smallwiki/slides/intro.pdf > Thanks !! > I'm currently working on an improved model of the layout engine. The > idea would be that a wiki is composed from different primitive Seaside > components, e.g. to display the menu, the login status, the current > path and the actual contents. In SmallWiki 1 we had the templates that > were composed statically, in SmallWiki 2 I want to use a meta-document > to describe the look of a page: > > *+Heading+* > | *+Menu+* | *+Path+* > | *+Search+* | *+Contents+* > Powered by *SmallWiki* > > Heading, Menu, Path and Search are all links to primitive Seaside > components, the + means that they will be embedded and not linked into > the resulting page. Contents is the embedded document. So my rendering > visitor will walk over this meta-document and build the whole > web-page. When reaching the 'contents' it will jump from the > meta-level to the document level of the page currently displayed. > > Does this all make sense? Any ideas where to put that meta-document > information? I am currently not quite sure where to store it ... To enhance to static template structure of SmallWiki 1 is certainly nice. So for me it makes sense. But I'm not shure what you mean with "where to store". But it would be nice if such meta document could itself be rendered and stored like a standard document, like a wiki on meta level. From this point of view, they should be stored like all documents too. Greetings Hans From ducasse at iam.unibe.ch Sat Apr 9 14:20:46 2005 From: ducasse at iam.unibe.ch (=?ISO-8859-1?Q?st=E9phane_ducasse?=) Date: Sat, 9 Apr 2005 14:20:46 +0200 Subject: Some newbie questions In-Reply-To: References: <4256F0E7.6070609@gmx.de> <425772B6.4090607@gmx.de> <4214dd57b5e868b1edb496a0e740333a@iam.unibe.ch> <3d837cccb606a2d5c64581fad4ed0752@t-online.de> Message-ID: <5b89a744738c10d1dd86511ca18f21a3@iam.unibe.ch> On 9 avr. 05, at 11:46, Lukas Renggli wrote: > Hi, > >> can you say a rough estimate whan you want to reach a beta ? I want >> to reorganize my Smallwiki and don't want to do things twice if it is >> only a matter of a couple of months.... > > we are now using an early alpha version of SmallWiki 2 in the Advanced > Design Lecture here at the University of Bern. The students are > working on different parts of SmallWiki and we try to improve the > engine with their feedback. > > If you like to satisfy your curiosity I suggest that you browser the > lecture homepage [1], download the SmallWiki 2 image [2] and browse > the presentation slides [3]. Note that big and important parts, like > the security and persistence, are not yet fished! > > [1] http://www.iam.unibe.ch/~scg/Teaching/AdvancedLabs/index.html > [2] http://www.iam.unibe.ch/~scg/Teaching/AdvancedLabs/swimages/sw2.zip > [3] http://www.lukas-renggli.ch/smallwiki/slides/intro.pdf > >> And because of beeing implemented in Seaside, it should run also on >> squeak ? > > Yes, I moved the main development branch to Squeak, read about this > decision in the mailing list archive. > > As you probably noticed, SmallWiki 2 is described in itself. This > means that there are meta-models [3] for most parts of the wiki. > > I'm currently working on an improved model of the layout engine. The > idea would be that a wiki is composed from different primitive Seaside > components, e.g. to display the menu, the login status, the current > path and the actual contents. In SmallWiki 1 we had the templates that > were composed statically, in SmallWiki 2 I want to use a meta-document > to describe the look of a page: > > *+Heading+* > | *+Menu+* | *+Path+* > | *+Search+* | *+Contents+* > Powered by *SmallWiki* sounds nice so will have have a kind of table in which components can be associated. > Heading, Menu, Path and Search are all links to primitive Seaside > components, the + means that they will be embedded and not linked into > the resulting page. Contents is the embedded document. So my rendering > visitor will walk over this meta-document and build the whole > web-page. When reaching the 'contents' it will jump from the > meta-level to the document level of the page currently displayed. > > Does this all make sense? Any ideas where to put that meta-document > information? I am currently not quite sure where to store it ... In the page and all the page sharing the same template will share the same "template" and a page can have its own by redefining locally. Does it make sense. From renggli at iam.unibe.ch Sat Apr 9 15:52:48 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 9 Apr 2005 15:52:48 +0200 Subject: Some newbie questions In-Reply-To: <5b89a744738c10d1dd86511ca18f21a3@iam.unibe.ch> References: <4256F0E7.6070609@gmx.de> <425772B6.4090607@gmx.de> <4214dd57b5e868b1edb496a0e740333a@iam.unibe.ch> <3d837cccb606a2d5c64581fad4ed0752@t-online.de> <5b89a744738c10d1dd86511ca18f21a3@iam.unibe.ch> Message-ID: >> *+Heading+* >> | *+Menu+* | *+Path+* >> | *+Search+* | *+Contents+* >> Powered by *SmallWiki* > > sounds nice > so will have have a kind of table in which components can be > associated. Yes, for simple layouts one can use the tables provided by SmallWiki. However for more advanced designs we will still need to code XHTML and provide a css-file. -- Lukas Renggli http://www.lukas-renggli.ch From mike at mjr104.co.uk Sun Apr 10 00:38:48 2005 From: mike at mjr104.co.uk (Michael Roberts) Date: Sat, 9 Apr 2005 23:38:48 +0100 Subject: 2005 Archives Message-ID: <200504092338.48591.mike@mjr104.co.uk> Hi, I've just joined the list and I'm looking for the archives for 2005. This link http://impara.de/pipermail/smallwiki/ stops at the end of last year. Is there some where else I can look? thanks Mike From ducasse at iam.unibe.ch Sun Apr 10 09:16:05 2005 From: ducasse at iam.unibe.ch (=?ISO-8859-1?Q?st=E9phane_ducasse?=) Date: Sun, 10 Apr 2005 09:16:05 +0200 Subject: 2005 Archives In-Reply-To: <200504092338.48591.mike@mjr104.co.uk> References: <200504092338.48591.mike@mjr104.co.uk> Message-ID: <1460819766a7ddf89e57ea3295d2f69c@iam.unibe.ch> This is strange that it stopped like that. Stef On 10 avr. 05, at 0:38, Michael Roberts wrote: > Hi, > > I've just joined the list and I'm looking for the archives for 2005. > This > link http://impara.de/pipermail/smallwiki/ stops at the end of last > year. Is > there some where else I can look? > > thanks > > Mike > From michael at squeakland.org Sun Apr 10 09:49:47 2005 From: michael at squeakland.org (Michael Rueger) Date: Sun, 10 Apr 2005 09:49:47 +0200 Subject: 2005 Archives In-Reply-To: <1460819766a7ddf89e57ea3295d2f69c@iam.unibe.ch> References: <200504092338.48591.mike@mjr104.co.uk> <1460819766a7ddf89e57ea3295d2f69c@iam.unibe.ch> Message-ID: <4258DA9B.4080104@squeakland.org> st?phane ducasse wrote: > This is strange that it stopped like that. It is some strange aftermath of our server move. The archive are now back online, there might be a few messages missing though. Michael From andreas.raab at gmx.de Sun Apr 10 10:00:23 2005 From: andreas.raab at gmx.de (Andreas Raab) Date: Sun, 10 Apr 2005 01:00:23 -0700 Subject: Menu component causing lockup? Message-ID: <4258DD17.7080609@gmx.de> Hi - I just had a very strange experience with Smallwiki. I installed it on my home machine and ran it since I wanted to play around a bit with a wiki that I could easily trash. I set up the menu component just like it had been described when suddenly Smallwiki locked up when trying to save to top-level page. *Just* the top-level page I should add. Since I had the image still open I got over there and some investigation showed that the problem was caused by an endless recursion caused from using #deepCopy to copy an object with "up" pointers (SWFolder) which was initiated by the following sequence: SWKom>>process: SWFolder(SWStructure)>>process: SWFolder(SWStructure)>>processSelf: SWFolder(SWStructure)>>processAction: BlockContext>>on:do: [] in SWFolder(SWStructure)>>processAction: {[anAction execute]} SWPageEdit(SWAction)>>execute SWPageEdit(SWAction)>>executeCallback SWPageEdit(SWAction)>>processFormCallback SortedCollection(OrderedCollection)>>do: [] in SWPageEdit(SWAction)>>processFormCallback {[:key | object := self request server callback get: key. object isNil if...]} SWPageEdit(SWAction)>>performCallback:withArguments: SWPageEdit(SWAction)>>performCallbackSymbol:withArguments: SWPageEdit(SWEditAction)>>save SWPageEdit(SWEditAction)>>privatePreSave SWFolder(SWStructure)>>nextVersion: SWFolder(SWStructure)>>nextVersionBecome: SWFolder(Object)>>copy SWFolder>>postCopy SWFolder(SWPage)>>postCopy SWFolder(SWStructure)>>postCopy SWPropertyManager(Object)>>copy SWPropertyManager>>postCopy Dictionary(Object)>>deepCopy Array(Object)>>deepCopy Association(Object)>>deepCopy OrderedCollection(Object)>>deepCopy Array(Object)>>deepCopy SWTemplateBodyMenu(Object)>>deepCopy SWFolder(Object)>>deepCopy Dictionary(Object)>>deepCopy Array(Object)>>deepCopy Association(Object)>>deepCopy SWFolder(Object)>>deepCopy Dictionary(Object)>>deepCopy Array(Object)>>deepCopy "... and downhill from here ..." Looking at it more closely it seems as if this is triggered by #internalTemplates referring to a SWTemplateBodyMenu which (I believe) is created when using the menu component. Is this is a known issue? Any recommended fixes? Cheers, - Andreas From mike at mjr104.co.uk Sun Apr 10 11:52:08 2005 From: mike at mjr104.co.uk (Michael Roberts) Date: Sun, 10 Apr 2005 10:52:08 +0100 Subject: 2005 Archives In-Reply-To: <4258DA9B.4080104@squeakland.org> References: <200504092338.48591.mike@mjr104.co.uk> <1460819766a7ddf89e57ea3295d2f69c@iam.unibe.ch> <4258DA9B.4080104@squeakland.org> Message-ID: <200504101052.08402.mike@mjr104.co.uk> Thanks Mike On Sunday 10 April 2005 08:49, Michael Rueger wrote: > st?phane ducasse wrote: > > This is strange that it stopped like that. > > It is some strange aftermath of our server move. > The archive are now back online, there might be a few messages missing > though. > > Michael From renggli at iam.unibe.ch Sun Apr 10 11:12:36 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sun, 10 Apr 2005 11:12:36 +0200 Subject: Menu component causing lockup? In-Reply-To: <4258DD17.7080609@gmx.de> References: <4258DD17.7080609@gmx.de> Message-ID: <1c17b773bdd2cc74b0eefd628ff158f2@iam.unibe.ch> > I just had a very strange experience with Smallwiki. I installed it on > my home machine and ran it since I wanted to play around a bit with a > wiki that I could easily trash. I set up the menu component just like > it had been described when suddenly Smallwiki locked up when trying to > save to top-level page. *Just* the top-level page I should add. > > Since I had the image still open I got over there and some > investigation showed that the problem was caused by an endless > recursion caused from using #deepCopy to copy an object with "up" > pointers (SWFolder) which was initiated by the following sequence: > > [...] > > Dictionary(Object)>>deepCopy > Array(Object)>>deepCopy > Association(Object)>>deepCopy > OrderedCollection(Object)>>deepCopy > Array(Object)>>deepCopy > > [...] I suspect this is a problem of the Squeak code, I am not using #deepCopy anywhere in the original implementation. As far as I know, at the time of the first port there was no #postCopy in Squeak and therefor copying had to be done differently. Now there is a #postCopy, so I don't understand why it doesn't work. Chris any thoughts/fixes? The last time I had a look at the Squeak port of SmallWiki the same problem hold for #initialize, since in VisualWorks I have to do it manually in Squeak objects are initialized twice. Lukas -- Lukas Renggli http://www.lukas-renggli.ch From andreas.raab at gmx.de Sun Apr 10 11:23:06 2005 From: andreas.raab at gmx.de (Andreas Raab) Date: Sun, 10 Apr 2005 02:23:06 -0700 Subject: Menu component causing lockup? In-Reply-To: <1c17b773bdd2cc74b0eefd628ff158f2@iam.unibe.ch> References: <4258DD17.7080609@gmx.de> <1c17b773bdd2cc74b0eefd628ff158f2@iam.unibe.ch> Message-ID: <4258F07A.2010902@gmx.de> > I suspect this is a problem of the Squeak code, I am not using #deepCopy > anywhere in the original implementation. As far as I know, at the time > of the first port there was no #postCopy in Squeak and therefor copying > had to be done differently. Now there is a #postCopy, so I don't > understand why it doesn't work. Chris any thoughts/fixes? If you look at the stack you see this is caused by SWPropertyManager which indeed uses deepCopy: SWPropertyManager(Object)>>copy SWPropertyManager>>postCopy Dictionary(Object)>>deepCopy > The last time I had a look at the Squeak port of SmallWiki the same > problem hold for #initialize, since in VisualWorks I have to do it > manually in Squeak objects are initialized twice. Trivial to fix - just make sure you implement: new ^self basicNew initialize instead of "super new" (which really is NOT the right thing to use anyway). Cheers, - Andreas From mike at mjr104.co.uk Sun Apr 10 23:31:08 2005 From: mike at mjr104.co.uk (Michael Roberts) Date: Sun, 10 Apr 2005 22:31:08 +0100 Subject: User roles Message-ID: <200504102231.09217.mike@mjr104.co.uk> Hi, I have recently installed SmallWiki and I am having a few problems with user permissions. I wanted to first see if there was something obvious that I had missed. I have created a new user and added both the anonymous role and a new 'basic' role that I have created. I have added to this later role the edit page permission. I have then added this user to the server instance. I login as the admin user and create a page and edit its content. I then logout and log back in as my new user. Unfortunately this new user doesn't have permission to edit the page. I have subsequently added all the permissions to my new user's basic role but it doesn't allow the user to edit the page. I can only edit the content as the admin user. I have tried to debug this situation. At the point that the available commands are rendered to the top of the test page, my user's basic role has an empty set of permissions. I have checked the user in the server instance and it does have the correct set of permissions. I have dug a bit further and it seems that SWStructure>>processSecurity: removes the roles from my user if at the server root and then updates the roles with the current roles instance variable from the root folder instance. Since this roles instance variable only has the anonymous role in I don't get to edit the page. Do I need to get my role into this roles variable on the root folder instance? I'm guessing I have got something wrong in my configuration? Any help appreciated. Thanks Mike From gluca980 at libero.it Mon Apr 11 15:25:58 2005 From: gluca980 at libero.it (gluca980@libero.it) Date: Mon, 11 Apr 2005 15:25:58 +0200 Subject: some newbie questions Message-ID: Hi, I've started to use Smallwiki since 2 weeks and i need help. I would have to write a function that allows me from the edit in my localhost to write a date,could you tell me please how can i write only in date-format? When i want to write a text, I use html textInutWithValue,but I don't know what i must to write fora date. Gianluca ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From renggli at iam.unibe.ch Mon Apr 11 16:00:47 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Mon, 11 Apr 2005 16:00:47 +0200 Subject: User roles In-Reply-To: <200504102231.09217.mike@mjr104.co.uk> References: <200504102231.09217.mike@mjr104.co.uk> Message-ID: Hi Michael, I would suggest that you check out the mailing list archive, questions like this have been answered several times. The idea of the SmallWiki 1 Security system is that you define the default role is defined in the root node and then every structure (including the root) is able to redefine the roles. Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Mon Apr 11 16:00:47 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Mon, 11 Apr 2005 16:00:47 +0200 Subject: User roles In-Reply-To: <200504102231.09217.mike@mjr104.co.uk> References: <200504102231.09217.mike@mjr104.co.uk> Message-ID: Hi Michael, I would suggest that you check out the mailing list archive, questions like this have been answered several times. The idea of the SmallWiki 1 Security system is that you define the default role is defined in the root node and then every structure (including the root) is able to redefine the roles. Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Mon Apr 11 15:49:47 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Mon, 11 Apr 2005 15:49:47 +0200 Subject: some newbie questions In-Reply-To: References: Message-ID: <154ad9b3de9ab12118740ee7ac4d009a@iam.unibe.ch> > I would have to write a function that allows me from the edit in my > localhost to write a date,could you tell me please how can i write > only in date-format? The simplest thing to do is that you do it using a single text field and do something like: html textInputWithValue: (date printString) callback: [ :action :value | action date: (Date fromString: value) ]. The next step would be to split it into different text fields for day, month and year. | day month ... | html textInputWithValue: date asDay callback: [ :value | day := value asNumber ]. html textInputWithValue: date asMonth callback: [ :value | month := value asNumber ]. ... html hiddenInputWithCallback: [ self date: (Date day: day month: ...) ]. Then you need soem validation ... etc. I haven't tried the above code but something like should work and it should give you an idea how to implement your requirements. With the help of Magritte in SmallWiki 2 something like this would be a breeze of course ;-) Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at netstyle.ch Mon Apr 11 23:32:40 2005 From: renggli at netstyle.ch (Lukas Renggli) Date: Mon, 11 Apr 2005 23:32:40 +0200 Subject: Widget registrieren In-Reply-To: <425AD62B.1070708@students.unibe.ch> References: <8fee504b0c6a84d16fedcda6562d7ddd@netstyle.ch> <425AD62B.1070708@students.unibe.ch> Message-ID: Hi Mike, use your web-browser and go the 'Environment' page to edit it. Add an embedded link *+My Widget+* at the place where you want to place your widget and save the page. A red link will be be displayed because the link is pointing to an non-existant structure. Click on it, choose 'Component', hit save and select your widget class in the drop down that is appearing. From now on your widget should be in place all the time, no need to edit the SmallWiki core code for this anymore. Cheers, Lukas On Apr 11, 2005, at 21:55, Michael Meyer wrote: > Hallo, > letze Eoche beim ADL habt ihr uns gezeigt wie wir selber > Widgets ins Gui integrieren k?nnen. (Siehe Code unten). > Der Code der initialize Methode hat sich jetzt ja etwas ge?ndert. > Kann du mir sagen wo ich jetzt mein eigenes Widget > registrieren kann? > Gruss mike > > SeasideFrame>>initialize > super initialize. > contextHolder := WAStateHolder new. > headerWidget := SW2HeaderWidget new. > contentWidget := SW2ContentWidget new. > boxWidgets := Array > "with: SW2DebugWidget new" > with: SW2CommandsWidget new > "with: SW2PathWidget new" > "with: SW2TableOfContentsWidget new" > with: SW2TreeWidget new > with: SW2SearchWidget new > with: SW2StatisticsWidget new. -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Mon Apr 11 23:39:23 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Mon, 11 Apr 2005 23:39:23 +0200 Subject: Widget registrieren In-Reply-To: References: <8fee504b0c6a84d16fedcda6562d7ddd@netstyle.ch> <425AD62B.1070708@students.unibe.ch> Message-ID: Sorry, this wasn't supposed to go to this list ;-) -- Lukas Renggli http://www.lukas-renggli.ch From ducasse at iam.unibe.ch Tue Apr 12 08:40:32 2005 From: ducasse at iam.unibe.ch (=?ISO-8859-1?Q?st=E9phane_ducasse?=) Date: Tue, 12 Apr 2005 08:40:32 +0200 Subject: Widget registrieren In-Reply-To: References: <8fee504b0c6a84d16fedcda6562d7ddd@netstyle.ch> <425AD62B.1070708@students.unibe.ch> Message-ID: <17644724b56d6822863a6b1646f5c955@iam.unibe.ch> but this was great to see SmallWiki 2 in action ;) On 11 avr. 05, at 23:39, Lukas Renggli wrote: > Sorry, this wasn't supposed to go to this list ;-) > > -- > Lukas Renggli > http://www.lukas-renggli.ch > From gluca980 at libero.it Tue Apr 12 11:01:26 2005 From: gluca980 at libero.it (gluca980@libero.it) Date: Tue, 12 Apr 2005 11:01:26 +0200 Subject: another question Message-ID: Hi, I still have a problem about to insert the function written with the edit in an other page, in one column of a list created from me. I am successful to insert my function in the url page , but i want insert in a column. For to insert in url page i've used : " redirectTo: self url " , but if I want insert in one column instead of url, how can i do? Gianluca ____________________________________________________________ 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it From gluca980 at libero.it Tue Apr 12 16:16:27 2005 From: gluca980 at libero.it (gluca980@libero.it) Date: Tue, 12 Apr 2005 16:16:27 +0200 Subject: another question Message-ID: Hi, I saw the link: http://www.seaside.st/Documentation/?action=SWFolderEdit and i found the example that i want do, i want to change with edit the date in modified, but i can't how. In my list i can change only the row as "contents documentation " in this page. ____________________________________________________________ 6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero! Scaricalo su INTERNET GRATIS 6X http://www.libero.it From renggli at iam.unibe.ch Tue Apr 12 19:25:11 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 12 Apr 2005 19:25:11 +0200 Subject: another question In-Reply-To: References: Message-ID: <968f3f237b3a6251a0db269b91231425@iam.unibe.ch> > and i found the example that i want do, i want to change with edit the > date in modified, but i can't how. In my list i can change only the > row as "contents documentation " in this page. Sorry, I don't understand what you exactly want to do? Could you give a possible scenario? Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Tue Apr 12 23:39:25 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 12 Apr 2005 23:39:25 +0200 Subject: Some problems with SW2 In-Reply-To: <423AEE770012D75E@mail17.bluewin.ch> (added by postmaster@bluewin.ch) References: <423AEE770012D75E@mail17.bluewin.ch> (added by postmaster@bluewin.ch) Message-ID: <3f86d7c325e9d3afd501d58e47464206@iam.unibe.ch> Hi David, > There's probably a bug in SW2PluggableComponent>>renderContentOn: > This class has a block as an inst var and in #renderContentOn: this > block is > analyzed if it expects two args. If not, it's tried to render this > block > with html render: block. But this won't work, because a block can't be > rendered directly. well what do you do with your all your div, span, heading and anchor-tags? There are blocks that are rendered all over the place :-) html div: [ html span: [ html heading: [ html anchorWith... do: [ ... ] ]?] ]. Have a look at WAAbstractHtmlBuilder>>render: and BlockContext>>renderOn: where the double dispatch on blocks happens. As you can see Seaside accepts zero and one argument blocks, and I enhanced this for SW2PluggableComponent to have two possible arguments. However it is generally not a very good idea to use SW2PluggableComponent extensively, but for fast prototyping its use might be nice. Currently there is no use of SW2PluggableComponent in SmallWiki2 anymore. > Another issue is that the style-sheet is stored in a remote file which > we > could not change/extend. Wouldn't it be better to have the style > definitions > directly in the image? For instance you could create a style library > class > for SW2. Please submit a patch to SmallWiki2-Seaside, I just didn't bothered to put all those style-sheets and images into a style library class yet, it was simply easier for me to edit the file in a css-editor. Check out the new style, it has some fancy css-buttons in the heading-bar! > Then I have encountered a problem with the commands for a structure. I > have > created a new subclass of Structure and now I would like to define some > commands for this new kind of structure. But then all the other > commands > that are bound to Structure (like Move, Copy, Add, ...) will also be > displayed in the command widget when browsing an instance of this new > structure. I see no way to specify that these commands should not be > available for my newly defined structure. It would be better to have > the > possibility to explicitly say for which structures a command should be > available. A collection of structure classes instead of SW2Command > class >> > defaultStructureClass maybe? I see the problem, but having collection the commands (static state) wouldn't solve the problem either, because one cannot know what structure and commands (it is an m to n relationship) will exist in the future. It also gets difficult because one doesn't know who has the responsibility to register the commands, the command or the structure? Generally I prefer dynamic state, that means we should introduce another dispatch in SW2Context>>allValidCommands to let the command and the structure have the possibility to reject a command. > Another problem with newly created subclasses of Structure is that > they will > all appear in the 'type'-dropdown when adding a child structure with > the > AddCommand. This might not be desired for all subclasses of Structure. Similar problem as above: I suggest that you submit a patch to the latest SmallWiki2 package that fits your needs so that it can be merged into the core code and everybody can profit. > It would be great to have a method MAElementDescription >> > attributeAt:put: > to specify new attributes for the component of a description. > Currently, one > has to use #attributes which is not convenient. Margritte is not a Seaside framework, generally speaking. As far as I know there is just one use of #attributes: in SmallWiki itself and as I don't write code that I don't need, I didn't felt the need for such methods yet. However feel free to add them for your convenience, that's the reason why there are class extensions ;-) > Then there are several components available that render a text field > with a > button, such as MADateInputComponent, MATimestampInputComponent, ... I > tried > to create a subclass of such a component to change the button's > appearance > (different label or an image as button). But this is not possible > because > the button is rendered directly in #renderEditorOn:, so I can't > override > this method. It would be better to have a method #renderButtonOn: in > MATextInputComponent, so all subclasses with a button have to override > just > this method which would be empty in MATextInputComponent. Yeah, I see, maybe sometimes I am too lazy. > But besides that, Magritte is really cool. :) Thanks. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From gluca980 at libero.it Wed Apr 13 10:46:33 2005 From: gluca980 at libero.it (gluca980@libero.it) Date: Wed, 13 Apr 2005 10:46:33 +0200 Subject: question Message-ID: Hi, I try to explain my problem better. I've built with smallwiki a page with links to three actions: "view", "edit" and "contents". In "view" I have a table with two columns, the first is the title of project and the second is the date that I would want to insert with ?edit?. My problem is that I can?t insert the date in the second column of the table. One possible example is that one on: http://www.seaside.st/Documentation/?action=SWFolderEdit How do you get the date in the ?modified ?column? I need exactly to do that. Cheers Gianluca ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From davidroe at bluewin.ch Wed Apr 13 13:10:21 2005 From: davidroe at bluewin.ch (=?iso-8859-1?Q?David_R=F6thlisberger?=) Date: Wed, 13 Apr 2005 13:10:21 +0200 Subject: Some problems with SW2 References: <423AEE770012D75E@mail17.bluewin.ch> (added by postmaster@bluewin.ch) <3f86d7c325e9d3afd501d58e47464206@iam.unibe.ch> Message-ID: <005201c54019$6509ac60$667ba8c0@DAVID1> Hello Lukas, > well what do you do with your all your div, span, heading and anchor-tags? > There are blocks that are rendered all over the place :-) yep, sorry, my bad, I have made a mess. ;) > Please submit a patch to SmallWiki2-Seaside, I just didn't bothered to put > all those style-sheets and images into a style library class yet, it was > simply easier for me to edit the file in a css-editor. yes, I see. I can add the styles to a library, no problem. > Similar problem as above: I suggest that you submit a patch to the latest > SmallWiki2 package that fits your needs so that it can be merged into the > core code and everybody can profit. ok, I can try. >> It would be great to have a method MAElementDescription >> >> attributeAt:put: >> to specify new attributes for the component of a description. Currently, >> one >> has to use #attributes which is not convenient. > > Margritte is not a Seaside framework, generally speaking. > > As far as I know there is just one use of #attributes: in SmallWiki itself > and as I don't write code that I don't need, I didn't felt the need for > such methods yet. However feel free to add them for your convenience, > that's the reason why there are class extensions ;-) hm, yes, but I think this might be a feature of general interest, because the possibility to adapt the components when defining the description could be important for many forms that will be created with Magritte in the future. Otherwise, all the form elements are bound to have the same look (width, height, alignment, etc.), and for forms that are a bit more complex, e.g., with different text areas for different types of content, it might be useful to adapt the look of the different form elements according to what they represent. I have developed a similar framework (in PHP, don't laugh ;) in the past, and there the ability to customize the different form elements freely is really crucial because we have to create many different and complex forms with it. Or how do you see the future of Magritte? I think it has a great potential and the possibility to customize the components easily without subclassing might come in quite handy. Another issue currently is the customization of a description if it depends on the instance of the structure. For instance, one would like to have elements in a select list that are dependent on the instance of a structure and that cannot be determined statically. As far as I understand the only possibility to achieve that is to override #description on the instance-side and to add the desired instance-dependent elements there. Or am I mistaken here? David From renggli at iam.unibe.ch Wed Apr 13 19:13:42 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Wed, 13 Apr 2005 19:13:42 +0200 Subject: question In-Reply-To: References: Message-ID: Hi Gianluca, > I've built with smallwiki a page with links to three actions: "view", > "edit" and "contents". In "view" I have a table with two columns, the > first is the title of project and the second is the date that I would > want to insert with ?edit?. My problem is that I can?t insert the date > in the second column of the table. > > One possible example is that one on: > > http://www.seaside.st/Documentation/?action=SWFolderEdit > > How do you get the date in the ?modified ?column? I need exactly to do > that. allright, I think I get it know; so you just need a read-only view of the date? Why don't you just have a look at the code and how it is done there? Structure>>modificationString ^String streamContents: [ :stream | stream nextPutAll: self timestamp printString. self creatorName notNil ifTrue: [ stream nextPutAll: ' by '; nextPutAll: self creatorName ]. self creatorIp notNil ifTrue: [ stream nextPutAll: ' from '; nextPutAll: self creatorIp ] ]. where the printing of the timestamp itself is implemented in the class Timestamp. HTH, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Wed Apr 13 19:33:03 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Wed, 13 Apr 2005 19:33:03 +0200 Subject: Some problems with SW2 In-Reply-To: <005201c54019$6509ac60$667ba8c0@DAVID1> References: <423AEE770012D75E@mail17.bluewin.ch> (added by postmaster@bluewin.ch) <3f86d7c325e9d3afd501d58e47464206@iam.unibe.ch> <005201c54019$6509ac60$667ba8c0@DAVID1> Message-ID: <36ab2c0dca9bb38ba240e0e87b1ffe09@iam.unibe.ch> >>> It would be great to have a method MAElementDescription >> >>> attributeAt:put: >>> to specify new attributes for the component of a description. >>> Currently, >>> one >>> has to use #attributes which is not convenient. >> >> Margritte is not a Seaside framework, generally speaking. >> >> As far as I know there is just one use of #attributes: in SmallWiki >> itself >> and as I don't write code that I don't need, I didn't felt the need >> for >> such methods yet. However feel free to add them for your convenience, >> that's the reason why there are class extensions ;-) > > hm, yes, but I think this might be a feature of general interest, > because > the possibility to adapt the components when defining the description > could > be important for many forms that will be created with Magritte in the > future. Otherwise, all the form elements are bound to have the same > look > (width, height, alignment, etc.), and for forms that are a bit more > complex, > e.g., with different text areas for different types of content, it > might be > useful to adapt the look of the different form elements according to > what > they represent. I find it very convenient just to have to specify an array, I mean usually you have your descriptions all just at one place and one line where you add the additional non-standard html-attributes: (MAStringDescription selector: #foo) attributes: { 'size' -> 12. 'maxlength' -> 14 }; .... > Or how do you see the future of Magritte? I think it has a great > potential and the possibility to customize the components easily > without subclassing might come in quite handy. As I mentioned in the presentation, we are using Magritte in industrial environment as well, where the users are able to click together web-forms on their own and specify arbitrary complex validation rules. > Another issue currently is the customization of a description if it > depends > on the instance of the structure. For instance, one would like to have > elements in a select list that are dependent on the instance of a > structure > and that cannot be determined statically. As far as I understand the > only > possibility to achieve that is to override #description on the > instance-side and to add the desired instance-dependent elements > there. Or > am I mistaken here? Yes, you are! You can do it on the class side using the description-builder as well. Imagine a hierarchy where A is the superclass of B and B is the superclass of C: A class>>descriptionFoo ^(MAOptionsDescrion key: #foo) options: self optionsToBeUsed; yourself. A class>>optionsToBeUsed ^#( a b c ) B class>>optionsToBeUsed ^super optionsToBeUsed , #( 1 2 ) A will have description with #( a b c ), whereas B will have one with #( a b c 1 2 ). Another powerful thing is the MADynamicObject class, that allows to define descriptions where you don't know the possible properties in advance. Try something like: B class>>optionsToBeUsed ^MADynamicObject on: [ 1 to: 100 atRandom ]. It is also possible to clear a description element in a subclass, by overriding the description method and returning nil C class>>descriptionFoo ^nil or you could change the description of the superclass by modifying it: C class>>descriptionFoo ^super descriptionFoo beReadonly; nilLabel: 'nothing'; yourself. Och, I like objects so much ;-) Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Thu Apr 14 14:39:16 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Thu, 14 Apr 2005 14:39:16 +0200 Subject: SW2Command Subclasses In-Reply-To: <1113481242.425e601aa99f5@www.students.unibe.ch> References: <1113481242.425e601aa99f5@www.students.unibe.ch> Message-ID: <3eff6dd2904bc805962569228210021e@iam.unibe.ch> > I have a basic question about commands. > When you click on the edit link you get > a special edit page. SW2Command>>asComponent (*) Usually this just returns a magritte component built automatically from the description of the command, but as you can see in SW2ViewCommand one can also override it to return any other Seaside component. > Shouldn't there be something like this somewhere: > html anchorWithAction: [SW2EditCommand>>doExecute] text: > SW2EditCommand asLabel This is something else, you can create a link to a structure and command anywhere using: html anchorToStructure: aStructure command: aCommand do: aBlock (*) Cheers, Lukas (*) Check the exact wording in your own image, i don't have access to one right now. -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Thu Apr 14 16:46:15 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Thu, 14 Apr 2005 16:46:15 +0200 Subject: Widget registrieren In-Reply-To: <7e75822ca05a992168125c168f472bf9@student.unibe.ch> References: <15bf5110e60ed2d88b4a990387cc88a3@iam.unibe.ch> <7e75822ca05a992168125c168f472bf9@student.unibe.ch> Message-ID: <603c108f77880004fb002308593a79c2@iam.unibe.ch> > Das mit dem Compilieren hat ja jetzt geklappt. Aber unser eigenes > Widget wird nicht in der Drop Box aufgelistet? Nach welchen Kriterien > wird da gesucht? Unser Widget erbt von SW2Widget. Es klappt nicht wenn > wir es in einem eigenen Package haben oder sogar im > SmallWiki2-Seaside-Widgets Package. Have a look at the following snippet of code and check for the conditions ;-) SW2EditComponentCommand class>>descriptionComponentClass ^(MAOptionsDescription selector: #componentClass label: 'Component Class' priority: 200) options: (MADynamicObject on: [ Array streamContents: [ :stream | SW2Widget allSubclassesDo: [ :each | each isAbstract ifFalse: [ stream nextPut: each ] ]. WAComponent allSubclassesDo: [ :each | each canBeRoot ifTrue: [ stream nextPut: each ] ] ] ]); beRequired; yourself. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From davidroe at bluewin.ch Thu Apr 14 21:38:54 2005 From: davidroe at bluewin.ch (=?iso-8859-1?Q?David_R=F6thlisberger?=) Date: Thu, 14 Apr 2005 21:38:54 +0200 Subject: AW: Some problems with SW2 In-Reply-To: <36ab2c0dca9bb38ba240e0e87b1ffe09@iam.unibe.ch> Message-ID: <423AED7D0027856C@mail6.bluewin.ch> (added by postmaster@bluewin.ch) Hi Lukas, > > Another issue currently is the customization of a description if it > > depends on the instance of the structure. For instance, one would like > > to have elements in a select list that are dependent on the instance > > of a structure and that cannot be determined statically. As far as I > > understand the only possibility to achieve that is to override > > #description on the instance-side and to add the desired > > instance-dependent elements there. Or am I mistaken here? > Another powerful thing is the MADynamicObject class, that > allows to define descriptions where you don't know the > possible properties in advance. Try something like: > > B class>>optionsToBeUsed > ^MADynamicObject on: [ 1 to: 100 atRandom ]. Sorry, I don't understand how this is then dependent on the instance, because this is still on the class side, no? I have checked MADynamicObject, but I don't see how can I bring in some instance-based properties? Maybe I did't clarify my problem well enough, so here's an example of what I would like to do: A >> elements ^Array with: instvar1 with: instvar2 with: instvar3 A class >> descriptionElements ^(MAOptionsDescription key: #foo) options: (MADynamicObject on: [ "how can I get access to A >> elements here?" ]); yourself. So I need a way to get the options from instances of the class in which I define the description. Maybe something like a block, such as MADynamicObject on: [:instance | instance elements]. When the options component (select list, radio buttons, ...) is built up, the arg of the block should be bound to the concrete instance of A and then the options are fetched from the #elements method of this instance. As I said, so far I add the options answered by #elements to the options description in A >> description, an override of Object >> description. > It is also possible to clear a description element in a > subclass, by overriding the description method and returning nil > > C class>>descriptionFoo > ^nil > > or you could change the description of the superclass by modifying it: > > C class>>descriptionFoo > ^super descriptionFoo > beReadonly; > nilLabel: 'nothing'; > yourself. Yep, I have seen that, indeed very useful. David From renggli at iam.unibe.ch Thu Apr 14 23:18:02 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Thu, 14 Apr 2005 23:18:02 +0200 Subject: Some problems with SW2 In-Reply-To: <423AED7D0027856C@mail6.bluewin.ch> (added by postmaster@bluewin.ch) References: <423AED7D0027856C@mail6.bluewin.ch> (added by postmaster@bluewin.ch) Message-ID: <02894f53d600c9a7e925161610d1c266@iam.unibe.ch> >> Another powerful thing is the MADynamicObject class, that >> allows to define descriptions where you don't know the >> possible properties in advance. Try something like: >> >> B class>>optionsToBeUsed >> ^MADynamicObject on: [ 1 to: 100 atRandom ]. > > Sorry, I don't understand how this is then dependent on the instance, > because this is still on the class side, no? Okay, in your case there is no ready made solution. Though, it is a very interesting problem to investigate. Just to explain where this problem is coming from: Basically I decided to have no blocks in the descriptions to get an certain uniformity in the interface. Of course it would be possible to have an option-block, but then maybe later on I also want to have a dynamic nil-label-block, and a default-block, ... and nobody knows where that should stop. What is more, blocks are generally a bad thing to serialize, in most of the cases they are not serialize-able at all, and I don't want to spoil ability to serialize description objects. Load the latest version of Magritte (Magritte-All-lr.10) and then there are two different solutions to your problem: 1. Do you descriptions on the instance side of your class exactly as you did on the class side but using the current state of the object. Then override the message #description with the following snipped of code: MyModel>>description ^MABuilder default build: self. 2. Load the latest version of Magritte (Magritte-All-lr.9) and use MAModelObject, it is similar to MADynamicObject but tries to pass into the block the instance of the model. I suggest not to use it, unless you really know what you do. Two more warnings: (1) Debugging code using this dynamic object can be very nasty. (2) Don't have a look at the code if you are easily scared. A class >> descriptionElements ^(MAOptionsDescription selector: #foo) options: (MAModelObject on: [ :model | model zork ]; yourself. The first solution I presented seems to work in all cases and to be much more clean. Try to use this one, if you don't have a reason not to do so! However the second solution is something that main-stream languages can't do and therefor it is cool :-) Does anybody has a third solution? Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Thu Apr 14 23:30:28 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Thu, 14 Apr 2005 23:30:28 +0200 Subject: editing components In-Reply-To: <18561.1113508914@www4.gmx.net> References: <18561.1113508914@www4.gmx.net> Message-ID: <237c2c1e5d82357e5afa4cba2da61e93@iam.unibe.ch> > Now that we can add arbitrary Seaside2 components in SmallWiki2, I'd > like to > be able to edit them. I initially though that'd be quite simple. Just > add a > description to my components and do something like this: > > MyCommand>>asComponent > | comp | > comp := self context componentFor: self structure. > ^(comp asComponent) > "addValidatedForm: #( save cancel );" > addDecoration: (MAFormDecoration buttons: #( save cancel )); > addDecoration: (SW2ValidationDecoration new); > yourself. > > This works until I press the save button. Then somehow my Seaside2 > component > ends up as structure in the context. I don't really understand what you try to do :-/ After all the component instance you are requesting by calling #componentFor: is only existing during the current session. Don't you want to have something more persistent? In my opinion the properties of the Seaside component should be stored in the structure. The description for this could be built from the command object (SW2EditComponentCommand) that is dynamically enhanced with the description of the currently selected component class. Another thing I don't like in your code is that you don't store the modifications in the command object. This means that the changes won't be logged. In general: Never write to the model directly, always use the command pattern, else your changes will be lost. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Fri Apr 15 00:57:32 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Fri, 15 Apr 2005 00:57:32 +0200 Subject: Ask for user input during doExecute or doValidate In-Reply-To: <425EEA11.9010302@students.unibe.ch> References: <18561.1113508914@www4.gmx.net> <425EEA11.9010302@students.unibe.ch> Message-ID: <31a5ae81ddf07452ccc858ac08ea3a21@iam.unibe.ch> > Is ther a way to ask for user input when I'm allready in the doValidate > or doExecute method? No, no way to do that. Commands should be atomic and are execute within a critical section. If you would have user interaction in there you would run into two problems: 1. The separation of the model (Command-Pattern) and the GUI (Seaside) would be broken. 2. When using Seaside as GUI the user could use the back- and forward-buttons and therefor destroy the atomic execution of the command. Again two possible solutions for this: 1. You raise an exception/notification in #doValidate to check for notify the GUI about the fact that there is a password required and then resume the validation. 2. You put a password field right into your command that can be left empty. #doValidate raises an exception if the password is missing or wrong. Hope this helps, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Fri Apr 15 11:00:57 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Fri, 15 Apr 2005 11:00:57 +0200 Subject: Refactoring In-Reply-To: <5C42378C-AD8B-11D9-8300-000D93495E5E@students.unibe.ch> References: <5C42378C-AD8B-11D9-8300-000D93495E5E@students.unibe.ch> Message-ID: Hi Daria, > Wir wollten gerade als Beispiel/Test f?r das Refactoring das L?schen > von allen externen Links auf einer Seite implementieren. Dabei haben > wir festgestellt, dass es keine M?glichkeit gibt, aus einem Container > (z.B. SW2DocumentGroup) ein "Kind" zu entfernen, da children ein Array > ist und das remove nicht zul?sst. Wir dachten daran, Array durch eine > Collection zu ersetzen, was aber nicht ohne weiteres funktioniert. > Hast Du eine Idee, wie wir das l?sen k?nnen? what about self setChildren: (self children copyWithout: aChild). and self setChildren: (self children copyWith: aChild) ? The rational of using arrays is that they are ways more space and time efficient than ordererd collections. Modifications to the parse tree are usually rare, the current code mostly just rebuilds the document. I suggest that you add the code snippets avove as extension methods #add: and #remove: to the composite of the document hierarchy. One thing you have to take care is that some document nodes require a parent information, like the internal links to do the update. So if you add new links you have to set the owner somehow, unless they won't work. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From kustos at gmx.net Fri Apr 15 11:34:03 2005 From: kustos at gmx.net (kustos@gmx.net) Date: Fri, 15 Apr 2005 11:34:03 +0200 (MEST) Subject: editing components References: <237c2c1e5d82357e5afa4cba2da61e93@iam.unibe.ch> Message-ID: <27304.1113557643@www20.gmx.net> Hi My earlier response somehow only got to Lukas. What I know have is: MyComponent class>>descriptionModel | desc | ^ MADynamicObject on: [ SW2CurrentContextHolder value contents in: [ :context | (context componentFor: context structure) in: [ :component | component description ] ] ]. MyCompoent>>doesNotUnderstand: aMessage ^(self context componentFor: self structure) perform: aMessage selector withArguments: aMessage arguments. This works fine for editing one component. However if I edit an other component with a different description, it fails because the description of the old component is used. Should I load Magritte-All-lr.10 and try ? MyCommand>>description ^MABuilder default build: self. Philippe -- +++ NEU: GMX DSL_Flatrate! Schon ab 14,99 EUR/Monat! +++ GMX Garantie: Surfen ohne Tempo-Limit! http://www.gmx.net/de/go/dsl From gluca980 at libero.it Fri Apr 15 17:38:29 2005 From: gluca980 at libero.it (gluca980@libero.it) Date: Fri, 15 Apr 2005 17:38:29 +0200 Subject: create_file Message-ID: Hi, i search to create a new file in smallwiki but i can't. Can you give me one simple example to try in workspace,please. I've tried with this,but it doesn't work: writeFile | aNewFileStream anEncodedStream | aNewFileStream := NewFileStream createFile: 'C:\testutf.txt' mode: #binary onError: []. anEncodedStream := EncodedStream on: aNewFileStream encodedBy: UTF8StreamEncoder new. anEncodedStream nextPut: (Character unicodeValue: 65279). anEncodedStream nextPutAll: ( '125,00 ?'). anEncodedStream nextPutAll: ( 'test '). aNewFileStream close. readFile | aNewFileStream anEncodedStream aString | aNewFileStream := NewFileStream on: (File open: 'c:\testutf.txt') mode: #binary. anEncodedStream := EncodedStream on: aNewFileStream encodedBy: UTF8StreamEncoder new. anEncodedStream next. "Skip header(BOM; for example, FF FE ..)" aString := anEncodedStream nextString. aNewFileStream close. aString out. cheers Gianluca ____________________________________________________________ Navighi a 4 MEGA e i primi 3 mesi sono GRATIS. Scegli Libero Adsl Flat senza limiti su http://www.libero.it From renggli at iam.unibe.ch Fri Apr 15 23:13:42 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Fri, 15 Apr 2005 23:13:42 +0200 Subject: editing components In-Reply-To: <1546.1113553779@www20.gmx.net> References: <237c2c1e5d82357e5afa4cba2da61e93@iam.unibe.ch> <1546.1113553779@www20.gmx.net> Message-ID: <223884ef5bb190270709e0bfc4406339@iam.unibe.ch> >> In my opinion the properties of the Seaside component should be stored >> in the structure. The description for this could be built from the >> command object (SW2EditComponentCommand) that is dynamically enhanced >> with the description of the currently selected component class. Okay, this is now in the latest code, load Magritte-All-lr.11 and SmallWiki2-All-lr.66. Just to be sure, reinitialize the environment and try out the new settings command on the Counter and the Tree-Widget. However there are not that many possible settings yet, but now it is just a matter of writing some descriptions and we will soon have more flexibility as we had in SmallWiki 1 with the templates. I also fixed some other bugs all over SmallWiki. > Right now I'm trying to edit the count of a WACounter (added a > descritption). I know Seaside2 components just live for the session but > that's not a problem for now. > > We can store arbitary objects in dictionary in the user. So we can > write a > structure that has a string and uses this as a key to fetch an object > from > the current user. I want do display and edit them. So we can pretend > we edit persistent objects instead of seaside components. > > Fine with me. Just how do I do that? I tried something like > > MyComponent class>>descriptionModel > ^ MADynamicObject on: [ > SW2CurrentContextHolder value contents in: [ :context | > (context componentFor: context structure) in: [ :component | > component description ] ] ]. > > but that didn't work. Okay, I see, you are probably not interested too much into the stuff I wrote above :-) Even-tough I again tried hard to understand what you want to do with the above code, I could not get it. Mhh, so I guess that you want to know how to use a description on a different model than it has been defined on? Answer: Suppose you have aDescription and aModel from anywhere in your image, you can plug them together and get a Seaside component by sending: aDescription asComponentOn: aModel >> Another thing I don't like in your code is that you don't store the >> modifications in the command object. This means that the changes won't >> be logged. > > Yes, right. This was thought to be a proof of concept prototype, not > the > final version. But how should I do that? Add a Dictionary and override > #doesNotUnderstand? Magritte is always doing a dispatch over the model using #readUsing: and #write:using:, so you should override those. See their implementors for some more documentation. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Sat Apr 16 10:58:15 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 16 Apr 2005 10:58:15 +0200 Subject: Link to page in a other branche of the tree In-Reply-To: <4260D1E4.4030202@students.unibe.ch> References: <5C42378C-AD8B-11D9-8300-000D93495E5E@students.unibe.ch> <4260D1E4.4030202@students.unibe.ch> Message-ID: <22f4e6591f037806693c57cf825bd9dd@iam.unibe.ch> > would it be a great effort to create a new type of link, that points > to a page in a different branche of the tree? I would like to do > something like this: > > SmallWiki 2 > |-Page 1 > |-Page 2 > |- Page 3 (This page has a Link to the page "SmallWiki 2") > > Perhaps a *singelton:SmallWiki 2* tag? :-) No, but you have full support of absolute and relative links simulating the unix file-system. In your case you could chose from any of the following: absolute: */* or nicer */>Back 2 Root* relative: *../..* or nicer *../..>2 Levels Up* Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From Roel.Wuyts at ulb.ac.be Sun Apr 17 10:03:34 2005 From: Roel.Wuyts at ulb.ac.be (Roel Wuyts) Date: Sun, 17 Apr 2005 10:03:34 +0200 Subject: Urgent: IE and Smallwiki Message-ID: <2aeea08455c5f76ad9f2c98e5bbc124f@ulb.ac.be> Hello, check out: http://decomp.ulb.ac.be:8082/ : it works with Safari (under Mac) or Firefox (under Windows), but *not* with Internet Explorer. Any ideas on what the problem is and how I can fix this ? -- Roel Wuyts DeComp roel.wuyts at ulb.ac.be Universit? Libre de Bruxelles http://homepages.ulb.ac.be/~rowuyts/ Belgique Vice-President of the European Smalltalk Users Group: www.esug.org From renggli at iam.unibe.ch Sun Apr 17 10:34:23 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sun, 17 Apr 2005 10:34:23 +0200 Subject: Urgent: IE and Smallwiki In-Reply-To: <2aeea08455c5f76ad9f2c98e5bbc124f@ulb.ac.be> References: <2aeea08455c5f76ad9f2c98e5bbc124f@ulb.ac.be> Message-ID: Hi Roel, > check out: http://decomp.ulb.ac.be:8082/ : it works with Safari (under > Mac) or Firefox (under Windows), but *not* with Internet Explorer. Any > ideas on what the problem is and how I can fix this ? wow, what a nice design! Evalue the following expression: server basePath: 'http://decomp.ulb.ac.be:8082/' IE doesn't seem to properly handle relative links. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From ducasse at iam.unibe.ch Sun Apr 17 10:42:46 2005 From: ducasse at iam.unibe.ch (=?ISO-8859-1?Q?st=E9phane_ducasse?=) Date: Sun, 17 Apr 2005 10:42:46 +0200 Subject: Urgent: IE and Smallwiki In-Reply-To: <2aeea08455c5f76ad9f2c98e5bbc124f@ulb.ac.be> References: <2aeea08455c5f76ad9f2c98e5bbc124f@ulb.ac.be> Message-ID: <86c79faeffa9e153c07cf1cb48ee8a76@iam.unibe.ch> really nice look stef On 17 avr. 05, at 10:03, Roel Wuyts wrote: > Hello, > > check out: http://decomp.ulb.ac.be:8082/ : it works with Safari (under > Mac) or Firefox (under Windows), but *not* with Internet Explorer. Any > ideas on what the problem is and how I can fix this ? > > -- > Roel Wuyts > DeComp > roel.wuyts at ulb.ac.be Universit? Libre de > Bruxelles > http://homepages.ulb.ac.be/~rowuyts/ > Belgique > Vice-President of the European Smalltalk Users Group: www.esug.org > From Roel.Wuyts at ulb.ac.be Sun Apr 17 10:46:27 2005 From: Roel.Wuyts at ulb.ac.be (Roel Wuyts) Date: Sun, 17 Apr 2005 10:46:27 +0200 Subject: Urgent: IE and Smallwiki In-Reply-To: References: <2aeea08455c5f76ad9f2c98e5bbc124f@ulb.ac.be> Message-ID: Hah, thanks. I should have checked that. My launch script is supposed to set it when the headless image is launched, but I guess something goes wrong there. Applied it in the running SmallWiki and all is well now! On 17 Apr 2005, at 10:34, Lukas Renggli wrote: > Hi Roel, > >> check out: http://decomp.ulb.ac.be:8082/ : it works with Safari >> (under Mac) or Firefox (under Windows), but *not* with Internet >> Explorer. Any ideas on what the problem is and how I can fix this ? > > wow, what a nice design! > > Evalue the following expression: > > server basePath: 'http://decomp.ulb.ac.be:8082/' > > IE doesn't seem to properly handle relative links. > > Cheers, > Lukas > > -- > Lukas Renggli > http://www.lukas-renggli.ch > > Roel Wuyts DeComp roel.wuyts at ulb.ac.be Universit? Libre de Bruxelles http://homepages.ulb.ac.be/~rowuyts/ Belgique Vice-President of the European Smalltalk Users Group: www.esug.org From Roel.Wuyts at ulb.ac.be Sun Apr 17 10:48:19 2005 From: Roel.Wuyts at ulb.ac.be (Roel Wuyts) Date: Sun, 17 Apr 2005 10:48:19 +0200 Subject: Urgent: IE and Smallwiki In-Reply-To: References: <2aeea08455c5f76ad9f2c98e5bbc124f@ulb.ac.be> Message-ID: <70043e9117403b44a241f71712ad8140@ulb.ac.be> PS: Thanks for the super-quick response :-) PS: and check out the following styles (I've been busy :-) ): http://decomp.ulb.ac.be:8082/roelwuyts/ http://decomp.ulb.ac.be:8081/ On 17 Apr 2005, at 10:34, Lukas Renggli wrote: > Hi Roel, > >> check out: http://decomp.ulb.ac.be:8082/ : it works with Safari >> (under Mac) or Firefox (under Windows), but *not* with Internet >> Explorer. Any ideas on what the problem is and how I can fix this ? > > wow, what a nice design! > > Evalue the following expression: > > server basePath: 'http://decomp.ulb.ac.be:8082/' > > IE doesn't seem to properly handle relative links. > > Cheers, > Lukas > > -- > Lukas Renggli > http://www.lukas-renggli.ch > > Roel Wuyts DeComp roel.wuyts at ulb.ac.be Universit? Libre de Bruxelles http://homepages.ulb.ac.be/~rowuyts/ Belgique Vice-President of the European Smalltalk Users Group: www.esug.org From renggli at iam.unibe.ch Sun Apr 17 11:02:52 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sun, 17 Apr 2005 11:02:52 +0200 Subject: Urgent: IE and Smallwiki In-Reply-To: <70043e9117403b44a241f71712ad8140@ulb.ac.be> References: <2aeea08455c5f76ad9f2c98e5bbc124f@ulb.ac.be> <70043e9117403b44a241f71712ad8140@ulb.ac.be> Message-ID: <61acd0dabf6aa2e0075fd27fbddbffce@iam.unibe.ch> > PS: and check out the following styles (I've been busy :-) ): > http://decomp.ulb.ac.be:8082/roelwuyts/ > http://decomp.ulb.ac.be:8081/ > Wow, I am really impressed -- SmallWiki in all different shapes and looks. I registered to the RSS feeds to keep updated ;-) Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From ducasse at iam.unibe.ch Sun Apr 17 11:04:28 2005 From: ducasse at iam.unibe.ch (=?ISO-8859-1?Q?st=E9phane_ducasse?=) Date: Sun, 17 Apr 2005 11:04:28 +0200 Subject: Urgent: IE and Smallwiki In-Reply-To: <70043e9117403b44a241f71712ad8140@ulb.ac.be> References: <2aeea08455c5f76ad9f2c98e5bbc124f@ulb.ac.be> <70043e9117403b44a241f71712ad8140@ulb.ac.be> Message-ID: reallly cool. Stef On 17 avr. 05, at 10:48, Roel Wuyts wrote: > PS: Thanks for the super-quick response :-) > > PS: and check out the following styles (I've been busy :-) ): > http://decomp.ulb.ac.be:8082/roelwuyts/ > http://decomp.ulb.ac.be:8081/ > > On 17 Apr 2005, at 10:34, Lukas Renggli wrote: > >> Hi Roel, >> >>> check out: http://decomp.ulb.ac.be:8082/ : it works with Safari >>> (under Mac) or Firefox (under Windows), but *not* with Internet >>> Explorer. Any ideas on what the problem is and how I can fix this ? >> >> wow, what a nice design! >> >> Evalue the following expression: >> >> server basePath: 'http://decomp.ulb.ac.be:8082/' >> >> IE doesn't seem to properly handle relative links. >> >> Cheers, >> Lukas >> >> -- >> Lukas Renggli >> http://www.lukas-renggli.ch >> >> > Roel Wuyts > DeComp > roel.wuyts at ulb.ac.be Universit? Libre de > Bruxelles > http://homepages.ulb.ac.be/~rowuyts/ > Belgique > Vice-President of the European Smalltalk Users Group: www.esug.org > > From renggli at iam.unibe.ch Sun Apr 17 11:11:16 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sun, 17 Apr 2005 11:11:16 +0200 Subject: SmallWiki2 and Magriette In-Reply-To: <20050417031155.25706.qmail@server271.com> References: <20050417031155.25706.qmail@server271.com> Message-ID: <1f7c88960b726dde046bb715d42fb5e7@iam.unibe.ch> Hi, > I read through your excellent presentation via Ian Prince's proaises > on his blog and I was intrigued by the Magriette framework that was > mentioned. I tried looking for the SmallWiki2 code in the VW code > repository and SqueakMap but came up empty. I did find SmallWiki2 on > the VW repository, but it seemed old. SmallWiki2 looks very cool and I > would love to play with it. I'm especially interested in the magriette > framework. Is there any chance that I could try out the code? > Everything in the presentation sounded very exciting! thanks a lot for your compliments! some time ago, I decided to change the primary development environment to Squeak. See the mailing-list archive for a discussion about this. Since I started out in VisualWorks there are still some very old packages in the public repository. There are no packages of SmallWiki2 and Magritte on SqueakSource yet, basically because both frameworks are still in a pre-alpha phase and the interface is still changing slightly. However you can always get the latest source code from http://mc.lukas-renggli.ch/smallwiki2 and http://mc.lukas-renggli.ch/magritte. Ready made preview-images can be downloaded from http://www.iam.unibe.ch/~scg/Teaching/AdvancedLabs/swimages. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From mike at mjr104.co.uk Sun Apr 17 17:02:26 2005 From: mike at mjr104.co.uk (Michael Roberts) Date: Sun, 17 Apr 2005 16:02:26 +0100 Subject: More roles Message-ID: <200504171602.26861.mike@mjr104.co.uk> Hi, I think I have followed both the archives and the FAQ in order to prevent access to part of my (Squeak) SmallWiki by the anonymous user: server root roles: (OrderedCollection with: server defaultRoleAnonymous). (server root at: 'Secret') roles: (OrderedCollection with: (SWBasicRole name: 'anonymous')) However this doesn't work for me and I don't understand why. I would really appreciate some pointers to diagnose this. I have stepped through the code but I can't see what is responsible for preventing the permissions being added from the root role when the role is specified on the child with an empty set of permissions. I can see the barrier logic, but this isn't a barrier role, and all the rest of the behaviour seems to add the permissions from the root back. Hence I can see the page as the anonymous user? Thanks Mike From renggli at iam.unibe.ch Tue Apr 19 20:28:09 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 19 Apr 2005 20:28:09 +0200 Subject: More roles In-Reply-To: <200504171602.26861.mike@mjr104.co.uk> References: <200504171602.26861.mike@mjr104.co.uk> Message-ID: <226d791635fb8fd5eb0510fcd7f7cf45@iam.unibe.ch> Oups, sorry for my slow replay, too much traffic lately. > I think I have followed both the archives and the FAQ in order to > prevent > access to part of my (Squeak) SmallWiki by the anonymous user: > > server root roles: (OrderedCollection with: server > defaultRoleAnonymous). > (server root at: 'Secret') roles: > (OrderedCollection with: (SWBasicRole name: 'anonymous')) That looks perfectly correct for me. I don't understand why it doesn't work for you. I suspect, you don't even need the first line of code. > I have stepped through the code but I can't see what is responsible for > preventing the permissions being added from the root role when the > role is > specified on the child with an empty set of permissions. I can see the > barrier logic, but this isn't a barrier role, and all the rest of the > behaviour seems to add the permissions from the root back. Hence I > can see > the page as the anonymous user? Strange, why the heck there is a barrier role in your image? This is actually not part of the base package of SmallWiki. As far as I know it changes some critical messages in the security framework, so it might have broken something. David Vogel can you help here? Lukas -- Lukas Renggli http://www.lukas-renggli.ch From ducasse at iam.unibe.ch Tue Apr 19 20:59:42 2005 From: ducasse at iam.unibe.ch (=?ISO-8859-1?Q?st=E9phane_ducasse?=) Date: Tue, 19 Apr 2005 20:59:42 +0200 Subject: More roles In-Reply-To: <226d791635fb8fd5eb0510fcd7f7cf45@iam.unibe.ch> References: <200504171602.26861.mike@mjr104.co.uk> <226d791635fb8fd5eb0510fcd7f7cf45@iam.unibe.ch> Message-ID: >> I have stepped through the code but I can't see what is responsible >> for >> preventing the permissions being added from the root role when the >> role is >> specified on the child with an empty set of permissions. I can see >> the >> barrier logic, but this isn't a barrier role, and all the rest of the >> behaviour seems to add the permissions from the root back. Hence I >> can see >> the page as the anonymous user? Can you tell us which version of SmallWiki and package you use since some security models are not maintained anymore (such as the one described in the master of David Vogel)? Stef From renggli at iam.unibe.ch Tue Apr 19 21:15:06 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 19 Apr 2005 21:15:06 +0200 Subject: AW: [SW2] Patches In-Reply-To: <423AEE7700182948@mail17.bluewin.ch> (added by postmaster@bluewin.ch) References: <423AEE7700182948@mail17.bluewin.ch> (added by postmaster@bluewin.ch) Message-ID: >> Why didn't you put the images in the style library? It seems >> strange to me to have them at a different location. > > Yes, I felt the same, but I didn't know what's the correct way of > putting > images into the library and I couldn't find any example for that, so I > was a > bit lost. > I have found a way to store images in the Squeak image, but is it > really > possible to link to these images from within a CSS definition? Yeah, of course in Smalltalk everything is possible ;-) Have a look at the smilies, however I doubt that this code works, it has been written back in the VisualWorks days. And for the style-sheets the tricky part is somewhere else, maybe ask that to the Seaside list ... Thanks for your submissions, I merged them in and published the new code in the repository. Some comments: - I kept the old style-include in SW2MainFrame till we get the thing with the images ironed out. There was something wrong with the line-feeds (as usual), so I pasted in the original files, I hope this is fine for everyone now? - I enhanced your enhancement to reject possible commands slightly, so that the structure instance is asked with the command-class and the context if this command is valid. I need this, in some of my newly created classes. I hope this suits your needs as well? Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Tue Apr 19 21:40:52 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 19 Apr 2005 21:40:52 +0200 Subject: More roles In-Reply-To: <226d791635fb8fd5eb0510fcd7f7cf45@iam.unibe.ch> References: <200504171602.26861.mike@mjr104.co.uk> <226d791635fb8fd5eb0510fcd7f7cf45@iam.unibe.ch> Message-ID: <21c44ca23fe793e508609d40039ac1e0@iam.unibe.ch> >> I have stepped through the code but I can't see what is responsible >> for >> preventing the permissions being added from the root role when the >> role is >> specified on the child with an empty set of permissions. I can see >> the >> barrier logic, but this isn't a barrier role, and all the rest of the >> behaviour seems to add the permissions from the root back. Hence I >> can see >> the page as the anonymous user? > > Strange, why the heck there is a barrier role in your image? This is > actually not part of the base package of SmallWiki. As far as I know > it changes some critical messages in the security framework, so it > might have broken something. David Vogel can you help here? The following is one of the critical overrides to the SmallWiki core, check if you have this code and restore it if necessary. It should then work as you expect: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Structure>>processSecurity: aRequest "Update the roles of the current user according to the current role configuration. See #updateRoles: in the \texttt{User} class for additional information." aRequest updateRoles: roles -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Tue Apr 19 21:40:52 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 19 Apr 2005 21:40:52 +0200 Subject: More roles In-Reply-To: <226d791635fb8fd5eb0510fcd7f7cf45@iam.unibe.ch> References: <200504171602.26861.mike@mjr104.co.uk> <226d791635fb8fd5eb0510fcd7f7cf45@iam.unibe.ch> Message-ID: <21c44ca23fe793e508609d40039ac1e0@iam.unibe.ch> >> I have stepped through the code but I can't see what is responsible >> for >> preventing the permissions being added from the root role when the >> role is >> specified on the child with an empty set of permissions. I can see >> the >> barrier logic, but this isn't a barrier role, and all the rest of the >> behaviour seems to add the permissions from the root back. Hence I >> can see >> the page as the anonymous user? > > Strange, why the heck there is a barrier role in your image? This is > actually not part of the base package of SmallWiki. As far as I know > it changes some critical messages in the security framework, so it > might have broken something. David Vogel can you help here? The following is one of the critical overrides to the SmallWiki core, check if you have this code and restore it if necessary. It should then work as you expect: -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Structure>>processSecurity: aRequest "Update the roles of the current user according to the current role configuration. See #updateRoles: in the \texttt{User} class for additional information." aRequest updateRoles: roles -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From mike at mjr104.co.uk Wed Apr 20 23:57:24 2005 From: mike at mjr104.co.uk (Michael Roberts) Date: Wed, 20 Apr 2005 22:57:24 +0100 Subject: More roles In-Reply-To: <226d791635fb8fd5eb0510fcd7f7cf45@iam.unibe.ch> References: <200504171602.26861.mike@mjr104.co.uk> <226d791635fb8fd5eb0510fcd7f7cf45@iam.unibe.ch> Message-ID: <200504202257.25147.mike@mjr104.co.uk> On Tuesday 19 April 2005 19:28, Lukas Renggli wrote: > Oups, sorry for my slow replay, too much traffic lately. no worries at all! thanks for the comments. I've checked the versions and its roughly Squeak 3.7 #5989 with SmallWiki-chbu-0.9.53-10.mcz (DynamicBindings-gk.1.mcz KomHttpServer-gk.6.mcz KomServices-gk.2.mcz Monticello-avi.231.mcz Refactory-md.3.7.36.mcz SmaCC-Runtime-md.4.mcz) > Strange, why the heck there is a barrier role in your image? This is > actually not part of the base package of SmallWiki. As far as I know it > changes some critical messages in the security framework, so it might > have broken something. David Vogel can you help here? > I have to admit to not having fully checked out a version for VW from Store so I'll do that and compare. I wanted to use Squeak and public Store is a bit painful at times.... anyway I only mentioned the barrier role because the hierarchy goes something like SWRole SWBasicRole SWBarrierRole and I was stepping through the code and it does some checking.. etc. so maybe I've got an old version of the port to Squeak? I think it's the one on SM. As for the method you mentioned in a later post --- processSecurity: aRequest "Update the roles of the current user according to the current role configuration and to the permisson strips given in the structures role barrier. - See #updateRoles: in the \texttt{User} class for additional information. - if we are on the root structure: clear the roles of the current user" self = aRequest server root ifTrue: [aRequest clearUserRoles]. aRequest updateRoles: roles --- so I'm not sure if the difference is important or not. The code in SWUser>>updateRole: and updateRoles: seems to be where I sit in the debugger e.g. --- updateRoles: aCollection "Create a new user with aCollection of roles updated, - make sure to remove the permissions in BarrierRole from the user' s role - exept for an user with an admin permission. - don't update anything for main administrator" | myUser | myUser := self copy. myUser isNotMainAdmin ifTrue: [myUser isNotAdmin ifTrue: [myUser := self clearRolesFromBarrierPermissions: aCollection]. aCollection notNil ifTrue: [^aCollection inject: myUser into: [:user :role | user updateRole: role]]]. ^myUser updateRole: currentStructureRole "Create a new user with aRole updated. if the user owns a role with the currentStructureRole name: - make a copy of user, and add the permissions of currentStructureRole to users role with same name; keep also its permission" ^(roles includes: currentStructureRole) ifTrue: [| newUser | newUser := self copy. roles do: [:userRole | userRole name = currentStructureRole name ifTrue: [newUser add: ((SWBasicRole name: userRole name) addAll: userRole permissions; addAll: currentStructureRole permissions; yourself)]]. newUser] ifFalse: [self] -- anyway I don't need to quote you all the code. I guess what I would find useful to know is which version I should be using. It's just a bit frustrating because I have the enthusiasm and I am making various people aware of SmallWiki but I can't quite get it sorted. I'm just hoping I've got the wrong version or I'm being usually stupid. I really want to deploy one version using VW and one version using Squeak in the short term. Longer term I'm looking at SW2 (started to poke around) and various extensions etc. When I tried to load SmallWiki from public store (an aborted attempt because it took too long), actually when I load almost anything from Store, I tend to get asked lots of questions about pre-requisite versions. Is there any advice about which versions I should pick. I wouldn't pick something blessed as broken but it would be nice to know whether people just take the latest development versions of all pre-reqs etc. Thanks for the time Cheers Mike From davidroe at bluewin.ch Thu Apr 21 22:01:44 2005 From: davidroe at bluewin.ch (=?iso-8859-1?Q?David_R=F6thlisberger?=) Date: Thu, 21 Apr 2005 22:01:44 +0200 Subject: AW: AW: [SW2] Patches In-Reply-To: Message-ID: <423AEC47003B65EC@mail2.bluewin.ch> (added by postmaster@bluewin.ch) > Yeah, of course in Smalltalk everything is possible ;-) Have > a look at the smilies, however I doubt that this code works, > it has been written back in the VisualWorks days. Here is the code that works in Squeak to read a directory of images. Then each image is stored as an array in a method with the same name. | contents source fileStream | (self directory fileNamesMatching: '*.png') do: [:imageName | fileStream := self directory readOnlyFileNamed: imageName. contents := [ fileStream contents asByteArray ] ensure: [ fileStream close ]. source := String streamContents: [ :stream | stream nextPutAll: (self convertFileNameToSelector: imageName); cr. stream tab; nextPutAll: '^ #('. contents do: [:element | element storeOn: stream ] separatedBy: [ stream space ]. stream nextPut: $); space; nextPutAll: 'asByteArray.' ]. self class compile: source classified: #images. ]. > And for the > style-sheets the tricky part is somewhere else, maybe ask > that to the Seaside list ... Ok, so far I didn't receive the answer that I would like to hear. ;) I tried the suggestion of Pavel (subclassing WAKom and overriding #processHttpRequest:) and it does not yet work, but I have expected that there would be a better way of doing it anyway... > - I enhanced your enhancement to reject possible commands > slightly, so that the structure instance is asked with the > command-class and the context if this command is valid. I > need this, in some of my newly created classes. I hope this > suits your needs as well? Yes, it works now in the newest version of SW2 as I need it, thanks. David From renggli at iam.unibe.ch Sat Apr 23 15:17:47 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 23 Apr 2005 15:17:47 +0200 Subject: broken kernel In-Reply-To: <31742.1114204136@www2.gmx.net> References: <31742.1114204136@www2.gmx.net> Message-ID: <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> > The way I broke the kernel I think is in a #doValidate I did a self > error: > 'foo'. I thought this was a the correct way to signal that there's > something > wrong with the user input. It obviously wasn't because I didn't get a > SW2 or > MA error but a Seaside error. So what is the correct way? Today I am in a paper writing mode, so let me try to explain this a little bit more than usual: The lock in the SmallWiki kernel makes sure that only one command is executed at once. It makes sure that the model doesn't get into an invalid state due to concurrent write accesses. However, having locks especially during the development phase, can be pretty boring: say if you are using the debugger to step through a critical section, restart, jump out of it, ... you might run into troubles because its semaphores are not properly reset. This is neither an implementation error of SmallWiki nor one of the the lock-implementation in Smalltalk, but a common and well known issue in powerful languages such as Smalltalk or Scheme, where the exception handling is done at the language and not at the VM level. Java, C#, C++, PHP, ... don't show this issue since their execution stack is not a first class object and the exception handling is out of the scope of the programmer, after an unhanded exception your application needs to be restarted anyway. A greatly simplified implementation of a lock might look the following piece of code. The critical piece is the ensure block, that ensures that the lock is opened after doing the critical thing in aBlock. So whatever happens inside aBlock (finishing the evaluation of the block, doing a non-local return from within the block, raising an exception, etc.) first the ensure-block is evaluated before continuing with the default executing. So if you have a self halt in there the ensure-block will be evaluated because the debugger is opened in a exception handler at the very top of the stack. However with the debugger we are able to jump back into aBlock and continue the execution, but now within the unlocked context. Of course when exiting again from aBlock the ensure-block will be evaluated again and the lock might get into a bad state. lock: aBlock self waitUntilUnlocked; lock. aBlock ensure: [ self unlock ]. Especially when using Seaside you have to be aware and take care about the use of ensure-blocks: say if you are using continuations to jump into aBlock or out of aBlock the semantics of the #ensure: are basically undefined! Should it be evaluated multiple times? Only the first time? Only the last time? How do we know when we leave aBlock for the last time? Actually I suggest, not to mix continuations and ensure-blocks. > Are there better/saver ways to fix such isses? No, it is a known problem, without good solutions. Search Google for "continuation unwind" and you will find a lot of material about this. > Is there some way of resting the kernel lock if a a command goes wild? SW2Kernel kernels do: [ :each | each instVarAt: 'lock' put: each defaultLock ]. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Sat Apr 23 15:38:37 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 23 Apr 2005 15:38:37 +0200 Subject: broken kernel In-Reply-To: <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> References: <31742.1114204136@www2.gmx.net> <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> Message-ID: >> Is there some way of resting the kernel lock if a a command goes wild? > > SW2Kernel kernels do: [ :each | > each instVarAt: 'lock' put: each defaultLock ]. Is is ... SW2Kernel kernels do: [ :each | each instVarNamed: 'lock' put: each defaultLock ]. of course ;-) -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Sun Apr 24 09:58:58 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sun, 24 Apr 2005 09:58:58 +0200 Subject: broken kernel In-Reply-To: <26295.1114265991@www67.gmx.net> References: <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> <26295.1114265991@www67.gmx.net> Message-ID: <5e91ecc1cec885e94b829a91b1865b65@iam.unibe.ch> > I looked at your code and you placed self error: there too (basically > in > #validateChild:titled:in:). But if I do this, I break my kernel. So how > should I do this? Strang, I've never seen this and I'm unable to reproduce. The error and validation handling in Magritte is certainly a dark part of the framework, it is trying to collect all errors by resuming certain exceptions and therefor jumps around in the code. However this doesn't work quite well as I expect, it definitely needs a different concept and some more work. Try to load the latest packages, I added an exception hander around the command validation so that any error is transformed into a Magritte error. Does this help? Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From Fritsche.Markus at gmx.net Tue Apr 26 23:15:17 2005 From: Fritsche.Markus at gmx.net (Markus Fritsche) Date: Tue, 26 Apr 2005 23:15:17 +0200 Subject: Squeak SmallWiki prototype - external links Message-ID: <426EAF65.10505@gmx.net> Hi! I saw the external link marker on the Squeak SmallWiki prototype; I saw that they're css based in wikipedia - does the prototype implement them the same way, and if yes, what do I have to alter to use them in my own wiki? Regards, Markus -- http://reauktion.de/archer/ From renggli at iam.unibe.ch Wed Apr 27 07:35:00 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Wed, 27 Apr 2005 07:35:00 +0200 Subject: Squeak SmallWiki prototype - external links In-Reply-To: <426EAF65.10505@gmx.net> References: <426EAF65.10505@gmx.net> Message-ID: <15c9891ae5c5cb823e7046d83a352e36@iam.unibe.ch> Hi Markus, > I saw the external link marker on the Squeak SmallWiki prototype; I > saw that they're css based in wikipedia - does the prototype implement > them the same way, and if yes, what do I have to alter to use them in > my own wiki? I checked this site, but I don't understand what you mean with the external link marker? http://en.wikipedia.org/wiki/Wikipedia: How_to_edit_a_page#Links_and_URLs The syntax of SmallWiki 1 [1] allows to alias links, is that what you are interested in? Else there is always the possibility to put raw html into your wiki pages, e.g. the two are equivalent: *Google>http://www.google.com* Google SmallWiki 2 will have a slightly enhanced syntax for links, e.g. it will support explicit embedding of any internal page, file, ... by putting something like *+Link+*. What is more it provides dynamic links, so one could write *isbn:123456789* and the wiki would automatically generate a link to a pre-configured bookstore. Cheers, Lukas - 1 ---------------------------------------------------------- To create a link, put it between *s. There are three different types of links: Internal Link: If the item exists in the Smallwiki (e.g. *Title of Item*), a link to that item shows up when the page is saved. In case the item does not already exist, the link shows up with a create-button next to it; click on it to create the new item. External Link: If the link is a valid url (e.g. *http://www.google.ch*), a link to that external page shows up. Mail Link: If the link is an email address (e.g. *self at mail.me.com*), a link to mail that person shows up, but it is obfuscated to prevent robots from collecting. You can also alias all these links using >. So, you can create a link like this: *Alias>Reference*. The link will show up as Alias, but link to Reference. For images, the alias text will become the alternate text for the image. -- Lukas Renggli http://www.lukas-renggli.ch From Fritsche.Markus at gmx.net Wed Apr 27 14:27:18 2005 From: Fritsche.Markus at gmx.net (Markus Fritsche) Date: Wed, 27 Apr 2005 14:27:18 +0200 Subject: Squeak SmallWiki prototype - external links In-Reply-To: <15c9891ae5c5cb823e7046d83a352e36@iam.unibe.ch> References: <426EAF65.10505@gmx.net> <15c9891ae5c5cb823e7046d83a352e36@iam.unibe.ch> Message-ID: <426F8526.3020509@gmx.net> Lukas Renggli wrote: > Hi Markus, > >> I saw the external link marker on the Squeak SmallWiki prototype; I >> saw that they're css based in wikipedia - does the prototype >> implement them the same way, and if yes, what do I have to alter to >> use them in my own wiki? > > > I checked this site, but I don't understand what you mean with the > external link marker? Well, as far as I understand, external links (those created with *link>http://target/*) are known to the structure as being external. So, I'd like to alter the class on external links - like http://box1.squeakfoundation.org:7777/ *Seaside>http://www.seaside.st/* expands to Seaside. The question is, where is the right place in the code to do that? Or is it a preference I have not yet found? -- http://reauktion.de/archer/ From renggli at iam.unibe.ch Wed Apr 27 18:07:35 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Wed, 27 Apr 2005 18:07:35 +0200 Subject: Squeak SmallWiki prototype - external links In-Reply-To: <426F8526.3020509@gmx.net> References: <426EAF65.10505@gmx.net> <15c9891ae5c5cb823e7046d83a352e36@iam.unibe.ch> <426F8526.3020509@gmx.net> Message-ID: <7b8e38b67978ff2ee0a2224d72f4251c@iam.unibe.ch> >>> I saw the external link marker on the Squeak SmallWiki prototype; I >>> saw that they're css based in wikipedia - does the prototype >>> implement them the same way, and if yes, what do I have to alter to >>> use them in my own wiki? >> >> >> I checked this site, but I don't understand what you mean with the >> external link marker? > > Well, as far as I understand, external links (those created with > *link>http://target/*) are known to the structure as being external. > So, I'd like to alter the class on external links - like > http://box1.squeakfoundation.org:7777/ > *Seaside>http://www.seaside.st/* expands to > > href="http://www.seaside.st/">Seaside. > The question is, where is the right place in the code to do that? Or > is it a preference I have not yet found? Ahh, I see the point. If you want the target to be _blank for all the external links you could add the following method: VisitorRendererHtml>>acceptLinkExternal: aLink stream attributeAt: 'target' put: '_blank'. super acceptLinkExternal: aLink. If you want this attribute to be set just for a few external links either use HTML in these cases or add a property to LinkExternal and update the classes WikiParser, WikiScanner, VisitorRendererWiki and VisitorRendererHtml accordingly. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From davidroe at bluewin.ch Thu Apr 14 21:38:54 2005 From: davidroe at bluewin.ch (=?iso-8859-1?Q?David_R=F6thlisberger?=) Date: Thu, 14 Apr 2005 21:38:54 +0200 Subject: AW: Some problems with SW2 In-Reply-To: <36ab2c0dca9bb38ba240e0e87b1ffe09@iam.unibe.ch> Message-ID: <423AED7D0027856C@mail6.bluewin.ch> (added by postmaster@bluewin.ch) Hi Lukas, > > Another issue currently is the customization of a description if it > > depends on the instance of the structure. For instance, one would like > > to have elements in a select list that are dependent on the instance > > of a structure and that cannot be determined statically. As far as I > > understand the only possibility to achieve that is to override > > #description on the instance-side and to add the desired > > instance-dependent elements there. Or am I mistaken here? > Another powerful thing is the MADynamicObject class, that > allows to define descriptions where you don't know the > possible properties in advance. Try something like: > > B class>>optionsToBeUsed > ^MADynamicObject on: [ 1 to: 100 atRandom ]. Sorry, I don't understand how this is then dependent on the instance, because this is still on the class side, no? I have checked MADynamicObject, but I don't see how can I bring in some instance-based properties? Maybe I did't clarify my problem well enough, so here's an example of what I would like to do: A >> elements ^Array with: instvar1 with: instvar2 with: instvar3 A class >> descriptionElements ^(MAOptionsDescription key: #foo) options: (MADynamicObject on: [ "how can I get access to A >> elements here?" ]); yourself. So I need a way to get the options from instances of the class in which I define the description. Maybe something like a block, such as MADynamicObject on: [:instance | instance elements]. When the options component (select list, radio buttons, ...) is built up, the arg of the block should be bound to the concrete instance of A and then the options are fetched from the #elements method of this instance. As I said, so far I add the options answered by #elements to the options description in A >> description, an override of Object >> description. > It is also possible to clear a description element in a > subclass, by overriding the description method and returning nil > > C class>>descriptionFoo > ^nil > > or you could change the description of the superclass by modifying it: > > C class>>descriptionFoo > ^super descriptionFoo > beReadonly; > nilLabel: 'nothing'; > yourself. Yep, I have seen that, indeed very useful. David From renggli at iam.unibe.ch Tue Apr 12 23:39:25 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 12 Apr 2005 23:39:25 +0200 Subject: Some problems with SW2 In-Reply-To: <423AEE770012D75E@mail17.bluewin.ch> (added by postmaster@bluewin.ch) References: <423AEE770012D75E@mail17.bluewin.ch> (added by postmaster@bluewin.ch) Message-ID: <3f86d7c325e9d3afd501d58e47464206@iam.unibe.ch> Hi David, > There's probably a bug in SW2PluggableComponent>>renderContentOn: > This class has a block as an inst var and in #renderContentOn: this > block is > analyzed if it expects two args. If not, it's tried to render this > block > with html render: block. But this won't work, because a block can't be > rendered directly. well what do you do with your all your div, span, heading and anchor-tags? There are blocks that are rendered all over the place :-) html div: [ html span: [ html heading: [ html anchorWith... do: [ ... ] ]?] ]. Have a look at WAAbstractHtmlBuilder>>render: and BlockContext>>renderOn: where the double dispatch on blocks happens. As you can see Seaside accepts zero and one argument blocks, and I enhanced this for SW2PluggableComponent to have two possible arguments. However it is generally not a very good idea to use SW2PluggableComponent extensively, but for fast prototyping its use might be nice. Currently there is no use of SW2PluggableComponent in SmallWiki2 anymore. > Another issue is that the style-sheet is stored in a remote file which > we > could not change/extend. Wouldn't it be better to have the style > definitions > directly in the image? For instance you could create a style library > class > for SW2. Please submit a patch to SmallWiki2-Seaside, I just didn't bothered to put all those style-sheets and images into a style library class yet, it was simply easier for me to edit the file in a css-editor. Check out the new style, it has some fancy css-buttons in the heading-bar! > Then I have encountered a problem with the commands for a structure. I > have > created a new subclass of Structure and now I would like to define some > commands for this new kind of structure. But then all the other > commands > that are bound to Structure (like Move, Copy, Add, ...) will also be > displayed in the command widget when browsing an instance of this new > structure. I see no way to specify that these commands should not be > available for my newly defined structure. It would be better to have > the > possibility to explicitly say for which structures a command should be > available. A collection of structure classes instead of SW2Command > class >> > defaultStructureClass maybe? I see the problem, but having collection the commands (static state) wouldn't solve the problem either, because one cannot know what structure and commands (it is an m to n relationship) will exist in the future. It also gets difficult because one doesn't know who has the responsibility to register the commands, the command or the structure? Generally I prefer dynamic state, that means we should introduce another dispatch in SW2Context>>allValidCommands to let the command and the structure have the possibility to reject a command. > Another problem with newly created subclasses of Structure is that > they will > all appear in the 'type'-dropdown when adding a child structure with > the > AddCommand. This might not be desired for all subclasses of Structure. Similar problem as above: I suggest that you submit a patch to the latest SmallWiki2 package that fits your needs so that it can be merged into the core code and everybody can profit. > It would be great to have a method MAElementDescription >> > attributeAt:put: > to specify new attributes for the component of a description. > Currently, one > has to use #attributes which is not convenient. Margritte is not a Seaside framework, generally speaking. As far as I know there is just one use of #attributes: in SmallWiki itself and as I don't write code that I don't need, I didn't felt the need for such methods yet. However feel free to add them for your convenience, that's the reason why there are class extensions ;-) > Then there are several components available that render a text field > with a > button, such as MADateInputComponent, MATimestampInputComponent, ... I > tried > to create a subclass of such a component to change the button's > appearance > (different label or an image as button). But this is not possible > because > the button is rendered directly in #renderEditorOn:, so I can't > override > this method. It would be better to have a method #renderButtonOn: in > MATextInputComponent, so all subclasses with a button have to override > just > this method which would be empty in MATextInputComponent. Yeah, I see, maybe sometimes I am too lazy. > But besides that, Magritte is really cool. :) Thanks. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Thu Apr 14 14:39:16 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Thu, 14 Apr 2005 14:39:16 +0200 Subject: SW2Command Subclasses In-Reply-To: <1113481242.425e601aa99f5@www.students.unibe.ch> References: <1113481242.425e601aa99f5@www.students.unibe.ch> Message-ID: <3eff6dd2904bc805962569228210021e@iam.unibe.ch> > I have a basic question about commands. > When you click on the edit link you get > a special edit page. SW2Command>>asComponent (*) Usually this just returns a magritte component built automatically from the description of the command, but as you can see in SW2ViewCommand one can also override it to return any other Seaside component. > Shouldn't there be something like this somewhere: > html anchorWithAction: [SW2EditCommand>>doExecute] text: > SW2EditCommand asLabel This is something else, you can create a link to a structure and command anywhere using: html anchorToStructure: aStructure command: aCommand do: aBlock (*) Cheers, Lukas (*) Check the exact wording in your own image, i don't have access to one right now. -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Thu Apr 14 16:46:15 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Thu, 14 Apr 2005 16:46:15 +0200 Subject: Widget registrieren In-Reply-To: <7e75822ca05a992168125c168f472bf9@student.unibe.ch> References: <15bf5110e60ed2d88b4a990387cc88a3@iam.unibe.ch> <7e75822ca05a992168125c168f472bf9@student.unibe.ch> Message-ID: <603c108f77880004fb002308593a79c2@iam.unibe.ch> > Das mit dem Compilieren hat ja jetzt geklappt. Aber unser eigenes > Widget wird nicht in der Drop Box aufgelistet? Nach welchen Kriterien > wird da gesucht? Unser Widget erbt von SW2Widget. Es klappt nicht wenn > wir es in einem eigenen Package haben oder sogar im > SmallWiki2-Seaside-Widgets Package. Have a look at the following snippet of code and check for the conditions ;-) SW2EditComponentCommand class>>descriptionComponentClass ^(MAOptionsDescription selector: #componentClass label: 'Component Class' priority: 200) options: (MADynamicObject on: [ Array streamContents: [ :stream | SW2Widget allSubclassesDo: [ :each | each isAbstract ifFalse: [ stream nextPut: each ] ]. WAComponent allSubclassesDo: [ :each | each canBeRoot ifTrue: [ stream nextPut: each ] ] ] ]); beRequired; yourself. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Fri Apr 15 00:57:32 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Fri, 15 Apr 2005 00:57:32 +0200 Subject: Ask for user input during doExecute or doValidate In-Reply-To: <425EEA11.9010302@students.unibe.ch> References: <18561.1113508914@www4.gmx.net> <425EEA11.9010302@students.unibe.ch> Message-ID: <31a5ae81ddf07452ccc858ac08ea3a21@iam.unibe.ch> > Is ther a way to ask for user input when I'm allready in the doValidate > or doExecute method? No, no way to do that. Commands should be atomic and are execute within a critical section. If you would have user interaction in there you would run into two problems: 1. The separation of the model (Command-Pattern) and the GUI (Seaside) would be broken. 2. When using Seaside as GUI the user could use the back- and forward-buttons and therefor destroy the atomic execution of the command. Again two possible solutions for this: 1. You raise an exception/notification in #doValidate to check for notify the GUI about the fact that there is a password required and then resume the validation. 2. You put a password field right into your command that can be left empty. #doValidate raises an exception if the password is missing or wrong. Hope this helps, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Fri Apr 15 11:00:57 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Fri, 15 Apr 2005 11:00:57 +0200 Subject: Refactoring In-Reply-To: <5C42378C-AD8B-11D9-8300-000D93495E5E@students.unibe.ch> References: <5C42378C-AD8B-11D9-8300-000D93495E5E@students.unibe.ch> Message-ID: Hi Daria, > Wir wollten gerade als Beispiel/Test f?r das Refactoring das L?schen > von allen externen Links auf einer Seite implementieren. Dabei haben > wir festgestellt, dass es keine M?glichkeit gibt, aus einem Container > (z.B. SW2DocumentGroup) ein "Kind" zu entfernen, da children ein Array > ist und das remove nicht zul?sst. Wir dachten daran, Array durch eine > Collection zu ersetzen, was aber nicht ohne weiteres funktioniert. > Hast Du eine Idee, wie wir das l?sen k?nnen? what about self setChildren: (self children copyWithout: aChild). and self setChildren: (self children copyWith: aChild) ? The rational of using arrays is that they are ways more space and time efficient than ordererd collections. Modifications to the parse tree are usually rare, the current code mostly just rebuilds the document. I suggest that you add the code snippets avove as extension methods #add: and #remove: to the composite of the document hierarchy. One thing you have to take care is that some document nodes require a parent information, like the internal links to do the update. So if you add new links you have to set the owner somehow, unless they won't work. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Fri Apr 15 23:13:42 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Fri, 15 Apr 2005 23:13:42 +0200 Subject: editing components In-Reply-To: <1546.1113553779@www20.gmx.net> References: <237c2c1e5d82357e5afa4cba2da61e93@iam.unibe.ch> <1546.1113553779@www20.gmx.net> Message-ID: <223884ef5bb190270709e0bfc4406339@iam.unibe.ch> >> In my opinion the properties of the Seaside component should be stored >> in the structure. The description for this could be built from the >> command object (SW2EditComponentCommand) that is dynamically enhanced >> with the description of the currently selected component class. Okay, this is now in the latest code, load Magritte-All-lr.11 and SmallWiki2-All-lr.66. Just to be sure, reinitialize the environment and try out the new settings command on the Counter and the Tree-Widget. However there are not that many possible settings yet, but now it is just a matter of writing some descriptions and we will soon have more flexibility as we had in SmallWiki 1 with the templates. I also fixed some other bugs all over SmallWiki. > Right now I'm trying to edit the count of a WACounter (added a > descritption). I know Seaside2 components just live for the session but > that's not a problem for now. > > We can store arbitary objects in dictionary in the user. So we can > write a > structure that has a string and uses this as a key to fetch an object > from > the current user. I want do display and edit them. So we can pretend > we edit persistent objects instead of seaside components. > > Fine with me. Just how do I do that? I tried something like > > MyComponent class>>descriptionModel > ^ MADynamicObject on: [ > SW2CurrentContextHolder value contents in: [ :context | > (context componentFor: context structure) in: [ :component | > component description ] ] ]. > > but that didn't work. Okay, I see, you are probably not interested too much into the stuff I wrote above :-) Even-tough I again tried hard to understand what you want to do with the above code, I could not get it. Mhh, so I guess that you want to know how to use a description on a different model than it has been defined on? Answer: Suppose you have aDescription and aModel from anywhere in your image, you can plug them together and get a Seaside component by sending: aDescription asComponentOn: aModel >> Another thing I don't like in your code is that you don't store the >> modifications in the command object. This means that the changes won't >> be logged. > > Yes, right. This was thought to be a proof of concept prototype, not > the > final version. But how should I do that? Add a Dictionary and override > #doesNotUnderstand? Magritte is always doing a dispatch over the model using #readUsing: and #write:using:, so you should override those. See their implementors for some more documentation. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Sat Apr 16 10:58:15 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 16 Apr 2005 10:58:15 +0200 Subject: Link to page in a other branche of the tree In-Reply-To: <4260D1E4.4030202@students.unibe.ch> References: <5C42378C-AD8B-11D9-8300-000D93495E5E@students.unibe.ch> <4260D1E4.4030202@students.unibe.ch> Message-ID: <22f4e6591f037806693c57cf825bd9dd@iam.unibe.ch> > would it be a great effort to create a new type of link, that points > to a page in a different branche of the tree? I would like to do > something like this: > > SmallWiki 2 > |-Page 1 > |-Page 2 > |- Page 3 (This page has a Link to the page "SmallWiki 2") > > Perhaps a *singelton:SmallWiki 2* tag? :-) No, but you have full support of absolute and relative links simulating the unix file-system. In your case you could chose from any of the following: absolute: */* or nicer */>Back 2 Root* relative: *../..* or nicer *../..>2 Levels Up* Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From davidroe at bluewin.ch Tue Apr 19 15:30:00 2005 From: davidroe at bluewin.ch (=?iso-8859-1?Q?David_R=F6thlisberger?=) Date: Tue, 19 Apr 2005 15:30:00 +0200 Subject: [SW2] Patches Message-ID: <423AEE880018143E@mail19.bluewin.ch> (added by postmaster@bluewin.ch) Hello, I have appended three patches, one for Magritte and two for SW2. The one for Magritte adds #renderButtonOn: to MATextInputComponent, so the several subclasses have to override just this method to provide a button after the text input field. Then the first patch for SW2 adds SW2Styles, a style library that includes all the CSS styles that were stored in an external CSS file so far. The second patch gives some more possibilites for adding/rejecting commands for a given structure. Any structure class can specify a collection of commands that shall be rejected, whereas a command can specify now a collection of structure classes where this command should be available. A command will only appear in the widget for a structure that has not rejected this command and only if the command should be displayed in this structure (specified with MyCommand class >> defaultStructureClasses). This solution may not be the best one to solve the problem, but at least I can now do what I need. ;) For instance, it's now possible to determine that a command should not appear in the command widget for any structure by providing an empty collection in MyCommand class >> defaultStructureClasses. Or a structure class can determine that some commands should never appear in the widget when a instance of this structure class is active. I hope that these patches are useful for others too. Kind regards, David -------------- next part -------------- A non-text attachment was scrubbed... Name: ma-patch.zip Type: application/x-zip-compressed Size: 2476 bytes Desc: not available Url : http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20050419/58f10d76/ma-patch.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: sw2-patch1.zip Type: application/x-zip-compressed Size: 2109 bytes Desc: not available Url : http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20050419/58f10d76/sw2-patch1.bin -------------- next part -------------- A non-text attachment was scrubbed... Name: sw2-patch2.zip Type: application/x-zip-compressed Size: 3950 bytes Desc: not available Url : http://www.iam.unibe.ch/pipermail/smallwiki/attachments/20050419/58f10d76/sw2-patch2.bin From renggli at iam.unibe.ch Tue Apr 19 19:44:49 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 19 Apr 2005 19:44:49 +0200 Subject: [SW2] Patches In-Reply-To: <423AEE880018143E@mail19.bluewin.ch> (added by postmaster@bluewin.ch) References: <423AEE880018143E@mail19.bluewin.ch> (added by postmaster@bluewin.ch) Message-ID: Hi David, thanks a lot for your patches, I really appreciate submissions like this! However, could you please resubmit them as Monticello files (just add a directory repository or even simple a SMTP repository and send the changed packages to me)? Since I continued working on SmallWiki and Magritte it isn't possible to load your change-sets without creating a huge mess. Having a proper tree-way merge would avoid that I have to look out for the changes and copy them manually into my code. Why didn't you put the images in the style library? It seems strange to me to have them at a different location. Thanks, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From davidroe at bluewin.ch Tue Apr 19 20:11:05 2005 From: davidroe at bluewin.ch (=?iso-8859-1?Q?David_R=F6thlisberger?=) Date: Tue, 19 Apr 2005 20:11:05 +0200 Subject: AW: [SW2] Patches In-Reply-To: Message-ID: <423AEE7700182948@mail17.bluewin.ch> (added by postmaster@bluewin.ch) Hello Lukas, > However, could you please resubmit them as Monticello files > (just add a directory repository or even simple a SMTP > repository and send the changed packages to me)? Okay, I did that. > Why didn't you put the images in the style library? It seems > strange to me to have them at a different location. Yes, I felt the same, but I didn't know what's the correct way of putting images into the library and I couldn't find any example for that, so I was a bit lost. I have found a way to store images in the Squeak image, but is it really possible to link to these images from within a CSS definition? David From renggli at iam.unibe.ch Tue Apr 19 21:15:06 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 19 Apr 2005 21:15:06 +0200 Subject: AW: [SW2] Patches In-Reply-To: <423AEE7700182948@mail17.bluewin.ch> (added by postmaster@bluewin.ch) References: <423AEE7700182948@mail17.bluewin.ch> (added by postmaster@bluewin.ch) Message-ID: >> Why didn't you put the images in the style library? It seems >> strange to me to have them at a different location. > > Yes, I felt the same, but I didn't know what's the correct way of > putting > images into the library and I couldn't find any example for that, so I > was a > bit lost. > I have found a way to store images in the Squeak image, but is it > really > possible to link to these images from within a CSS definition? Yeah, of course in Smalltalk everything is possible ;-) Have a look at the smilies, however I doubt that this code works, it has been written back in the VisualWorks days. And for the style-sheets the tricky part is somewhere else, maybe ask that to the Seaside list ... Thanks for your submissions, I merged them in and published the new code in the repository. Some comments: - I kept the old style-include in SW2MainFrame till we get the thing with the images ironed out. There was something wrong with the line-feeds (as usual), so I pasted in the original files, I hope this is fine for everyone now? - I enhanced your enhancement to reject possible commands slightly, so that the structure instance is asked with the command-class and the context if this command is valid. I need this, in some of my newly created classes. I hope this suits your needs as well? Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Sat Apr 23 15:17:47 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 23 Apr 2005 15:17:47 +0200 Subject: broken kernel In-Reply-To: <31742.1114204136@www2.gmx.net> References: <31742.1114204136@www2.gmx.net> Message-ID: <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> > The way I broke the kernel I think is in a #doValidate I did a self > error: > 'foo'. I thought this was a the correct way to signal that there's > something > wrong with the user input. It obviously wasn't because I didn't get a > SW2 or > MA error but a Seaside error. So what is the correct way? Today I am in a paper writing mode, so let me try to explain this a little bit more than usual: The lock in the SmallWiki kernel makes sure that only one command is executed at once. It makes sure that the model doesn't get into an invalid state due to concurrent write accesses. However, having locks especially during the development phase, can be pretty boring: say if you are using the debugger to step through a critical section, restart, jump out of it, ... you might run into troubles because its semaphores are not properly reset. This is neither an implementation error of SmallWiki nor one of the the lock-implementation in Smalltalk, but a common and well known issue in powerful languages such as Smalltalk or Scheme, where the exception handling is done at the language and not at the VM level. Java, C#, C++, PHP, ... don't show this issue since their execution stack is not a first class object and the exception handling is out of the scope of the programmer, after an unhanded exception your application needs to be restarted anyway. A greatly simplified implementation of a lock might look the following piece of code. The critical piece is the ensure block, that ensures that the lock is opened after doing the critical thing in aBlock. So whatever happens inside aBlock (finishing the evaluation of the block, doing a non-local return from within the block, raising an exception, etc.) first the ensure-block is evaluated before continuing with the default executing. So if you have a self halt in there the ensure-block will be evaluated because the debugger is opened in a exception handler at the very top of the stack. However with the debugger we are able to jump back into aBlock and continue the execution, but now within the unlocked context. Of course when exiting again from aBlock the ensure-block will be evaluated again and the lock might get into a bad state. lock: aBlock self waitUntilUnlocked; lock. aBlock ensure: [ self unlock ]. Especially when using Seaside you have to be aware and take care about the use of ensure-blocks: say if you are using continuations to jump into aBlock or out of aBlock the semantics of the #ensure: are basically undefined! Should it be evaluated multiple times? Only the first time? Only the last time? How do we know when we leave aBlock for the last time? Actually I suggest, not to mix continuations and ensure-blocks. > Are there better/saver ways to fix such isses? No, it is a known problem, without good solutions. Search Google for "continuation unwind" and you will find a lot of material about this. > Is there some way of resting the kernel lock if a a command goes wild? SW2Kernel kernels do: [ :each | each instVarAt: 'lock' put: each defaultLock ]. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Sat Apr 23 15:17:47 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 23 Apr 2005 15:17:47 +0200 Subject: broken kernel In-Reply-To: <31742.1114204136@www2.gmx.net> References: <31742.1114204136@www2.gmx.net> Message-ID: <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> > The way I broke the kernel I think is in a #doValidate I did a self > error: > 'foo'. I thought this was a the correct way to signal that there's > something > wrong with the user input. It obviously wasn't because I didn't get a > SW2 or > MA error but a Seaside error. So what is the correct way? Today I am in a paper writing mode, so let me try to explain this a little bit more than usual: The lock in the SmallWiki kernel makes sure that only one command is executed at once. It makes sure that the model doesn't get into an invalid state due to concurrent write accesses. However, having locks especially during the development phase, can be pretty boring: say if you are using the debugger to step through a critical section, restart, jump out of it, ... you might run into troubles because its semaphores are not properly reset. This is neither an implementation error of SmallWiki nor one of the the lock-implementation in Smalltalk, but a common and well known issue in powerful languages such as Smalltalk or Scheme, where the exception handling is done at the language and not at the VM level. Java, C#, C++, PHP, ... don't show this issue since their execution stack is not a first class object and the exception handling is out of the scope of the programmer, after an unhanded exception your application needs to be restarted anyway. A greatly simplified implementation of a lock might look the following piece of code. The critical piece is the ensure block, that ensures that the lock is opened after doing the critical thing in aBlock. So whatever happens inside aBlock (finishing the evaluation of the block, doing a non-local return from within the block, raising an exception, etc.) first the ensure-block is evaluated before continuing with the default executing. So if you have a self halt in there the ensure-block will be evaluated because the debugger is opened in a exception handler at the very top of the stack. However with the debugger we are able to jump back into aBlock and continue the execution, but now within the unlocked context. Of course when exiting again from aBlock the ensure-block will be evaluated again and the lock might get into a bad state. lock: aBlock self waitUntilUnlocked; lock. aBlock ensure: [ self unlock ]. Especially when using Seaside you have to be aware and take care about the use of ensure-blocks: say if you are using continuations to jump into aBlock or out of aBlock the semantics of the #ensure: are basically undefined! Should it be evaluated multiple times? Only the first time? Only the last time? How do we know when we leave aBlock for the last time? Actually I suggest, not to mix continuations and ensure-blocks. > Are there better/saver ways to fix such isses? No, it is a known problem, without good solutions. Search Google for "continuation unwind" and you will find a lot of material about this. > Is there some way of resting the kernel lock if a a command goes wild? SW2Kernel kernels do: [ :each | each instVarAt: 'lock' put: each defaultLock ]. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Sat Apr 23 15:38:37 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 23 Apr 2005 15:38:37 +0200 Subject: broken kernel In-Reply-To: <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> References: <31742.1114204136@www2.gmx.net> <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> Message-ID: >> Is there some way of resting the kernel lock if a a command goes wild? > > SW2Kernel kernels do: [ :each | > each instVarAt: 'lock' put: each defaultLock ]. Is is ... SW2Kernel kernels do: [ :each | each instVarNamed: 'lock' put: each defaultLock ]. of course ;-) -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Sat Apr 23 15:38:37 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sat, 23 Apr 2005 15:38:37 +0200 Subject: broken kernel In-Reply-To: <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> References: <31742.1114204136@www2.gmx.net> <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> Message-ID: >> Is there some way of resting the kernel lock if a a command goes wild? > > SW2Kernel kernels do: [ :each | > each instVarAt: 'lock' put: each defaultLock ]. Is is ... SW2Kernel kernels do: [ :each | each instVarNamed: 'lock' put: each defaultLock ]. of course ;-) -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Sun Apr 24 09:58:58 2005 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Sun, 24 Apr 2005 09:58:58 +0200 Subject: broken kernel In-Reply-To: <26295.1114265991@www67.gmx.net> References: <6e6779a3d5a447ad3221edee5f73b57e@iam.unibe.ch> <26295.1114265991@www67.gmx.net> Message-ID: <5e91ecc1cec885e94b829a91b1865b65@iam.unibe.ch> > I looked at your code and you placed self error: there too (basically > in > #validateChild:titled:in:). But if I do this, I break my kernel. So how > should I do this? Strang, I've never seen this and I'm unable to reproduce. The error and validation handling in Magritte is certainly a dark part of the framework, it is trying to collect all errors by resuming certain exceptions and therefor jumps around in the code. However this doesn't work quite well as I expect, it definitely needs a different concept and some more work. Try to load the latest packages, I added an exception hander around the command validation so that any error is transformed into a Magritte error. Does this help? Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch