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 Bug Fix
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 2.1.2
    • Fix Version/s: Backlog
    • Component/s: Development
    • Security Level: Public (Public: Anyone can view)
    • Labels:
    • Similar issues:
      KULRICE-7066Issue when two quickfinders on same view have different lookup configuration
      KULRICE-9187Maintenance framework needs a hook that gets executed prior to serialization to XML
      KULRICE-9105Determine how to do a more efficient and less wasteful approach for XML object serialization for the maintenenace framework
      KULRICE-6850AutoPopulatingList needs to have a custom Converter registered with the XStream instance used by maintenance framework
      KULRICE-4496Speed Test: Soap vs java serialization for our remoted services
      KULRICE-5349LookupForm does not serialize properly
      KULRICE-11001Advanced Lookup Demo - ORM mapping for BOs
      KULRICE-4892Document Operation screen in workflow doesn't display XML properly if it's encrypted with a different encryption key then the standalone server uses
      KULRICE-13737Create Labs Transactional docs to have different default open/close items
      KULRICE-4700Fully convert java serialized services to SOAP services
    • 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.

        Issue Links

          Activity

          Hide
          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
          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
          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
          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
          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
          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
          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
          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
          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
          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:
              Jonathan Keller
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Structure Helper Panel