Hi
I discovered I had a mixture of 2 problems: firstly there was a database
integrity problem, and secondly my encoding of the qualifier over-enthusiastic
(I hadn't realised that it's essential the url is only partially encoded, with
the 'qualifier=' staying as '=' rather than '%3D'.
Thanks for the pointers.
Liz
On 23 Jul 2011, at 18:27, Pascal Robert wrote:
>
> Le 2011-07-23 à 12:17, Elizabeth Lynch a écrit :
>
>> My ERREST application has progressed nicely, feeding an iPhone app, and I
>> have a couple more very similar projects to work on over summer.
>>
>> However, I am experiencing a problem with my baseQualifier not being
>> applied. Code sample:
>>
>> public class CategoryController extends ERXRouteController {
>> ...
>> public static EOQualifier baseQualifier() {
>> return new EOKeyValueQualifier(Category.RUN_ID_KEY,
>> EOQualifier.QualifierOperatorEqual, runId());
>> }
>> ...
>> public WOActionResults indexAction() {
>> NSLog.debug.appendln("indexAction reached " + baseQualifier());
>>
>> ERXRestFetchSpecification<Category> fetchSpec = new
>> ERXRestFetchSpecification<Category>(Category.ENTITY_NAME, null,
>> baseQualifier(), queryFilter(), null, 25);
>> return response(fetchSpec, showFilter());
>> }
>>
>> Query sent:
>>
>> /ra/category.json?qualifier=parent='1669'
>
> I don't think you can put two = in a single parameter. The correct format is:
>
> ?qualifier=someAttr%3D'SomeValue'
>
> so it would be:
>
> ?qualifier= parent%3D'1669'
>
> See:
>
> <Capture d’écran 2011-07-23 à 13.24.08.gif>
>
>> Output:
>>
>> 14004 [WorkerThread15] DEBUG NSLog - indexAction reached (runId =
>> '20110723:11:50')
>>
>>
>> queryFilter() has the line:
>>
>> filter.exclude(new ERXKey<String>("runId"));
>>
>> but removing that line has no effect.
>>
>>
>> The values returned include all Category objects; however, I expected to see
>> only those matching the baseQualifier AND the URL specified qualifier; is
>> this correct? How do I achieve this result?
>>
>> Liz
>>
>> _______________________________________________
>> 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/probert%40macti.ca
>>
>> 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:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]