You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by js...@apache.org on 2006/08/22 22:18:02 UTC

svn commit: r433737 - /incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp

Author: jsdelfino
Date: Tue Aug 22 13:17:57 2006
New Revision: 433737

URL: http://svn.apache.org/viewvc?rev=433737&view=rev
Log:
Fix to load the default value from a property type definition, works for simple types

Modified:
    incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp

Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp?rev=433737&r1=433736&r2=433737&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp Tue Aug 22 13:17:57 2006
@@ -427,8 +427,6 @@
                     string src = component->getName() + "/" + refName;
 
                     // Get the reference value
-                    //TODO this works but probably not the correct way to get
-                    // the simple content value of an element...
                     string refValue = refs[i]->getCString("value");
                     
                     composite->addWire(src, refValue);
@@ -515,7 +513,7 @@
                 DataObjectList& props = componentType->getList("property");
                 for (int i=0; i<props.size(); i++)
                 {
-                    // cout << "Property " << props[i];
+                    //cout << "Property " << props[i];
                     
                     string name = props[i]->getCString("name");
                     string type = props[i]->getCString("type");
@@ -524,15 +522,14 @@
                     {
                         many = props[i]->getBoolean("many");
                     }
-
+                    
+                    //TODO need to add support for complex properties, need the SDO
+                    // folks to shed some light on how to do this...
                     const char* defaultValue = 0;
-                    if (props[i]->getSequence() != 0)
-                    {
-                        //TODO this works but probably not the correct way to get
-                        // the open content...
-                        defaultValue = props[i]->getSequence()->getCStringValue(0);
+                    if (props[i]->isSet("value")) {
+                        defaultValue = props[i]->getCString("value");
                     }
-                    
+
                     component->addProperty(name, type, many, defaultValue);
                 }
             }



---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org