SlideShare a Scribd company logo
Filtering data with D2W
Philippe Rabier - twitter.com/prabier
Sophiacom
What is the problem to solve?
Company
EOEntityA
EOEntityB
User
EOEntityC
• Use D2W
• Limit the visibility of the data
• Use conventions to name relationships (for example, any toOne
relationship to Company entity, is called company)
• Minimize the code
• Be magic!
The Requirements
Feedback fromYou ’N Push
First Solution
Working at the editingContext level
modified fetchspec
notification
ec factory
ec
company
objectsWithFetch
Specification()
creates
businessFP
fetchspec
How the qualifier is modified?
	 public void alterFetchSpecification(final NSNotification aNotification)
	 {
	 	 EOEditingContext ec = (EOEditingContext) aNotification.object();
	 	 if (shouldAddRestrictionQualifier)
	 	 {
	 	 	 Company aCompany = (NOClient) ec.userInfoForKey(NBEditingContextFactory.COMPANY_KEY);
	 	 	 final EOFetchSpecification fs = (EOFetchSpecification) aNotification.userInfo().valueForKey(COEditingContext.FETCH_SPEC_KEY);
	 	 	 if (aCompany != null && fs != null)
	 	 	 {
	 	 	 	 EOEntity aEntity = EOUtilities.entityNamed(ec, fs.entityName());
	 	 	 	 EOQualifier fsQualifier = fs.qualifier();
	 	 	 	 if (fsQualifier != null)
	 	 	 	 {
	 	 	 	 	 NSSet<String> keys = fsQualifier.allQualifierKeys();
	 	 	 	 	 for (String aKey : keys)
	 	 	 	 	 {
	 	 	 	 	 	 if (aKey.contains("company"))
	 	 	 	 	 	 {
	 	 	 	 	 	 	 shouldAddRestrictionQualifier = false;
	 	 	 	 	 	 	 break;
	 	 	 	 	 	 }
	 	 	 	 	 }
	 	 	 	 }
	 	 	 	 if (shouldAddRestrictionQualifier)
	 	 	 	 {
	 	 	 	 	 EOQualifier aRestrictionQualifier = clientRestrictionQualifier(aEntity, aClient);
	 	 	 	 	 if (aRestrictionQualifier != null)
	 	 	 	 	 {
	 	 	 	 	 	 if (fsQualifier != null)
	 	 	 	 	 	 	 fsQualifier = new EOAndQualifier(new NSArray<EOQualifier>(new EOQualifier[] {fsQualifier, aRestrictionQualifier}));
	 	 	 	 	 	 else
	 	 	 	 	 	 	 fsQualifier = aRestrictionQualifier;
	 	 	 	 	 	 fs.setQualifier(fsQualifier);
	 	 	 	 	 }
	 	 	 	 }
	 	 	 }
	 	 }
	 }
How the qualifier is modified?
	 public EOQualifier companyRestrictionQualifier(final EOEntity entity, final Company company)
	 {
	 	 EOQualifier aQualifier = null;
	 	 if (entity.name().equals(Company.Keys.ENTITY_NAME))
	 	 	 aQualifier = new EOKeyValueQualifier(Company.Keys.NAME, EOQualifier.QualifierOperatorEqual, company.name());
	 	 else if (entity.relationshipNamed("company") != null)
	 	 	 aQualifier = new EOKeyValueQualifier("company", EOQualifier.QualifierOperatorEqual, company);
	 	 else if (entity.relationshipNamed("entityB") != null)
	 	 	 aQualifier = new EOKeyValueQualifier("entityB.company", EOQualifier.QualifierOperatorEqual, client);
	 	 else if (entity.relationshipNamed("entityC") != null)
	 	 	 ...;
	 	 if (log.isDebugEnabled())
	 	 	 log.debug("method: qualifier: " + aQualifier);
	 	 return aQualifier;
	 }
It works great
but there is a little problem
it’s too low level
An Example of Problem
	 public void validateForSave() throws ValidationException
	 {
	 	 super.validateForSave();
	 	 ERXEOControlUtilities.validateUniquenessOf(this, NOUser.Keys.LOGIN);
	 	 ERXEOControlUtilities.validateUniquenessOf(this, NOUser.Keys.EMAIL);
	 }
	 public void validateForSave() throws ValidationException
	 {
	 	 super.validateForSave();
	 	 editingContext().setUserInfoForKey(Boolean.FALSE, NBEditingContextFactory.NO_RESTRICTION_QUAL_KEY);
	 	 ERXEOControlUtilities.validateUniquenessOf(this, NOUser.Keys.LOGIN);
	 	 ERXEOControlUtilities.validateUniquenessOf(this, NOUser.Keys.EMAIL);
	 	 editingContext().setUserInfoForKey(Boolean.TRUE, NBEditingContextFactory.NO_RESTRICTION_QUAL_KEY);
	 }
Second Solution
• Displaying a list
• Using a query component
• Using ERD2WEditToManyRelationship component
• Using ERD2WEditToOneRelationship component
When should we filter?
• Modify the NavigationController object
• Change the data source
Displaying a list
	 public WOComponent listPageForEntityName(final String entityName)
	 {
	 	 ListPageInterface newListPageInterface = D2W.factory().listPageForEntityNamed(entityName, session());
	 	 EODatabaseDataSource dataSource = new EODatabaseDataSource(ERXEC.newEditingContext(), entityName);
	 	 EOEntity entity = ERXEOAccessUtilities.entityNamed(null, entityName);
	 	 EOQualifier auxQual = NBBusinessLogicPrincipal.getSharedInstance().clientRestrictionQualifier(entity,
	 	 	 	 ((Session)session()).getCompany());
	 	 dataSource.setAuxiliaryQualifier(auxQual);
	 	 newListPageInterface.setDataSource(dataSource);
	 	 return (WOComponent) newListPageInterface;
	 }
• Use a query delegate
• Override the method queryDataSource(ERD2WQueryPage sender)
Using a query component
{
author = 100;
class = "com.webobjects.directtoweb.Rule";
lhs = {
class = "com.webobjects.eocontrol.EOKeyValueQualifier";
key = pageConfiguration;
selectorName = isEqualTo;
value = QueryMyEntity;
};
rhs = {
class = "er.directtoweb.ERDDelayedObjectCreationAssignment";
keyPath = queryDataSourceDelegate;
value = "ca.wowodc.very.util.pascal.delegate.SomeOneElse";
};
}
• Maybe subclass the 2 component is the best solution
• Use restrictingFetchSpecification key. If all fetchspec have the
same name, it’s possible to build a generic rule.
• Need to be modified to add the possibility to set a binding to
the fetchspec
• Maybe a lot of pain to create many fetchspec in the EOModel
EditRelationship components
How the qualifier is modified?
public Object restrictedChoiceList() {
String restrictedChoiceKey=(String)d2wContext().valueForKey("restrictedChoiceKey");
if( restrictedChoiceKey!=null && restrictedChoiceKey.length()>0 )
return valueForKeyPath(restrictedChoiceKey);
String fetchSpecName=(String)d2wContext().valueForKey("restrictingFetchSpecification");
if(fetchSpecName != null) {
EORelationship relationship = ERXUtilities.relationshipWithObjectAndKeyPath(object(),
(String)d2wContext().valueForKey("propertyKey"));
if(relationship != null)
return EOUtilities.objectsWithFetchSpecificationAndBindings(object().editingContext(),
relationship.destinationEntity().name(),fetchSpecName,null);
}
return null;
}
@prabier
Follow me!
Q&A
TBD

More Related Content

PDF
KAAccessControl
WO Community
 
PDF
ERRest - The Next Steps
WO Community
 
PDF
ERRest
WO Community
 
PDF
ERRest in Depth
WO Community
 
PDF
ERRest - Designing a good REST service
WO Community
 
PPT
Hibernate Tutorial
Ram132
 
PPT
Introduction to hibernate
hr1383
 
PDF
A Dexterity Intro for Recovering Archetypes Addicts
David Glick
 
KAAccessControl
WO Community
 
ERRest - The Next Steps
WO Community
 
ERRest
WO Community
 
ERRest in Depth
WO Community
 
ERRest - Designing a good REST service
WO Community
 
Hibernate Tutorial
Ram132
 
Introduction to hibernate
hr1383
 
A Dexterity Intro for Recovering Archetypes Addicts
David Glick
 

What's hot (19)

PPT
JavaScript
Sunil OS
 
PPT
Deployment
Roy Antony Arnold G
 
PPT
Intro To Hibernate
Amit Himani
 
PPTX
Spring data jpa
Jeevesh Pandey
 
PPT
hibernate with JPA
Mohammad Faizan
 
PPTX
Hibernate inheritance and relational mappings with examples
Er. Gaurav Kumar
 
PDF
Expression Language in JSP
corneliuskoo
 
PPTX
Art of Javascript
Tarek Yehia
 
PDF
Introduction to JPA and Hibernate including examples
ecosio GmbH
 
PDF
Efficient Rails Test-Driven Development - Week 6
Marakana Inc.
 
PDF
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Rabble .
 
PPTX
Hibernate in Nutshell
Onkar Deshpande
 
PPTX
jQuery from the very beginning
Anis Ahmad
 
PPTX
Web весна 2013 лекция 6
Technopark
 
PDF
Web2py tutorial to create db driven application.
fRui Apps
 
PDF
Designing a JavaFX Mobile application
Fabrizio Giudici
 
PPT
Jquery 4
Manish Kumar Singh
 
PPTX
Domain Driven Design using Laravel
wajrcs
 
JavaScript
Sunil OS
 
Intro To Hibernate
Amit Himani
 
Spring data jpa
Jeevesh Pandey
 
hibernate with JPA
Mohammad Faizan
 
Hibernate inheritance and relational mappings with examples
Er. Gaurav Kumar
 
Expression Language in JSP
corneliuskoo
 
Art of Javascript
Tarek Yehia
 
Introduction to JPA and Hibernate including examples
ecosio GmbH
 
Efficient Rails Test-Driven Development - Week 6
Marakana Inc.
 
Introduction to Active Record - Silicon Valley Ruby Conference 2007
Rabble .
 
Hibernate in Nutshell
Onkar Deshpande
 
jQuery from the very beginning
Anis Ahmad
 
Web весна 2013 лекция 6
Technopark
 
Web2py tutorial to create db driven application.
fRui Apps
 
Designing a JavaFX Mobile application
Fabrizio Giudici
 
Domain Driven Design using Laravel
wajrcs
 
Ad

Viewers also liked (17)

PDF
iOS for ERREST
WO Community
 
PDF
iOS for ERREST - alternative version
WO Community
 
PDF
Reenabling SOAP using ERJaxWS
WO Community
 
PDF
WOver
WO Community
 
PDF
Chaining the Beast - Testing Wonder Applications in the Real World
WO Community
 
PDF
Apache Cayenne for WO Devs
WO Community
 
PDF
Migrating existing Projects to Wonder
WO Community
 
PDF
D2W Stateful Controllers
WO Community
 
PDF
Using Nagios to monitor your WO systems
WO Community
 
PDF
Advanced Apache Cayenne
WO Community
 
PDF
Life outside WO
WO Community
 
PDF
Unit Testing with WOUnit
WO Community
 
PDF
Build and deployment
WO Community
 
PDF
High availability
WO Community
 
PDF
Deploying WO on Windows
WO Community
 
PDF
"Framework Principal" pattern
WO Community
 
PDF
In memory OLAP engine
WO Community
 
iOS for ERREST
WO Community
 
iOS for ERREST - alternative version
WO Community
 
Reenabling SOAP using ERJaxWS
WO Community
 
Chaining the Beast - Testing Wonder Applications in the Real World
WO Community
 
Apache Cayenne for WO Devs
WO Community
 
Migrating existing Projects to Wonder
WO Community
 
D2W Stateful Controllers
WO Community
 
Using Nagios to monitor your WO systems
WO Community
 
Advanced Apache Cayenne
WO Community
 
Life outside WO
WO Community
 
Unit Testing with WOUnit
WO Community
 
Build and deployment
WO Community
 
High availability
WO Community
 
Deploying WO on Windows
WO Community
 
"Framework Principal" pattern
WO Community
 
In memory OLAP engine
WO Community
 
Ad

Similar to Filtering data with D2W (20)

PDF
Clean coding-practices
John Ferguson Smart Limited
 
PPTX
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
Ali Parmaksiz
 
PPTX
Typed? Dynamic? Both! Cross-platform DSLs in C#
Vagif Abilov
 
PDF
Rails is not just Ruby
Marco Otte-Witte
 
PPTX
Adding a modern twist to legacy web applications
Jeff Durta
 
PPTX
Developing ASP.NET Applications Using the Model View Controller Pattern
goodfriday
 
PDF
Cocoa heads testing and viewcontrollers
Stijn Willems
 
PDF
Requery overview
Sunghyouk Bae
 
PDF
Test-driven Development with AEM
Jan Wloka
 
DOCX
Quick Fix Sample
Neeraj Kaushik
 
PDF
Deep dive into Oracle ADF
Euegene Fedorenko
 
PDF
PHPSpec - the only Design Tool you need - 4Developers
Kacper Gunia
 
PPTX
Functional programming in C#
Thomas Jaskula
 
PDF
react-hooks.pdf
chengbo xu
 
PPTX
[Final] ReactJS presentation
洪 鹏发
 
DOCX
Ecom lec4 fall16_jpa
Zainab Khallouf
 
PPTX
Devoxx 2012 hibernate envers
Romain Linsolas
 
PDF
Jsr 303
Aleksandr Zhuikov
 
PDF
Windows 8 Training Fundamental - 1
Kevin Octavian
 
PDF
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
Daniel Bryant
 
Clean coding-practices
John Ferguson Smart Limited
 
A GWT Application with MVP Pattern Deploying to CloudFoundry using Spring Roo
Ali Parmaksiz
 
Typed? Dynamic? Both! Cross-platform DSLs in C#
Vagif Abilov
 
Rails is not just Ruby
Marco Otte-Witte
 
Adding a modern twist to legacy web applications
Jeff Durta
 
Developing ASP.NET Applications Using the Model View Controller Pattern
goodfriday
 
Cocoa heads testing and viewcontrollers
Stijn Willems
 
Requery overview
Sunghyouk Bae
 
Test-driven Development with AEM
Jan Wloka
 
Quick Fix Sample
Neeraj Kaushik
 
Deep dive into Oracle ADF
Euegene Fedorenko
 
PHPSpec - the only Design Tool you need - 4Developers
Kacper Gunia
 
Functional programming in C#
Thomas Jaskula
 
react-hooks.pdf
chengbo xu
 
[Final] ReactJS presentation
洪 鹏发
 
Ecom lec4 fall16_jpa
Zainab Khallouf
 
Devoxx 2012 hibernate envers
Romain Linsolas
 
Windows 8 Training Fundamental - 1
Kevin Octavian
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
Daniel Bryant
 

More from WO Community (12)

PDF
Localizing your apps for multibyte languages
WO Community
 
PDF
WOdka
WO Community
 
PDF
ERGroupware
WO Community
 
PDF
D2W Branding Using jQuery ThemeRoller
WO Community
 
PDF
CMS / BLOG and SnoWOman
WO Community
 
PDF
Using GIT
WO Community
 
PDF
Persistent Session Storage
WO Community
 
PDF
Back2 future
WO Community
 
PDF
WebObjects Optimization
WO Community
 
PDF
Dynamic Elements
WO Community
 
PDF
Practical ERSync
WO Community
 
PDF
ERRest: the Basics
WO Community
 
Localizing your apps for multibyte languages
WO Community
 
ERGroupware
WO Community
 
D2W Branding Using jQuery ThemeRoller
WO Community
 
CMS / BLOG and SnoWOman
WO Community
 
Using GIT
WO Community
 
Persistent Session Storage
WO Community
 
Back2 future
WO Community
 
WebObjects Optimization
WO Community
 
Dynamic Elements
WO Community
 
Practical ERSync
WO Community
 
ERRest: the Basics
WO Community
 

Recently uploaded (20)

PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
PDF
Brief History of Internet - Early Days of Internet
sutharharshit158
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PDF
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PDF
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
PDF
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
PDF
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
PDF
Doc9.....................................
SofiaCollazos
 
PDF
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
PDF
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
PDF
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
PDF
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
PDF
Software Development Methodologies in 2025
KodekX
 
PDF
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
CIFDAQ's Market Wrap : Bears Back in Control?
CIFDAQ
 
Brief History of Internet - Early Days of Internet
sutharharshit158
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Using Anchore and DefectDojo to Stand Up Your DevSecOps Function
Anchore
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
AI Unleashed - Shaping the Future -Starting Today - AIOUG Yatra 2025 - For Co...
Sandesh Rao
 
MASTERDECK GRAPHSUMMIT SYDNEY (Public).pdf
Neo4j
 
AI-Cloud-Business-Management-Platforms-The-Key-to-Efficiency-Growth.pdf
Artjoker Software Development Company
 
Doc9.....................................
SofiaCollazos
 
Orbitly Pitch Deck|A Mission-Driven Platform for Side Project Collaboration (...
zz41354899
 
Unlocking the Future- AI Agents Meet Oracle Database 23ai - AIOUG Yatra 2025.pdf
Sandesh Rao
 
Accelerating Oracle Database 23ai Troubleshooting with Oracle AHF Fleet Insig...
Sandesh Rao
 
Presentation about Hardware and Software in Computer
snehamodhawadiya
 
Software Development Methodologies in 2025
KodekX
 
Tea4chat - another LLM Project by Kerem Atam
a0m0rajab1
 

Filtering data with D2W

  • 1. Filtering data with D2W Philippe Rabier - twitter.com/prabier Sophiacom
  • 2. What is the problem to solve?
  • 4. • Use D2W • Limit the visibility of the data • Use conventions to name relationships (for example, any toOne relationship to Company entity, is called company) • Minimize the code • Be magic! The Requirements
  • 6. First Solution Working at the editingContext level
  • 8. How the qualifier is modified? public void alterFetchSpecification(final NSNotification aNotification) { EOEditingContext ec = (EOEditingContext) aNotification.object(); if (shouldAddRestrictionQualifier) { Company aCompany = (NOClient) ec.userInfoForKey(NBEditingContextFactory.COMPANY_KEY); final EOFetchSpecification fs = (EOFetchSpecification) aNotification.userInfo().valueForKey(COEditingContext.FETCH_SPEC_KEY); if (aCompany != null && fs != null) { EOEntity aEntity = EOUtilities.entityNamed(ec, fs.entityName()); EOQualifier fsQualifier = fs.qualifier(); if (fsQualifier != null) { NSSet<String> keys = fsQualifier.allQualifierKeys(); for (String aKey : keys) { if (aKey.contains("company")) { shouldAddRestrictionQualifier = false; break; } } } if (shouldAddRestrictionQualifier) { EOQualifier aRestrictionQualifier = clientRestrictionQualifier(aEntity, aClient); if (aRestrictionQualifier != null) { if (fsQualifier != null) fsQualifier = new EOAndQualifier(new NSArray<EOQualifier>(new EOQualifier[] {fsQualifier, aRestrictionQualifier})); else fsQualifier = aRestrictionQualifier; fs.setQualifier(fsQualifier); } } } } }
  • 9. How the qualifier is modified? public EOQualifier companyRestrictionQualifier(final EOEntity entity, final Company company) { EOQualifier aQualifier = null; if (entity.name().equals(Company.Keys.ENTITY_NAME)) aQualifier = new EOKeyValueQualifier(Company.Keys.NAME, EOQualifier.QualifierOperatorEqual, company.name()); else if (entity.relationshipNamed("company") != null) aQualifier = new EOKeyValueQualifier("company", EOQualifier.QualifierOperatorEqual, company); else if (entity.relationshipNamed("entityB") != null) aQualifier = new EOKeyValueQualifier("entityB.company", EOQualifier.QualifierOperatorEqual, client); else if (entity.relationshipNamed("entityC") != null) ...; if (log.isDebugEnabled()) log.debug("method: qualifier: " + aQualifier); return aQualifier; }
  • 10. It works great but there is a little problem it’s too low level
  • 11. An Example of Problem public void validateForSave() throws ValidationException { super.validateForSave(); ERXEOControlUtilities.validateUniquenessOf(this, NOUser.Keys.LOGIN); ERXEOControlUtilities.validateUniquenessOf(this, NOUser.Keys.EMAIL); } public void validateForSave() throws ValidationException { super.validateForSave(); editingContext().setUserInfoForKey(Boolean.FALSE, NBEditingContextFactory.NO_RESTRICTION_QUAL_KEY); ERXEOControlUtilities.validateUniquenessOf(this, NOUser.Keys.LOGIN); ERXEOControlUtilities.validateUniquenessOf(this, NOUser.Keys.EMAIL); editingContext().setUserInfoForKey(Boolean.TRUE, NBEditingContextFactory.NO_RESTRICTION_QUAL_KEY); }
  • 13. • Displaying a list • Using a query component • Using ERD2WEditToManyRelationship component • Using ERD2WEditToOneRelationship component When should we filter?
  • 14. • Modify the NavigationController object • Change the data source Displaying a list public WOComponent listPageForEntityName(final String entityName) { ListPageInterface newListPageInterface = D2W.factory().listPageForEntityNamed(entityName, session()); EODatabaseDataSource dataSource = new EODatabaseDataSource(ERXEC.newEditingContext(), entityName); EOEntity entity = ERXEOAccessUtilities.entityNamed(null, entityName); EOQualifier auxQual = NBBusinessLogicPrincipal.getSharedInstance().clientRestrictionQualifier(entity, ((Session)session()).getCompany()); dataSource.setAuxiliaryQualifier(auxQual); newListPageInterface.setDataSource(dataSource); return (WOComponent) newListPageInterface; }
  • 15. • Use a query delegate • Override the method queryDataSource(ERD2WQueryPage sender) Using a query component { author = 100; class = "com.webobjects.directtoweb.Rule"; lhs = { class = "com.webobjects.eocontrol.EOKeyValueQualifier"; key = pageConfiguration; selectorName = isEqualTo; value = QueryMyEntity; }; rhs = { class = "er.directtoweb.ERDDelayedObjectCreationAssignment"; keyPath = queryDataSourceDelegate; value = "ca.wowodc.very.util.pascal.delegate.SomeOneElse"; }; }
  • 16. • Maybe subclass the 2 component is the best solution • Use restrictingFetchSpecification key. If all fetchspec have the same name, it’s possible to build a generic rule. • Need to be modified to add the possibility to set a binding to the fetchspec • Maybe a lot of pain to create many fetchspec in the EOModel EditRelationship components
  • 17. How the qualifier is modified? public Object restrictedChoiceList() { String restrictedChoiceKey=(String)d2wContext().valueForKey("restrictedChoiceKey"); if( restrictedChoiceKey!=null && restrictedChoiceKey.length()>0 ) return valueForKeyPath(restrictedChoiceKey); String fetchSpecName=(String)d2wContext().valueForKey("restrictingFetchSpecification"); if(fetchSpecName != null) { EORelationship relationship = ERXUtilities.relationshipWithObjectAndKeyPath(object(), (String)d2wContext().valueForKey("propertyKey")); if(relationship != null) return EOUtilities.objectsWithFetchSpecificationAndBindings(object().editingContext(), relationship.destinationEntity().name(),fetchSpecName,null); } return null; }