SDO XMLDocument loads Ecore AnyType instead of the SDO AnyType DataObject
-------------------------------------------------------------------------

         Key: TUSCANY-36
         URL: http://issues.apache.org/jira/browse/TUSCANY-36
     Project: Tuscany
        Type: Bug
  Components: Java SDO Implementation  
 Environment: Linux
    Reporter: Jean-Sebastien Delfino
 Assigned to: Frank Budinsky 


Load an XML document containing open content (<xsd:any>) using 
XMLHelper.INSTANCE.load(...). You will get an instance of XMLDocumentImpl 
containing org.eclipse.emf.ecore.xml.type.AnyType objects instead of the 
expected SDO org.apache.tuscany.sdo.AnyTypeDataObject.

I checked in a patch in XMLDocumentImpl, I added the following lines:
    resource.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_TYPE, 
SDOPackage.eINSTANCE.getAnyTypeDataObject());
    resource.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_TYPE, 
SDOPackage.eINSTANCE.getAnyTypeDataObject());

    resource.getDefaultLoadOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, 
SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject());
    resource.getDefaultSaveOptions().put(XMLResource.OPTION_ANY_SIMPLE_TYPE, 
SDOPackage.eINSTANCE.getSimpleAnyTypeDataObject());

This seems to fix the problem but I think we should look for a better fix, 
DataGraphResourceImpl seems to already configure a all the correct load/save 
options, maybe we could reuse it, or at least configure centralize the 
configuration of these options.


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira

Reply via email to