[Seaside] "Injecting" options into a Magritte description
Esteban A. Maringolo
emaringolo at gmail.com
Tue Oct 1 13:05:12 UTC 2013
Thanks for the advice, I think I can replicate the WAObject methods in my
own classes, and avoid subclassing it.
Regarding the Memento error, it has to do with the fact the objects come
from the database (GLORP).
Maybe because GLORP uses proxies. Looking for this, I found a mail from
several years ago about redefining #= as:
^self == anObject yourSelf
The QCMagritte name sounds familiar to me, but I really don't know what it
is. Is there a blog post, presentation, website or something before looking
into the code? :) The SmalltalkHub summary seems interesting.
Esteban A. Maringolo
2013/10/1 Diego Lont <diego.lont at delware.nl>
> Hi Esteban,
> I have a similar solution in QC Magritte, that allows the session to be
> acquired from the objects as well. I use it for my rights, as my user is in
> my session. As you can see in the seaside implementation WAObject already
> implements request-context, session and application. I do recommend that
> you use an indirection, that you put in your description "self allStores"
> and implement the allStores as "self session allStores". But other than
> that I think the solution is sound.
> As for the validation error. From what you have written here I have no
> clue what the problem is. In Magritte the memento stores an original value.
> If the original value is not exactly the same as the value of the model, it
> gives a validation error. Maybe you can put a halt here and find out what
> the difference is. Maybe you recreate a certain object (return a copy) that
> causes the difference?
> If you need a more dynamic solution (with updating values), please take a
> look at QCMagritte. It can be found at smalltalkhub, and loaded by:
> Gofer new
> url: 'http://smalltalkhub.com/mc/DiegoLont/QCMagritte/main';
> package: 'ConfigurationOfQCMagritte';
> ((Smalltalk at: #ConfigurationOfQCMagritte) project version: '0.1') load:
> (Smalltalk at: #ZnZincServerAdaptor) startOn: 8080. "only if seaside is
> not started yet"
> On Oct 1, 2013, at 4:51 AM, Esteban A. Maringolo wrote:
> > I don't know whether it has to do with my previous solution. But now I'm
> getting a 'Input is conflicting with concurrent modification' validation
> error, when there is no concurrent use (it is just me using the app).
> > The model I'm editing has only two attributes: #time and #store, and I'm
> not changing #store, even if I don't change anything I get the same error.
> > Any clues?
> > Esteban A. Maringolo
> > 2013/9/30 Esteban A. Maringolo <emaringolo at gmail.com>
> > Answering myself...
> > Maybe not an elegant solution (nor a scalable one) but I found I can use
> the dynamic variable scoping to access the current session.
> > I changed my description to use:
> > descriptionStore
> > <magritteDescription>
> > ^MASingleOptionDescription new
> > label: 'Store';
> > accessor: #store;
> > beRequired;
> > options: self currentSession allStores;
> > yourself
> > #currentSession
> > ^WACurrentRequestContext value session
> > It still smells bad, for some reason DynamicVariable's seems "hacky" to
> > Maybe they're more clever than what I'm used to.
> > Regards,
> > Esteban.
> > _______________________________________________
> > seaside mailing list
> > seaside at lists.squeakfoundation.org
> > http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> seaside mailing list
> seaside at lists.squeakfoundation.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the seaside