You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by ke...@apache.org on 2007/07/10 11:37:17 UTC
svn commit: r554885 - in /incubator/tuscany/java/sdo: distribution/
distribution/src/main/assembly/ distribution/src/main/release/
distribution/src/main/release/bin/ sample/
sample/src/main/java/org/apache/tuscany/samples/sdo/
sample/src/main/java/org/...
Author: kelvingoodson
Date: Tue Jul 10 02:37:15 2007
New Revision: 554885
URL: http://svn.apache.org/viewvc?view=rev&rev=554885
Log:
more build and sample program updates
Added:
incubator/tuscany/java/sdo/distribution/src/main/release/bin/runsamples.bat
incubator/tuscany/java/sdo/distribution/src/main/release/bin/runsamples.sh
Removed:
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/ExecuteSamples2.java
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/otherSources/
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/specCodeSnippets/
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/tuscanyapi/
Modified:
incubator/tuscany/java/sdo/distribution/pom.xml
incubator/tuscany/java/sdo/distribution/src/main/assembly/bin.xml
incubator/tuscany/java/sdo/distribution/src/main/release/RELEASE_NOTES
incubator/tuscany/java/sdo/sample/pom.xml
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/ExecuteSamples.java
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/MedicalScenario.java
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/ObtainingDataGraphFromXml.java
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/AccessDataObjectPropertiesByName.java
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/CreateCompany.java
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/CreatePurchaseOrder.java
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/intermediate/CreateCompanyTuscanyAPI.java
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/overview.html
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/sampleProgramContents.html
incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/util/DocumentSamples.java
Modified: incubator/tuscany/java/sdo/distribution/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/distribution/pom.xml?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/distribution/pom.xml (original)
+++ incubator/tuscany/java/sdo/distribution/pom.xml Tue Jul 10 02:37:15 2007
@@ -33,6 +33,7 @@
<properties>
<maven.test.skip>true</maven.test.skip>
<tuscany.version>${pom.version}</tuscany.version>
+ <sdo.previousversion>1.0-incubating-beta1</sdo.previousversion>
</properties>
<!-- in the sca build the bundle module is creating the merged jar which contains all the tuscany
@@ -59,6 +60,11 @@
<dependency>
<groupId>org.apache.tuscany.sdo</groupId>
<artifactId>tuscany-sdo-tools</artifactId>
+ <version>${pom.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.tuscany.sdo</groupId>
+ <artifactId>sample-sdo</artifactId>
<version>${pom.version}</version>
</dependency>
</dependencies>
Modified: incubator/tuscany/java/sdo/distribution/src/main/assembly/bin.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/distribution/src/main/assembly/bin.xml?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/distribution/src/main/assembly/bin.xml (original)
+++ incubator/tuscany/java/sdo/distribution/src/main/assembly/bin.xml Tue Jul 10 02:37:15 2007
@@ -35,7 +35,6 @@
<includes>
<include>DISCLAIMER</include>
<include>README</include>
- <include>RELEASE_NOTES</include>
</includes>
</fileSet>
<fileSet>
@@ -80,6 +79,24 @@
</fileSet>
</fileSets>
+ <files>
+ <file>
+ <source>src/main/release/bin/runsamples.bat</source>
+ <outputDirectory>tuscany-sdo-${sdo.version}/samples</outputDirectory>
+ <filtered>true</filtered>
+ </file>
+ <file>
+ <source>src/main/release/bin/runsamples.sh</source>
+ <outputDirectory>tuscany-sdo-${sdo.version}/samples</outputDirectory>
+ <filtered>true</filtered>
+ </file>
+ <file>
+ <source>src/main/release/RELEASE_NOTES</source>
+ <outputDirectory>tuscany-sdo-${sdo.version}</outputDirectory>
+ <filtered>true</filtered>
+ </file>
+ </files>
+
<dependencySets>
<dependencySet>
<outputDirectory>tuscany-sdo-${sdo.version}/lib</outputDirectory>
@@ -87,6 +104,7 @@
<include>org.apache.tuscany.sdo:tuscany-sdo-lib</include>
<include>org.apache.tuscany.sdo:tuscany-sdo-impl</include>
<include>org.apache.tuscany.sdo:tuscany-sdo-tools</include>
+ <include>org.apache.tuscany.sdo:sample-sdo</include>
</includes>
<fileMode>644</fileMode>
</dependencySet>
Modified: incubator/tuscany/java/sdo/distribution/src/main/release/RELEASE_NOTES
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/distribution/src/main/release/RELEASE_NOTES?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/distribution/src/main/release/RELEASE_NOTES (original)
+++ incubator/tuscany/java/sdo/distribution/src/main/release/RELEASE_NOTES Tue Jul 10 02:37:15 2007
@@ -1,96 +1,27 @@
-What's New in SDO Java M3
+What's New in SDO Java ${sdo.version}
-For previous revision history, take a look at the http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/distribution/RELEASE_NOTES.txt?view=markup&pathrev=465232
+For previous revision history, take a look at
+http://svn.apache.org/viewvc/incubator/tuscany/tags/java/sdo/${sdo.previousversion}/sdo/distribution/RELEASE_NOTES.txt
-Details are described below.
-
-SDO Java M3 is a superset of previous SDO Java M2 release.
-Anything in M2 is also in M3, but M3 contains features and bugfixes not present in M2 release.
+SDO Java ${sdo.version} is a superset of previous SDO ${sdo.previousversion} release.
+Anything in ${sdo.previousversion} is also in ${sdo.version}, but ${sdo.version} contains
+features and bugfixes not present in ${sdo.previousversion} release.
Downloading
- http://cwiki.apache.org/confluence/display/TUSCANY/SDO+Java+Download
-
-Compatibility Concerns
- M3 now uses the SDO 2.1 interfaces whereas M2 used the 2.0.1 interfaces.
- A program written to the M2 dynamic SDO API/SPI can compile against M3 libraries,
- although some API and SPI interfaces have been deprecated between releases.
- In most instances these programs will execute as before, but if the programs relied
- on the exposure of EMF Property instances through the SDO API then they will fail.
- Static SDO classes generated with the M2 release must be regenerated before they will work in an M3 environment.
- A program written for M3 cannot necessarily compile or run against M2 libraries.
+ http://incubator.apache.org/tuscany/sdo-java-releases.html
New Features and Fixes
For more detail on these fixes and features please see ...
-http://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&&pid=12310210&fixfor=12312317&resolution=1&sorter/field=issuekey&sorter/order=DESC
-
-
-TUSCANY-153 ChangeSummary on root data object not supported
-TUSCANY-396 Cardinality of wildcard element not respected
-TUSCANY-521 Hide special Sequence-type properties from SDO Types
-TUSCANY-684 Generated SDO classes should be able to register the static types to a given TypeHelper
-TUSCANY-701 Conversion to date types which do not include month can give incorrect results
-TUSCANY-708 Should TypeHelper.define return List of Types that includes DocumentRootType
-TUSCANY-709 Loads DataGraph in designated scope(TypeHelper)
-TUSCANY-713 Discover and regiester new SDO types during the time of loading the XML instance document
-TUSCANY-718 make -noEMF code generation the default
-TUSCANY-836 doubleValue() may be inaccurate for Long
-TUSCANY-859 ChangeSummary#isCreated cache is not updated while changes are still going on
-TUSCANY-885 Property DataObject.getProperty(String propertyName) should return null if the property cannot be fou
-TUSCANY-887 TypeHelper.define() should create an accompanying global property per type
-TUSCANY-894 SDO (and indirectly DAS) may not now depend on CPL if EMF has completed migration to EPL
-TUSCANY-901 jar Manifests require Implementation-Vendor-Id
-TUSCANY-902 release distributions should have common root folder naming the release
-TUSCANY-928 Define Tuscany SDO options for XMLHelper load and save operations
-TUSCANY-929 Move to SDO 2.1 spec APIs
-TUSCANY-930 Add new SDOUtil.createHelperContext() method
-TUSCANY-931 Sequence.add(int index, String propertyName, Object value) is not functioning correctly
-TUSCANY-932 Invoking DataObject.isSet(String path) with invalid path would result in NPE
-TUSCANY-933 XSD2Java Generator still generates EMF codes with -noEMF option on
-TUSCANY-934 XSD2JavaGenerator -noEMF option does not work with abstract classes.
-TUSCANY-935 SDO path accessors need to support names that contain "."
-TUSCANY-956 SDOFactory instance lookup is using the wrong namespace URI
-TUSCANY-958 NPE generated during a property set of a static SDO
-TUSCANY-972 commonj.sdo/xml namespace should be supported by SDO runtime by default
-TUSCANY-1100 Dynamic Type tests are needed to ensure that all XSD datatypes are supported
-TUSCANY-1006 ChangeSummaryImpl.cachedSDOObjectChanges appears to not be thread safe
-TUSCANY-1044 DataHelperImpl.toDateTime() is not compliant with spec.
-TUSCANY-1050 For some schemas, the code generated will not compile (notication and settable problems)
-TUSCANY-1055 DataFactory.create(abstract_type) should throw an IllegalArgumentException
-TUSCANY-1062 DataGraph.createRootObject implementation does not match 2.1 spec and also is not helpful when given
-TUSCANY-1065 Coexistence problem between EMF and Tuscany SDO
-TUSCANY-1082 Change Summary XML deserialization
-TUSCANY-1083 Shorter NameSpace prefix to speed up XML processing and reduce communication bandwidth
-TUSCANY-1085 schemaLocation attribute in the <xsd:import> should be only a hint
-TUSCANY-1086 Scope defined java serialiazation/deserialization of SDO
-TUSCANY-1088 SDO should tolerate malformed XML
-TUSCANY-1091 DataObjectXMLStreamReader doesn't have to repeat NameSpace declaration which impacts performance
-TUSCANY-1093 isSet returning false when boolean set to false, or int set to 0
-TUSCANY-1096 Exception thrown when reference with many multiplicity to the element of anyType
-TUSCANY-1097 DataObjectXMLStreamReader shouldn't have ignored (transient Properties in) Sequence
-TUSCANY-1098 Add get() and getInstanceProperties() methods in Type and Property
-TUSCANY-1099 fix for TUSCANY-1083 used lookupPrefix method of Node not available to Java 1.4.2 users
-TUSCANY-1101 Support mixed Sequence and any Sequence in Change Summary
-TUSCANY-1102 Support EMF 2.2.2
-TUSCANY-1107 Multiple calls to getNamespaceContext
-TUSCANY-1113 Extensible namespaces and types that change
-TUSCANY-1120 Static code generator template bugs
-TUSCANY-1123 test case generated code and metadata access is anachronistic
-TUSCANY-1130 Concurrent access to SDOUtil.createHelperContext() results in exception
-TUSCANY-1132 SDO Java serialization/deserialization throws an exception when the serialized data object is not the
-TUSCANY-1141 The dependency/imported package was not initialized if the codegen tool was provided with -javaPackag
-TUSCANY-1155 Java SDO static code generation tool java doc and usage hints need updating.
-TUSCANY-1156 CodeGen generates lowercase feature name when the schema specifies uppercase
-TUSCANY-1164 Container of root object is non-null after endLogging()
-TUSCANY-1167 SDO Codegen generates bad code when the noNotification option is used
-TUSCANY-1168 Type.isSequenced() returns wrong value for my XSD
-TUSCANY-1169 Property.getType() throws ClassCastException if the property is from AnyDataObjectType.getInstancePro
-TUSCANY-1172 plugin LICENSE.txt file has spurious
-TUSCANY-1179 Race condition due to lazy metada initialization when SDO is shared across threads for read intent
-TUSCANY-1185 Contribution of EMF classes, BasicExtendedMetaData and XSDEcoreBuilder
-TUSCANY-1190 IAE in static case when using DataObject.setList() to assign multiple Objects to a many-valued Proper
+https://issues.apache.org/jira/secure/IssueNavigator.jspa?reset=true&&pid=12310210&fixfor=12312521&resolution=1&sorter/field=issuekey&sorter/order=DESC
+TUSCANY-1393 ClassCastException saving codegen-based DataGraph with ChangeSummary containing an xsd:int
+TUSCANY-1322 Static code gen objects not deleting contained children successfully
+TUSCANY-1305 Changesummary of datagraph using static interfaces.
+TUSCANY-1284 Manifest version number in Java SDO Impl and Tools jars
+TUSCANY-1233 Enhance SDO static codegen (XSD2Java) to support multiple namespaces in a single pass.
+TUSCANY-513 Implement support for dynamic subclasses of statically generated types
Added: incubator/tuscany/java/sdo/distribution/src/main/release/bin/runsamples.bat
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/distribution/src/main/release/bin/runsamples.bat?view=auto&rev=554885
==============================================================================
--- incubator/tuscany/java/sdo/distribution/src/main/release/bin/runsamples.bat (added)
+++ incubator/tuscany/java/sdo/distribution/src/main/release/bin/runsamples.bat Tue Jul 10 02:37:15 2007
@@ -0,0 +1,21 @@
+REM Licensed to the Apache Software Foundation (ASF) under one
+REM or more contributor license agreements. See the NOTICE file
+REM distributed with this work for additional information
+REM regarding copyright ownership. The ASF licenses this file
+REM to you under the Apache License, Version 2.0 (the
+REM "License"); you may not use this file except in compliance
+REM with the License. You may obtain a copy of the License at
+REM
+REM http://www.apache.org/licenses/LICENSE-2.0
+REM
+REM Unless required by applicable law or agreed to in writing,
+REM software distributed under the License is distributed on an
+REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+REM KIND, either express or implied. See the License for the
+REM specific language governing permissions and limitations
+REM under the License.
+set BINARY_BASE=edit this variable to point to the root folder of your binary distribution
+set RELEASE=${sdo.version}
+set LIB=%BINARY_BASE%\lib
+set CLASSPATH=%LIB%\sample-sdo-%RELEASE%.jar;%LIB%\sdo-api-r2.1-%RELEASE%.jar;%LIB%\tuscany-sdo-lib-%RELEASE%.jar;%LIB%\tuscany-sdo-impl-%RELEASE%.jar;%LIB%\tuscany-sdo-tools-%RELEASE%.jar;%LIB%\codegen-ecore-2.2.3.jar;%LIB%\codegen-2.2.3.jar;%LIB%\ecore-2.2.3.jar;%LIB%\ecore-change-2.2.3.jar;%LIB%\ecore-xmi-2.2.3.jar;%LIB%\common-2.2.3.jar;%LIB%\xsd-2.2.3.jar;%LIB%\stax-api-1.0.1.jar
+java org.apache.tuscany.samples.sdo.ExecuteSamples
\ No newline at end of file
Added: incubator/tuscany/java/sdo/distribution/src/main/release/bin/runsamples.sh
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/distribution/src/main/release/bin/runsamples.sh?view=auto&rev=554885
==============================================================================
--- incubator/tuscany/java/sdo/distribution/src/main/release/bin/runsamples.sh (added)
+++ incubator/tuscany/java/sdo/distribution/src/main/release/bin/runsamples.sh Tue Jul 10 02:37:15 2007
@@ -0,0 +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.
+
+export BINARY_BASE=change this value to be a valid path to your binary distribution root
+export RELEASE=${sdo.version}
+export LIB=$BINARY_BASE/lib
+export CLASSPATH=$LIB/sample-sdo-$RELEASE.jar;$LIB/sdo-api-r2.1-$RELEASE.jar;$LIB/tuscany-sdo-lib-$RELEASE.jar;$LIB/tuscany-sdo-impl-$RELEASE.jar;$LIB/tuscany-sdo-tools-$RELEASE.jar;$LIB/codegen-ecore-2.2.3.jar;$LIB/codegen-2.2.3.jar;$LIB/ecore-2.2.3.jar;$LIB/ecore-change-2.2.3.jar;$LIB/ecore-xmi-2.2.3.jar;$LIB/common-2.2.3.jar;$LIB/xsd-2.2.3.jar;$LIB/stax-api-1.0.1.jar
+java org.apache.tuscany.samples.sdo.ExecuteSamples
\ No newline at end of file
Modified: incubator/tuscany/java/sdo/sample/pom.xml
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/pom.xml?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/pom.xml (original)
+++ incubator/tuscany/java/sdo/sample/pom.xml Tue Jul 10 02:37:15 2007
@@ -43,6 +43,20 @@
<version>${pom.version}</version>
<scope>compile</scope>
</dependency>
+
+ <dependency>
+ <groupId>stax</groupId>
+ <artifactId>stax-api</artifactId>
+ <version>1.0.1</version>
+ </dependency>
+
+ <dependency>
+ <groupId>org.codehaus.woodstox</groupId>
+ <artifactId>wstx-asl</artifactId>
+ <version>3.2.0</version>
+ <scope>test</scope>
+ </dependency>
+
</dependencies>
<build>
Modified: incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/ExecuteSamples.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/ExecuteSamples.java?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/ExecuteSamples.java (original)
+++ incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/ExecuteSamples.java Tue Jul 10 02:37:15 2007
@@ -17,172 +17,75 @@
* specific language governing permissions and limitations
* under the License.
*/
-
package org.apache.tuscany.samples.sdo;
import java.io.BufferedReader;
+import java.io.IOException;
import java.io.InputStreamReader;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
-import org.apache.tuscany.samples.sdo.advanced.ObtainingDataGraphFromXml;
-import org.apache.tuscany.samples.sdo.basic.AccessDataObjectPropertiesByName;
-import org.apache.tuscany.samples.sdo.basic.AccessingTheContentsOfASequence;
-import org.apache.tuscany.samples.sdo.basic.CreatePurchaseOrder;
-import org.apache.tuscany.samples.sdo.basic.ReadPurchaseOrder;
-import org.apache.tuscany.samples.sdo.intermediate.AccessingDataObjectsViaPropertyIndex;
-import org.apache.tuscany.samples.sdo.intermediate.CreateDataObjectFromXmlString;
-import org.apache.tuscany.samples.sdo.intermediate.DynamicCustomerTypeSample;
-import org.apache.tuscany.samples.sdo.intermediate.SerializingDeserializingADataObject;
-import org.apache.tuscany.samples.sdo.otherSources.PurchaseOrderCmdLine;
-import org.apache.tuscany.samples.sdo.specExampleSection.CreatingDataObjectTreesFromXMLDocuments;
-import org.apache.tuscany.samples.sdo.specExampleSection.UsingTypeAndPropertyWithDataObjects;
/**
- * Executes all command line samples. <br>
- * <br>
- * <b>Usage:</b> <br>
- * This sample can easily be run from within Eclipse as a Java Application if Tuscany or
- * the sample-sdo project is imported into Eclipse as an existing project.
- * <br><br>
- * If executing as a standalone application please do the following:
- * <br>
- * <UL>
- * <LI>Include the following jar files on your classpath :
- * <UL>
- * <LI>SDO API and Tuscany Implementation
- * <UL>
- * <LI>sdo-api-{version}.jar - SDO API
- * <LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation
- * </UL>
- * </LI>
- * <LI>EMF dependencies.
- * <UL>
- * <LI>emf-common-{version}.jar - some common framework utility and base classes
- * <LI>emf-ecore-{version}.jar - the EMF core runtime implementation classes (the Ecore metamodel)
- * <LI>emf-ecore-change-{version}.jar - the EMF change recorder and framework
- * <LI>emf-ecore-xmi-{version}.jar - EMF's default XML (and XMI) serializer and loader
- * <LI>xsd-{version}.jar - the XML Schema model
- * </UL>
- * </LI>
- * </UL>
- * <LI>Execute: <br>
- * java org.apache.tuscany.samples.sdo.ExecuteSamples </LI>
- * </UL>
+ * A program to execute a sequence of SDO sample programs. The program executes
+ * the sample programs listed in the {@link SampleInfrastructure#sampleClasses sample classes}
+ * static constant. These samples are executed in roughly increasing order of complexity.
+ * You can edit the {@link #pauseBetweenSamples}, {@link #runSamplesUpToLevel} and
+ * {@link #constructorArgs} variables to change the way this program executes the samples.
+ *
+ * <P>
+ * Each of the samples creates text output to the console. If the commentary
+ * level in {@link #constructorArgs the sample program constructor arguments}
+ * used to construct each sample is set to
+ * {@link SampleInfrastructure#COMMENTARY_FOR_NOVICE COMMENTARY_FOR_NOVICE} then there
+ * will be much more output than if set to one of the other values.
+ *
*/
public class ExecuteSamples {
- /**
- * @param args
- */
- public static void main(String[] args) {
- try {
-
- System.out.println("Welcome to SDO Sample Land");
- System.out.println("This class will simply execute samples within this jar file");
-
- BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
- System.out.println();
- System.out.println();
- System.out.println("There are currently three groups of samples");
- System.out.println("1. Simple code snippets located throughout the specifiction with comparative methods for acheiving the same results");
- System.out.println("2. Full examples located within Examples section of specification");
- System.out.println("3. Other sample sources such as white papers and online articles");
- System.out.println(">>>Press Enter to continue");
- in.readLine();
- System.out
- .println("--------------------------------------------------------------------------------------------------------------------------");
- System.out
- .println("Lets start with some basics. These samples are located within the org.apache.tuscany.sdo.samples.specCodeSnipets package."
- + " They demonstrate many code snippets that are located throughout the SDO specification");
- System.out
- .println("--------------------------------------------------------------------------------------------------------------------------");
-
- System.out.println(">>>Press Enter to continue");
- in.readLine();
- CreateDataObjectFromXmlString.main(args);
- System.out.println(">>>Press Enter for next sample");
- in.readLine();
- AccessDataObjectPropertiesByName.main(args);
- System.out.println(">>>Press Enter to continue");
- in.readLine();
-
- //The following samples are still under construction
-
- //CreateXmlAndXsdFromDataObject.main(args);
- //System.out.println(">>>Press Enter for next sample");
- //in.readLine();
- //DataObjectWithChangeSummary.main(args);
- //System.out.println(">>>Press Enter for next sample");
- //in.readLine();
-
- DynamicCustomerTypeSample.main(args);
- System.out.println(">>>Press Enter for next sample");
- in.readLine();
-
- ObtainingDataGraphFromXml.main(args);
-
- System.out.println();
- System.out
- .println("--------------------------------------------------------------------------------------------------------------------------");
- System.out
- .println("The following group of samples implement the examples located within Examples section of specification and are located in "
- + "the org.apache.tuscany.sdo.samples.specExampleSection package");
- System.out
- .println("--------------------------------------------------------------------------------------------------------------------------");
-
- System.out.println(">>>Press Enter to continue");
- in.readLine();
-
-
- AccessingDataObjectsViaPropertyIndex.main(args);
- System.out.println(">>>Press Enter for next sample");
- in.readLine();
-
- AccessingTheContentsOfASequence.main(args);
- System.out.println(">>>Press Enter for next sample");
- in.readLine();
-
- CreatingDataObjectTreesFromXMLDocuments.main(args);
- System.out.println(">>>Press Enter for next sample");
- in.readLine();
-
- SerializingDeserializingADataObject.main(args);
- System.out.println(">>>Press Enter for next sample");
- in.readLine();
-
- UsingTypeAndPropertyWithDataObjects.main(args);
- System.out.println(">>>Press Enter for next sample");
- in.readLine();
-
- System.out.println();
- System.out
- .println("--------------------------------------------------------------------------------------------------------------------------");
- System.out.println("The following group of samples come from sources other than the specification");
- System.out
- .println("--------------------------------------------------------------------------------------------------------------------------");
-
- System.out
- .println("The next two samples are based upon Fuhwei Lwo's paper http://www-128.ibm.com/developerworks/webservices/library/ws-sdoxmlschema/");
- System.out.println(">>>Press Enter to continue");
- in.readLine();
- CreatePurchaseOrder.main(args);
- System.out.println(">>>Press Enter for next sample");
- in.readLine();
- ReadPurchaseOrder.main(args);
-
- System.out.println();
- System.out.println();
- System.out
- .println("The following sample is slightly more extensive and provides a interactive menu to play with purchase order DataObjects");
- System.out.println(">>>Press Enter to continue");
- in.readLine();
- PurchaseOrderCmdLine.main(args);
-
- } catch (Exception e) {
- System.out.println("Sorry an exception was encountered " + e.toString());
- e.printStackTrace();
+ /**
+ * Edit this value to cause the program to pause between each sample program
+ * and wait for the user to hit the enter key.
+ */
+ private static final boolean pauseBetweenSamples = true;
+
+ /**
+ * By default run all samples from novice level right up to advanced level.
+ * Edit this to run fewer samples.
+ */
+ private static final int runSamplesUpToLevel = SampleInfrastructure.SAMPLE_LEVEL_ADVANCED.intValue();
+
+ /**
+ * Edit the value of this argument to one of COMMENTARY_FOR_NOVICE, COMMENTARY_FOR_INTERMEDIATE or COMMENTARY_FOR_ADVANCED to see
+ * more or less commentary. Note, this value only controls the level of commentary,
+ * not which samples are executed. Use it to filter out the noise if you have already
+ * understood the more basic commentary.
+ */
+ private static final Object[] constructorArgs = { SampleInfrastructure.COMMENTARY_FOR_NOVICE };
+
+
+ public static void main(String [] args) throws SecurityException, NoSuchMethodException, IllegalArgumentException, InstantiationException, IllegalAccessException, InvocationTargetException, IOException {
+
+
+
+ Class[] constructorArgTypes = { Integer.class };
+
+
+ BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
+
+ int sampleCount = 0;
+ for (int i=0; i < SampleInfrastructure.sampleClasses.length; i++) {
+ Constructor c = SampleInfrastructure.sampleClasses[i].getConstructor(constructorArgTypes);
+ SampleBase sample = (SampleBase)c.newInstance(constructorArgs);
+ if(sample.getSampleComplexityLevel() <= runSamplesUpToLevel) {
+ sample.run();
+ sampleCount++;
+ if(pauseBetweenSamples) {
+ System.out.println(">>>Press Enter to continue");
+ in.readLine();
}
- System.out.println("All done, goodBye");
-
+ }
}
-
-}
+ System.out.println("Ran " + sampleCount + " samples");
+ }
+}
\ No newline at end of file
Modified: incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/MedicalScenario.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/MedicalScenario.java?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/MedicalScenario.java (original)
+++ incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/MedicalScenario.java Tue Jul 10 02:37:15 2007
@@ -23,7 +23,6 @@
import java.util.List;
import org.apache.tuscany.samples.sdo.SampleBase;
-import org.apache.tuscany.samples.sdo.SampleInfrastructure.SDOFacets;
import org.apache.tuscany.sdo.api.SDOUtil;
import commonj.sdo.DataObject;
Modified: incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/ObtainingDataGraphFromXml.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/ObtainingDataGraphFromXml.java?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/ObtainingDataGraphFromXml.java (original)
+++ incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/advanced/ObtainingDataGraphFromXml.java Tue Jul 10 02:37:15 2007
@@ -165,7 +165,7 @@
"loading a data graph which uses a method, XMLHelper.load(). This loads an XML instance document\n"+
"into an instance of XMLDocument ...\n\n"+
"XMLDocument doc = scope.getXMLHelper().load(\n"+
- "ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_DATAGRAPH_XML));"
+ "ClassLoader.getSystemResourceAsStream(SampleInfrastructure.COMPANY_DATAGRAPH_XML));"
);
InputStream is = ClassLoader.getSystemResourceAsStream(SampleInfrastructure.COMPANY_DATAGRAPH_XML);
@@ -211,7 +211,7 @@
"The SDO API has some limitations in the area of saving and loading instances of the\n"+
"Java DataGraph type, so Tuscany has an API for doing this ...\n\n"+
"DataGraph datagraph = SDOUtil.loadDataGraph(\n"+
- " ClassLoader.getSystemResourceAsStream(SdoSampleConstants.COMPANY_DATAGRAPH_XML), null);"
+ " ClassLoader.getSystemResourceAsStream(SampleInfrastructure.COMPANY_DATAGRAPH_XML), null);"
);
Modified: incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/AccessDataObjectPropertiesByName.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/AccessDataObjectPropertiesByName.java?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/AccessDataObjectPropertiesByName.java (original)
+++ incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/AccessDataObjectPropertiesByName.java Tue Jul 10 02:37:15 2007
@@ -64,7 +64,7 @@
banner("This sample will access a DataObject's properties by name\n"+
"Take a look at the sample code to see all the uses of dataObject.get(String)\n"+
- "dataObject.getList(String) and dataobhect.getdataObject(String)");
+ "dataObject.getList(String) and dataObject.getDataObject(String)");
// setting up the type system for the example, see the utility methods for details of these operations
HelperContext scope = createScopeForTypes();
@@ -72,6 +72,7 @@
DataObject purchaseOrder = getDataObjectFromFile(scope, SampleInfrastructure.PO_XML_RESOURCE);
+ // FIXME still converting this sample
System.out.println("Accessing properties by name");
System.out.println("Purchase Order: ");
Modified: incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/CreateCompany.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/CreateCompany.java?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/CreateCompany.java (original)
+++ incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/CreateCompany.java Tue Jul 10 02:37:15 2007
@@ -87,7 +87,7 @@
commentary(
"Now that our type system has been loaded and made available through the scope\n"+
"DataObjects can be created by a DataFactory that has access to the required types.\n\n"+
- "DataObject company = scope.getDataFactory().create(SdoSampleConstants.COMPANY_NAMESPACE, \"CompanyType\");");
+ "DataObject company = scope.getDataFactory().create(SampleInfrastructure.COMPANY_NAMESPACE, \"CompanyType\");");
DataObject company = scope.getDataFactory().create(SampleInfrastructure.COMPANY_NAMESPACE, "CompanyType");
@@ -97,13 +97,13 @@
commentary(
"The XMLHelper can be used to write an XML serialized version of the data graph\n\n"+
- "scope.getXMLHelper().save(company, SdoSampleConstants.COMPANY_NAMESPACE, \"company\", fos);");
+ "scope.getXMLHelper().save(company, SampleInfrastructure.COMPANY_NAMESPACE, \"company\", fos);");
scope.getXMLHelper().save(company, SampleInfrastructure.COMPANY_NAMESPACE, "company", fos);
commentary(
"Similarly we can serialize the graph to an XML String using the XMLHelper\n\n"+
- "String xml = scope.getXMLHelper().save(company, SdoSampleConstants.COMPANY_NAMESPACE, \"company\");\n");
+ "String xml = scope.getXMLHelper().save(company, SampleInfrastructure.COMPANY_NAMESPACE, \"company\");\n");
String xml = scope.getXMLHelper().save(company, SampleInfrastructure.COMPANY_NAMESPACE, "company");
Modified: incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/CreatePurchaseOrder.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/CreatePurchaseOrder.java?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/CreatePurchaseOrder.java (original)
+++ incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/basic/CreatePurchaseOrder.java Tue Jul 10 02:37:15 2007
@@ -119,7 +119,7 @@
"We are creating a DataObject using a DataFactory by specifying the URI and name of\n"+
"the Type that we want to use for the DataObject.\n\n"+
"DataFactory factory = scope.getDataFactory();\n"+
- "DataObject purchaseOrder = factory.create(SdoSampleConstants.PO_NAMESPACE, \"PurchaseOrderType\");");
+ "DataObject purchaseOrder = factory.create(SampleInfrastructure.PO_NAMESPACE, \"PurchaseOrderType\");");
DataFactory factory = scope.getDataFactory();
DataObject purchaseOrder = factory.create(SampleInfrastructure.PO_NAMESPACE, "PurchaseOrderType");
@@ -168,8 +168,8 @@
"Now we use the XMLHelper to write an XML document representing the data graph\n"+
"to a file. We must supply a namespace and a name for the root element of the graph, since it is\n"+
"not contained in the DataObject\n\n"+
- "OutputStream stream = new FileOutputStream(SdoSampleConstants.PO_XML_GENERATED);\n"+
- "scope.getXMLHelper().save(purchaseOrder, SdoSampleConstants.PO_NAMESPACE, \"purchaseOrder\", stream);"
+ "OutputStream stream = new FileOutputStream(SampleInfrastructure.PO_XML_GENERATED);\n"+
+ "scope.getXMLHelper().save(purchaseOrder, SampleInfrastructure.PO_NAMESPACE, \"purchaseOrder\", stream);"
);
@@ -182,7 +182,7 @@
"This has the advantage that the namespace URI and root element name are preserved in the Object\n"+
"This interface was introduced after Fuhwei's paper, and has particular advantage\n"+
"when loading an XML document from a file\n\n"+
- "scope.getXMLHelper().createDocument(purchaseOrder, SdoSampleConstants.PO_NAMESPACE, \"purchaseOrder\");\n"+
+ "scope.getXMLHelper().createDocument(purchaseOrder, SampleInfrastructure.PO_NAMESPACE, \"purchaseOrder\");\n"+
"scope.getXMLHelper().save(doc, System.out, null);");
Modified: incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/intermediate/CreateCompanyTuscanyAPI.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/intermediate/CreateCompanyTuscanyAPI.java?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/intermediate/CreateCompanyTuscanyAPI.java (original)
+++ incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/intermediate/CreateCompanyTuscanyAPI.java Tue Jul 10 02:37:15 2007
@@ -119,7 +119,7 @@
commentary(COMMENTARY_FOR_INTERMEDIATE,
"Now we create a root object of a selected type for the DataGraph wrapper to contain.\n"+
"This is an example of a DataGraph interface that currently forces us to use the default scope.\n\n"+
- "company = dataGraph.createRootObject(SdoSampleConstants.COMPANY_NAMESPACE, \"CompanyType\");");
+ "company = dataGraph.createRootObject(SampleInfrastructure.COMPANY_NAMESPACE, \"CompanyType\");");
DataObject company = dataGraph.createRootObject(SampleInfrastructure.COMPANY_NAMESPACE, "CompanyType");
Modified: incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/overview.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/overview.html?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/overview.html (original)
+++ incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/overview.html Tue Jul 10 02:37:15 2007
@@ -44,6 +44,7 @@
<LI>The SDO API and the Tuscany SDO Implementation
<UL>
<LI>sdo-api-{version}.jar - SDO API</LI>
+ <LI>tuscany-sdo-lib-{version}.jar - Tuscany APIs and support function</LI>
<LI>tuscany-sdo-impl-{version}.jar - Tuscany SDO implementation</LI>
</UL>
</LI>
Modified: incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/sampleProgramContents.html
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/sampleProgramContents.html?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/sampleProgramContents.html (original)
+++ incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/sampleProgramContents.html Tue Jul 10 02:37:15 2007
@@ -1,4 +1,6 @@
<html>
+<!-- Note -- this file is GENERATED from the samples using the
+Document Samples utility. Hand edits will be lost when regenerated!-->
<!--
*
* Licensed to the Apache Software Foundation (ASF) under one
@@ -20,7 +22,14 @@
-->
<head><title>SDO Samples</title></head><body>
<h1>SDO Samples</h1>
-<H2>Index by Sample Program Name</H2>
+<P>
+The samples provided in the Tuscany SDO distribution cover many areas of
+the SDO API. Here we provide two indexes into the samples. The first lists
+each sample in sequence and details the central theme(s) of the sample.
+It also mentions if the sample significantly demonstrates other areas in passing.
+The second index lists all the themes that are covered by these samples, and
+indicates which of the samples has that subject area as a central theme or as
+demonstrates the subject area significant as an incidental part of the sample.<H2>Index by Sample Program Name</H2>
<h3>Sample Program CreateCompany</h3>
<b>Core function:</b><br/>
<a href="#facet2">Set Properties of DataObject by name</a><br/>
Modified: incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/util/DocumentSamples.java
URL: http://svn.apache.org/viewvc/incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/util/DocumentSamples.java?view=diff&rev=554885&r1=554884&r2=554885
==============================================================================
--- incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/util/DocumentSamples.java (original)
+++ incubator/tuscany/java/sdo/sample/src/main/java/org/apache/tuscany/samples/sdo/util/DocumentSamples.java Tue Jul 10 02:37:15 2007
@@ -31,6 +31,17 @@
import org.apache.tuscany.samples.sdo.SampleInfrastructure;
import org.apache.tuscany.samples.sdo.SampleInfrastructure.SDOFacets;
+/**
+ * Class to generate html documentation for the SDO Samples.
+ * The program introspects the sample programs listed in the
+ * {@link SampleInfrastructure#sampleClasses sample classes}
+ * static constant, for the values of the static CORE_FUNCTION
+ * and SIGNIFICANT_FUNCTION variables.
+ * <P>
+ * It builds indexes from
+ * sample to function and from function to sample and creates
+ * html output that displays these indexes.
+ */
public class DocumentSamples {
private Map classToCoreFunction = new HashMap();
@@ -48,7 +59,9 @@
}
private static String HTML_HEADER =
- "<html>\n"+
+ "<html>\n" +
+ "<!-- Note -- this file is GENERATED from the samples using the\n" +
+ "Document Samples utility. Hand edits will be lost when regenerated!-->\n"+
"<!-- \n"+
"* \n"+
"* Licensed to the Apache Software Foundation (ASF) under one \n"+
@@ -69,7 +82,15 @@
"* under the License. \n"+
"--> \n"+
"<head><title>SDO Samples</title></head><body>\n" +
- " <h1>SDO Samples</h1>\n";
+ " <h1>SDO Samples</h1>\n" +
+ "<P>\n" +
+ "The samples provided in the Tuscany SDO distribution cover many areas of\n" +
+ "the SDO API. Here we provide two indexes into the samples. The first lists\n" +
+ "each sample in sequence and details the central theme(s) of the sample.\n" +
+ "It also mentions if the sample significantly demonstrates other areas in passing.\n" +
+ "The second index lists all the themes that are covered by these samples, and\n" +
+ "indicates which of the samples has that subject area as a central theme or as\n" +
+ "demonstrates the subject area significant as an incidental part of the sample.";
private static String CLASSES_HEADING =
"<H2>Index by Sample Program Name</H2>\n";
---------------------------------------------------------------------
To unsubscribe, e-mail: tuscany-commits-unsubscribe@ws.apache.org
For additional commands, e-mail: tuscany-commits-help@ws.apache.org