Re: Ponder: AuthorizeEntity

Ramsey Gurley <[email protected]>
Newsgroups gmane.comp.web.webobjects.wonder-disc
Message-ID <[email protected]>
Honestly didn't remember. I had to go look :-)

20 : *true* => actions = {"left" = ("leftControllerAction"); "right" = ("rightControllerAction"); } [com.webobjects.directtoweb.Assignment]

My list table repetition follows the pattern in ERD2W where action keys are specified by an actions rule. I liked that because if you do everything through a delegate, then you only need to think about setting the leftControllerChoices or rightControllerChoices. 

If you wanted to add something besides controller choices on a list table, you'd do it with that rule. I haven't implemented a pick list page yet, so that might be a logical place for a checkbox for instance...

Ramsey

On Dec 20, 2012, at 9:00 PM, James Cicenia wrote:

> Riddle me this:
> 
> In Dashboard you assign your displayKeys in the wod file. There is no key for anything but the entity attributes. There are no "action" keys of any sort:
> 
> ListMovie: ERXD2WList {
> 	entityName = "Movie";
> 	dataSource = movieDataSource;
> 	displayKeys = "((movieInfo, title, category, rated, dateReleased, revenue),(voteInfo, voting.numberOfVotes, voting.runningAverage, castVote))";
> }
> 
> So how does the embedded ERXD2WList know to tack on "right" and "left" action? 
> 
> Now in my own new app, I have a simple setup emulating the above and no action component shows up. So I don't know what I am missing.
> 
> Thanks
> James
> 
> 
> 
> On Dec 20, 2012, at 9:33 PM, Ramsey Gurley <[email protected]> wrote:
> 
>> Well, that's the beauty of ponder. That's why all the rest of it works. All the actions in R2D2W happen through controller buttons and branch delegates. 
>> 
>> Unless they are set explicitly, actions are provided via a common delegate (R2DDefaultBranchDelegate) and the actions themselves are determined by an assignment (R2DDefaultBranchChoicesAssignment). Look for the default *ControllerChoices in the rules.
>> 
>> This allows for mind-blowing simplicity in the templates. R2's inspect page template handles inspect, edit, tab, and wizard pages. It does what takes ERD2W three separate templates to do, and it does it in eight lines of component html. So no more rules like shouldShowCreateButton, shouldShowCancelButton, and winding WOConditionals everywhere… all of that goes away and you just assign a list of actions directly like
>> 
>> 100 : propertyKey = 'rightControllerAction' => rightControllerChoices = ("_edit", "_delete") [Assignment]
>> 
>> By default, that's done for you by the branch choices assignment. ALL of the control logic scattered across all of the D2W pages in ERDirectToWeb is relocated to a single delegate file in R2. And the root level D2W page shares a single delegate instance with all its nested pages unless you specify a custom delegate for an embedded page config :-)
>> 
>> In the dashboard example, the R2DDefaultBranchChoicesAssignment honors the old isEntityEditable stuff. That's why you'll see it in the user.d2wmodel. 
>> 
>> An auth aware assignment lives in ERAuth (ERADefaultAuthorizationAssignment). In the ERAuth rules, it overrides the one in R2. The assignment in ERAuth supplies the actions based on what your CRUDAuthorization says. Maybe you can edit row two, but you can't edit row three. That depends on what you return from canUpdate(eo).
>> 
>> Ramsey
>> 
>> 
>> On Dec 20, 2012, at 6:39 PM, James Cicenia wrote:
>> 
>>> OK -
>>> 
>>> Two Questions:
>>> 1) In the example you directed me to, there are action icons on the left and right of the list... where the heck are they getting specified?
>>> 
>>> 2) I have a nice ERXD2WList embedded in my component. Works ok, though can't seem to automagically create the action buttons. I can create my own component, just want to know the magic.
>>> Anyway, I get an npe error if I display the list with an Inspect component embedded below it.
>>> 
>>> So, I figure... ah.. I need to Authorize for inspect, etc., so I run wa/AuthorizeUser, set some switches, hit save and then boom:
>>> 
>>> 
>>> com.webobjects.foundation.NSForwardException [java.lang.NullPointerException] null:java.lang.NullPointerException
>>> 	at er.directtoweb.delegates.ERDBranchDelegate.nextPage(ERDBranchDelegate.java:109)
>>> 	at er.r2d2w.components.buttons.R2DControllerButton.nextPageFromParent(R2DControllerButton.java:54)
>>> 	at er.r2d2w.components.buttons.R2DControllerButton.performAction(R2DControllerButton.java:59)
>>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> 
>>> 
>>> Do I need to set the next page somewhere?
>>> 
>>> Thanks
>>> James
>>> ------------------------------------------------------------------------------
>>> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
>>> Remotely access PCs and mobile devices and provide instant support
>>> Improve your efficiency, and focus on delivering more value-add services
>>> Discover what IT Professionals Know. Rescue delivers
>>> http://p.sf.net/sfu/logmein_12329d2d_______________________________________________
>>> Wonder-disc mailing list
>>> [email protected]
>>> https://lists.sourceforge.net/lists/listinfo/wonder-disc
>> 
> 
> ------------------------------------------------------------------------------
> LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
> Remotely access PCs and mobile devices and provide instant support
> Improve your efficiency, and focus on delivering more value-add services
> Discover what IT Professionals Know. Rescue delivers
> http://p.sf.net/sfu/logmein_12329d2d_______________________________________________
> Wonder-disc mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/wonder-disc

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d

_______________________________________________
Wonder-disc mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wonder-disc
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.