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/18 21:36:20 UTC
svn commit: r432696 - in /incubator/tuscany/sandbox/robbinspg/sdo:
projects/tuscany_sdo/ runtime/core/src/commonj/sdo/ runtime/core/test/
Author: robbinspg
Date: Fri Aug 18 12:36:17 2006
New Revision: 432696
URL: http://svn.apache.org/viewvc?rev=432696&view=rev
Log:
Update to latest SDO fixes
Modified:
incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.dsw
incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.ncb
incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.opt
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.cpp
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.h
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOUtils.h
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/TypeImpl.cpp
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelper.h
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.h
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/main.cpp
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/maintest.txt
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.cpp
incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.h
Modified: incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.dsw
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.dsw?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.dsw (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.dsw Fri Aug 18 12:36:17 2006
@@ -62,6 +62,9 @@
Begin Project Dependency
Project_Dep_Name sdo_runtime
End Project Dependency
+ Begin Project Dependency
+ Project_Dep_Name sdo_axiom
+ End Project Dependency
}}}
###############################################################################
Modified: incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.ncb
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.ncb?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.opt
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/projects/tuscany_sdo/tuscany_sdo.opt?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.cpp?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.cpp Fri Aug 18 12:36:17 2006
@@ -28,6 +28,7 @@
#include "commonj/sdo/Logger.h"
+#include "commonj/sdo/SDOUtils.h"
#include "commonj/sdo/PropertyList.h"
@@ -2265,6 +2266,12 @@
{
return generateInterface(fileroot.c_str(), factoryname.c_str());
}
+
+ std::ostream& DataFactoryImpl::printSelf(std::ostream &os)
+ {
+ SDOUtils::printTypes(os, this);
+ return os;
+ }
};
};
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.h?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/DataFactoryImpl.h Fri Aug 18 12:36:17 2006
@@ -681,6 +681,8 @@
virtual bool generateInterface(const SDOString& fileroot, const SDOString& factoryname);
+ virtual std::ostream& printSelf(std::ostream &os);
+
private:
typedef std::map<std::string, TypeImpl*> TYPES_MAP;
TYPES_MAP types;
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.cpp Fri Aug 18 12:36:17 2006
@@ -609,7 +609,7 @@
SchemaInfo schemaInf;
SDOSchemaSAX2Parser schemaParser(schemaInf, (ParserErrorSetter*)setter);
-
+
TypeDefinitionsImpl* typedefs;
SDOXMLString schemaLocation = attributes.getValue("schemaLocation");
@@ -622,7 +622,7 @@
// we were not able to start the parse
return;
}
-
+
typedefs = &schemaParser.getTypeDefinitions();
}
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOSchemaSAX2Parser.h Fri Aug 18 12:36:17 2006
@@ -49,7 +49,8 @@
public:
SDOSchemaSAX2Parser(SchemaInfo& schemaInfo,
- ParserErrorSetter* insetter);
+ ParserErrorSetter* insetter,
+ bool loadImportNamespace = false);
virtual ~SDOSchemaSAX2Parser();
@@ -224,6 +225,7 @@
TypeDefinitionsImpl typeDefinitions;
+ bool loadImportNamespace;
};
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOUtils.cpp Fri Aug 18 12:36:17 2006
@@ -224,5 +224,27 @@
incr--;
out << "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< end of do" << endl;
}
+
+
+ void SDOUtils::printTypes(std::ostream& out, DataFactoryPtr df)
+ {
+ TypeList tl = df->getTypes();
+ for (int i = 0; i < tl.size(); i++)
+ {
+ out << "Type: " << tl[i].getURI()<< "#" << tl[i].getName() <<
+ " isOpen: " << tl[i].isOpenType()
+ << " isSequenced: " << tl[i].isSequencedType() << endl;
+ PropertyList pl = tl[i].getProperties();
+ for (int j = 0; j < pl.size(); j++)
+ {
+ out << "\tProperty: " << pl[j].getName()
+ << " type: " <<pl[j].getType().getURI()<<"#"<<pl[j].getType().getName()<<
+ " isMany: " << pl[j].isMany() << endl;
+
+ }
+ }
+
+ }
+
};
};
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOUtils.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOUtils.h?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOUtils.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/SDOUtils.h Fri Aug 18 12:36:17 2006
@@ -43,7 +43,8 @@
static SDO_API void printDataObject(std::ostream& out, DataObjectPtr d);
static SDO_API const char* SDOToXSD(const char* sdoname);
static SDO_API const char* XSDToSDO(const char* xsdname);
-
+ static void printTypes(std::ostream& out, DataFactoryPtr df);
+
private:
static bool populate();
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/TypeImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/TypeImpl.cpp?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/TypeImpl.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/TypeImpl.cpp Fri Aug 18 12:36:17 2006
@@ -861,11 +861,13 @@
const TypeImpl& t,
bool many, bool rdonly, bool cont)
{
-
+ // do not add duplicate properties
+ if (!getPropertyImpl(propname))
+ {
props.insert(props.end(),new PropertyImpl(*this,
propname, t, many,rdonly, cont));
localPropsSize++;
-
+ }
}
///////////////////////////////////////////////////////////////////////////
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelper.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelper.h?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelper.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelper.h Fri Aug 18 12:36:17 2006
@@ -51,9 +51,9 @@
*
*/
- SDO_API virtual const char* defineFile(const char* schemaFile) = 0;
- SDO_API virtual const char* define(std::istream& schema) = 0;
- SDO_API virtual const char* define(const char* schema) = 0;
+ SDO_API virtual const char* defineFile(const char* schemaFile, bool loadImportNamespace = false) = 0;
+ SDO_API virtual const char* define(std::istream& schema, bool loadImportNamespace = false) = 0;
+ SDO_API virtual const char* define(const char* schema, bool loadImportNamespace = false) = 0;
/** generate buildsXSD from types/properties
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.cpp Fri Aug 18 12:36:17 2006
@@ -75,10 +75,10 @@
*
*/
- const char* XSDHelperImpl::defineFile(const char* schema)
+ const char* XSDHelperImpl::defineFile(const char* schema, bool loadImportNamespace)
{
- SDOSchemaSAX2Parser schemaParser(schemaInfo, this);
+ SDOSchemaSAX2Parser schemaParser(schemaInfo, this, loadImportNamespace);
clearErrors();
if (schemaParser.parse(schema) == 0)
{
@@ -88,19 +88,19 @@
return 0;
}
- const char* XSDHelperImpl::define(std::istream& schema)
+ const char* XSDHelperImpl::define(std::istream& schema, bool loadImportNamespace)
{
- SDOSchemaSAX2Parser schemaParser(schemaInfo, this);
+ SDOSchemaSAX2Parser schemaParser(schemaInfo, this, loadImportNamespace);
clearErrors();
schema >> schemaParser;
defineTypes(schemaParser.getTypeDefinitions());
return schemaInfo.getTargetNamespaceURI();
}
- const char* XSDHelperImpl::define(const char* schema)
+ const char* XSDHelperImpl::define(const char* schema, bool loadImportNamespace)
{
std::istringstream str(schema);
- SDOSchemaSAX2Parser schemaParser(schemaInfo, this);
+ SDOSchemaSAX2Parser schemaParser(schemaInfo, this, loadImportNamespace);
clearErrors();
str >> schemaParser;
defineTypes(schemaParser.getTypeDefinitions());
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.h?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/src/commonj/sdo/XSDHelperImpl.h Fri Aug 18 12:36:17 2006
@@ -62,9 +62,9 @@
* The return value is the URI of the root Type
*
*/
- virtual const char* defineFile(const char* schemaFile);
- virtual const char* define(std::istream& schema);
- virtual const char* define(const char* schema);
+ virtual const char* defineFile(const char* schemaFile, bool loadImportNamespace = false);
+ virtual const char* define(std::istream& schema, bool loadImportNamespace = false);
+ virtual const char* define(const char* schema, bool loadImportNamespace = false);
/** getErrorCount gets number of parse errors
*
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/main.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/main.cpp?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/main.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/main.cpp Fri Aug 18 12:36:17 2006
@@ -167,7 +167,6 @@
TEST ( sdotest::b46617() );
TEST ( sdotest::b46613() );
TEST ( sdotest::b45933() );
- TEST ( sdotest::importnamespace() );
cout << "Total tests:" << totaltests << " Tests passed:" << testspassed << endl;
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/maintest.txt
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/maintest.txt?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/maintest.txt (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/maintest.txt Fri Aug 18 12:36:17 2006
@@ -53,7 +53,7 @@
Type Manager
Has Property name of type String
Has Property officeid of type String
-Has Property string of type String
+Has Property str of type String
Has Property boolean of type Boolean
Has Property byte of type Byte
Has Property character of type Character
@@ -115,7 +115,7 @@
Has Property name of type String
Has Property name of type String
Has Property officeid of type String
-Has Property string of type String
+Has Property str of type String
Has Property boolean of type Boolean
Has Property byte of type Byte
Has Property character of type Character
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.cpp
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.cpp?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.cpp (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.cpp Fri Aug 18 12:36:17 2006
@@ -313,7 +313,6 @@
DataObjectPtr com = dor->createDataObject("companies");
com->setCString("name","acme");
com->setCString("id","123");
- cout << com;
ChangeSummaryPtr cs = dor->getChangeSummary();
cs->beginLogging();
@@ -2333,7 +2332,7 @@
*/
/* Now add a primitive type test to the manager */
- mdg->addPropertyToType(tm,"string",ts);
+ mdg->addPropertyToType(tm,"str",ts);
fprintf(f, "Manager is sequenced?%d\n",tm.isSequencedType());
@@ -8831,22 +8830,6 @@
}
-
-int sdotest::importnamespace()
-{
- try
- {
- XSDHelperPtr xsh = HelperProvider::getXSDHelper();
- xsh->defineFile("importnamespace.xsd");
- return 1;
- }
- catch (SDORuntimeException e)
- {
- if (!silent)cout << "importnamespace" << endl << e << endl;
- return 0;
- }
-
-}
Modified: incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.h
URL: http://svn.apache.org/viewvc/incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.h?rev=432696&r1=432695&r2=432696&view=diff
==============================================================================
--- incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.h (original)
+++ incubator/tuscany/sandbox/robbinspg/sdo/runtime/core/test/sdotest.h Fri Aug 18 12:36:17 2006
@@ -189,5 +189,4 @@
static int b46617();
static int b46617b();
static int b45933();
- static int importnamespace();
};
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org