You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Linus Kamb <ka...@emsc-csem.org> on 2010/02/02 10:07:02 UTC
case-insensitive RS query parameters?
Hi,
Is it possible to configure CXF to have case-insensitive query parameters in rs services?
cheers,
Linus
Re: JAXRS : WADL and external schemas
Posted by Sergey Beryozkin <sb...@progress.com>.
Hi Gabo - it will be included in 2.2.7, perhaps you can try 2.2.7-SNAPSHOT and provide some early feedback ? Let me know please if
you need the docs be updated asap
cheers, Sergey
> Hi Sergey,
>
> Just to confirm. Both features will be included in 2.2.7 or are they already included in 2.2.6?
>
> Thanks again!
>
> Gabo
>
> Sergey Beryozkin wrote:
>> I've updated the WADL Generator to support the inclusion of the external schemas. The following options are supported :
>>
>> 1. Schemas are classpath resources, schemas are inlined. JAXB is used to generate the referencs to schema elements. This option
>> is a similar to the existing one but the schemas which have been used to generate the JAXB classes will be copied intact as
>> opposed to JAXB 'reproducing' them.
>>
>> 2. Only external links to schemas are provided, JAXB is still used to generate the refs. Grammar section will contain the links
>> only
>>
>> 3. Both schemas on classpath and external links are registered. In this case external links are used to overwrite the schema
>> imports if any
>>
>> 4. Any of the above options but no JAXB is used to generate the refs, instead a newly introduced @XMLName annotation is checked
>> on a class itself, on the parameter or on the method. Ex, one could link to the atom schema and annotate input/output parameters
>> of type Abdera Feed/Entry and have WADL generated. Similarly for XMLBeans/SDO
>>
>> 5. Similarly, one could regiter a custom ElementQNameResolver to ensure a parameter of a given type is linked properly with the
>> corresponding schema element
>>
>> Will be documenting it shortly...
>> Sergey
>>
Re: JAXRS : WADL and external schemas
Posted by Gabo Manuel <km...@solegysystems.com>.
Hi Sergey,
Just to confirm. Both features will be included in 2.2.7 or are they
already included in 2.2.6?
Thanks again!
Gabo
Sergey Beryozkin wrote:
> I've updated the WADL Generator to support the inclusion of the
> external schemas. The following options are supported :
>
> 1. Schemas are classpath resources, schemas are inlined. JAXB is used
> to generate the referencs to schema elements. This option is a similar
> to the existing one but the schemas which have been used to generate
> the JAXB classes will be copied intact as opposed to JAXB
> 'reproducing' them.
>
> 2. Only external links to schemas are provided, JAXB is still used to
> generate the refs. Grammar section will contain the links only
>
> 3. Both schemas on classpath and external links are registered. In
> this case external links are used to overwrite the schema imports if any
>
> 4. Any of the above options but no JAXB is used to generate the refs,
> instead a newly introduced @XMLName annotation is checked on a class
> itself, on the parameter or on the method. Ex, one could link to the
> atom schema and annotate input/output parameters of type Abdera
> Feed/Entry and have WADL generated. Similarly for XMLBeans/SDO
>
> 5. Similarly, one could regiter a custom ElementQNameResolver to
> ensure a parameter of a given type is linked properly with the
> corresponding schema element
>
> Will be documenting it shortly...
> Sergey
>
JAXRS : WADL and external schemas
Posted by Sergey Beryozkin <sb...@progress.com>.
I've updated the WADL Generator to support the inclusion of the external schemas. The following options are supported :
1. Schemas are classpath resources, schemas are inlined. JAXB is used to generate the referencs to schema elements. This option is a
similar to the existing one but the schemas which have been used to generate the JAXB classes will be copied intact as opposed to
JAXB 'reproducing' them.
2. Only external links to schemas are provided, JAXB is still used to generate the refs. Grammar section will contain the links only
3. Both schemas on classpath and external links are registered. In this case external links are used to overwrite the schema imports
if any
4. Any of the above options but no JAXB is used to generate the refs, instead a newly introduced @XMLName annotation is checked on a
class itself, on the parameter or on the method. Ex, one could link to the atom schema and annotate input/output parameters of type
Abdera Feed/Entry and have WADL generated. Similarly for XMLBeans/SDO
5. Similarly, one could regiter a custom ElementQNameResolver to ensure a parameter of a given type is linked properly with the
corresponding schema element
Will be documenting it shortly...
Sergey
Re: case-insensitive RS query parameters?
Posted by Sergey Beryozkin <sb...@progress.com>.
Just FYI, one can now set a
"org.apache.cxf.http.case_insensitive_queries"
jaxrs:property on a given endpoint for case-insensitive query lookups be supported
cheers, Sergey
----- Original Message -----
From: "Linus Kamb" <ka...@emsc-csem.org>
To: <us...@cxf.apache.org>
Sent: Tuesday, February 02, 2010 10:20 AM
Subject: RE: case-insensitive RS query parameters?
Yes, I see that could work. I guess it will lower case the entire query, but if that's a problem, I suppose I could break it up and
work on each parameter.
Thanks,
Linus
> -----Message d'origine-----
> De : Sergey Beryozkin [mailto:sberyozk@progress.com]
> Envoyé : Tuesday, February 02, 2010 10:52 AM
> À : users@cxf.apache.org
> Objet : RE: case-insensitive RS query parameters?
>
> Hi
>
> It is interesting HttpHeaders.getRequestHeaders docs do talk about the
> case-insensitive keys but UriInfo.getQueryParameters docs don't. I'll
> need to ask a question on the jaxrs list.
> What you can try to do is to reset a Message.QUERY_STRING on a current
> message in a request filter:
>
> String query = (String)message.get(Message.QUERY_STRING);
> message.put(Message.QUERY_STRING, query.toLowerCase());
>
> hope it helps, Sergey
>
> -----Original Message-----
> From: Linus Kamb [mailto:kamb@emsc-csem.org]
> Sent: 02 February 2010 09:07
> To: users@cxf.apache.org
> Subject: case-insensitive RS query parameters?
>
> Hi,
>
>
>
> Is it possible to configure CXF to have case-insensitive query
> parameters in rs services?
>
>
>
> cheers,
>
> Linus
>
>
RE: case-insensitive RS query parameters?
Posted by Sergey Beryozkin <sb...@progress.com>.
Oh yes, I forgot about the values.
Indeed, you can have UriInfo injected and use its getQueryParameters to build a new Message.QUERY_STRING.
Another approach will be CXF specific (as far as the app code is concerned) :
- use new MetadataMap(UriInfo.getQueryParameters(), true, true) and set it on a message using say a "case.insensitive.query" key and then get this map from an injected MessageContext, using its get() method.
Rebuilding the Message.QUERY_STRING should be cheaper though, especially if the query string is short
Cheers, Sergey
-----Original Message-----
From: Linus Kamb [mailto:kamb@emsc-csem.org]
Sent: 02 February 2010 10:21
To: users@cxf.apache.org
Subject: RE: case-insensitive RS query parameters?
Yes, I see that could work. I guess it will lower case the entire query, but if that's a problem, I suppose I could break it up and work on each parameter.
Thanks,
Linus
> -----Message d'origine-----
> De : Sergey Beryozkin [mailto:sberyozk@progress.com]
> Envoyé : Tuesday, February 02, 2010 10:52 AM
> À : users@cxf.apache.org
> Objet : RE: case-insensitive RS query parameters?
>
> Hi
>
> It is interesting HttpHeaders.getRequestHeaders docs do talk about the
> case-insensitive keys but UriInfo.getQueryParameters docs don't. I'll
> need to ask a question on the jaxrs list.
> What you can try to do is to reset a Message.QUERY_STRING on a current
> message in a request filter:
>
> String query = (String)message.get(Message.QUERY_STRING);
> message.put(Message.QUERY_STRING, query.toLowerCase());
>
> hope it helps, Sergey
>
> -----Original Message-----
> From: Linus Kamb [mailto:kamb@emsc-csem.org]
> Sent: 02 February 2010 09:07
> To: users@cxf.apache.org
> Subject: case-insensitive RS query parameters?
>
> Hi,
>
>
>
> Is it possible to configure CXF to have case-insensitive query
> parameters in rs services?
>
>
>
> cheers,
>
> Linus
>
>
RE: case-insensitive RS query parameters?
Posted by Linus Kamb <ka...@emsc-csem.org>.
Yes, I see that could work. I guess it will lower case the entire query, but if that's a problem, I suppose I could break it up and work on each parameter.
Thanks,
Linus
> -----Message d'origine-----
> De : Sergey Beryozkin [mailto:sberyozk@progress.com]
> Envoyé : Tuesday, February 02, 2010 10:52 AM
> À : users@cxf.apache.org
> Objet : RE: case-insensitive RS query parameters?
>
> Hi
>
> It is interesting HttpHeaders.getRequestHeaders docs do talk about the
> case-insensitive keys but UriInfo.getQueryParameters docs don't. I'll
> need to ask a question on the jaxrs list.
> What you can try to do is to reset a Message.QUERY_STRING on a current
> message in a request filter:
>
> String query = (String)message.get(Message.QUERY_STRING);
> message.put(Message.QUERY_STRING, query.toLowerCase());
>
> hope it helps, Sergey
>
> -----Original Message-----
> From: Linus Kamb [mailto:kamb@emsc-csem.org]
> Sent: 02 February 2010 09:07
> To: users@cxf.apache.org
> Subject: case-insensitive RS query parameters?
>
> Hi,
>
>
>
> Is it possible to configure CXF to have case-insensitive query
> parameters in rs services?
>
>
>
> cheers,
>
> Linus
>
>
RE: case-insensitive RS query parameters?
Posted by Sergey Beryozkin <sb...@progress.com>.
Hi
It is interesting HttpHeaders.getRequestHeaders docs do talk about the
case-insensitive keys but UriInfo.getQueryParameters docs don't. I'll
need to ask a question on the jaxrs list.
What you can try to do is to reset a Message.QUERY_STRING on a current
message in a request filter:
String query = (String)message.get(Message.QUERY_STRING);
message.put(Message.QUERY_STRING, query.toLowerCase());
hope it helps, Sergey
-----Original Message-----
From: Linus Kamb [mailto:kamb@emsc-csem.org]
Sent: 02 February 2010 09:07
To: users@cxf.apache.org
Subject: case-insensitive RS query parameters?
Hi,
Is it possible to configure CXF to have case-insensitive query
parameters in rs services?
cheers,
Linus