You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Biju Nair (JIRA)" <ji...@apache.org> on 2011/05/17 22:21:47 UTC

[jira] [Created] (CXF-3529) Support for Map Interface in CXF Service and Beans

Support for Map Interface in CXF Service and Beans
--------------------------------------------------

                 Key: CXF-3529
                 URL: https://issues.apache.org/jira/browse/CXF-3529
             Project: CXF
          Issue Type: New Feature
          Components: Core
    Affects Versions: 2.4.1
         Environment: All platforms
            Reporter: Biju Nair
             Fix For: 2.4.1


Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.

This fix is to support Map interface as arguments and fields inside a bean.

> 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&currencies.IND=INR&currencies.USA=DOLLAR
> Output
> TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> map={y=9, x=11}
>



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin updated CXF-3529:
----------------------------------

    Attachment: config

Please copy the attached Subversion config file to 

~/.subversion (Unix)

or similar folder on Windows

please save the original config file just in case

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Biju Nair (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Biju Nair updated CXF-3529:
---------------------------

    Attachment: InjectionUtils.java

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, InjectionUtils.java, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CXF-3529) Support for Map Interface in CXF Parameter Beans

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin resolved CXF-3529.
-----------------------------------

    Resolution: Fixed

> Support for Map Interface in CXF Parameter Beans
> ------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: JAX-RS
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>            Assignee: Sergey Beryozkin
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, InjectionUtils.java, InjectionUtils.java, InjectionUtils_052511.patch, InjectionUtils_060511.patch, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin reassigned CXF-3529:
-------------------------------------

    Assignee: Sergey Beryozkin

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>            Assignee: Sergey Beryozkin
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, InjectionUtils.java, InjectionUtils.java, InjectionUtils_052511.patch, InjectionUtils_060511.patch, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035237#comment-13035237 ] 

Sergey Beryozkin commented on CXF-3529:
---------------------------------------

Hi Biju

Can you please do the following in the trunk:

svn diff > cxf-3529.diff

and attach cxf-3529.diff 

Cheers

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, JAXRSUtils.java
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3529) Support for Map Interface in CXF Parameter Beans

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sergey Beryozkin updated CXF-3529:
----------------------------------

    Component/s:     (was: Core)
                 JAX-RS
        Summary: Support for Map Interface in CXF Parameter Beans  (was: Support for Map Interface in CXF Service and Beans)

> Support for Map Interface in CXF Parameter Beans
> ------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: JAX-RS
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>            Assignee: Sergey Beryozkin
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, InjectionUtils.java, InjectionUtils.java, InjectionUtils_052511.patch, InjectionUtils_060511.patch, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Sergey Beryozkin (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040175#comment-13040175 ] 

Sergey Beryozkin commented on CXF-3529:
---------------------------------------

Hi, can you explain please what this code means:

+		boolean isbean = false; // TODO:isbean = true if realType is a Bean 
+		Map<String, Object> theValues = new HashMap<String, Object>();
+		if (isbean) {
+			
+		} else {
+			Set<Entry<String, String>> entrySet = values.entrySet();
+			for (Entry<String, String> entry : entrySet) {
+				Object o = InjectionUtils.handleParameter(entry.getValue(),
+						decoded, realType, paramAnns, pathParam, message);
+				theValues.put(entry.getKey(), o);
+			}

Does it address the case such as
public void method(@FormParam("") User user)

where User looks like this:

public class User {
Map<String, String> k;
}

and a sequence like this is posted:
k.a=1 and k.b=2 



> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, InjectionUtils.java, InjectionUtils_052511.patch, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Biju Nair (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044612#comment-13044612 ] 

Biju Nair commented on CXF-3529:
--------------------------------

Modified the code to accommodate Map<String,List<Primitive>

Files Changed : InjectionUtils.java

Methods Changed : handleBean (added  if (InjectionUtils.isSupportedMap(genericType)) )

Methods Added : 
isSupportedMap
isMapParamTypeSupported
isMapSecondTypeArgumentsSupported
mergeMap
injectIntoMap


Attached InjectionUtils.java and InjectionUtils_060511.patch

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, InjectionUtils.java, InjectionUtils.java, InjectionUtils_052511.patch, InjectionUtils_060511.patch, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Biju Nair (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Biju Nair updated CXF-3529:
---------------------------

    Attachment: JAXRSUtils.java
                InjectionUtils.java

> 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

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, JAXRSUtils.java
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Biju Nair (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Biju Nair updated CXF-3529:
---------------------------

    Attachment: InjectionUtils_052511.patch

Patch for Map Support

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, InjectionUtils.java, InjectionUtils_052511.patch, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Biju Nair (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13035023#comment-13035023 ] 

Biju Nair commented on CXF-3529:
--------------------------------

> 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&currencies.IND=INR&currencies.USA=DOLLAR
> Output
> TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> map={y=9, x=11}
>

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Biju Nair (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Biju Nair updated CXF-3529:
---------------------------

    Attachment: InjectionUtils.java
                InjectionUtils_060511.patch

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, InjectionUtils.java, InjectionUtils.java, InjectionUtils_052511.patch, InjectionUtils_060511.patch, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Biju Nair (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038941#comment-13038941 ] 

Biju Nair commented on CXF-3529:
--------------------------------

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





> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Biju Nair (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040347#comment-13040347 ] 

Biju Nair commented on CXF-3529:
--------------------------------

The current implementation only supports Map<string,primitive type> objects. In case if you have Map<string,bean> then the implementation should be done within if(isBean){} block.

Yes the current implementation address, public void method(@FormParam("") User user), where public class User { Map<String, String> k; }

and not
public class User { Map<String, Address> k; }, where Address is a bean. I am not sure whether we need to do it.

So I just put a placeholder for handling value beans in a map.

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, InjectionUtils.java, InjectionUtils_052511.patch, JAXRSUtils.java, config, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3529) Support for Map Interface in CXF Service and Beans

Posted by "Biju Nair (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3529?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Biju Nair updated CXF-3529:
---------------------------

    Attachment: cxf-3529.diff

Attaching the cxf-3529.diff.
Changed Files are 
    InjectionUtils.java 
    JAXRSUtils.java

> Support for Map Interface in CXF Service and Beans
> --------------------------------------------------
>
>                 Key: CXF-3529
>                 URL: https://issues.apache.org/jira/browse/CXF-3529
>             Project: CXF
>          Issue Type: New Feature
>          Components: Core
>    Affects Versions: 2.4.1
>         Environment: All platforms
>            Reporter: Biju Nair
>              Labels: java.util.map, map
>             Fix For: 2.4.1
>
>         Attachments: InjectionUtils.java, JAXRSUtils.java, cxf-3529.diff
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> Apache CXF Rest Services doesn't support java.util.Map interface as their service arguments. They even do not support java.util.Map interface inside a bean.
> This fix is to support Map interface as arguments and fields inside a bean.
> > 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&currencies.IND=INR&currencies.USA=DOLLAR
> > Output
> > TestEmployeeTO[currencies={IND=INR, USA=DOLLAR}]
> > map={y=9, x=11}
> >

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira