Re: Qualifying a DisplayGroup in WOO
Re: Qualifying a DisplayGroup in WOO
- Subject: Re: Qualifying a DisplayGroup in WOO
- From: Don Lindsay via Webobjects-dev <email@hidden>
- Date: Mon, 12 Oct 2020 10:36:42 -0500
Hello, I apologize if this is a duplicate, I recently re-subscribed because my
old Mac.com email address appears to intermittently reject messages;
I want to apply a qualifier to an ERXDisplayGroup that is defined in WOO. I
couldn’t figure out how to create a EOFetchSpecification with a qualifier in
EOModeler that would take a value from the user’s session. The qualifier takes
it’s value from a variable in the user’s session using a method in the
component class.
My ERXDisplayGroup is defined like this:
{
"WebObjects Release" = "WebObjects 5.0";
variables = {
databaseDetailsDisplayGroup = {
class = ERXDisplayGroup;
dataSource = {
class = EODatabaseDataSource;
editingContext = "session.defaultEditingContext";
fetchSpecification = {
class = EOFetchSpecification;
entityName = Databasedetails;
fetchLimit = 0;
isDeep = YES;
};
};
fetchesOnLoad = YES;
formatForLikeQualifier = "%@*";
numberOfObjectsPerBatch = 10;
selectsFirstObjectAfterFetch = YES;
sortOrdering = ({class = EOSortOrdering; key = name; selectorName =
"compareAscending:"; });
};
};
}
In my component I have
public NSArray<EOGenericRecord> getConnectorEntries() {
databaseDetailsDisplayGroup.setQualifier(tenantSpec().qualifier());
return databaseDetailsDisplayGroup.filteredObjects();
}
public EOFetchSpecification tenantSpec() {
return ((Session)session()).tenantFetchSpecification();
}
Session:
public EOFetchSpecification tenantFetchSpecification() {
EOFetchSpecification fetchSpecification = new EOFetchSpecification();
fetchSpecification.setQualifier(new
EOKeyValueQualifier("tenant",EOQualifier.QualifierOperatorEqual,this.tenant));
return fetchSpecification;
}
And in my WOD I have
RowRepetition: WORepetition {
list = connectorEntries;
item = currentItem;
}
The data never gets filtered by the Qualifier, it returns all objects with no
filtering.
What have I done wrong here, am I going at this the wrong way?
Thanks in Advance
Don
_______________________________________________
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