> Sorry this is confusing.
I'm sorry, as I fear I've been wasting your time by messing up the rules!
> You've got an EditEntityC page with an embedded relationship to A or B and
> then a second embedded relationship back to C inside those embedded pages?
The root level pageConfiguration is either "EditEntityA" or "EditEntityB". Each
of these has a to-many relation to EntityC and as such a
ERMODEditRelationshipPage with a pageConfiguration of
"EditRelationshipEmbeddedEntityC". When you edit one of those relationships to
EntityC, you'll end up with a pageConfiguration "EditEmbeddedEntityC". Nothing
special really.
Now, depending on whether the root level pageConfiguration is "EditEntityA" or
"EditEntityB", different property keys should be shown.
> Can you paste the rules for this page? What are the parent page display
> property keys?
100 : (session.user.isOwnerOrEmployee = 1 and pageConfiguration !=
'CreateEntityA' and task = 'edit' and entity.name = 'EntityA') =>
displayPropertyKeys = ( "foo", "entityCs")
[com.webobjects.directtoweb.Assignment]
333 : ((pageConfiguration = 'CreateEmbeddedEntityC' or pageConfiguration =
'EditEmbeddedEntityC') and session.context.page.d2wContext.pageConfiguration
like '*EntityA') => displayPropertyKeys = ("foo", "bar", "baz")
[com.webobjects.directtoweb.Assignment]
333 : ((pageConfiguration = 'CreateEmbeddedEntityC' or pageConfiguration =
'EditEmbeddedEntityC') and session.context.page.d2wContext.pageConfiguration
like '*EntityB') => displayPropertyKeys = ("foo", "bar")
[com.webobjects.directtoweb.Assignment]
> And where are you hoping to vary the displayPropertyKeys?
This time the rules are correct, I figure. And make it clear where the change
occurs.
>
> On 2012-10-26, at 11:18 AM, Fabian Peters wrote:
>
>> Sorry, sent too fast and mixed up my mock entities. This seems to be (more)
>> correct:
>>
>> Unfortunately parentPageConfiguration doesn't help, as there's an additional
>> level of nesting due to the "EditRelationshipEmbeddedEntityC". It will
>> always just return "EditRelationshipEmbeddedEntityC", when the embedded page
>> is "EditEmbeddedEntityC" and the "root" pageConfiguration is "EditEntityA"
>> or "EditEntityB".
>>
>> My rule works fine when the pageConfiguration is "CreateEmbeddedEntityC":
>>
>> 333 : ((pageConfiguration = 'CreateEmbeddedEntityC' or pageConfiguration =
>> 'EditEmbeddedEntityC') and session.context.page.d2wContext.pageConfiguration
>> like '*EntityC') => displayPropertyKeys = ("foo", "bar", "baz")
>> [com.webobjects.directtoweb.Assignment]
>>
>> But the same rule fails when the task is "edit". Tracing the rules shows
>> that "session.context.page.d2wContext.pageConfiguration" evaluates to null
>> then.
>>
>> Am 26.10.2012 um 20:00 schrieb David Holt:
>>
>>> Sorry those should have been: editEmbeddedRelationshipEntityC
>>>
>>>
>>> On 2012-10-26, at 10:57 AM, David Holt wrote:
>>>
>>>> If you're using embedded configurations, wouldn't you just have a couple
>>>> of rules like:
>>>>
>>>> 20 : (pageConfiguration = 'editRelationshipEntityC' and
>>>> parentPageConfiguration = 'EditEntityA') => displayPropertyKeys =
>>>> ("name", "description") [com.webobjects.directtoweb.Assignment]
>>>>
>>>> 20 : (pageConfiguration = 'editRelationshipEntityC' and
>>>> parentPageConfiguration = 'EditEntityB') => displayPropertyKeys =
>>>> ("name") [com.webobjects.directtoweb.Assignment]
>>>>
>>>> Unless I'm missing what you're trying to do.
>>>>
>>>> d
>>>>
>>>>
>>>> On 2012-10-26, at 10:09 AM, Fabian Peters wrote:
>>>>
>>>>> Yes, this is with ModernLook.
>>>>>
>>>>> Am 26.10.2012 um 17:56 schrieb David Holt:
>>>>>
>>>>>> Are you using ModernLook with actual embedded page configurations?
>>>>>>
>>>>>> David
>>>>>>
>>>>>> On 2012-10-26, at 6:40 AM, Fabian Peters wrote:
>>>>>>
>>>>>>> Hi all,
>>>>>>>
>>>>>>> An entity that's being edited (EntityC) has relationships to two
>>>>>>> different entities (EntityA, EntityB) and different keys should be
>>>>>>> shown depending on the context (root pageConfiguration being
>>>>>>> "EditEntityA" or "EditEntityB"). In order to display the right
>>>>>>> properties on an embedded page, I need to look at the root
>>>>>>> pageConfiguration, "parentPageConfiguration" is the same in both
>>>>>>> contexts.
>>>>>>>
>>>>>>> Calling "session.context.page.d2wContext.pageConfiguration" works when
>>>>>>> used at the property level, but (mostly) fails when used in a rule
>>>>>>> acting on "displayPropertyKeys". Apparently, it's impossible to get to
>>>>>>> the session from there. Is there an alternative approach to get the
>>>>>>> root page configuration in a D2W app?
>>>>>>>
>>>>>>> Fabian
>>>>>>> _______________________________________________
>>>>>>> Do not post admin requests to the list. They will be ignored.
>>>>>>> Webobjects-dev mailing list ([email protected])
>>>>>>> Help/Unsubscribe/Update your Subscription:
>>>>>>> https://lists.apple.com/mailman/options/webobjects-dev/programmingosx%40mac.com
>>>>>>>
>>>>>>> This email sent to [email protected]
>>>>>>
>>>>>
>>>>
>>>> _______________________________________________
>>>> Do not post admin requests to the list. They will be ignored.
>>>> Webobjects-dev mailing list ([email protected])
>>>> Help/Unsubscribe/Update your Subscription:
>>>> https://lists.apple.com/mailman/options/webobjects-dev/programmingosx%40mac.com
>>>>
>>>> This email sent to [email protected]
>>>
>>
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/lists.fabian%40e-lumo.com
>>
>> This email sent to [email protected]
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Webobjects-dev mailing list ([email protected])
>> Help/Unsubscribe/Update your Subscription:
>> https://lists.apple.com/mailman/options/webobjects-dev/programmingosx%40mac.com
>>
>> This email sent to [email protected]
>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]