• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: directtoweb and readOnlyEntityNames rule
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: directtoweb and readOnlyEntityNames rule


  • Subject: Re: directtoweb and readOnlyEntityNames rule
  • From: Steve Quirk <email@hidden>
  • Date: Tue, 29 Aug 2006 20:15:22 -0400 (EDT)



On Tue, 29 Aug 2006, David Avendasora wrote:

Steve,

Have you tried putting it in the user.d2wmodel file instead of the d2w.d2wmodel file?

Dave

Yeah. Makes no difference. But if I remove the lhs from the rule, I get the desired result (no edit/delete buttons) - of course, I need to be able to turn that on and off.


Is there any way to intercept the rule firing on code? Subclass D2WContext somehow (doesn't look probable)? Seems this rule is evaluated from D2WUtils in a static method. Phooey.

I'd have to do something grotesque like turning off concurrent request handling and munge the rule array on every appendToResponse.

-sq



On Aug 29, 2006, at 6:41 PM, Steve Quirk wrote:


I'm trying to remove the edit/delete buttons from the UI of a D2W app by using the "readOnlyEntityNames" rule. I'd like to make the result of this to be conditional on a Session method "noEdits()".


I put this rule in my d2w.d2wmodel (using RuleEditor):

     {
           author = 50;
           class = "com.webobjects.directtoweb.Rule";
           lhs = {
               class = com.webobjects.eocontrol.EOKeyComparisonQualifier;
               leftKey = "session.noEdits";
               rightKey = 1;
               selectorName = "isEqualTo";
           };
           rhs = {
               class = "com.webobjects.directtoweb.Assignment";
               keyPath = readOnlyEntityNames;
               value = (User, Group);
           };
       }

This is the *only* rule in this file. FYI, the only rule in user.d2wmodel is
{
class = com.webobjects.directtoweb.Rule;
author = 100;
rhs = {
class = com.webobjects.directtoweb.Assignment;
keyPath = look;
value = "BasicLook";
};
}


D2W.factory().newSignificantKey("session.noEdits") has been added to Application.java

The edit/delete buttons always show however. When tracing the rule firing, I only see the default readOnlyEntityNames rule:

****** fire : *true* => readOnly=isEntityReadOnly (-1)
****** fire : *true* => readOnlyEntityNames=() (com.webobjects.foundation.NSMutableArray) (-1)


If I rummage through the D2WModel _rules array at runtime, I can find my rule. If I manually call the fire() method on my rule, I get the expected ("User", "Group") array.

Anyone have any ideas on what I'm doing wrong? Suggestions on how to do this easily? (Editing the rules is pretty much out of the question, this is a boiled down version of an existing app whose rule file is 18000+ lines - but "no code", jeez!!).

Steve
_______________________________________________
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



_______________________________________________
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


  • Follow-Ups:
    • Re: directtoweb and readOnlyEntityNames rule
      • From: David Avendasora <email@hidden>
References: 
 >directtoweb and readOnlyEntityNames rule (From: Steve Quirk <email@hidden>)

  • Prev by Date: Re: custom display for WOToManyRelationship destinationDisplayKey
  • Next by Date: Re: Subclass final class (Boolean) ?
  • Previous by thread: directtoweb and readOnlyEntityNames rule
  • Next by thread: Re: directtoweb and readOnlyEntityNames rule
  • Index(es):
    • Date
    • Thread