> 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