this is *fun*! If I had known it would be this easy, I would have started a
long time ago...
Thanks to your tip with the custom subclass, what works is:
- ERD2WRuleEditorModel with loading/saving of
- ERD2WExtendedRule that holds a mutableUserInfo that get's loaded via a
"userInfo" key in the rule's dict.
Models are morphed to use ERD2WExtendedRule instead of
com.webobjects.directtoweb.Rule during load and save ops. So you can use th=
created files without the ERD2WExtendedRule class. Of course, this is a bit
hackish, but who cares:)
So, basically I'm finished. You can wrap any sort of interface on top if it
and the userInfo allows for any sort of key like "comments", "group" etc
without further modification. As the extra keys will be only used during
development for Documentation I don't see a pressing need to extend the Rul=
While I wait for the latest CVS tarball, I also wrapped the whole thing int=
a WODisplayGroup...lo and behold: it works. Now sorting, inserting and
filtering will be done for me and editing is left as an exercise to the
on 21.06.2002 9:20 Uhr, Anjo Krank at anjo.krank@... wrote:
> Hi Max,
> on 21.06.2002 2:51 Uhr, Max Muller at maxmuller@... wrote:
>>> I just started this evening after I really got fed up with the lack of
>>> The idea is to have a framework that you can embed into your D2W apps
>>> and that will ultimately provide
>>> - MD5 sums (unique IDs) on rules
>>> - thus have comments, grouping, filtering, ordering, printing, live
>> Nice idea. Would the comments be stored along with every rule? Meaning
>> are you planning on having a subclass of Rule? One thing to be aware of
>> is that if you subclass Rule then you will need to have this method:
>> public static Object
>> decodeWithKeyValueUnarchiver(EOKeyValueUnarchiver eokeyvalueunarchiver)
>> return new
>> Or else your rules will not load correctly. Also the way RuleEditor
>> works it will not respect your custom Rule subclass name (it overwrites
>> it with Rule).
> Hey, that's neat! I didn't know you can supply custom rule classes. I bee=
> bit worried about how to actually load, edit and save extra info - thus t=
> idea with the unique ID, but this should make it easy:) The only drawback=
> that you'll *have* to use the app if you plan on keeping the extra stuff
> after editing.
>> Here is also one from my wish list:
>> Be able to add additional qualifiers, for instance being able to
>> associate the operator 'isKindOfEntity' with a qualifier
>> ERDKindOfEntityQualifier such that I could write a lhs of a rule like:
>> 'entity isKindOfEntity User'.
> Hmh. I'm currently using EOQualifier.qualifierWithFormat to convert the
> string into a EOQualifier. Typing (foo isKindOfEntity 'User') parses fin=
> but how would I get it to create/use a specific subclass of EOQualifier?
> The only thing I found is (EOQualifer javadoc):
> Using Selectors in Qualifier Expressions
> The format strings you use to initialize a qualifier can include methods.
> The parser recognizes an unquoted string followed by a colon (such as
> myMethod: ) as a method. For example:
> point1 isInside: area
> firstName isAnagramOfString: "Computer"
> Methods specified in a qualifier are parsed and applied only in memory; t=
> is, they can't be used in to qualify fetches in a database.
> or this (from EOQualifier.ComparisionSupport):
> public static void setSupportForClass(EOQualifier.ComparisonSupport=A0suppo=
> Sets aClass as the support class to be used for comparing instances of
> aClass. When compareValues is called, the methods in supportClass are use=
> to do the comparison for instances of aClass.
> supportClass - support class to be used for comparing
> aClass - the class to be compared
> which could obsolete the need for a ERDKindOfEntityQualifier at least in
> this context...
> Cheers, Anjo
> Sponsored by:
> ThinkGeek at http://www.ThinkGeek.com/
> Wonder-disc mailing list