ERRest and ERXKeyFilters advice
ERRest and ERXKeyFilters advice
- Subject: ERRest and ERXKeyFilters advice
- From: Giles Palmer <email@hidden>
- Date: Tue, 02 Apr 2013 15:55:27 +0100
Hi
I am just starting my first ERRest app and playing with ERXKeyFilters.
I have an OrganisationController using a filter and I remove unwanted attributes from the rest response with:
ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
filter.exclude("dateTimeStamp","autoNotify","notifyMethod","webSitePassword","website");
This works great, however if I then have a TransactionController and a Transaction object that has a to-1 Organisation relationship how best do I also remove the unwanted Organisation attributes from the rest response? At the moment I have the below:
ERXKeyFilter filter = ERXKeyFilter.filterWithAttributes();
filter.include("organisation").includeAttributes();
filter.exclude("organisation.dateTimeStamp","organisation.autoNotify","organisation.notifyMethod","organisation.webSitePassword","organisation.website");
but I can't help thinking there is a better way to ensure consistency about what attributes are contained in the response for various EOs when they form parts of responses that contain relationship objects. Is there a better way of achieving this?
Thanks
Giles
_______________________________________________
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