You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ro...@apache.org on 2006/08/23 18:03:01 UTC
svn commit: r434066 - in
/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model:
Component.cpp ModelLoader.cpp
Author: robbinspg
Date: Wed Aug 23 09:02:58 2006
New Revision: 434066
URL: http://svn.apache.org/viewvc?rev=434066&view=rev
Log:
Set property default for simple types
Modified:
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp
incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/ModelLoader.cpp
Modified: incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp?rev=434066&r1=434065&r2=434066&view=diff
==============================================================================
--- incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp (original)
+++ incubator/tuscany/cpp/sca/runtime/core/src/tuscany/sca/model/Component.cpp Wed Aug 23 09:02:58 2006
@@ -211,7 +211,22 @@
false,
true);
- // Set the default
+ // Set the default for a dataType
+ try
+ {
+ const Type& propType = factory->getType(typeUri.c_str(), typeName.c_str());
+ if (propType.isDataType())
+ {
+ factory->setDefault("org/osoa/sca", "Properties",
+ name.c_str(),
+ (char*)defaultValue->getCString(""));
+ }
+ }
+ catch (SDOTypeNotFoundException&)
+ {
+ // cout << "setting default failed" <<endl;
+ }
+
}
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=434066&r1=434065&r2=434066&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 Wed Aug 23 09:02:58 2006
@@ -380,7 +380,7 @@
try
{
XMLDocumentPtr componentTypeFile = getXMLHelper()->loadFile(typeFileName.c_str());
- if (componentTypeFile->getRootDataObject() == 0)
+ if (!componentTypeFile || componentTypeFile->getRootDataObject() == 0)
{
LOGERROR_1(0, "ModelLoader::addComponent: Unable to load file: %s", typeFileName.c_str());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org