Hi all,

One week ago before knowing the list server outage, I sent the following email 
which was never sent. And the solution below.
(if you want to read my question quickly go to the end)

The email I sent: 
--------------------------------------------
I have 2 entities:
- Client (company)
- User

There are 2 relationships between User and Client
- a toOne called employer (a user has only one employer)
- a Many2Many called contractors where a user can work for different Client

There is an edit page for the Client entity (template name: 
ERMODTabInspectPage, page configuration name: EditNOClient) with 3 tabs:
- address informations
- users
- contractors

I have several issues to customize the users list and the contractors list 
because both have:
- the same parent page configuration (EditNOClient)
- the same page configuration (EditRelationshipEmbeddedNOUser)

I would like to customize the list of attributes, let the New button for the 
users list but remove it for the contractors list, …

I tried (but didn't believe it would work) to play withe the relationship name 
like:
(pageConfiguration = 'EditRelationshipEmbeddedNOUser' and 
parentPageConfiguration = 'EditNOClient' and propertyKey = 'users') -> RHS

But this propertyKey is unknown at this level.

So if you have any clue to share, I would be very happy.
--------------------------------------------

Since that day, I found that the object who handles the configuration page name 
was an instance of ERMDDefaultConfigurationNameAssignment.

So I create a subclass, MyMDDefaultConfigurationNameAssignment and put this 
kind of code:


public Object editRelationshipEmbeddedConfigurationName(final D2WContext c) 
    {
        Object result = super.editRelationshipEmbeddedConfigurationName(c) + 
configurationPageSuffix(c);
        return result;
    }

ou super. editRelationshipEmbeddedConfigurationName corresond a ca :

    public Object editRelationshipEmbeddedConfigurationName(D2WContext c) {
        return "EditRelationshipEmbedded" + entityNameForContext(c);
    }

et configurationPageSuffix est :
    private String configurationPageSuffix(final D2WContext c)
    {
        String pageSuffix = (String)c.valueForKey("configurationPageSuffix");
                return pageSuffix != null ? pageSuffix : "";
    }

I changed the rules accordingly and it works great

My question:
No I have a last question. When I click on the Delete button, I get 3 options:
- delete
- remove from relationShip
- cancel

What I want is to remove the delete action but I didn't know how? 

My suggestion:
Do you think any interest to modify ERMDDefaultConfigurationNameAssignment and 
add the method  configurationPageSuffix as I did in my own class?

Thanks,

Philippe

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to