You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ad...@apache.org on 2007/06/06 09:29:54 UTC
svn commit: r544749 - in /incubator/tuscany/cpp/das: VSExpress/tuscany_das/
VSExpress/tuscany_das/Build/ VSExpress/tuscany_das/das_runtime/
VSExpress/tuscany_das/das_test/ runtime/core/include/apache/das/rdb/
runtime/core/resource/ runtime/core/src/ ru...
Author: adrianocrestani
Date: Wed Jun 6 00:29:53 2007
New Revision: 544749
URL: http://svn.apache.org/viewvc?view=rev&rev=544749
Log:
- DAS doesn't need anymore config.xsd to load xml configuration files
Removed:
incubator/tuscany/cpp/das/VSExpress/tuscany_das/Build/config.xsd
incubator/tuscany/cpp/das/runtime/core/resource/
Modified:
incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_runtime/das_runtime.vcproj
incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_test/das_test.vcproj
incubator/tuscany/cpp/das/VSExpress/tuscany_das/tuscany_das.suo
incubator/tuscany/cpp/das/runtime/core/include/apache/das/rdb/ConfigImpl.h
incubator/tuscany/cpp/das/runtime/core/include/apache/das/rdb/das_constants.h
incubator/tuscany/cpp/das/runtime/core/src/apache/das/DataGraphPrinter.cpp
incubator/tuscany/cpp/das/runtime/core/src/apache/das/rdb/ConfigImpl.cpp
incubator/tuscany/cpp/das/runtime/core/src/deploy.bat
incubator/tuscany/cpp/das/runtime/test/src/main.cpp
Modified: incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_runtime/das_runtime.vcproj
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_runtime/das_runtime.vcproj?view=diff&rev=544749&r1=544748&r2=544749
==============================================================================
--- incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_runtime/das_runtime.vcproj (original)
+++ incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_runtime/das_runtime.vcproj Wed Jun 6 00:29:53 2007
@@ -124,6 +124,8 @@
>
<Tool
Name="VCPreBuildEventTool"
+ Description=""
+ CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
@@ -146,7 +148,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
- AdditionalIncludeDirectories="..\..\..\runtime\core\include;"$(TUSCANY_SDOCPP)\include";"$(LIBXML2_HOME)\include";"$(ICONV_HOME)\include""
+ AdditionalIncludeDirectories="..\..\..\runtime\generator\src;..\..\..\runtime\core\include;"$(TUSCANY_SDOCPP)\include";"$(LIBXML2_HOME)\include";"$(ICONV_HOME)\include""
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;"
MinimalRebuild="true"
BasicRuntimeChecks="0"
Modified: incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_test/das_test.vcproj
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_test/das_test.vcproj?view=diff&rev=544749&r1=544748&r2=544749
==============================================================================
--- incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_test/das_test.vcproj (original)
+++ incubator/tuscany/cpp/das/VSExpress/tuscany_das/das_test/das_test.vcproj Wed Jun 6 00:29:53 2007
@@ -63,7 +63,7 @@
/>
<Tool
Name="VCLinkerTool"
- AdditionalDependencies="tuscany_das.lib tuscany_sdo.lib odbc32.lib libxml2.lib $(NOINHERIT)"
+ AdditionalDependencies="tuscany_das.lib tuscany_sdo.lib odbc32.lib $(NOINHERIT)"
OutputFile=".\Debug/das_test.exe"
LinkIncremental="2"
AdditionalLibraryDirectories=""$(ICONV_HOME)\lib";"$(LIBXML2_HOME)\lib";"$(TUSCANY_SDOCPP)/lib";../../../deploy/lib"
Modified: incubator/tuscany/cpp/das/VSExpress/tuscany_das/tuscany_das.suo
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/VSExpress/tuscany_das/tuscany_das.suo?view=diff&rev=544749&r1=544748&r2=544749
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/cpp/das/runtime/core/include/apache/das/rdb/ConfigImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/include/apache/das/rdb/ConfigImpl.h?view=diff&rev=544749&r1=544748&r2=544749
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/include/apache/das/rdb/ConfigImpl.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/include/apache/das/rdb/ConfigImpl.h Wed Jun 6 00:29:53 2007
@@ -23,6 +23,7 @@
#include <map>
#include "commonj/sdo/DataFactory.h"
+#include "commonj/sdo/DataFactoryImpl.h"
#include "commonj/sdo/XSDHelper.h"
#include "commonj/sdo/XMLHelper.h"
#include "commonj/sdo/HelperProvider.h"
Modified: incubator/tuscany/cpp/das/runtime/core/include/apache/das/rdb/das_constants.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/include/apache/das/rdb/das_constants.h?view=diff&rev=544749&r1=544748&r2=544749
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/include/apache/das/rdb/das_constants.h (original)
+++ incubator/tuscany/cpp/das/runtime/core/include/apache/das/rdb/das_constants.h Wed Jun 6 00:29:53 2007
@@ -1,3 +1,3 @@
#define DAS_ROOT_NAME "DAS_ROOT"
-#define DAS_NAMESPACE "das.lite"
+#define DAS_NAMESPACE "apache.das"
#define SDO_NAMESPACE "commonj.sdo"
Modified: incubator/tuscany/cpp/das/runtime/core/src/apache/das/DataGraphPrinter.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/apache/das/DataGraphPrinter.cpp?view=diff&rev=544749&r1=544748&r2=544749
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/apache/das/DataGraphPrinter.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/apache/das/DataGraphPrinter.cpp Wed Jun 6 00:29:53 2007
@@ -33,20 +33,35 @@
const commonj::sdo::TypeList& typeList = root->getDataFactory()->getTypes();
for (unsigned int i = 0 ; i < typeList.size() ; i++) {
- out << std::endl << "[" << typeList[i].getName() << "]" << std::endl;
+ out << std::endl << "[" << typeList[i].getName();
+
+ const commonj::sdo::Type* base = typeList[i].getBaseType();
+ out << "{";
+ out << " baseType = " << ((base == 0) ? "NULL" : base->getName());
+ out << " uri = " << typeList[i].getURI();
+ out << " abstractType = " << typeList[i].isAbstractType();
+ out << " changeSummaryType = " << typeList[i].isChangeSummaryType();
+ out << " dataObjectType = " << typeList[i].isDataObjectType();
+ out << " dataType = " << typeList[i].isDataType();
+ out << " openType = " << typeList[i].isOpenType();
+ out << " sequencedType = " << typeList[i].isSequencedType();
+ out << "} ]" << std::endl;
+
commonj::sdo::PropertyList propertyList = typeList[i].getProperties();
for (unsigned int j = 0 ; j < propertyList.size() ; j++) {
out << propertyList[j].getName();
-
- if (propertyList[j].isReference()) {
- out << "-> ";
- } else {
- out << " - ";
- }
-
- out << propertyList[j].getType().getName() << std::endl;
+ out << "{";
+ out << " type = " << propertyList[j].getType().getName();
+ out << " alias = " << propertyList[j].getAlias();
+ out << " aliasCount = " << propertyList[j].getAliasCount();
+ out << " contaiment = " << propertyList[j].isContainment();
+ out << " defaulted = " << propertyList[j].isDefaulted();
+ out << " many = " << propertyList[j].isMany();
+ out << " readOnly = " << propertyList[j].isReadOnly();
+ out << " reference = " << propertyList[j].isReference();
+ out << "}" << std::endl;
}
Modified: incubator/tuscany/cpp/das/runtime/core/src/apache/das/rdb/ConfigImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/apache/das/rdb/ConfigImpl.cpp?view=diff&rev=544749&r1=544748&r2=544749
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/apache/das/rdb/ConfigImpl.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/apache/das/rdb/ConfigImpl.cpp Wed Jun 6 00:29:53 2007
@@ -59,15 +59,55 @@
tables = new std::map<std::string, const Table*>();
convOverConfig = false;
- commonj::sdo::DataFactoryPtr df = commonj::sdo::DataFactory::getDataFactory();
- commonj::sdo::XSDHelperPtr xsdh = commonj::sdo::HelperProvider::getXSDHelper(df);
- xsdh->defineFile("config.xsd");
- commonj::sdo::XMLHelperPtr xmlh = commonj::sdo::HelperProvider::getXMLHelper(df);
- commonj::sdo::XMLDocumentPtr doc = xmlh->loadFile(xmlFile.c_str());
+ commonj::sdo::DataFactoryPtr dataFactory = commonj::sdo::DataFactory::getDataFactory();
+ dataFactory->addType(DAS_NAMESPACE, "RootType");
+ dataFactory->addType(DAS_NAMESPACE, "Table");
+ dataFactory->addType(DAS_NAMESPACE, "Relationship");
+ dataFactory->addType(DAS_NAMESPACE, "KeyPair");
+ dataFactory->addType(DAS_NAMESPACE, "Column");
+ dataFactory->addType(DAS_NAMESPACE, "Config");
+
+ const commonj::sdo::Type& rootType = dataFactory->getType(DAS_NAMESPACE, "RootType");
+ const commonj::sdo::Type& table = dataFactory->getType(DAS_NAMESPACE, "Table");
+ const commonj::sdo::Type& relationship = dataFactory->getType(DAS_NAMESPACE, "Relationship");
+ const commonj::sdo::Type& keyPair = dataFactory->getType(DAS_NAMESPACE, "KeyPair");
+ const commonj::sdo::Type& column = dataFactory->getType(DAS_NAMESPACE, "Column");
+ const commonj::sdo::Type& config = dataFactory->getType(DAS_NAMESPACE, "Config");
+
+ dataFactory->addPropertyToType(rootType, "Config", config);
+
+ dataFactory->addPropertyToType(table, "Column", column, true, false, true);
+ dataFactory->addPropertyToType(table, "tableName", SDO_NAMESPACE, "String", false, false, true);
+ dataFactory->addPropertyToType(table, "typeName", SDO_NAMESPACE, "String", false, false, true);
+
+ dataFactory->addPropertyToType(config, "Table", table, true, false, true);
+ dataFactory->addPropertyToType(config, "Relationship", relationship, true, false, true);
+ dataFactory->addPropertyToType(config, "uri", SDO_NAMESPACE, "String", false, false, true);
+
+ dataFactory->addPropertyToType(relationship, "KeyPair", keyPair, true, false, true);
+ dataFactory->addPropertyToType(relationship, "name", SDO_NAMESPACE, "String", false, false, true);
+ dataFactory->addPropertyToType(relationship, "primaryKeyTable", SDO_NAMESPACE, "String", false, false, true);
+ dataFactory->addPropertyToType(relationship, "foreignKeyTable", SDO_NAMESPACE, "String", false, false, true);
+ dataFactory->addPropertyToType(relationship, "many", SDO_NAMESPACE, "Boolean", false, false, true);
+ dataFactory->setDefault(relationship, "many", true);
+
+ dataFactory->addPropertyToType(keyPair, "primaryKeyColumn", SDO_NAMESPACE, "String", false, false, true);
+ dataFactory->addPropertyToType(keyPair, "foreignKeyColumn", SDO_NAMESPACE, "String", false, false, true);
+
+ dataFactory->addPropertyToType(column, "columnName", SDO_NAMESPACE, "String", false, false, true);
+ dataFactory->addPropertyToType(column, "sqlType", SDO_NAMESPACE, "String", false, false, true);
+ dataFactory->addPropertyToType(column, "propertyName", SDO_NAMESPACE, "String", false, false, true);
+ dataFactory->addPropertyToType(column, "primaryKey", SDO_NAMESPACE, "Boolean", false, false, true);
+ dataFactory->setDefault(column, "primaryKey", false);
+
+ dataFactory->resolve();
+
+ commonj::sdo::XMLHelperPtr xmlh = commonj::sdo::HelperProvider::getXMLHelper(dataFactory);
+ commonj::sdo::XMLDocumentPtr doc = xmlh->loadFile(xmlFile.c_str(), DAS_NAMESPACE);
commonj::sdo::DataObjectPtr root = doc->getRootDataObject();
commonj::sdo::DataObjectList& tableList = root->getList("Table");
-
+
for (unsigned int i = 0 ; i < tableList.size() ; i++) {
std::string tableName = SDODataObjectWrapper(tableList[i]).getString("tableName");
Modified: incubator/tuscany/cpp/das/runtime/core/src/deploy.bat
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/core/src/deploy.bat?view=diff&rev=544749&r1=544748&r2=544749
==============================================================================
--- incubator/tuscany/cpp/das/runtime/core/src/deploy.bat (original)
+++ incubator/tuscany/cpp/das/runtime/core/src/deploy.bat Wed Jun 6 00:29:53 2007
@@ -37,7 +37,6 @@
if not exist %deploydir% mkdir %deploydir%
-if not exist %deploydir%\resource mkdir %deploydir%\resource
if not exist %deploydir%\lib mkdir %deploydir%\lib
if not exist %deploydir%\include mkdir %deploydir%\include
if not exist %deploydir%\include\apache mkdir %deploydir%\include\apache
@@ -47,9 +46,6 @@
if not exist %deploydir%\include\apache\das\rdb mkdir %deploydir%\include\apache\das\rdb
-
-copy %includedir%\resource\* %deploydir%\resource
-
copy %includedir%\include\apache\das\* %deploydir%\include\apache\das
copy %includedir%\include\apache\das\rdb\* %deploydir%\include\apache\das\rdb
Modified: incubator/tuscany/cpp/das/runtime/test/src/main.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/cpp/das/runtime/test/src/main.cpp?view=diff&rev=544749&r1=544748&r2=544749
==============================================================================
--- incubator/tuscany/cpp/das/runtime/test/src/main.cpp (original)
+++ incubator/tuscany/cpp/das/runtime/test/src/main.cpp Wed Jun 6 00:29:53 2007
@@ -1,3 +1,22 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
#include <iostream>
#include <apache/das/rdb/Connection.h>
#include <apache/das/DAS.h>
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org