It never fires :-(
public class DelayedCustomReportKeysAssignment extends ERDDelayedAssignment{ public DelayedCustomReportKeysAssignment(EOKeyValueUnarchiver u) { super(u); // TODO Auto-generated constructor stub }
static final long serialVersionUID = 1L;
public Object fireNow(D2WContext c) { String keyPath = "session.objectStore." + c.entity().name() + "_reportKeys"; Object keys = c.valueForKeyPath(keyPath); return keys; }
}
On Dec 9, 2014, at 4:28 PM, Ramsey Gurley < email@hidden> wrote:
Put a breakpoint on the line
return keys;
It sounds like keys is a string, not an array. On Dec 9, 2014, at 3:17 PM, James Cicenia < email@hidden> wrote:
Uh… that first rule.
I created my DelayedAssignment that extended ERDDelayedAssignment and implemented fireNow
I put in a rule to for displayPropertyKeys but it crashes on = “”
100 : pageConfiguration like ‘ListCustom*' => displayPropertyKeys = "" [DelayedCustomReportKeysAssignment]
java.lang.ClassCastException: java.lang.String cannot be cast to com.webobjects.foundation.NSArray
On Dec 9, 2014, at 3:52 PM, Ramsey Gurley < email@hidden> wrote:
:-)
100 : task = ‘list’ and entity.userInfo.availableKeys.count > 0 => displayPropertyKeys = "” [MyDelayedAssignment]
MyDelayedAssignment.java
public Object fireNow(D2WContext c) { String keyPath = “session.objectStore.” + c.pageName + “_availableKeys”; Object keys = c.valueForKeyPath(keyPath); //TODO Do something if keys is null return keys; } On Dec 9, 2014, at 2:41 PM, James Cicenia < email@hidden> wrote: Is there a generic way to get the PageConfiguration and then the delayed response? Or Do I have to create a 90 : pageConfiguration = 'ListCustomCategory' => displayPropertyKeys = "session.objectStore.ListCustomCategory_reportKeys" [er.directtoweb.ERDDelayedKeyValueAssignment] for each Entity?
Anyway, this method does work so I will definitely go this route. thanks
On Dec 9, 2014, at 3:13 PM, Ramsey Gurley < email@hidden> wrote:
Yep, it’s a full blown NSKeyValueCodingAdditions object backed by the same dictionary that holds the page cache I believe. On Dec 9, 2014, at 2:06 PM, James Cicenia < email@hidden> wrote: OK -
Though I added the cover methods to all entities, so I will still go with that method vs. user info and eomodeler.
Now what does the syntax "session.objectStore.<pageConfiguration>_availableKeys” mean?
Is objectStore a custom dictionary in your Session?
On Dec 9, 2014, at 2:53 PM, Ramsey Gurley < email@hidden> wrote:
Just keep in mind that while the context may be one of many instances, the rule cache is global. It might seem to work fine for you in Eclipse. Can you say that when multiple users are accessing the same page concurrently on the same app instance? It works great, until it doesn’t :-)
Were I doing this, I would put the keys in the userInfo like you were doing. I would then take the selected values from the custom page and stuff it in say, session.objectStore.<pageConfiguration>_availableKeys. Then I would have a custom delayed assignment which pulled those keys back out of the session and provided them to the displayPropertyKeys RHS key. On Dec 9, 2014, at 1:36 PM, James Cicenia < email@hidden> wrote:
I am using D2W except for on custom screens like my column picker. I am using two wobrowsers for the user to pick columns and some ajaxsubmitbuttons
Typical:
Leftlist <<-->> RightList
Then some buttons:
PDF Excel Screen So since I am generating a new “List” with the buttons, the setting of the d2wcontext directly works fine.
On Dec 9, 2014, at 2:21 PM, Ramsey Gurley < email@hidden> wrote:
Using D2W? In this case, you could make a rule per entity if that’s what you need.
100: entity.name=‘Blah’ => availableKeys = {“name”=“Name”; “-DATES-“ = “— Dates —“;} [Assignment]
Or store in the userInfo like you were doing
100: *true* => availableKeys = entity.userInfo.availableKeys [ERDKeyValueAssignment]
As you noted, entering data via EOModeler for userInfo is a bit of a pain. You may want to get the userInfo started and then edit the entity.plist directly in a text editor instead. On Dec 9, 2014, at 9:22 AM, James Cicenia < email@hidden> wrote: I want to run a method called availableKeys which just returns an NSArray of keypaths for that Entity.
I will be creating a picker of keys that are pre determined. I was going to use the UserInfo but it made EOModeler act a bit funny. So I am doing something like:
public NSMutableDictionary availableKeys(){ if(availableKeys == null){ availableKeys.takeValueForKeyPath("Name", "name”); availableKeys.takeValueForKeyPath("--- Dates ---", "-DATES-"); availableKeys.takeValueForKeyPath("Active Date", "activeDt"); } return availableKeys; } So in my “Generic” pick list component I want to pass in the displayGroup, let them pick the columns of the report, and then process.
On Dec 9, 2014, at 10:14 AM, Ramsey Gurley < email@hidden> wrote:
EOEntity entity = EOModelGroup.defaultModelGroup().entityNamed(entityName); Class class = _NSUtilities.classWithName(entity.className()); Method method = class.getMethod(methodName, parameterTypes); method.invoke(null, parameters); //null target for static methods
You could do it through java’s reflection APIs, but that sounds really fishy. Maybe if you explain what you are trying to accomplish, we could offer better insight. For instance, you may be better served using the clazz pattern if you want static methods you can override.
On Dec 9, 2014, at 8:37 AM, James Cicenia < email@hidden> wrote:
I have a string that is an EntityName. I want to run that entity’s static class method.
do I have to do this?:
EOEnterpriseObject myClass = EOUtilities.createAndInsertInstance( ec, entityName) ;
I really don’t want to create an instance.
Thanks James
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
|