[Seaside] "Injecting" options into a Magritte description

Diego Lont diego.lont at delware.nl
Tue Oct 1 13:15:57 UTC 2013


Hi Esteban,

I did a presentation on ESUG this year on it. The presentation should be online by now. Also it contains a demo, that explains how it is build and some of the tools it contains. It lacks a lot of tests and the documentation could be more extensive, I am working on that. But if you have questions about it, I am happy to answer you (and at the same time put them in documentation).

Cheers,
Diego

On Oct 1, 2013, at 3:05 PM, Esteban A. Maringolo wrote:

> Hi Diego,
> 
> 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:
> = anObject 
>     ^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.
> 
> Regards,
> 
> 
> 
> 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';
>         load.
> 
> ((Smalltalk at: #ConfigurationOfQCMagritte) project version: '0.1') load: 'Demo'.
> 
> (Smalltalk at: #ZnZincServerAdaptor) startOn: 8080. "only if seaside is not started yet"
> 
> 
> Cheers,
> Diego
> 
> 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 me.
> >
> > 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
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside
> 
> _______________________________________________
> seaside mailing list
> seaside at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/seaside/attachments/20131001/9874a203/attachment.htm


More information about the seaside mailing list