[Seaside] [Magritte] Validation object existence in collection.

Lukas Renggli renggli at gmail.com
Tue Nov 28 06:10:29 UTC 2006

> Thats pretty standard. he Thing is, all the validations for each
> description in this container are validated but only for this object.
> Do i have to make my own validations if i want to validate the
> existence of this object in a Collection. I know this sound really
> dumb but i would like to know if theres a clean way to do this. I want
> to use Seaside with Magritte for building and validating my objects
> and persist them with magma.
> I created a magma repository with a Dictionary as a root. This
> dictionary has one entry called people with a OrderedCollection as
> it's value.
> So, which strategy is the best in this case? Is there a clean way to
> do it? Am i missing something? Sorry for the verbosity and thanks
> again!

Yeah, see MADescription in the #validating protocol. To check if all
you objects are valid you can do:

    anOrderedCollection allSatisfy: [ :ea | ea description isSatisfiedBy: ea ]

To validate your all your objects and trigger an exception in case of
a problem you can do:

    anOrderedCollection do: [ :ea | ea description validate: ea ]

> One last thing. In the MAReport class is a method called NOW that says
> we shouldn't use that class. I works that bad? I Used it and still now
> it's working ok.

That comment has been there for years and most people have been
ignoring it. MAReport is even used in several industrial application,
so I guess its save to ignore that comment. It definitely needs a
cleanup ...


Lukas Renggli

More information about the Seaside mailing list