Uploaded image for project: 'Kuali Rice Development'
  1. Kuali Rice Development
  2. KULRICE-8651

There are two services that serialize BOs to XML and they have different configurations

    Details

    • Type: Bug Fix
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.2
    • Fix Version/s: Backlog
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
    • Rice Module:
      KRAD
    • KAI Review Status:
      Not Required
    • KTI Review Status:
      Not Required

      Description

      There are two components in KRAD which can convert BOs into XML via XStream. One is the BusinessObjectSerializerServiceImpl The other is the XmlObjectSerializerServiceImpl.

      Unfortunately, they configure the XStream object differently. And, despite the name, the BO service is not always used for BOs. In fact, in most cases, it delegates to the latter. This means that some of the configuration, most noticably these lines:

              xstream.addDefaultImplementation(AutoPopulatingList.class, ListProxyDefaultImpl.class);
              xstream.registerConverter(new AutoPopulatingListConverter(xstream.getMapper()));
      

      are not being used.

      I do not know if this is a problem or not. But, it seems that, if BOs start using the AutoPopulatingList class, they may not be handled properly.

        Attachments

          Issue Links

            Activity

            Hide
            jkeller Jonathan Keller added a comment -

            BTW, if you were ever to have:

            xstream.addDefaultImplementation(AutoPopulatingList.class, ListProxyDefaultImpl.class);

            in the xstream handler doing the deserialization, it would blow up on the first ListProxyDefaultImpl it encountered. AutoPopulatingList has no default constructor.

            Show
            jkeller Jonathan Keller added a comment - BTW, if you were ever to have: xstream.addDefaultImplementation(AutoPopulatingList.class, ListProxyDefaultImpl.class); in the xstream handler doing the deserialization, it would blow up on the first ListProxyDefaultImpl it encountered. AutoPopulatingList has no default constructor.
            Hide
            shahess Shannon Hess added a comment -

            Jonathan,

            Do you have an example of some XML that would have these AutoPopulatingList isses and uses XmlObjectSerializerServiceImpl? I'm having problems try to create some. It seems to me that the two different configurations were intentional, and I hesitate to change them. BusinessObjectSerializerServiceImpl uses ProxyAndStateAwareJavaReflectionProvider while XmlObjectSerializerServiceImpl uses ProxyAwareJavaReflectionProvider. I'm wondering if this should be left as is until there is a business case that requires a change. I was working with IdentityManagementRoleDocument, which has permissions as an AutoPopulatingListlooking. It uses XmlObjectSerializerServiceImpl.toXml to create the xml when it's serializing the document for routing. However, it's not a maintenance document so fromXML is never called for this document.

            Used by BusinessObjectSerializerServiceImpl :

            xstream = new XStream(new ProxyAndStateAwareJavaReflectionProvider());
            xstream.registerConverter(new ProxyConverter(xstream.getMapper(), xstream.getReflectionProvider() ));
            xstream.addDefaultImplementation(ArrayList.class, ListProxyDefaultImpl.class);
            xstream.addDefaultImplementation(AutoPopulatingList.class, ListProxyDefaultImpl.class);
            xstream.registerConverter(new AutoPopulatingListConverter(xstream.getMapper()));
            xstream.registerConverter(new DateTimeConverter());
            

            Used by XmlObjectSerializerServiceImpl:

            xstream = new XStream(new ProxyAwareJavaReflectionProvider());
            xstream.registerConverter(new ProxyConverter(xstream.getMapper(), xstream.getReflectionProvider() ));
            xstream.addDefaultImplementation(ArrayList.class, ListProxyDefaultImpl.class);
            xstream.registerConverter(new DateTimeConverter());
            
            Show
            shahess Shannon Hess added a comment - Jonathan, Do you have an example of some XML that would have these AutoPopulatingList isses and uses XmlObjectSerializerServiceImpl? I'm having problems try to create some. It seems to me that the two different configurations were intentional, and I hesitate to change them. BusinessObjectSerializerServiceImpl uses ProxyAndStateAwareJavaReflectionProvider while XmlObjectSerializerServiceImpl uses ProxyAwareJavaReflectionProvider. I'm wondering if this should be left as is until there is a business case that requires a change. I was working with IdentityManagementRoleDocument, which has permissions as an AutoPopulatingListlooking. It uses XmlObjectSerializerServiceImpl.toXml to create the xml when it's serializing the document for routing. However, it's not a maintenance document so fromXML is never called for this document. Used by BusinessObjectSerializerServiceImpl : xstream = new XStream( new ProxyAndStateAwareJavaReflectionProvider()); xstream.registerConverter( new ProxyConverter(xstream.getMapper(), xstream.getReflectionProvider() )); xstream.addDefaultImplementation(ArrayList.class, ListProxyDefaultImpl.class); xstream.addDefaultImplementation(AutoPopulatingList.class, ListProxyDefaultImpl.class); xstream.registerConverter( new AutoPopulatingListConverter(xstream.getMapper())); xstream.registerConverter( new DateTimeConverter()); Used by XmlObjectSerializerServiceImpl: xstream = new XStream( new ProxyAwareJavaReflectionProvider()); xstream.registerConverter( new ProxyConverter(xstream.getMapper(), xstream.getReflectionProvider() )); xstream.addDefaultImplementation(ArrayList.class, ListProxyDefaultImpl.class); xstream.registerConverter( new DateTimeConverter());
            Hide
            shahess Shannon Hess added a comment -

            Attaching the XML created for a IdentityManagementRoleDocument when it is serialized for routing. IdentityManagementRoleDocument contains several lists defined as AutoPopulatingLists

            Show
            shahess Shannon Hess added a comment - Attaching the XML created for a IdentityManagementRoleDocument when it is serialized for routing. IdentityManagementRoleDocument contains several lists defined as AutoPopulatingLists
            Hide
            jkeller Jonathan Keller added a comment -

            Maybe the KFS Vendor document would do it. It's a huge maintenance document with a number of lists within lists.

            Show
            jkeller Jonathan Keller added a comment - Maybe the KFS Vendor document would do it. It's a huge maintenance document with a number of lists within lists.
            Hide
            shahess Shannon Hess added a comment -

            Jonathan,

            I tried the KFS Vendor document, but it doesn't contain any AutoPopulatingLists in the xml. I talked to Peter and we decided to backlog this issue for now since there is currently no reproducible problem. If that changes at any time please let us know and we can push the priority of this back up.

            Thanks,
            Shannon

            Show
            shahess Shannon Hess added a comment - Jonathan, I tried the KFS Vendor document, but it doesn't contain any AutoPopulatingLists in the xml. I talked to Peter and we decided to backlog this issue for now since there is currently no reproducible problem. If that changes at any time please let us know and we can push the priority of this back up. Thanks, Shannon

              People

              • Assignee:
                Unassigned
                Reporter:
                jkeller Jonathan Keller
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: