From stephan at stack.nl Sun Apr 1 13:24:42 2007 From: stephan at stack.nl (Stephan Eggermont) Date: Sun, 1 Apr 2007 13:24:42 +0200 Subject: Magritte usage pattern In-Reply-To: <1175337143.21739.54.camel@localhost> References: <1175337143.21739.54.camel@localhost> Message-ID: <20070401112442.GA40030@stack.nl> On Sat, Mar 31, 2007 at 12:32:23PM +0200, Norbert Hartl wrote: > For customization I put every little bit in a wrapper class > around the generated Magritte component. This is for customizing > the generated component as well as to do some manual html if > it isn't avoidable. I have the feeling that this is not the > right way to do but I have no better idea. To minimize the effort > to do a component for a model component I've built a base class > which should ease the customization of the component. Nice description! In the applications I've been building I also noticed a basic pattern of - search for an object with a limited number of search fields - present a list of conforming objects - edit/display the selected object That would also be nice as a wrapper component. Depending on the number of fields and found objects the search could be eliminated, or put on the same page as the list. > - buttons > A Collection of Associations (button label -> selector). MAForm- > Decoration is only useful if you have save and cancel buttons. As the > selectors are performed on the MAContainerComponent there is no way of > extending it. I extendend MAFormDecoration to have associations for > buttons (to distinguish the button label and the selector to use) and > to be created with a delegator. The selector is than performed on the > delegate which leads to a usage form In Nakedobjects, there are not just descriptions of objects fields, but also of actions. Zero-parameter ones are shown as menu items (or buttons in the Sanssoucci system), one-parameter actions are invoked by drag-and-drop. Stephan From yjgalla at gmx.net Mon Apr 2 11:10:51 2007 From: yjgalla at gmx.net (Elfi Heck) Date: Mon, 02 Apr 2007 11:10:51 +0200 Subject: Image embedding (was: Re: wikimatrix.org) In-Reply-To: <460DA231.1010403@yahoo.co.uk> References: <460A598A.4030105@gmx.net> <460A6783.5050602@gmx.net> <460BBA8D.2060201@gmx.net> <66666f210703300938qf5b072t93224ba9db270545@mail.gmail.com> <460D5496.3000102@gmx.net> <460DA231.1010403@yahoo.co.uk> Message-ID: <4610C89B.5020807@gmx.net> >>> Images (syntax): +image+ >>> >>> >>> >> Oh, and I didn't understand this. Putting +whatever+ in a page gives me >> a regular link to "whatever" I think they meant an image shown directly >> on the page. >> >> Elfi >> >> > Dear Elfi, > > *whatever* is for linking, +whatever+ is for embedding, if 'whatever' > exists and is an image it will display in the page. > How is "and is an image" being detected? I tried +...+ (with an external reference, in 1.0.9, on Linux) and actually *got* a link and not an embedded image. Are there restrictions on the type of reference or on the image type? Elfi From renggli at iam.unibe.ch Mon Apr 2 13:25:22 2007 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Mon, 2 Apr 2007 13:25:22 +0200 Subject: Image embedding (was: Re: wikimatrix.org) In-Reply-To: <4610C89B.5020807@gmx.net> References: <460A598A.4030105@gmx.net> <460A6783.5050602@gmx.net> <460BBA8D.2060201@gmx.net> <66666f210703300938qf5b072t93224ba9db270545@mail.gmail.com> <460D5496.3000102@gmx.net> <460DA231.1010403@yahoo.co.uk> <4610C89B.5020807@gmx.net> Message-ID: <8F16B390-4F4E-4E5E-9763-0DF340C2DD93@iam.unibe.ch> > How is "and is an image" being detected? I tried +...+ (with an > external reference, in 1.0.9, on Linux) and actually *got* a link > and not an embedded image. Are there restrictions on the type of > reference or on the image type? Embedding currently does not work with external links. It seems to be possible to add quite easy, I am tempted to implement it ;-) Lukas -- Lukas Renggli http://www.lukas-renggli.ch From renggli at iam.unibe.ch Mon Apr 2 14:00:23 2007 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Mon, 2 Apr 2007 14:00:23 +0200 Subject: Image embedding (was: Re: wikimatrix.org) In-Reply-To: <8F16B390-4F4E-4E5E-9763-0DF340C2DD93@iam.unibe.ch> References: <460A598A.4030105@gmx.net> <460A6783.5050602@gmx.net> <460BBA8D.2060201@gmx.net> <66666f210703300938qf5b072t93224ba9db270545@mail.gmail.com> <460D5496.3000102@gmx.net> <460DA231.1010403@yahoo.co.uk> <4610C89B.5020807@gmx.net> <8F16B390-4F4E-4E5E-9763-0DF340C2DD93@iam.unibe.ch> Message-ID: <5451D6C3-4C62-40A3-BD9A-4EFD481983B4@iam.unibe.ch> >> How is "and is an image" being detected? I tried +...+ (with an >> external reference, in 1.0.9, on Linux) and actually *got* a link >> and not an embedded image. Are there restrictions on the type of >> reference or on the image type? > > Embedding currently does not work with external links. It seems to be > possible to add quite easy, I am tempted to implement it ;-) Name: Pier-All-lr.180 Author: lr Time: 2 April 2007, 1:59:20 pm UUID: 418e9cd7-7a65-4664-96a0-ffdcfc064280 Ancestors: Pier-All-lr.179 Dependencies: Pier-Model-lr.135, Pier-Tests-lr.63, Pier-Seaside-lr. 150, Pier-OmniBrowser-lr.23, Pier-Security-lr.75, Pier-Blog-lr.49 Tries to embed external links marked with + as well, if the url contains .gif, .jpg, .jpeg, .png an IMG tag will be generated, otherwise an IFRAME (ugly, but this is what the user requested). Other cases shoud be added, but that's it for now. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From philippe.marschall at gmail.com Mon Apr 2 14:50:03 2007 From: philippe.marschall at gmail.com (Philippe Marschall) Date: Mon, 2 Apr 2007 14:50:03 +0200 Subject: Image embedding (was: Re: wikimatrix.org) In-Reply-To: <5451D6C3-4C62-40A3-BD9A-4EFD481983B4@iam.unibe.ch> References: <460A598A.4030105@gmx.net> <460A6783.5050602@gmx.net> <460BBA8D.2060201@gmx.net> <66666f210703300938qf5b072t93224ba9db270545@mail.gmail.com> <460D5496.3000102@gmx.net> <460DA231.1010403@yahoo.co.uk> <4610C89B.5020807@gmx.net> <8F16B390-4F4E-4E5E-9763-0DF340C2DD93@iam.unibe.ch> <5451D6C3-4C62-40A3-BD9A-4EFD481983B4@iam.unibe.ch> Message-ID: <66666f210704020550p103eb70qffea4845d25a5a47@mail.gmail.com> 2007/4/2, Lukas Renggli : > >> How is "and is an image" being detected? I tried +...+ (with an > >> external reference, in 1.0.9, on Linux) and actually *got* a link > >> and not an embedded image. Are there restrictions on the type of > >> reference or on the image type? > > > > Embedding currently does not work with external links. It seems to be > > possible to add quite easy, I am tempted to implement it ;-) > > Name: Pier-All-lr.180 > Author: lr > Time: 2 April 2007, 1:59:20 pm > UUID: 418e9cd7-7a65-4664-96a0-ffdcfc064280 > Ancestors: Pier-All-lr.179 > Dependencies: Pier-Model-lr.135, Pier-Tests-lr.63, Pier-Seaside-lr. > 150, Pier-OmniBrowser-lr.23, Pier-Security-lr.75, Pier-Blog-lr.49 > > Tries to embed external links marked with + as well, if the url > contains .gif, .jpg, .jpeg, .png an IMG tag will be generated, > otherwise an IFRAME (ugly, but this is what the user requested). > Other cases shoud be added, but that's it for now. I guess IFRAME is for PDFs Why not do a HEAD request and using the same code (and semantic) for embedding internal and external links (MAFileModel). Philippe > Cheers, > Lukas > > -- > Lukas Renggli > http://www.lukas-renggli.ch > > > > _______________________________________________ > SmallWiki, Magritte, Pier and Related Tools ... > https://www.iam.unibe.ch/mailman/listinfo/smallwiki > From damien.pollet at gmail.com Mon Apr 2 18:11:16 2007 From: damien.pollet at gmail.com (Damien Pollet) Date: Mon, 2 Apr 2007 18:11:16 +0200 Subject: Image embedding (was: Re: wikimatrix.org) In-Reply-To: <66666f210704020550p103eb70qffea4845d25a5a47@mail.gmail.com> References: <460A598A.4030105@gmx.net> <460BBA8D.2060201@gmx.net> <66666f210703300938qf5b072t93224ba9db270545@mail.gmail.com> <460D5496.3000102@gmx.net> <460DA231.1010403@yahoo.co.uk> <4610C89B.5020807@gmx.net> <8F16B390-4F4E-4E5E-9763-0DF340C2DD93@iam.unibe.ch> <5451D6C3-4C62-40A3-BD9A-4EFD481983B4@iam.unibe.ch> <66666f210704020550p103eb70qffea4845d25a5a47@mail.gmail.com> Message-ID: <34b4844b0704020911u78c5d330w2fbb4ca17077f56b@mail.gmail.com> On 02/04/07, Philippe Marschall wrote: > I guess IFRAME is for PDFs No, AFAIK it is like the old and ... to compose a full web page inside another one. -- Damien Pollet type less, do more [ | ] http://typo.cdlm.fasmz.org From norbert at hartl.name Mon Apr 2 19:20:18 2007 From: norbert at hartl.name (Norbert Hartl) Date: Mon, 02 Apr 2007 19:20:18 +0200 Subject: splitting description into multiple containers Message-ID: <1175534418.28069.23.camel@localhost> Hi, I need to render multiple fieldsets for a model. My idea was to split up descriptions into multiple groups, assign each of the group to a MAContainer and add the containers into a root container. Something like this: MAPriorityContainer MAContainer MAStringDescription MAStringDescription MAContainer MAStringDescription MAStringDescription So I would be able to render a fieldset per container. As containers have labels I could even render a legend tag for the fieldsets. But I wasn't very lucky to do so. Is this a conceptional problem? I tried MAContainer new and setting an accessor as well as self description copy setChildren to get a container. But no luck. Any help is appreciated. thanks, Norbert From renggli at iam.unibe.ch Mon Apr 2 20:14:15 2007 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Mon, 2 Apr 2007 20:14:15 +0200 Subject: splitting description into multiple containers In-Reply-To: <1175534418.28069.23.camel@localhost> References: <1175534418.28069.23.camel@localhost> Message-ID: > MAPriorityContainer > MAContainer > MAStringDescription > MAStringDescription > MAContainer > MAStringDescription > MAStringDescription > > So I would be able to render a fieldset per container. > As containers have labels I could even render a legend > tag for the fieldsets. > > But I wasn't very lucky to do so. Is this a conceptional > problem? I tried MAContainer new and setting an accessor > as well as self description copy setChildren to get a > container. But no luck. No, I guess directly nesting the containers does not work. What you would need to do is to create a MAToOneReferenceDescription that points onto the next container. Too ugly for me. MAPriorityContainer MAToOneReferenceDescription MAContainer MAStringDescription MAStringDescription MAToOneReferenceDescription MAContainer MAStringDescription MAStringDescription What I did for grouping so far is to give every description a #group attribute (class extension on MADescription), so in your example this look like: MAPriorityContainer MAStringDescription #group -> 'Part 1' MAStringDescription #group -> 'Part 1' MAStringDescription #group -> 'Part 2' MAStringDescription #group -> 'Part 2' And then write a specific renderer that takes advantage of this information and displays the group headings or emits a field set around the containing descriptions. Hope this helps, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From norbert at hartl.name Tue Apr 3 08:49:19 2007 From: norbert at hartl.name (Norbert Hartl) Date: Tue, 03 Apr 2007 08:49:19 +0200 Subject: splitting description into multiple containers In-Reply-To: References: <1175534418.28069.23.camel@localhost> Message-ID: <1175582959.28069.27.camel@localhost> On Mon, 2007-04-02 at 20:14 +0200, Lukas Renggli wrote: > > MAPriorityContainer > > MAContainer > > MAStringDescription > > MAStringDescription > > MAContainer > > MAStringDescription > > MAStringDescription > > > > So I would be able to render a fieldset per container. > > As containers have labels I could even render a legend > > tag for the fieldsets. > > > > But I wasn't very lucky to do so. Is this a conceptional > > problem? I tried MAContainer new and setting an accessor > > as well as self description copy setChildren to get a > > container. But no luck. > > No, I guess directly nesting the containers does not work. What you > would need to do is to create a MAToOneReferenceDescription that > points onto the next container. Too ugly for me. > > MAPriorityContainer > MAToOneReferenceDescription > MAContainer > MAStringDescription > MAStringDescription > MAToOneReferenceDescription > MAContainer > MAStringDescription > MAStringDescription > Yes, that's too heavy/ugly for me, too. > What I did for grouping so far is to give every description a #group > attribute (class extension on MADescription), so in your example this > look like: > > MAPriorityContainer > MAStringDescription #group -> 'Part 1' > MAStringDescription #group -> 'Part 1' > MAStringDescription #group -> 'Part 2' > MAStringDescription #group -> 'Part 2' > > And then write a specific renderer that takes advantage of this > information and displays the group headings or emits a field set > around the containing descriptions. > Yes, I thought about doing the same. I just wanted to avoid writing renderers which carry a lot of state in their traversal. thanks, Norbert From norbert at hartl.name Tue Apr 3 10:42:24 2007 From: norbert at hartl.name (Norbert Hartl) Date: Tue, 03 Apr 2007 10:42:24 +0200 Subject: MADescription attributes Message-ID: <1175589745.28069.31.camel@localhost> Hi, if I use attributes on a description I get something strange. I use descriptionDummy | desc | desc := MAStringDescription selector: #dummy label: 'Dummy' priority: 10. desc attributes at: #dummyKey put: #dummyVal. ^ desc and I request the attributes in my renderer visitElementDescription: aDescription | dummyVal | dummyVal := aDescription attributes at: #dummyKey ifAbsent: ['']. html text: '(',aDescription asString, ') at: #dummyKey = ', dummyVal asString. The value is an Association #dummyKey->#dummyVal Attached you will find the complete code which shows it. Norbert -------------- next part -------------- WAComponent subclass: #DummyComponent instanceVariableNames: 'comp' classVariableNames: '' poolDictionaries: '' category: 'Attributes-Test'! !DummyComponent methodsFor: 'as yet unclassified' stamp: 'noha 4/3/2007 10:29'! initialize | desc dummy | dummy := DummyObject new. desc := dummy description. desc componentRenderer: DummyRenderer. comp := desc asComponentOn: dummy.! ! !DummyComponent methodsFor: 'as yet unclassified' stamp: 'noha 4/3/2007 10:29'! renderContentOn: html html render: comp! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! DummyComponent class instanceVariableNames: ''! !DummyComponent class methodsFor: 'as yet unclassified' stamp: 'noha 4/3/2007 10:33'! initialize super initialize. self registerAsApplication: 'attributes-test'! ! Object subclass: #DummyObject instanceVariableNames: 'dummy' classVariableNames: '' poolDictionaries: '' category: 'Attributes-Test'! !DummyObject methodsFor: 'as yet unclassified' stamp: 'noha 4/3/2007 10:15'! dummy ^ dummy! ! !DummyObject methodsFor: 'as yet unclassified' stamp: 'noha 4/3/2007 10:37'! dummy: aDummy dummy := aDummy ! ! "-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "! DummyObject class instanceVariableNames: ''! !DummyObject class methodsFor: 'as yet unclassified' stamp: 'noha 4/3/2007 10:18'! descriptionDummy | desc | desc := MAStringDescription selector: #dummy label: 'Dummy' priority: 10. desc attributes at: #dummyKey put: #dummyVal. ^ desc! ! MAComponentRenderer subclass: #DummyRenderer instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' category: 'Attributes-Test'! !DummyRenderer methodsFor: 'as yet unclassified' stamp: 'noha 4/3/2007 10:36'! visitElementDescription: aDescription | dummyVal | dummyVal := aDescription attributes at: #dummyKey ifAbsent: ['']. html text: '(',aDescription asString, ') at: #dummyKey = ', dummyVal asString. ! ! DummyComponent initialize! From renggli at iam.unibe.ch Tue Apr 3 10:51:39 2007 From: renggli at iam.unibe.ch (Lukas Renggli) Date: Tue, 3 Apr 2007 10:51:39 +0200 Subject: MADescription attributes In-Reply-To: <1175589745.28069.31.camel@localhost> References: <1175589745.28069.31.camel@localhost> Message-ID: > if I use attributes on a description I get something strange. > I use You are looking for properties (#properties), not attributes (#attributes). Attributes are XHTML attributes to be used with Magritte-Seaside. Properties are a dictionary where you can store your own values. There are some convenience methods such as #propertyAt:, #propertyAt:put:, etc. Cheers, Lukas -- Lukas Renggli http://www.lukas-renggli.ch From philippe.marschall at gmail.com Tue Apr 3 11:21:49 2007 From: philippe.marschall at gmail.com (Philippe Marschall) Date: Tue, 3 Apr 2007 11:21:49 +0200 Subject: Image embedding (was: Re: wikimatrix.org) In-Reply-To: <34b4844b0704020911u78c5d330w2fbb4ca17077f56b@mail.gmail.com> References: <460A598A.4030105@gmx.net> <460BBA8D.2060201@gmx.net> <66666f210703300938qf5b072t93224ba9db270545@mail.gmail.com> <460D5496.3000102@gmx.net> <460DA231.1010403@yahoo.co.uk> <4610C89B.5020807@gmx.net> <8F16B390-4F4E-4E5E-9763-0DF340C2DD93@iam.unibe.ch> <5451D6C3-4C62-40A3-BD9A-4EFD481983B4@iam.unibe.ch> <66666f210704020550p103eb70qffea4845d25a5a47@mail.gmail.com> <34b4844b0704020911u78c5d330w2fbb4ca17077f56b@mail.gmail.com> Message-ID: <66666f210704030221s74d88d3dt47af40a1bddd09a5@mail.gmail.com> 2007/4/2, Damien Pollet : > On 02/04/07, Philippe Marschall wrote: > > I guess IFRAME is for PDFs > > No, AFAIK it is like the old and ... to compose a > full web page inside another one. That's not what I meant. To "embed" images you use , to "embed" audio, video, flash, java you use . The only way to "embed" PDF I see is