Return-Path: X-Original-To: apmail-cxf-dev-archive@www.apache.org Delivered-To: apmail-cxf-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 7BE99440C for ; Wed, 8 Jun 2011 20:24:55 +0000 (UTC) Received: (qmail 35453 invoked by uid 500); 8 Jun 2011 20:24:55 -0000 Delivered-To: apmail-cxf-dev-archive@cxf.apache.org Received: (qmail 35303 invoked by uid 500); 8 Jun 2011 20:24:55 -0000 Mailing-List: contact dev-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list dev@cxf.apache.org Received: (qmail 35295 invoked by uid 99); 8 Jun 2011 20:24:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2011 20:24:55 +0000 X-ASF-Spam-Status: No, hits=1.8 required=5.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL,WEIRD_QUOTING X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sberyozkin@gmail.com designates 209.85.214.41 as permitted sender) Received: from [209.85.214.41] (HELO mail-bw0-f41.google.com) (209.85.214.41) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2011 20:24:47 +0000 Received: by bwz17 with SMTP id 17so961544bwz.0 for ; Wed, 08 Jun 2011 13:24:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type:content-transfer-encoding; bh=R2LUizAde+qU1QM6uWHuySo3ZJcPofAdehBWOwye7lg=; b=ZLROy3AWWI2dlwP3EkURqDct8LWWVysTuhQMBD1Nua9qg/WEdSg4hxVuuT/3TOqF5n hBnczK8URXRA7/5zjkAcIRVXXhAcbcSe8hzTmkwMkHhTPEiDhquwrpMbKkUFjE5kqyBz Zdz50mmQGeFBUrv28iBXooivJbP0BlpPpe6Jk= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=pw71RIhr2IT5yCmCDDVBRWh7FuVzA92BeLuVho/2j4NI9keubD94f44HEgrvtaeA6x KE56xkP4JUxkW0r49q8lnmcdKVIdn6Wck8k/XkiEwfWi1/XX6vZQggkSrBv7WaVHJ8U8 ZNQlO6ryZtya0lywwpA07K+HZ9AEgiCbysCSA= MIME-Version: 1.0 Received: by 10.204.7.1 with SMTP id b1mr962682bkb.6.1307564666972; Wed, 08 Jun 2011 13:24:26 -0700 (PDT) Received: by 10.204.55.82 with HTTP; Wed, 8 Jun 2011 13:24:26 -0700 (PDT) In-Reply-To: References: Date: Wed, 8 Jun 2011 21:24:26 +0100 Message-ID: Subject: Re: Custom Reuqest Param Name for Bean Request Object From: Sergey Beryozkin To: dev@cxf.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Your patch has been applied with few minor modificatios. Many thanks for your help, apologies for a delay in dealing with it Have a look please at the client side, the proxies can 'unwrap' parameter beans, so InjectionUtils.fillInValuesFromBean maya need to be updated a bit for Map properties handled as well. Both client proxies and WADLGenerator will use this function and properly represent parameter bean values as query or form or path params thanks, Sergey On Wed, Jun 8, 2011 at 5:52 PM, Biju Nair wrote: > Did you get chance to look into the new code? Does it satisfy your > requirement? > > Biju B > > On Sun, Jun 5, 2011 at 12:28 PM, Biju Nair wrote= : > >> Updated JIRA with path and modified files for the new implementation... >> >> >> On Fri, Jun 3, 2011 at 1:52 AM, Sergey Beryozkin w= rote: >> >>> Your patch contains empty (if) branches so that can not be committed; >>> Allowing for Map will result in all but the last >>> name/value pairs with identical names being lost >>> >>> Does it make sense ? >>> Cheers, Sergey >>> >>> On Fri, Jun 3, 2011 at 1:22 AM, Biju Nair wrot= e: >>> > I am confused on what you mean by "empty branches", can you just >>> elaborate? >>> > >>> > Do you mean we need to have only Map> and not >>> > Map? >>> > >>> > On Thu, Jun 2, 2011 at 1:46 PM, Sergey Beryozkin >> >wrote: >>> > >>> >> Please check a previous message, we need a better Map check and no >>> >> empty branches >>> >> >>> >> thanks, Sergey >>> >> >>> >> On Thu, Jun 2, 2011 at 6:37 PM, Biju Nair >>> wrote: >>> >> > Yes I can help you in improving. Let me know what needs to be done= . >>> >> > >>> >> > On Wed, Jun 1, 2011 at 10:16 AM, Sergey Beryozkin < >>> sberyozkin@gmail.com >>> >> >wrote: >>> >> > >>> >> >> I did. It needs a bit more work and I'll need to allocate some ti= me >>> to >>> >> >> add a test and see what needs to be improved, ex, having empty if >>> >> >> branches is not possible. Realistically, it has to be Map>> >> >> List> (where Primitive is String or Integer/etc, to >>> handle >>> >> >> m.v=3D1&m.v=3D2 or similar), so isMapSupported() should check it = and >>> >> >> return false if not (this can help with eliminating empty branche= s). >>> >> >> Would you like to improve this patch a bit ? I can do some test o= nce >>> >> >> it's ready, but I can't afford at all to look into improving the >>> patch >>> >> >> right now... >>> >> >> >>> >> >> Thanks, Sergey >>> >> >> >>> >> >> On Wed, Jun 1, 2011 at 6:02 PM, Biju Nair >>> >> wrote: >>> >> >> > Did you get chance to look into this? >>> >> >> > >>> >> >> > On Thu, May 26, 2011 at 2:19 PM, Sergey Beryozkin < >>> >> sberyozkin@gmail.com >>> >> >> >wrote: >>> >> >> > >>> >> >> >> Sorry, not yet, hoping to do it shortly >>> >> >> >> >>> >> >> >> Sergey >>> >> >> >> >>> >> >> >> On Thu, May 26, 2011 at 8:36 PM, Biju Nair < >>> biju74techie@gmail.com> >>> >> >> wrote: >>> >> >> >> > did you get chance to update the patch and test it? >>> >> >> >> > >>> >> >> >> > Biju >>> >> >> >> > >>> >> >> >> > On Wed, May 25, 2011 at 9:09 AM, Biju Nair < >>> biju74techie@gmail.com >>> >> > >>> >> >> >> wrote: >>> >> >> >> > >>> >> >> >> >> Attached the path in JIRA. >>> >> >> >> >> >>> >> >> >> >> Attaching with this mail also. >>> >> >> >> >> >>> >> >> >> >> =A0 On Wed, May 25, 2011 at 4:33 AM, Sergey Beryozkin < >>> >> >> >> sberyozkin@gmail.com>wrote: >>> >> >> >> >> >>> >> >> >> >>> Hi >>> >> >> >> >>> >>> >> >> >> >>> Can you attach the updated patch to JIRA please ? I'm not >>> seeing >>> >> a >>> >> >> >> >>> patch attached to your email message. >>> >> >> >> >>> >>> >> >> >> >>> Supporting explicit Lists for JAX-RS param annotations >>> >> (@PathParam, >>> >> >> >> >>> etc) is a JAX-RS spec requirement. >>> >> >> >> >>> Supporting explicit Lists which are mapped to request >>> payloads or >>> >> >> >> >>> responses is the extensions. All JAX-RS stacks are probabl= y >>> >> >> supporting >>> >> >> >> >>> it, but that is an extension. >>> >> >> >> >>> Supporting MultivaluedMap in case of form submissions is a >>> spec >>> >> >> >> >>> requirement as well. It really only makes sense for form >>> >> payloads. >>> >> >> The >>> >> >> >> >>> only other exception is probably QueryParams and may be >>> >> >> HeaderParams, >>> >> >> >> >>> but it has to be a MultivaluedMap for a single key/multipl= e >>> >> values >>> >> >> >> >>> case to work. >>> >> >> >> >>> >>> >> >> >> >>> Cheers, Sergey >>> >> >> >> >>> >>> >> >> >> >>> On Wed, May 25, 2011 at 4:45 AM, Biju Nair < >>> >> biju74techie@gmail.com> >>> >> >> >> >>> wrote: >>> >> >> >> >>> > I gave the Explict Map Support, becuase CXF was supporti= ng >>> >> Explict >>> >> >> >> List >>> >> >> >> >>> > support. >>> >> >> >> >>> > >>> >> >> >> >>> > The code which i send you have only support for beans wi= th >>> >> nested >>> >> >> Map >>> >> >> >> >>> > interface. >>> >> >> >> >>> > >>> >> >> >> >>> > On Tue, May 24, 2011 at 8:28 PM, Biju Nair < >>> >> >> biju74techie@gmail.com> >>> >> >> >> >>> wrote: >>> >> >> >> >>> > >>> >> >> >> >>> >> That was my mistake. I was using Eclipse IDE and I >>> formatted >>> >> the >>> >> >> >> java >>> >> >> >> >>> file, >>> >> >> >> >>> >> so the whole file got messed up. >>> >> >> >> >>> >> >>> >> >> >> >>> >> I revereted the changes and made support only for bean >>> with >>> >> >> nested >>> >> >> >> Map >>> >> >> >> >>> >> interface (FormParam(""),QueryParam("")..) >>> >> >> >> >>> >> >>> >> >> >> >>> >> Attaching the changed file with this mail. >>> >> >> >> >>> >> ------------------------------ >>> >> >> >> >>> >> Details, >>> >> >> >> >>> >> >>> >> >> >> >>> >> Modified the changes only for supporting map's interfac= e >>> only >>> >> >> inside >>> >> >> >> >>> beans. >>> >> >> >> >>> >> >>> >> >> >> >>> >> Classes Changed, >>> >> >> >> >>> >> org.apache.cxf.jaxrs.utils.InjectionUtils >>> >> >> >> >>> >> >>> >> >> >> >>> >> Methods Changed >>> >> >> >> >>> >> public static Object handleBean(...) - Added another if >>> clause >>> >> >> >> >>> >> "} else if (InjectionUtils.isSupportedMap(type)) {" >>> >> >> >> >>> >> >>> >> >> >> >>> >> Methods Added >>> >> >> >> >>> >> isSupportedMap >>> >> >> >> >>> >> mergeMap >>> >> >> >> >>> >> convertMultimapToMap >>> >> >> >> >>> >> injectIntoMap >>> >> >> >> >>> >> >>> >> >> >> >>> >> -------------------------- >>> >> >> >> >>> >> >>> >> >> >> >>> >> >>> >> >> >> >>> >> =A0 On Tue, May 24, 2011 at 4:36 AM, Sergey Beryozkin < >>> >> >> >> >>> sberyozkin@gmail.com>wrote: >>> >> >> >> >>> >> >>> >> >> >> >>> >>> Actually, I can see you modifying the code for explici= t >>> Maps >>> >> be >>> >> >> >> >>> >>> supported as well. >>> >> >> >> >>> >>> >>> >> >> >> >>> >>> That is not a bad idea but I'd prefer for one issue (t= o >>> do >>> >> with >>> >> >> >> >>> >>> parameter beans containing Map fileds) addressed first= . >>> >> >> >> >>> >>> >>> >> >> >> >>> >>> Explicit Maps can be supported right now (a bit of wor= k >>> is >>> >> >> needed >>> >> >> >> to >>> >> >> >> >>> >>> register ParameterHandler to capture Form, query or pa= th >>> >> values >>> >> >> or >>> >> >> >> >>> >>> XmlJavaTypeAdapter to capture say XML payload). >>> >> >> >> >>> >>> >>> >> >> >> >>> >>> Please, simplify the patch a bit so that only a >>> >> 'FormParam(""), >>> >> >> >> >>> >>> QueryParam(""), =A0or PathParam("") Map' case can be >>> supported >>> >> >> >> >>> >>> >>> >> >> >> >>> >>> thanks, Sergey >>> >> >> >> >>> >>> >>> >> >> >> >>> >>> On Tue, May 24, 2011 at 12:04 PM, Sergey Beryozkin < >>> >> >> >> >>> sberyozkin@gmail.com> >>> >> >> >> >>> >>> wrote: >>> >> >> >> >>> >>> > Hi >>> >> >> >> >>> >>> > >>> >> >> >> >>> >>> > On Fri, May 20, 2011 at 11:23 PM, Biju Nair < >>> >> >> >> biju74techie@gmail.com >>> >> >> >> >>> > >>> >> >> >> >>> >>> wrote: >>> >> >> >> >>> >>> >> Updated the JIRA with DIFF file. >>> >> >> >> >>> >>> >> >>> >> >> >> >>> >>> >> May I know whether that worked. >>> >> >> >> >>> >>> >> >>> >> >> >> >>> >>> > I have problems applying the patch, as it seems like >>> >> >> >> InjectionUtils >>> >> >> >> >>> >>> > has been completely changed, I can't spot, by lookin= g >>> at >>> >> the >>> >> >> diff >>> >> >> >> >>> >>> > file, what the actual changes are. >>> >> >> >> >>> >>> > I'm going to attach svn properties file from my loca= l >>> >> snapshot >>> >> >> to >>> >> >> >> >>> >>> > JIRA, can you please give me a favor and try again w= ith >>> >> those >>> >> >> >> >>> >>> > properties applied ? >>> >> >> >> >>> >>> > >>> >> >> >> >>> >>> > thanks, Sergey >>> >> >> >> >>> >>> > >>> >> >> >> >>> >>> >> On Fri, May 20, 2011 at 2:26 AM, Sergey Beryozkin < >>> >> >> >> >>> >>> sberyozkin@gmail.com>wrote: >>> >> >> >> >>> >>> >> >>> >> >> >> >>> >>> >>> Hi - did you see the comments on JIRA ? >>> >> >> >> >>> >>> >>> Please update your local snapshot and create a pat= ch >>> >> >> >> >>> >>> >>> >>> >> >> >> >>> >>> >>> thanks, Sergey >>> >> >> >> >>> >>> >>> >>> >> >> >> >>> >>> >>> On Tue, May 17, 2011 at 9:25 PM, Biju Nair < >>> >> >> >> >>> biju74techie@gmail.com> >>> >> >> >> >>> >>> wrote: >>> >> >> >> >>> >>> >>> > Created JIRA - CXF-3529 >>> >> >> >> >>> >>> >>> > >>> >> >> >> >>> >>> >>> > Let me know what is the next step? >>> >> >> >> >>> >>> >>> > >>> >> >> >> >>> >>> >>> > Biju >>> >> >> >> >>> >>> >>> > >>> >> >> >> >>> >>> >>> > On Tue, May 17, 2011 at 1:51 AM, Sergey Beryozki= n < >>> >> >> >> >>> >>> sberyozkin@gmail.com >>> >> >> >> >>> >>> >>> >wrote: >>> >> >> >> >>> >>> >>> > >>> >> >> >> >>> >>> >>> >> Hi >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> On Tue, May 17, 2011 at 7:09 AM, Biju Nair < >>> >> >> >> >>> biju74techie@gmail.com >>> >> >> >> >>> >>> > >>> >> >> >> >>> >>> >>> wrote: >>> >> >> >> >>> >>> >>> >> > Added the Map feature for service level and b= ean >>> >> level. >>> >> >> >> >>> >>> >>> >> > >>> >> >> >> >>> >>> >>> >> > I was not able to check-in the files, so >>> attaching >>> >> the >>> >> >> >> same. >>> >> >> >> >>> >>> >>> >> > >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> I don't see an attachment, but what you need to= do >>> is >>> >> to >>> >> >> >> create >>> >> >> >> >>> a >>> >> >> >> >>> >>> CXF >>> >> >> >> >>> >>> >>> >> JIRA, attach a patch and I will apply it. >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> > Following are the changes, >>> >> >> >> >>> >>> >>> >> > Added Map Support to Rest Based Services >>> >> >> >> >>> >>> >>> >> > -- Added InjectionUtils.injectIntoMap >>> >> >> >> >>> >>> >>> >> > -- Added InjectionUtils.convertMultimapToMap >>> >> >> >> >>> >>> >>> >> > -- Changed Signature of >>> >> >> >> InjectionUtils.createParameterObject >>> >> >> >> >>> >>> >>> >> > -- Modified handleBean >>> >> >> >> >>> >>> >>> >> > -- Modified createParameterObject >>> >> >> >> >>> >>> >>> >> > -- Added InjectionUtils.injectIntoMap >>> >> >> >> >>> >>> >>> >> > -- Added InjectionUtils.isSupportedMap >>> >> >> >> >>> >>> >>> >> > -- Added InjectionUtils.mergeMap >>> >> >> >> >>> >>> >>> >> > -- Added JAXRSUtils.processMapValue >>> >> >> >> >>> >>> >>> >> > -- Changed JAXRSUtils.processFormParam >>> >> >> >> >>> >>> >>> >> > >>> >> >> >> >>> >>> >>> >> > The code is tested with sample services like, >>> >> >> >> >>> >>> >>> >> > public String debug(@FormParam("")TestEmploye= eTO >>> >> >> >> >>> >>> >>> >> > testObject1,@FormParam("map") >>> Map >>> >> map) >>> >> >> >> >>> >>> >>> >> > >>> >> >> >> >>> >>> >>> >> > public class TestEmployeeTO =A0{ >>> >> >> >> >>> >>> >>> >> > >>> >> >> >> >>> >>> >>> >> > =A0private HashMap currencies; >>> >> >> >> >>> >>> >>> >> > >>> >> >> >> >>> >>> >>> >> > =A0//getters/setters >>> >> >> >> >>> >>> >>> >> > } >>> >> >> >> >>> >>> >>> >> > Input Data >>> >> >> >> >>> >>> >>> >> > >>> >> >> map.x=3D11&map.y=3D9¤cies.IND=3DINR¤cies.USA=3DDOLLAR >>> >> >> >> >>> >>> >>> >> > Output >>> >> >> >> >>> >>> >>> >> > TestEmployeeTO[currencies=3D{IND=3DINR, USA= =3DDOLLAR}] >>> >> >> >> >>> >>> >>> >> > map=3D{y=3D9, x=3D11} >>> >> >> >> >>> >>> >>> >> > >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> thanks, Sergey >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> > Please verify and let me know is this is good= . >>> >> >> >> >>> >>> >>> >> > >>> >> >> >> >>> >>> >>> >> > Biju B >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> -- >>> >> >> >> >>> >>> >>> >> =A0Sergey Beryozkin >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> >> Application Integration Division of Talend >>> >> >> >> >>> >>> >>> >> http://sberyozkin.blogspot.com >>> >> >> >> >>> >>> >>> >> >>> >> >> >> >>> >>> >>> > >>> >> >> >> >>> >>> >>> >>> >> >> >> >>> >>> >> >>> >> >> >> >>> >>> > >>> >> >> >> >>> >>> >>> >> >> >> >>> >> >>> >> >> >> >>> >> >>> >> >> >> >>> > >>> >> >> >> >>> >>> >> >> >> >>> >>> >> >> >> >>> >>> >> >> >> >>> -- >>> >> >> >> >>> =A0Sergey Beryozkin >>> >> >> >> >>> >>> >> >> >> >>> Application Integration Division of Talend >>> >> >> >> >>> http://sberyozkin.blogspot.com >>> >> >> >> >>> >>> >> >> >> >> >>> >> >> >> >> >>> >> >> >> > >>> >> >> >> >>> >> >> >> >>> >> >> >> >>> >> >> >> -- >>> >> >> >> =A0Sergey Beryozkin >>> >> >> >> >>> >> >> >> Application Integration Division of Talend >>> >> >> >> http://sberyozkin.blogspot.com >>> >> >> >> >>> >> >> > >>> >> >> >>> >> >> >>> >> >> >>> >> >> -- >>> >> >> =A0Sergey Beryozkin >>> >> >> >>> >> >> Application Integration Division of Talend >>> >> >> http://sberyozkin.blogspot.com >>> >> >> >>> >> > >>> >> >>> >> >>> >> >>> >> -- >>> >> =A0Sergey Beryozkin >>> >> >>> >> Application Integration Division of Talend >>> >> http://sberyozkin.blogspot.com >>> >> >>> > >>> >>> >>> >>> -- >>> =A0Sergey Beryozkin >>> >>> Application Integration Division of Talend >>> http://sberyozkin.blogspot.com >>> >> >> > --=20 Sergey Beryozkin Application Integration Division of Talend http://sberyozkin.blogspot.com