Re: directtoweb and readOnlyEntityNames rule
Re: directtoweb and readOnlyEntityNames rule
- Subject: Re: directtoweb and readOnlyEntityNames rule
- From: Steve Quirk <email@hidden>
- Date: Wed, 30 Aug 2006 10:34:43 -0400 (EDT)
Holy crap! That worked! It also fixed it in the original bloated project
as well.
The rule I created was done with RuleEditor and based on documentation
from BugTracker in Wonder (though I could never find the rule mentioned in
the docs). I don't take back any of the nasty cusses I muttered about D2W.
Thanks a whole lot for your help!
Steve
On Wed, 30 Aug 2006, David Avendasora wrote:
Okay, I'm going to take another stab at it. I think you're using the wrong
class.
From the 5.3 API, EOKeyComparisionQualifier compares a named property of an
object with a named value of another object. For example, to return all of
the employees whose salaries are greater than those of their managers, you
might use an expression such as "salary > manager.salary", where "salary" is
the left key and "manager.salary" is the right key.
I think you should be using EOKeyValueQualifier, which the API states that it
compares a named property of an object with a supplied value, which I believe
is what you are doing. Based on this, You should rewrite the rule as:
{
author = 50;
class = "com.webobjects.directtoweb.Rule";
lhs = {
class = com.webobjects.eocontrol.EOKeyValueQualifier;
key = "session.noEdits";
selectorName = "isEqualTo";
value = 1;
};
rhs = {
class = "com.webobjects.directtoweb.Assignment";
keyPath = readOnlyEntityNames;
value = (User, Group);
};
}
The reason the rule you wrote is not being triggered is that there is no
object "1" and "1" certainly doesn't have named value so the lhs is never
"True."
Again, I'm pretty new to rules writing, but I think this is correct.
Dave
On Aug 29, 2006, at 8:15 PM, Steve Quirk wrote:
class = com.webobjects.eocontrol.EOKeyComparisonQualifier;
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden