I did. It needs a bit more work and I'll need to allocate some time 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<String, List<Primitive>> (where Primitive is String or Integer/etc, to handle m.v=1&m.v=2 or similar), so isMapSupported() should check it and return false if not (this can help with eliminating empty branches). Would you like to improve this patch a bit ? I can do some test once 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 <biju74tec...@gmail.com> wrote: > Did you get chance to look into this? > > On Thu, May 26, 2011 at 2:19 PM, Sergey Beryozkin <sberyoz...@gmail.com>wrote: > >> Sorry, not yet, hoping to do it shortly >> >> Sergey >> >> On Thu, May 26, 2011 at 8:36 PM, Biju Nair <biju74tec...@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 <biju74tec...@gmail.com> >> wrote: >> > >> >> Attached the path in JIRA. >> >> >> >> Attaching with this mail also. >> >> >> >> On Wed, May 25, 2011 at 4:33 AM, Sergey Beryozkin < >> sberyoz...@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 probably 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/multiple values >> >>> case to work. >> >>> >> >>> Cheers, Sergey >> >>> >> >>> On Wed, May 25, 2011 at 4:45 AM, Biju Nair <biju74tec...@gmail.com> >> >>> wrote: >> >>> > I gave the Explict Map Support, becuase CXF was supporting Explict >> List >> >>> > support. >> >>> > >> >>> > The code which i send you have only support for beans with nested Map >> >>> > interface. >> >>> > >> >>> > On Tue, May 24, 2011 at 8:28 PM, Biju Nair <biju74tec...@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 interface 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 >> >>> >> >> >>> >> -------------------------- >> >>> >> >> >>> >> >> >>> >> On Tue, May 24, 2011 at 4:36 AM, Sergey Beryozkin < >> >>> sberyoz...@gmail.com>wrote: >> >>> >> >> >>> >>> Actually, I can see you modifying the code for explicit Maps be >> >>> >>> supported as well. >> >>> >>> >> >>> >>> That is not a bad idea but I'd prefer for one issue (to do with >> >>> >>> parameter beans containing Map fileds) addressed first. >> >>> >>> >> >>> >>> Explicit Maps can be supported right now (a bit of work is needed >> to >> >>> >>> register ParameterHandler to capture Form, query or path values or >> >>> >>> XmlJavaTypeAdapter to capture say XML payload). >> >>> >>> >> >>> >>> Please, simplify the patch a bit so that only a 'FormParam(""), >> >>> >>> QueryParam(""), or PathParam("") Map' case can be supported >> >>> >>> >> >>> >>> thanks, Sergey >> >>> >>> >> >>> >>> On Tue, May 24, 2011 at 12:04 PM, Sergey Beryozkin < >> >>> sberyoz...@gmail.com> >> >>> >>> wrote: >> >>> >>> > Hi >> >>> >>> > >> >>> >>> > On Fri, May 20, 2011 at 11:23 PM, Biju Nair < >> biju74tec...@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 looking at the diff >> >>> >>> > file, what the actual changes are. >> >>> >>> > I'm going to attach svn properties file from my local snapshot to >> >>> >>> > JIRA, can you please give me a favor and try again with those >> >>> >>> > properties applied ? >> >>> >>> > >> >>> >>> > thanks, Sergey >> >>> >>> > >> >>> >>> >> On Fri, May 20, 2011 at 2:26 AM, Sergey Beryozkin < >> >>> >>> sberyoz...@gmail.com>wrote: >> >>> >>> >> >> >>> >>> >>> Hi - did you see the comments on JIRA ? >> >>> >>> >>> Please update your local snapshot and create a patch >> >>> >>> >>> >> >>> >>> >>> thanks, Sergey >> >>> >>> >>> >> >>> >>> >>> On Tue, May 17, 2011 at 9:25 PM, Biju Nair < >> >>> biju74tec...@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 Beryozkin < >> >>> >>> sberyoz...@gmail.com >> >>> >>> >>> >wrote: >> >>> >>> >>> > >> >>> >>> >>> >> Hi >> >>> >>> >>> >> >> >>> >>> >>> >> On Tue, May 17, 2011 at 7:09 AM, Biju Nair < >> >>> biju74tec...@gmail.com >> >>> >>> > >> >>> >>> >>> wrote: >> >>> >>> >>> >> > Added the Map feature for service level and bean 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("")TestEmployeeTO >> >>> >>> >>> >> > testObject1,@FormParam("map") Map<String,Integer> map) >> >>> >>> >>> >> > >> >>> >>> >>> >> > public class TestEmployeeTO { >> >>> >>> >>> >> > >> >>> >>> >>> >> > private HashMap<String,String> currencies; >> >>> >>> >>> >> > >> >>> >>> >>> >> > //getters/setters >> >>> >>> >>> >> > } >> >>> >>> >>> >> > Input Data >> >>> >>> >>> >> > map.x=11&map.y=9¤cies.IND=INR¤cies.USA=DOLLAR >> >>> >>> >>> >> > Output >> >>> >>> >>> >> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}] >> >>> >>> >>> >> > map={y=9, x=11} >> >>> >>> >>> >> > >> >>> >>> >>> >> >> >>> >>> >>> >> thanks, Sergey >> >>> >>> >>> >> >> >>> >>> >>> >> >> >>> >>> >>> >> >> >>> >>> >>> >> > Please verify and let me know is this is good. >> >>> >>> >>> >> > >> >>> >>> >>> >> > Biju B >> >>> >>> >>> >> >> >>> >>> >>> >> >> >>> >>> >>> >> >> >>> >>> >>> >> -- >> >>> >>> >>> >> Sergey Beryozkin >> >>> >>> >>> >> >> >>> >>> >>> >> Application Integration Division of Talend >> >>> >>> >>> >> http://sberyozkin.blogspot.com >> >>> >>> >>> >> >> >>> >>> >>> > >> >>> >>> >>> >> >>> >>> >> >> >>> >>> > >> >>> >>> >> >>> >> >> >>> >> >> >>> > >> >>> >> >>> >> >>> >> >>> -- >> >>> Sergey Beryozkin >> >>> >> >>> Application Integration Division of Talend >> >>> http://sberyozkin.blogspot.com >> >>> >> >> >> >> >> > >> >> >> >> -- >> Sergey Beryozkin >> >> Application Integration Division of Talend >> http://sberyozkin.blogspot.com >> > -- Sergey Beryozkin Application Integration Division of Talend http://sberyozkin.blogspot.com