Hallo Sergey,

the  visitor pattern of the filter /order by expression is more of less the 
same, 
there are just some new methods and operators and the path segments for 
member are expressed differently. Thinks it will be possible to call the filter 
visitor directly.

Regards,
Sven


-----Original Message-----
From: Sergey Beryozkin [mailto:[email protected]] 
Sent: Mittwoch, 12. Februar 2014 11:29
To: [email protected]
Subject: Re: How to use Olingo Parser directly

Specifically, we have a code where

org.apache.olingo.odata2.api.uri.expression.ExpressionVisitor is
implemented and the implementing class is getting the callbacks.

We parse it a $filter expression and getting the callbacks and translate 
them accordingly.

Here is a pseudo code:

String searchExpression = getItFrom$filter();

final FilterExpression expression = new 
FilterParserImpl(null).parseFilterString(searchExpression);

final ExpressionVisitor visitor = new CustomExpressionVisitor();

expression.accept(visitor);

I am a bit confused by a reference to UriInfo: I guess UriInfo is more 
of the alternative, right, and would expect the filter visitor mechanism 
still working even though it is very reasonable to expect that migration 
effort might be needed.

Cheers, Sergey


On 12/02/14 10:15, Sergey Beryozkin wrote:
> Hi Sven, Michael. All
>
> So with Olingo 1.1.0 we have the code as shown at [1] working.
>
> Am I reading it that with the Olingo trunk implementing 4.0 Filter
> parser a different mechanism will be needed ?
>
> If so, we'd appreciate having [1] updated accordingly
>
> Thanks, Sergey
>
> [1]
> http://olingo.incubator.apache.org/doc/tutorials/Olingo_Tutorial_AdvancedRead_FilterVisitor.html
>
> On 12/02/14 08:40, Kobler-Morris, Sven wrote:
>> Hello Sergey,
>>
>> the ODATA 4.0 Filter parser  is combined with the URI parser in order
>> to parse the URI  as a whole.
>>
>> The filter expression tree itself is more or less the same as in ODATA
>> 2.0 an can be accessed through an
>> UriInfo object.
>>
>> The API for the URI parser is in package
>> "org.apache.olingo.odata4.producer.api.uri"
>> whereas the filter part is in
>> "org.apache.olingo.odata4.producer.api.uri.queryoption.expression"
>>
>> Kind regards,
>> Sven
>> -----Original Message-----
>> From: Bolz, Michael
>> Sent: Mittwoch, 12. Februar 2014 06:12
>> To: [email protected]; Kobler-Morris, Sven
>> Subject: Re: How to use Olingo Parser directly
>>
>> * PGP Signature not checked
>>
>> Hi Sergey,
>>
>> The $filter mechanism in Odata 4 should work like in Odata 2.
>> At least the basic filter expressions (logic and arithmetic like Œeq¹,
>> Œadd¹, Š).
>> I think the functions have changed a little bit with naming and syntax.
>>
>> But I guess your question points more to the implementation in Olingo
>> library for Odata 4.
>> I think here we can give Sven a better answer.
>> @Sven: Can you give an answer here?
>>
>> Kind regards,
>> Michael
>>
>>
>>
>>
>> On 11/02/14 17:31, "Sergey Beryozkin" <[email protected]> wrote:
>>
>>> Hi
>>>
>>> Can we expect the filter visitor mechanism working in the future Olingo
>>> releases, example, the ones supporting OData 4 ? I reckon the $filter
>>> mechanism is supported in the backward-compatible manner, but would like
>>> to check as we've gone ahead with doing some work in CXF
>>>
>>> Thanks, Sergey
>>>>>
>>
>> * Signature checking is off by policy
>>
>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to