CopyHelper::copy fails when the data object being copied contains open content
------------------------------------------------------------------------------

                 Key: TUSCANY-873
                 URL: http://issues.apache.org/jira/browse/TUSCANY-873
             Project: Tuscany
          Issue Type: Bug
          Components: C++ SDO
    Affects Versions: Cpp-M2
         Environment: Windows XP
            Reporter: Simon Laws


With schemafree.xsd : 

<schema xmlns="http://www.w3.org/2001/XMLSchema"; 
        targetNamespace="GenericNS" 
        xmlns:tns="GenericNS">
    
    <complexType name="GenericType">
        <sequence>
            <any namespace="##any"/>
        </sequence>
    </complexType>
        
 </schema>

And a C++ app that uses SDO as follows:

        DataFactoryPtr mdg  = DataFactory::getDataFactory();
        XSDHelperPtr myXSDHelper = HelperProvider::getXSDHelper(mdg);
       myXSDHelper->defineFile("schemafree.xsd");
        XMLHelperPtr myXMLHelper = HelperProvider::getXMLHelper(mdg);
        DataObjectPtr root = mdg->create("GenericNS", "GenericType");       
        root->setInteger("mystring", 12);
       DataObjectPtr rootCopy = CopyHelper::copy(root);

The app fails at the last line with:

      Cannot find property:mystring

This is failing because  CopyHelper::copy() uses 
DataObjectImpl::set???(Property&, value) to copy primitive types.  The first 
thing that this does is get the index of the property as it exists on the 
target data object of the copy. Of course the property doesn't exist because 
the property is added as an open property, i.e. in a place where open 
properties are allowed. The fix is to create a new internal method that creates 
a new open property in this situation. 

I'm looking at this now so hope to propose a patch in due course. 


-- 
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

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to