Hi
I've added a contextual property "search.decode.values" that can be used
to tell the parser that values have to be decoded when they build a
search condition. There are too many variations across different visitor
outputs for it to become a default, in some case people may actually
want to search across the data stored in the encoded form, we don not know.
So in your case setting this property will work. 2.7.12 will be released
soon.
By the way, check
http://cxf.apache.org/docs/jax-rs-search.html#JAX-RSSearch-ConvertingthequerieswithQueryContext
if you have SQL Visitor itself pre registered (and prepared to be
thread-safe) then you can simplify your code
Thanks, Sergey
On 08/07/14 11:27, nikosdim wrote:
Hi
In my service I use semicolon (;) based on this JAX-RS Search
<http://cxf.apache.org/docs/jax-rs-search.html#JAX-RSSearch-SearchExpressionsinURIPathsegments>
So my service looks like this
@GET
@Path("services;{search}")
public Response services(@PathParam("search") String searchExpression) {
SearchCondition<Service> sc =
searchContext.getCondition(searchExpression,
Service.class);
SQLPrinterVisitor<Service> visitor = new SQLPrinterVisitor<Service>(
beanPropertiesMap,
beanConfiguration.get("db_table"),
cols);
sc.accept(visitor);
String sql = visitor.getQuery();
}
I added the @Encoded and it solved the problem of the NullPointerException
coming from the SearchContext but I still get don't get what I want. Here is
why
by requesting
http://my.com/appl/services;serviceClass==PROCMON;serviceInstance==director%3B-D
the searchExpression is
objectClass==BA_PROCMON;objectInstance==director--cimlistener%3B-D
and it goes through the searchContext.getCondition(searchExpression,
Service.class); without exceptions.
The problem now is with the %3B which results in a sql of
SELECT * FROM SERVICES WHERE (OBJECT_CLASS = 'BA_PROCMON') AND
(OBJECT_INSTANCE LIKE 'director--cimlistener%3B-D')
The way that I see it is that the url should be send as
http://my.com/appl/services;serviceClass==PROCMON;serviceInstance==director;-D
and the SearchContext should be able to identify based on the fields of the
Service.class which semicolon is part of a value and which ones denote part
of the query.
Is there any way of doing that or I have to implement a workaround?
Thanks in advance
--
View this message in context:
http://cxf.547215.n5.nabble.com/How-to-escape-semicolon-when-matrix-parameters-FIQL-are-used-tp5746002p5746145.html
Sent from the cxf-user mailing list archive at Nabble.com.
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com