diff options
Diffstat (limited to 'sca-cpp/branches/cpp-M1/sdo/samples')
36 files changed, 2430 insertions, 0 deletions
diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/AUTHORS b/sca-cpp/branches/cpp-M1/sdo/samples/AUTHORS new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/AUTHORS diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/COPYING b/sca-cpp/branches/cpp-M1/sdo/samples/COPYING new file mode 100755 index 0000000000..6b0b1270ff --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/COPYING @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed 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. + diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ChangeLog b/sca-cpp/branches/cpp-M1/sdo/samples/ChangeLog new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ChangeLog diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/GettingStarted.html b/sca-cpp/branches/cpp-M1/sdo/samples/GettingStarted.html new file mode 100644 index 0000000000..df5fa3ffb1 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/GettingStarted.html @@ -0,0 +1,173 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> +<HTML> +<HEAD> + <META CONTENT="text/html; charset=iso-8859-1" HTTP-EQUIV="Content-Type"> + <META CONTENT="text/css" HTTP-EQUIV="Content-Style-Type"> + <STYLE MEDIA="all" TYPE="text/css"> +@import url("../doc/css/maven-base.css"); +@import url("../doc/css/maven-theme.css"); + </STYLE> + + <LINK HREF="../doc/css/maven-theme.css" MEDIA="print" REL="stylesheet" + TYPE="text/css"> + <TITLE>Tuscany SDO C++ Samples - Getting Started</TITLE> +</HEAD> + +<BODY> +<DIV ID="bodyColumn"> + <DIV ID="contentBox"> + <DIV CLASS="section"> + <H2>Tuscany Samples - Getting Started - SDO C++ Milestone release 1</H2> + + <P>Tuscany SDO C++ includes some simple technology samples that demonstrate some of the basic sceanrios for C++ SDO. + This page describes the samples and what is needed to install and run them. + </P> + <P>The ObjectCreation sample demonstrates building the metadata programmatically, followed by use + of the metadata to instantiate objects in a graph. + </P> + <P>The XSDLoading sample shows how to load metadata from an XSD, and how to check for errors during + parsing. The parser gathers all non-fatal errors into one list, so all errors can be checked at one + time after parsing. Elements which contained errors will have been omitted from the resulting metadata. + </P> + <P>The ChangeSummarySave sample modifies a data graph of employees, and saves the modified graph with + its change summary. The output in ChangeSummarySave-output.xml shows the summary and its relationship + by references to the data graph. + </P> + <P>The Substitutes sample shows how to use substitites in XSD to achieve a property which will accept a + range of types. + </P> + <P>The Query sample shows how to use XPath to navigate within a graph to the required element. Note + that exceptions such as "path not found" may well be thrown if the XPath specified does not lead to + a real object in the graph. + </P> + <P>The SDO samples are built together into a single executable called sdo_misc.exe on Windows and sdo_misc on Linux + </P> + </DIV> + + <DIV CLASS="section"> + <H2>Contents</H2> + <OL> + <LI><A HREF="#linuxbld">Building the samples on Linux</A></LI> + <LI><A HREF="#linuxrun">Running the samples on Linux</A></LI> + <LI><A HREF="#winbld">Building the samples on Windows</A></LI> + <LI><A HREF="#winrun">Running the samples on Windows</A></LI> + </OL> + </DIV> + + + <DIV CLASS="section"> + <A NAME="linuxbld"><H2>Building the samples on Linux</H2></A> + <P>If using the binary distribution the samples are built and installed in + <tuscany_sdo_install_dir>/samples - go directly to <A HREF="#linuxrun">Running the samples on Linux</A>.</P> + <OL> + <LI>The following environment variables are required: + <UL> + <LI>TUSCANY_SDOCPP=<path to installed Tuscany SDO> + <LI>AXIS2C_HOME=<path to axis2c version 0.92></LI> + </UL></LI> + </LI> + <LI>Build the source with the following command sequence: + <UL> + <LI>cd <tuscany_sdo_install_dir>/samples</LI> + <LI>./configure</LI> + <LI>make</LI> + <LI>make install</LI> + </UL> + NOTE: If you don't provide a --prefix configure option, it will by default install into + /usr/local/tuscany/sdo/samples/misc</LI> + </OL> + </DIV> + + <DIV CLASS="section"> + <A NAME="linuxrun"><H2>Running the samples on Linux</H2></A> + <OL> + <LI>Ensure that <tuscany_sdo_install_dir>/lib is included in the LD_LIBRARY_PATH environment variable + </LI> + <LI>Run the sample with the following commands: + <UL> + <LI>cd <tuscany_sdo_install_dir>/samples/misc/deploy</LI> + <LI>./bin/sdo_misc</LI> + </UL> + </LI> + </OL> + </DIV> + + <DIV CLASS="section"> + <A NAME="winbld"><H2>Building the samples on Windows</H2></A> + <P>If using the binary distribution the samples are built and installed in + <tuscany_sdo_install_dir>/samples - go directly to <A HREF="#winrun">Running the samples on Windows</A>.</P> + <OL> + <LI>The following environment variables are required: + <UL> + <LI>TUSCANY_SDOCPP=<path to installed Tuscany SDO> + <LI>AXIS2C_HOME=<path to axis2c version 0.92></LI> + </UL></LI> + </LI> + <LI>You must have set up the environment for Microsoft Visual C++ tools. + The build command will call vcvars32 to set the environment. Ensure the + directory containing this is on your path. This will be where you + installed the compiler. + </LI> + <LI>Build the source, either via the Visual Studio 6 project under + <tuscany_sdo_install_dir>\samples\ides or via the command-line build file + found at <tuscany_sdo_install_dir>\samples\ides\devstudio6\projects\misc\build.cmd + which will build and deploy the samples. + </LI> + </OL> + </DIV> + + <DIV CLASS="section"> + <A NAME="winrun"><H2>Running the samples on Windows</H2></A> + <OL> + <LI>Ensure that <tuscany_sdo_install_dir>\bin is included in the PATH environment variable + </LI> + <LI>Run the sample with the following commands: + <UL> + <LI>cd <tuscany_sdo_install_dir>/samples/misc/deploy</LI> + <LI>bin\sdo_misc</LI> + </UL> + </LI> + </OL> + </DIV> + + + <DIV CLASS="section"> + <A NAME="help"><H2>Getting Help</H2></A> + + <P>First place to look is at the Tuscany FAQ at + <A HREF="http://incubator.apache.org/tuscany/faq.html" + TARGET="_blank">http://incubator.apache.org/tuscany/faq.html</A> </P> + + <P>Any problem with this release can be reported to the Tuscany + <A HREF="http://incubator.apache.org/tuscany/mail-lists.html" + TARGET="_blank">mailing lists</A> or create a JIRA issue at <A HREF="http://issues.apache.org/jira/browse/Tuscany" + TARGET="_blank">http://issues.apache.org/jira/browse/Tuscany</A>.</P> + + + <P> </P> + + <P> </P> + + <P> </P> + <TABLE CLASS="bodyTable"> + <TBODY> + <TR CLASS="a"> + <TD> + + <P>Thank you for your interest in Tuscany.</P> <STRONG><EM>-The + Tuscany Development Team</EM></STRONG> + + <P></P> + + </TD> + </TR> + </TBODY> + </TABLE> + + <P></P> + </DIV> + </DIV> +</DIV> +</BODY> + +</HTML> diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/INSTALL b/sca-cpp/branches/cpp-M1/sdo/samples/INSTALL new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/INSTALL diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/LICENSE b/sca-cpp/branches/cpp-M1/sdo/samples/LICENSE new file mode 100755 index 0000000000..f433b1a53f --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/LICENSE @@ -0,0 +1,177 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/Makefile.am b/sca-cpp/branches/cpp-M1/sdo/samples/Makefile.am new file mode 100644 index 0000000000..68251b1e10 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/Makefile.am @@ -0,0 +1,3 @@ +SUBDIRS = misc + +EXTRA_DIST = GettingStarted.html diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/NEWS b/sca-cpp/branches/cpp-M1/sdo/samples/NEWS new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/NEWS diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/NOTICE b/sca-cpp/branches/cpp-M1/sdo/samples/NOTICE new file mode 100644 index 0000000000..bfb81409ad --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/NOTICE @@ -0,0 +1,2 @@ +This product includes software developed by +The Apache Software Foundation (http://www.apache.org/)
\ No newline at end of file diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/README b/sca-cpp/branches/cpp-M1/sdo/samples/README new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/README diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/autogen.sh b/sca-cpp/branches/cpp-M1/sdo/samples/autogen.sh new file mode 100755 index 0000000000..3cebb0a380 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/autogen.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +for i in "libtoolize --force" aclocal autoconf autoheader +do + echo -n "Running $i..." + $i || exit 1 + echo 'done.' +done + +echo -n 'Running automake...' +automake --add-missing +echo 'done.' +exit 0 + diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/build.sh b/sca-cpp/branches/cpp-M1/sdo/samples/build.sh new file mode 100755 index 0000000000..adfc9e6ae9 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/build.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Copyright 2005 The Apache Software Foundation or its licensors, as applicable. +# +# Licensed 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. + +if [ x$TUSCANY_SDOCPP = x ]; then +echo "TUSCANY_SDOCPP not set" +exit; +fi +echo "Using SDO installed at $TUSCANY_SDOCPP" + +if [ x$AXIS2C_HOME = x ]; then +echo "AXIS2C_HOME not set" +exit; +fi +echo "Using Axis2C installed at $AXIS2C_HOME" + +./configure --prefix=${TUSCANY_SDOCPP} --enable-static=no +make +make install + diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/configure.ac b/sca-cpp/branches/cpp-M1/sdo/samples/configure.ac new file mode 100644 index 0000000000..6fb77f3dd3 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/configure.ac @@ -0,0 +1,23 @@ +dnl run autogen.sh to generate the configure script. + +AC_PREREQ(2.59) +AC_INIT(tuscany_sdo_samples, 0.1.incubating-M1) +AC_CANONICAL_SYSTEM +AM_CONFIG_HEADER(config.h) +AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION) +AC_PREFIX_DEFAULT(/usr/local/tuscany/sdo/samples) + +# Checks for programs. +AC_PROG_CXX +AC_PROG_CC +AC_PROG_CPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AC_PROG_LIBTOOL + +AC_CONFIG_FILES([Makefile + misc/Makefile + ]) +AC_OUTPUT + diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/build.cmd b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/build.cmd new file mode 100644 index 0000000000..c43c1b17ef --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/build.cmd @@ -0,0 +1,23 @@ +@echo off + +@REM Copyright 2006 The Apache Software Foundation or its licensors, as applicable. +@REM +@REM Licensed under the Apache License, Version 2.0 (the "License"); +@REM you may not use this file except in compliance with the License. +@REM 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, software +@REM distributed under the License is distributed on an "AS IS" BASIS, +@REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +@REM See the License for the specific language governing permissions and +@REM limitations under the License. +setlocal +if not exist ..\..\..\..\misc\deploy mkdir ..\..\..\..\misc\deploy +if not exist ..\..\..\..\misc\deploy\bin mkdir ..\..\..\..\misc\deploy\bin +call vcvars32 +cd sdo_misc +nmake -f sdo_misc.mak CFG="sdo_misc - Win32 Release" +cd .. +endlocal diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/misc.dsw b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/misc.dsw new file mode 100644 index 0000000000..816b3b2f93 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/misc.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "sdo_misc"=.\sdo_misc\sdo_misc.dsp - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/misc.ncb b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/misc.ncb Binary files differnew file mode 100644 index 0000000000..e05deb80a8 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/misc.ncb diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/misc.opt b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/misc.opt Binary files differnew file mode 100644 index 0000000000..8e3cd5168a --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/misc.opt diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/sdo_misc/BuildInstructions.txt b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/sdo_misc/BuildInstructions.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/sdo_misc/BuildInstructions.txt diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/sdo_misc/sdo_misc.dsp b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/sdo_misc/sdo_misc.dsp new file mode 100644 index 0000000000..ad3c9daae4 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/sdo_misc/sdo_misc.dsp @@ -0,0 +1,156 @@ +# Microsoft Developer Studio Project File - Name="sdo_misc" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Console Application" 0x0103
+
+CFG=sdo_misc - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "sdo_misc.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "sdo_misc.mak" CFG="sdo_misc - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "sdo_misc - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "sdo_misc - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "sdo_misc - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /I "$(TUSCANY_SDOCPP)\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FD /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib /nologo /subsystem:console /machine:I386 /libpath:"$(TUSCANY_SDOCPP)\lib"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=if not exist ..\..\..\..\..\misc\deploy mkdir ..\..\..\..\..\misc\deploy if not exist ..\..\..\..\..\misc\deploy\bin mkdir ..\..\..\..\..\misc\deploy\bin copy ..\..\..\..\..\misc\*.xsd ..\..\..\..\..\misc\deploy copy ..\..\..\..\..\misc\*.xml ..\..\..\..\..\misc\deploy copy Release\*.exe ..\..\..\..\..\misc\deploy\bin
+# End Special Build Tool
+
+!ELSEIF "$(CFG)" == "sdo_misc - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(TUSCANY_SDOCPP)\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FD /GZ /c
+# SUBTRACT CPP /YX
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"$(TUSCANY_SDOCPP)\lib"
+# Begin Special Build Tool
+SOURCE="$(InputPath)"
+PostBuild_Cmds=if not exist ..\..\..\..\..\misc\deploy mkdir ..\..\..\..\..\misc\deploy if not exist ..\..\..\..\..\misc\deploy\bin mkdir ..\..\..\..\..\misc\deploy\bin copy ..\..\..\..\..\misc\*.xsd ..\..\..\..\..\misc\deploy copy ..\..\..\..\..\misc\*.xml ..\..\..\..\..\misc\deploy copy Debug\*.exe ..\..\..\..\..\misc\deploy\bin
+# End Special Build Tool
+
+!ENDIF
+
+# Begin Target
+
+# Name "sdo_misc - Win32 Release"
+# Name "sdo_misc - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\ChangeSummarySave.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\ObjectCreation.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\Query.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\samples.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\Substitutes.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\XSDLoading.cpp
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\samples.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\ChangeSummarySave.xsd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\companysubs.xsd
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\XSDLoading.xml
+# End Source File
+# Begin Source File
+
+SOURCE=..\..\..\..\..\misc\XSDLoading.xsd
+# End Source File
+# End Group
+# Begin Source File
+
+SOURCE=.\BuildInstructions.txt
+# End Source File
+# End Target
+# End Project
diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/sdo_misc/sdo_misc.mak b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/sdo_misc/sdo_misc.mak new file mode 100644 index 0000000000..2b382d844a --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio6/projects/misc/sdo_misc/sdo_misc.mak @@ -0,0 +1,266 @@ +# Microsoft Developer Studio Generated NMAKE File, Based on sdo_misc.dsp
+!IF "$(CFG)" == ""
+CFG=sdo_misc - Win32 Debug
+!MESSAGE No configuration specified. Defaulting to sdo_misc - Win32 Debug.
+!ENDIF
+
+!IF "$(CFG)" != "sdo_misc - Win32 Release" && "$(CFG)" != "sdo_misc - Win32 Debug"
+!MESSAGE Invalid configuration "$(CFG)" specified.
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "sdo_misc.mak" CFG="sdo_misc - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "sdo_misc - Win32 Release" (based on "Win32 (x86) Console Application")
+!MESSAGE "sdo_misc - Win32 Debug" (based on "Win32 (x86) Console Application")
+!MESSAGE
+!ERROR An invalid configuration is specified.
+!ENDIF
+
+!IF "$(OS)" == "Windows_NT"
+NULL=
+!ELSE
+NULL=nul
+!ENDIF
+
+!IF "$(CFG)" == "sdo_misc - Win32 Release"
+
+OUTDIR=.\Release
+INTDIR=.\Release
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+ALL : "$(OUTDIR)\sdo_misc.exe"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\ChangeSummarySave.obj"
+ -@erase "$(INTDIR)\ObjectCreation.obj"
+ -@erase "$(INTDIR)\Query.obj"
+ -@erase "$(INTDIR)\samples.obj"
+ -@erase "$(INTDIR)\Substitutes.obj"
+ -@erase "$(INTDIR)\vc60.idb"
+ -@erase "$(INTDIR)\XSDLoading.obj"
+ -@erase "$(OUTDIR)\sdo_misc.exe"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MD /W3 /GX /I "$(TUSCANY_SDOCPP)\include" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /c
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\sdo_misc.bsc"
+BSC32_SBRS= \
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib /nologo /subsystem:console /incremental:no /pdb:"$(OUTDIR)\sdo_misc.pdb" /machine:I386 /out:"$(OUTDIR)\sdo_misc.exe" /libpath:"$(TUSCANY_SDOCPP)\lib"
+LINK32_OBJS= \
+ "$(INTDIR)\ChangeSummarySave.obj" \
+ "$(INTDIR)\ObjectCreation.obj" \
+ "$(INTDIR)\Query.obj" \
+ "$(INTDIR)\samples.obj" \
+ "$(INTDIR)\Substitutes.obj" \
+ "$(INTDIR)\XSDLoading.obj"
+
+"$(OUTDIR)\sdo_misc.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+SOURCE="$(InputPath)"
+DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
+
+ALL : $(DS_POSTBUILD_DEP)
+
+# Begin Custom Macros
+OutDir=.\Release
+# End Custom Macros
+
+$(DS_POSTBUILD_DEP) : "$(OUTDIR)\sdo_misc.exe"
+ copy ..\..\..\..\..\misc\*.xsd ..\..\..\..\..\misc\deploy
+ copy ..\..\..\..\..\misc\*.xml ..\..\..\..\..\misc\deploy
+ copy Release\*.exe ..\..\..\..\..\misc\deploy\bin
+ echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
+
+!ELSEIF "$(CFG)" == "sdo_misc - Win32 Debug"
+
+OUTDIR=.\Debug
+INTDIR=.\Debug
+# Begin Custom Macros
+OutDir=.\Debug
+# End Custom Macros
+
+ALL : "$(OUTDIR)\sdo_misc.exe"
+
+
+CLEAN :
+ -@erase "$(INTDIR)\ChangeSummarySave.obj"
+ -@erase "$(INTDIR)\ObjectCreation.obj"
+ -@erase "$(INTDIR)\Query.obj"
+ -@erase "$(INTDIR)\samples.obj"
+ -@erase "$(INTDIR)\Substitutes.obj"
+ -@erase "$(INTDIR)\vc60.idb"
+ -@erase "$(INTDIR)\vc60.pdb"
+ -@erase "$(INTDIR)\XSDLoading.obj"
+ -@erase "$(OUTDIR)\sdo_misc.exe"
+ -@erase "$(OUTDIR)\sdo_misc.ilk"
+ -@erase "$(OUTDIR)\sdo_misc.pdb"
+
+"$(OUTDIR)" :
+ if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
+
+CPP=cl.exe
+CPP_PROJ=/nologo /MDd /W3 /Gm /GX /ZI /Od /I "$(TUSCANY_SDOCPP)\include" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /Fo"$(INTDIR)\\" /Fd"$(INTDIR)\\" /FD /GZ /c
+
+.c{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.obj::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.c{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cpp{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+.cxx{$(INTDIR)}.sbr::
+ $(CPP) @<<
+ $(CPP_PROJ) $<
+<<
+
+RSC=rc.exe
+BSC32=bscmake.exe
+BSC32_FLAGS=/nologo /o"$(OUTDIR)\sdo_misc.bsc"
+BSC32_SBRS= \
+
+LINK32=link.exe
+LINK32_FLAGS=kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib tuscany_sdo.lib /nologo /subsystem:console /incremental:yes /pdb:"$(OUTDIR)\sdo_misc.pdb" /debug /machine:I386 /out:"$(OUTDIR)\sdo_misc.exe" /pdbtype:sept /libpath:"$(TUSCANY_SDOCPP)\lib"
+LINK32_OBJS= \
+ "$(INTDIR)\ChangeSummarySave.obj" \
+ "$(INTDIR)\ObjectCreation.obj" \
+ "$(INTDIR)\Query.obj" \
+ "$(INTDIR)\samples.obj" \
+ "$(INTDIR)\Substitutes.obj" \
+ "$(INTDIR)\XSDLoading.obj"
+
+"$(OUTDIR)\sdo_misc.exe" : "$(OUTDIR)" $(DEF_FILE) $(LINK32_OBJS)
+ $(LINK32) @<<
+ $(LINK32_FLAGS) $(LINK32_OBJS)
+<<
+
+SOURCE="$(InputPath)"
+DS_POSTBUILD_DEP=$(INTDIR)\postbld.dep
+
+ALL : $(DS_POSTBUILD_DEP)
+
+# Begin Custom Macros
+OutDir=.\Debug
+# End Custom Macros
+
+$(DS_POSTBUILD_DEP) : "$(OUTDIR)\sdo_misc.exe"
+ copy ..\..\..\..\..\misc\*.xsd ..\..\..\..\..\misc\deploy
+ copy ..\..\..\..\..\misc\*.xml ..\..\..\..\..\misc\deploy
+ copy Debug\*.exe ..\..\..\..\..\misc\deploy\bin
+ echo Helper for Post-build step > "$(DS_POSTBUILD_DEP)"
+
+!ENDIF
+
+
+!IF "$(NO_EXTERNAL_DEPS)" != "1"
+!IF EXISTS("sdo_misc.dep")
+!INCLUDE "sdo_misc.dep"
+!ELSE
+!MESSAGE Warning: cannot find "sdo_misc.dep"
+!ENDIF
+!ENDIF
+
+
+!IF "$(CFG)" == "sdo_misc - Win32 Release" || "$(CFG)" == "sdo_misc - Win32 Debug"
+SOURCE=..\..\..\..\..\misc\ChangeSummarySave.cpp
+
+"$(INTDIR)\ChangeSummarySave.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\..\..\..\misc\ObjectCreation.cpp
+
+"$(INTDIR)\ObjectCreation.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\..\..\..\misc\Query.cpp
+
+"$(INTDIR)\Query.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\..\..\..\misc\samples.cpp
+
+"$(INTDIR)\samples.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\..\..\..\misc\Substitutes.cpp
+
+"$(INTDIR)\Substitutes.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+SOURCE=..\..\..\..\..\misc\XSDLoading.cpp
+
+"$(INTDIR)\XSDLoading.obj" : $(SOURCE) "$(INTDIR)"
+ $(CPP) $(CPP_PROJ) $(SOURCE)
+
+
+
+!ENDIF
+
diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/misc.sln b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/misc.sln new file mode 100644 index 0000000000..e17079e801 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/misc.sln @@ -0,0 +1,21 @@ +Microsoft Visual Studio Solution File, Format Version 7.00
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sdo_misc", "sdo_misc\sdo_misc.vcproj", "{0B4E79E7-D66A-4501-9941-580C3E00A382}"
+EndProject
+Global
+ GlobalSection(SolutionConfiguration) = preSolution
+ ConfigName.0 = Debug
+ ConfigName.1 = Release
+ EndGlobalSection
+ GlobalSection(ProjectDependencies) = postSolution
+ EndGlobalSection
+ GlobalSection(ProjectConfiguration) = postSolution
+ {0B4E79E7-D66A-4501-9941-580C3E00A382}.Debug.ActiveCfg = Debug|Win32
+ {0B4E79E7-D66A-4501-9941-580C3E00A382}.Debug.Build.0 = Debug|Win32
+ {0B4E79E7-D66A-4501-9941-580C3E00A382}.Release.ActiveCfg = Release|Win32
+ {0B4E79E7-D66A-4501-9941-580C3E00A382}.Release.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ EndGlobalSection
+ GlobalSection(ExtensibilityAddIns) = postSolution
+ EndGlobalSection
+EndGlobal
diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/misc.suo b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/misc.suo Binary files differnew file mode 100644 index 0000000000..d31a854277 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/misc.suo diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/sdo_misc/BuildInstructions.txt b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/sdo_misc/BuildInstructions.txt new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/sdo_misc/BuildInstructions.txt diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/sdo_misc/sdo_misc.vcproj b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/sdo_misc/sdo_misc.vcproj new file mode 100644 index 0000000000..faf875dabd --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/ides/devstudio7/projects/misc/sdo_misc/sdo_misc.vcproj @@ -0,0 +1,182 @@ +<?xml version="1.0" encoding = "Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="7.00"
+ Name="sdo_misc"
+ SccProjectName=""
+ SccLocalPath="">
+ <Platforms>
+ <Platform
+ Name="Win32"/>
+ </Platforms>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ AdditionalIncludeDirectories="$(TUSCANY_SDOCPP)\include"
+ PreprocessorDefinitions="WIN32,NDEBUG,_CONSOLE"
+ RuntimeLibrary="2"
+ PrecompiledHeaderFile=".\Release/sdo_misc.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="odbc32.lib odbccp32.lib tuscany_sdo.lib"
+ OutputFile=".\Release/sdo_misc.exe"
+ LinkIncremental="1"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="$(TUSCANY_SDOCPP)\lib"
+ ProgramDatabaseFile=".\Release/sdo_misc.pdb"
+ SubSystem="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Release/sdo_misc.tlb"/>
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if not exist ..\..\..\..\..\misc\deploy mkdir ..\..\..\..\..\misc\deploy
+if not exist ..\..\..\..\..\misc\deploy\bin mkdir ..\..\..\..\..\misc\deploy\bin
+copy ..\..\..\..\..\misc\*.xsd ..\..\..\..\..\misc\deploy
+copy ..\..\..\..\..\misc\*.xml ..\..\..\..\..\misc\deploy
+copy Release\*.exe ..\..\..\..\..\misc\deploy\bin
+"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="2057"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="1"
+ UseOfMFC="0"
+ ATLMinimizesCRunTimeLibraryUsage="FALSE"
+ CharacterSet="2">
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="$(TUSCANY_SDOCPP)\include"
+ PreprocessorDefinitions="WIN32,_DEBUG,_CONSOLE"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="3"
+ PrecompiledHeaderFile=".\Debug/sdo_misc.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="TRUE"
+ DebugInformationFormat="4"
+ CompileAs="0"/>
+ <Tool
+ Name="VCCustomBuildTool"/>
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalOptions="/MACHINE:I386"
+ AdditionalDependencies="odbc32.lib odbccp32.lib tuscany_sdo.lib"
+ OutputFile=".\Debug/sdo_misc.exe"
+ LinkIncremental="2"
+ SuppressStartupBanner="TRUE"
+ AdditionalLibraryDirectories="$(TUSCANY_SDOCPP)\lib"
+ GenerateDebugInformation="TRUE"
+ ProgramDatabaseFile=".\Debug/sdo_misc.pdb"
+ SubSystem="1"/>
+ <Tool
+ Name="VCMIDLTool"
+ TypeLibraryName=".\Debug/sdo_misc.tlb"/>
+ <Tool
+ Name="VCPostBuildEventTool"
+ CommandLine="if not exist ..\..\..\..\..\misc\deploy mkdir ..\..\..\..\..\misc\deploy
+if not exist ..\..\..\..\..\misc\deploy\bin mkdir ..\..\..\..\..\misc\deploy\bin
+copy ..\..\..\..\..\misc\*.xsd ..\..\..\..\..\misc\deploy
+copy ..\..\..\..\..\misc\*.xml ..\..\..\..\..\misc\deploy
+copy Debug\*.exe ..\..\..\..\..\misc\deploy\bin
+"/>
+ <Tool
+ Name="VCPreBuildEventTool"/>
+ <Tool
+ Name="VCPreLinkEventTool"/>
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="2057"/>
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"/>
+ <Tool
+ Name="VCWebDeploymentTool"/>
+ </Configuration>
+ </Configurations>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">
+ <File
+ RelativePath="..\..\..\..\..\misc\ChangeSummarySave.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\misc\ObjectCreation.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\misc\Query.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\misc\Substitutes.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\misc\XSDLoading.cpp">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\misc\samples.cpp">
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl">
+ <File
+ RelativePath="..\..\..\..\..\misc\samples.h">
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe">
+ <File
+ RelativePath="..\..\..\..\..\misc\ChangeSummarySave.xsd">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\misc\XSDLoading.xml">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\misc\XSDLoading.xsd">
+ </File>
+ <File
+ RelativePath="..\..\..\..\..\misc\companysubs.xsd">
+ </File>
+ </Filter>
+ <File
+ RelativePath=".\BuildInstructions.txt">
+ </File>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/ChangeSummarySave.cpp b/sca-cpp/branches/cpp-M1/sdo/samples/misc/ChangeSummarySave.cpp new file mode 100644 index 0000000000..5d65ec1009 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/ChangeSummarySave.cpp @@ -0,0 +1,186 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +/* $Rev$ $Date: 2005/12/22 16:54:14 $ */ + +#include "samples.h" +using namespace std; + +void ChangeSummarySave::sample() +{ + cout << " ********** ChangeSummarySave sample********" << endl; + + try { + + DataFactoryPtr mdg = DataFactory::getDataFactory(); + + XSDHelperPtr xsh = HelperProvider::getXSDHelper(mdg); + xsh->defineFile("ChangeSummarySave.xsd"); + + /** + * Load the schema from ChangeSummarySave.xsd + */ + + const Type& tstring = mdg->getType("commonj.sdo","String"); + const Type& tbool = mdg->getType("commonj.sdo","Boolean"); + const Type& tcs = mdg->getType("commonj.sdo","ChangeSummary"); + const Type& tcomp = mdg->getType("companyNS","CompanyType"); + const Type& tdept = mdg->getType("companyNS","DepartmentType"); + const Type& temp = mdg->getType("companyNS","EmployeeType"); + + + /** + * create a graph, set the change summary logging, modify the + * data, then save it to a file + */ + + DataObjectPtr comp = mdg->create((Type&)tcomp); + comp->setCString("name","ACME"); + + DataObjectPtr dept = mdg->create((Type&)tdept); + DataObjectList& dol = comp->getList("departments"); + dol.append(dept); + + dept->setCString("name","Advanced Technologies"); + dept->setCString("location","NY"); + dept->setCString("number","123"); + + DataObjectPtr emp1 = mdg->create(temp); + DataObjectPtr emp2 = mdg->create(temp); + DataObjectPtr emp3 = mdg->create(temp); + + emp1->setCString("name","John Jones"); + emp1->setCString("SN","E0001"); + + emp2->setCString("name","Mary Smith"); + emp2->setCString("SN","E0002"); + emp2->setBoolean("manager",true); + + emp3->setCString("name","Jane Doe"); + emp3->setCString("SN","E0003"); + + DataObjectList& dol2 = dept->getList("employees"); + dol2.append(emp1); + dol2.append(emp2); + dol2.append(emp3); + + + /** + * Set the employee of the month - which is a reference, not + * a containment value + */ + + comp->setDataObject("employeeOfTheMonth",emp2); + + /** + * The XSD defined the company type as having a change summary, + * so we can get it... + */ + + ChangeSummaryPtr cs = comp->getChangeSummary(); + + /** + * And ask it to start logging... + */ + + cs->beginLogging(); + + /** + * With logging on, create a new employee + */ + + DataObjectPtr emp4 = mdg->create(temp); + emp4->setCString("name","Al Smith"); + emp4->setCString("SN","E0004"); + emp4->setBoolean("manager",true); + + /** + * The first recorded change happens now, as the employee is + * added into the data graph. Emp4 (Al Smith) will appear in the + * change summary as a creation. There will also be a change + * record for the list "employees" of this department, holding the + * values before Al was added. + */ + dol2.append(emp4); + + /** + * The second change is to remove element 1 from the + * same list - Thats Mary Smith. + * Mary will appear as a deletion, but there will be no extra + * change record for "employees", as its already been changed. + * Mary was employee of the month, so that reference gets + * emptied, and a change record is set up for it, recording + * Mary as the old value. + */ + + dol2.remove(1); // element 1 is Mary + + DataObjectPtr emp5 = mdg->create(temp); + emp5->setCString("name","Bill Withers"); + emp5->setCString("SN","E0005"); + + + /** + * The third change is to append Bill to the same list. + * Bill appears as a creation, but there is no change recorded to + * the employees list. + */ + + dol2.append(emp5); + + + /** + * The company name is changed. A change record is set up for + * the property "name" of this company. It stores the old value + * "ACME" + */ + + comp->setCString("name","MegaCorp"); + + /** + * The company employee of the month is changed. The old + * value has already been changed from Mary to NULL, so no change + * record is created here at all + */ + + comp->setDataObject("employeeOfTheMonth",emp4); + + + /** + * Stop logging changes + */ + + cs->endLogging(); + + + XMLHelperPtr xmh = HelperProvider::getXMLHelper(mdg); + XMLDocumentPtr doc = xmh->createDocument(comp,"companyNS","company"); + xmh->save(doc,"ChangeSummarySave-output.xml"); + + /** + * Have a look in the file and see if you can recognise the changes + * above + */ + + } + catch (SDORuntimeException e) + { + cout << "Exception in ChangeSummarySave" << endl; + cout << e; + } + cout << " ********** Sample ends ********************" << endl; +} diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/ChangeSummarySave.xsd b/sca-cpp/branches/cpp-M1/sdo/samples/misc/ChangeSummarySave.xsd new file mode 100644 index 0000000000..2c7769167a --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/ChangeSummarySave.xsd @@ -0,0 +1,46 @@ + +<!-- + Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + + Licensed 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. + --> + <xsd:schema + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:sdo="commonj.sdo" + xmlns:sdoxml="commonj.sdo/xml" + xmlns:company="companyNS" + targetNamespace="companyNS"> + <xsd:element name="company" type="company:CompanyType"/> + <xsd:complexType name="CompanyType"> + <xsd:sequence> + <xsd:element name="departments" type="company:DepartmentType" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="cs" type="sdo:ChangeSummaryType"/> + <xsd:attribute name="employeeOfTheMonth" type="xsd:IDREF" sdoxml:propertyType="company:EmployeeType"/> + </xsd:complexType> + <xsd:complexType name="DepartmentType"> + <xsd:sequence> + <xsd:element name="employees" type="company:EmployeeType" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="location" type="xsd:string"/> + <xsd:attribute name="number" type="xsd:int"/> + </xsd:complexType> + <xsd:complexType name="EmployeeType"> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="SN" type="xsd:ID"/> + <xsd:attribute name="manager" type="xsd:boolean"/> + </xsd:complexType> + </xsd:schema> + diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/Makefile.am b/sca-cpp/branches/cpp-M1/sdo/samples/misc/Makefile.am new file mode 100644 index 0000000000..07107de2c8 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/Makefile.am @@ -0,0 +1,24 @@ +deploydir=$(prefix)/samples/misc/deploy/ +prgbindir=$(deploydir)/bin + +prgbin_PROGRAMS = sdo_misc +prgbin_SCRIPTS = +EXTRA_DIST = *.xsd *.xml +deploy_DATA = *.xsd *.xml + +AM_CPPFLAGS = $(CPPFLAGS) +sdo_misc_SOURCES = samples.cpp \ +ChangeSummarySave.cpp \ +ObjectCreation.cpp \ +Query.cpp \ +Substitutes.cpp \ +XSDLoading.cpp + + +noinst_HEADERS = *.h + +sdo_misc_LDADD = -L${TUSCANY_SDOCPP}/lib -ltuscany_sdo -lxml2 + + +INCLUDES = -I$(top_builddir)/misc \ + -I${TUSCANY_SDOCPP}/include diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/ObjectCreation.cpp b/sca-cpp/branches/cpp-M1/sdo/samples/misc/ObjectCreation.cpp new file mode 100644 index 0000000000..7f570efb76 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/ObjectCreation.cpp @@ -0,0 +1,249 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +/* $Rev$ $Date: 2005/12/22 16:54:14 $ */ + +#include "samples.h" +using namespace std; + +void ObjectCreation::sample() +{ + + + cout << " ********** Sample ObjectCreation **********" << endl; + + try { + + + /** + * Get a data factory. With it we can either create metadata + * or load it from an XSD. + */ + + DataFactoryPtr mdg = DataFactory::getDataFactory(); + + /** + * Add some Types to the data factory.. + * The booleans at on addType are: + * "isSequenced", "isOpen" "isAbstract" and "isDataType" + */ + + mdg->addType("myspace","Company"); + + mdg->addType("myspace","Department"); + + /** + * Manager is going to be a sequenced type... + */ + + mdg->addType("myspace","Manager", true, false); + + mdg->addType("myspace","Employee"); + + + /** + * We will make employee and manager sub-types of 'person' + */ + + mdg->addType("myspace","Person", true, false); + + + /** + * having all the types defined, we can now define the tree + * by giving properties to the types. + */ + + /** + * We could use the API passing in name and URI for each + * Type , or get the Types back and use them directly. + * Here we get back the types to use... + */ + + const Type& tc = mdg->getType("myspace","Company"); + const Type& ts = mdg->getType("commonj.sdo","String"); + const Type& ti = mdg->getType("commonj.sdo","Integer"); + const Type& tm = mdg->getType("myspace","Manager"); + const Type& td = mdg->getType("myspace","Department"); + const Type& te = mdg->getType("myspace","Employee"); + const Type& tp = mdg->getType("myspace","Person"); + + + /** + * Example 1 - add a property of type String to type company + */ + + mdg->addPropertyToType(tc,"name",ts); + + /** + * Example 2 - add using the name of the company instead of the + * type... + */ + + mdg->addPropertyToType("myspace","Company","address",ts); + + /** + * Example 3 - add a many valued property + */ + + mdg->addPropertyToType(tc,"departments", "myspace","Department", + true); + + + /** + * Example 4 - add a reference property + */ + + mdg->addPropertyToType(tc,"employee of the month", "myspace", + "Employee",false, false, false); + + + /** + * Add other department properties... + */ + + mdg->addPropertyToType(td,"name", ts); + mdg->addPropertyToType(td,"id", ti); + mdg->addPropertyToType(td,"manager", tm); + mdg->addPropertyToType(td,"employees",te,true,false,true); + + /** + * Add a name to the person + */ + + mdg->addPropertyToType(tp,"name", ts); + + + + /** + * Make employees and mamagers both substypes of person + */ + + mdg->setBaseType(te,tp); + mdg->setBaseType(tm,tp); + + /** + * And give them different properties of their own. + */ + + mdg->addPropertyToType(tm,"officeid", ts); + mdg->addPropertyToType(te,"cubelocation", ts); + + + + /** + * The data structure looks like this: + + * Company + * ----name (String) + * ----address *String) + * ----departments (Department, many valued) + * ----employee of the month ( Employee - reference) + + * Person + * ----name (String) + + * Employee + * ----name (String - inherited from Person) + * ----cubelocation (String) + + * Manager + * ----name (String - inherited from Person) + * ----officeid (String) + + * Department + * ----name (String) + * ----id (Integer) + * ---- manager (Manager) + * ---- employees (Employee - many valued) + + + /** + * create an object of type Company using the DataFactory + */ + + DataObjectPtr dor = mdg->create((Type&)tc); + + /** + * Set the company name to Acme + */ + + dor->setCString("name","Acme"); + + /** + * Set up the two departments - using the + * DataObject createDataObject API + */ + + DataObjectPtr dep1 = dor->createDataObject("departments"); + dep1->setCString("name","Development"); + dep1->setInteger("id",100); + + DataObjectPtr man1 = dep1->createDataObject("manager"); + man1->setCString("name","Herve Jones"); + + DataObjectPtr dep2= dor->createDataObject("departments"); + dep2->setCString("name","Marketing"); + dep2->setInteger("id",200); + + DataObjectPtr man2 = dep2->createDataObject("manager"); + man1->setCString("name","August Phan"); + + /** + * Give the departments some employees + */ + + DataObjectPtr emp1 = dep1->createDataObject("employees"); + emp1->setCString("name","Fred Appleby"); + emp1->setCString("cubelocation","100-A"); + + DataObjectPtr emp2 = dep1->createDataObject("employees"); + emp2->setCString("name","Jane Bloggs"); + emp2->setCString("cubelocation","100-B"); + + DataObjectPtr emp3 = dep2->createDataObject("employees"); + emp3->setCString("name","Robin Corbet"); + emp3->setCString("cubelocation","200-A"); + + DataObjectPtr emp4 = dep2->createDataObject("employees"); + emp4->setCString("name","Martha Denby"); + emp4->setCString("cubelocation","200-B"); + + cout << "Company Name:" << dor->getCString("name") << endl; + + DataObjectList& depts = dor->getList("departments"); + for (int i=0;i<depts.size();i++) + { + cout << " Department Name:" << depts[i]->getCString("name") << endl; + + DataObjectList& emps = depts[i]->getList("employees"); + + for (int j=0;j<emps.size();j++) + { + cout << " Employee Name:" << emps[j]->getCString("name") << endl; + } + } + } + catch (SDORuntimeException e) + { + cout << "Exception in ObjectCreation" <<endl; + cout << e; + } + cout << " ********** Sample ends ********************" << endl; + return; +} + + diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/Query.cpp b/sca-cpp/branches/cpp-M1/sdo/samples/misc/Query.cpp new file mode 100644 index 0000000000..d86b896679 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/Query.cpp @@ -0,0 +1,176 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +/* $Rev$ $Date: 2005/12/22 16:54:14 $ */ + +#include "samples.h" +using namespace std; + +void Query::sample() +{ + cout << " ********** Query sample *******************" << endl; + + DataFactoryPtr mdg = DataFactory::getDataFactory(); + + /** + * Create some types + */ + + mdg->addType("myspace","Company"); + mdg->addType("myspace","Department"); + mdg->addType("myspace","Employee"); + + + /* Now add the properties to the types...*/ + + + const Type& tstring = mdg->getType("commonj.sdo","String"); + const Type& tbool= mdg->getType("commonj.sdo","Boolean"); + const Type& tint= mdg->getType("commonj.sdo","Integer"); + + const Type& tc = mdg->getType("myspace","Company"); + const Type& td = mdg->getType("myspace","Department"); + const Type& te = mdg->getType("myspace","Employee"); + + /** + * The company + */ + + mdg->addPropertyToType(tc,"name",tstring); // single string name + mdg->addPropertyToType(tc,"departments", + td,true); // many departments + mdg->addPropertyToType(tc,"employee of the month" + , te, false, false, false); // reference to employee + + /** + * The department + */ + + mdg->addPropertyToType(td,"name", tstring); // single string name + mdg->addPropertyToType(td,"employees",te, + true,false,true); // many employees + + + /** + * The employee + */ + + mdg->addPropertyToType(te,"isFullTime",tbool); + mdg->addPropertyToType(te,"employeeNumber",tint); + mdg->addPropertyToType(te,"name",tstring); + + + const Type& tcc = mdg->getType("myspace","Company"); + + DataObjectPtr dor = mdg->create((Type&)tcc); + + // The departments + + DataObjectPtr dept = dor->createDataObject("departments"); + dept->setCString("name","Shipping"); + + DataObjectPtr dept2 = dor->createDataObject("departments"); + dept2->setCString("name","Buying"); + + // The employees + + DataObjectPtr emp1 = dept->createDataObject("employees"); + DataObjectPtr emp2 = dept->createDataObject("employees"); + DataObjectPtr emp3 = dept->createDataObject("employees"); + DataObjectPtr emp4 = dept2->createDataObject("employees"); + + + emp1->setBoolean("isFullTime",true); + emp1->setInteger("employeeNumber",65443); + emp1->setCString("name","Norman"); + + + emp2->setBoolean("isFullTime",false); + emp2->setInteger("employeeNumber",64778); + emp2->setCString("name","Carl"); + + emp3->setBoolean("isFullTime",true); + emp3->setInteger("employeeNumber",61990); + emp3->setCString("name","Amanda"); + + emp4->setBoolean("isFullTime",true); + emp4->setInteger("employeeNumber",56789); + emp4->setCString("name","Donna"); + + dor->setDataObject("employee of the month",emp4); // Donna is referenced. + + + try { + + // access the first employee of the first department who is not full time + + DataObjectPtr dob1 = dor->getDataObject("departments[1]/employees[isFullTime=false]"); + cout << "Carl should be the first part timer: " << dob1->getCString("name") << " is." <<endl; + + // get the same employee by index + + DataObjectPtr dob2 = dor->getDataObject("departments[1]/employees[2]"); + cout << "Carl should be employees[2]:" << dob2->getCString("name") << " is." << endl; + + // use the dot notation to get the same employee + + DataObjectPtr dob3 = dor->getDataObject("departments.0/employees.1"); + cout << "Carl should be employees.1:" << dob3->getCString("name") << " is." << endl; + + // get the reference... + + DataObjectPtr dob4 = dor->getDataObject("employee of the month"); + cout << "Donna should be employee of the month:" << dob4->getCString("name") << " is." << endl; + + // And by employee number... + + DataObjectPtr dob5 = dor->getDataObject("departments[2]/employees[employeeNumber=56789]"); + cout << "Donna should be employee 56789:" << dob5->getCString("name") << " is." << endl; + + // If the query yields no value because the element doesnt exist... + + try + { + DataObjectPtr dob6 = dor->getDataObject("departments[1]/employees[employeeNumber=56789]"); + cout << "Did not get the expected exception" << endl; + } + catch (SDORuntimeException e) + { + cout << "Expected an IndexOutOfRangeException and got " << e.getEClassName() << endl; + } + + // If the query yields no value because the path is invalid... + + + try + { + DataObjectPtr dob7 = dor->getDataObject("departments[fish]/employees[0]"); + cout << "Did not get the expected exception" << endl; + } + catch (SDORuntimeException e) + { + cout << "Expected an PathNotFoundException and got " << e.getEClassName() << endl; + } + } + catch (SDORuntimeException e) + { + cout << "Unexpected error in Query " << e << endl; + } + + + cout << " ********** End Query Sample **************" << endl; +} diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/Substitutes.cpp b/sca-cpp/branches/cpp-M1/sdo/samples/misc/Substitutes.cpp new file mode 100644 index 0000000000..826e7f8aee --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/Substitutes.cpp @@ -0,0 +1,119 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +/* $Rev$ $Date: 2005/12/22 16:54:14 $ */ + +#include "samples.h" +using namespace std; + +void Substitutes::sample() +{ + cout << " ********** Substitutes sample *************" << endl; + try + { + + DataFactoryPtr mdg = DataFactory::getDataFactory(); + XSDHelperPtr xsh = HelperProvider::getXSDHelper(mdg); + xsh->defineFile("companysubs.xsd"); + + /** + * The companysubs xsd defines some types including a + * type which allows substitutions. The PublicationType is + * the base of BookType and MagazineType, and the substitutions + * are enabled so that properties can be either. + */ + + const Type& tstring = mdg->getType("commonj.sdo","String"); + const Type& tcomp = mdg->getType("companyNS","CompanyType"); + const Type& book = mdg->getType("companyNS","BookType"); + const Type& mag = mdg->getType("companyNS","MagazineType"); + const Type& pub = mdg->getType("companyNS","PublicationType"); + + + /** + * Create some data to work with + */ + + DataObjectPtr comp = mdg->create((Type&)tcomp); + comp->setCString("name","Puflet Publishing"); + + + DataObjectPtr book1 = mdg->create(book); + book1->setCString("author","Mr P B Writer"); + + /** + * book has a title property because it inherits from Publication + */ + book1->setCString("title","Nowhere Man"); + + + DataObjectPtr mag1 = mdg->create(mag); + + /** + * Magazine has an eidtor, and a title inherited from publication + */ + + mag1->setCString("editor","Mr B Picky"); + // inherited from publication + mag1->setCString("title","Bionicle Weekly"); + + + DataObjectPtr pub1 = mdg->create(pub); + pub1->setCString("title","Noddy In Toyland"); + + + /** + * The property "Publication" is defined as substitutable, so + * any of the book, magazine or publication should be + * acceptable values. When the type is queried, the type + * returned should correspond to the current type of the + * property... + */ + + comp->setDataObject("Publication",pub1); + const Type& tpub1 = comp->getDataObject("Publication")->getType(); + cout << "Publication is now of type " << tpub1.getName() << endl; + + comp->setDataObject("Publication",book1); + const Type& tpub2 = comp->getDataObject("Publication")->getType(); + cout << "Publication now is of type " << tpub2.getName() << endl; + + comp->setDataObject("Publication",mag1); + const Type& tpub3 = comp->getDataObject("Publication")->getType(); + cout << "Publication now is of type " << tpub3.getName() << endl; + + /** + * As the substitutes have names, they act as a sort of + * alias, so we can address Publication as Book or Magazine too + */ + + comp->setDataObject("Book",book1); + const Type& tpub4 = comp->getDataObject("Book")->getType(); + cout << "Book is of type " << tpub4.getName() << endl; + + comp->setDataObject("Magazine",mag1); + const Type& tpub5 = comp->getDataObject("Magazine")->getType(); + cout << "Magazine is of type " << tpub5.getName() << endl; + + } + catch (SDORuntimeException e) + { + cout << "Exception in Substitutes"<< endl; + cout<< e; + } + cout << " ********** Sample ends ********************" << endl; +} diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/XSDLoading.cpp b/sca-cpp/branches/cpp-M1/sdo/samples/misc/XSDLoading.cpp new file mode 100644 index 0000000000..f1997d31bf --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/XSDLoading.cpp @@ -0,0 +1,108 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +/* $Rev$ $Date: 2005/12/22 16:54:14 $ */ + +#include "samples.h" +using namespace std; + +void XSDLoading::sample() +{ + int i,j; + + cout << " ********** XSDLoading Sample **************" << endl; + try + { + DataFactoryPtr mdg = DataFactory::getDataFactory(); + + /** + * Get an XSD helper to load XSD information into the + * data factory + */ + + XSDHelperPtr myXSDHelper = HelperProvider::getXSDHelper(mdg); + myXSDHelper->defineFile("XSDLoading.xsd"); + + /** + * Check if there were any errors. The parse may still + * succeed, but errors indicate some elements were not + * understood + */ + + if ((i = myXSDHelper->getErrorCount()) > 0) + { + cout << "XSD Loading reported some errors:" << endl; + for (j=0;j<i;j++) + { + const char *m = myXSDHelper->getErrorMessage(j); + if (m != 0) cout << m; + cout << endl; + } + } + + /** + * Use the same data factory to load XML corresponding to + * data objects adhering to the previously loaded schema + */ + + XMLHelperPtr myXMLHelper = HelperProvider::getXMLHelper(mdg); + + XMLDocumentPtr myXMLDocument = myXMLHelper->loadFile("XSDLoading.xml", "companyNS"); + + /** + * Check if there were any errors. The parse may still + * succeed, but errors indicate some elements did not match + * the schema, or were malformed. + * + */ + + if ((i = myXMLHelper->getErrorCount()) > 0) + { + cout << "XML Loading reported some errors:" << endl; + for (j=0;j<i;j++) + { + const char *m = myXMLHelper->getErrorMessage(j); + if (m != 0) cout << m; + cout << endl; + } + } + + DataObjectPtr newdob = myXMLDocument->getRootDataObject(); + + cout << "Company Name:" << newdob->getCString("name") << endl; + + DataObjectList& depts = newdob->getList("departments"); + for (int i=0;i<depts.size();i++) + { + cout << " Department Name:" << depts[i]->getCString("name") << endl; + + DataObjectList& emps = depts[i]->getList("employees"); + + for (int j=0;j<emps.size();j++) + { + cout << " Employee Name:" << emps[j]->getCString("name") << endl; + } + } + + } + catch (SDORuntimeException e) + { + cout << "Exception in XSD Loading test" << endl; + cout << e; + } + cout << " ********** Sample ends ********************" << endl; +} diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/XSDLoading.xml b/sca-cpp/branches/cpp-M1/sdo/samples/misc/XSDLoading.xml new file mode 100644 index 0000000000..6253ca34fd --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/XSDLoading.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!-- + Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + + Licensed 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. + --> + + <!-- This XML has an employee with an SN of nil, which should appear in the SDO as NULL + --> + <company xmlns="companyNS" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="MegaCorp" employeeOfTheMonth="#/departments.0/employees.1"> +<departments name="Advanced Technologies" location="NY" number="123"> +<employees> +<name>Jane Doe</name> +<SN xsi:nil="true" /> +</employees> +</departments> +</company>
\ No newline at end of file diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/XSDLoading.xsd b/sca-cpp/branches/cpp-M1/sdo/samples/misc/XSDLoading.xsd new file mode 100644 index 0000000000..808e075a2d --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/XSDLoading.xsd @@ -0,0 +1,45 @@ + +<!-- + Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + + Licensed 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. + --> +<!-- This XSD recasts the properties of employee to elements in order to allow the SN property to be nillable --> +<xsd:schema + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:sdo="commonj.sdo" + xmlns:sdoxml="commonj.sdo/xml" + xmlns:company="companyNS" + targetNamespace="companyNS"> + <xsd:element name="company" type="company:CompanyType"/> + <xsd:complexType name="CompanyType"> + <xsd:sequence> + <xsd:element name="departments" type="company:DepartmentType" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="employeeOfTheMonth" type="xsd:IDREF" +sdoxml:propertyType="company:EmployeeType"/> </xsd:complexType> + <xsd:complexType name="DepartmentType"> + <xsd:sequence> + <xsd:element name="employees" type="company:EmployeeType" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="location" type="xsd:string"/> + <xsd:attribute name="number" type="xsd:int"/> + </xsd:complexType> + <xsd:complexType name="EmployeeType"> + <xsd:element name="name" type="xsd:string"/> + <xsd:element name="SN" type="xsd:ID" nillable="true"/> + <xsd:element name="manager" type="xsd:boolean"/> + </xsd:complexType> +</xsd:schema> diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/companysubs.xsd b/sca-cpp/branches/cpp-M1/sdo/samples/misc/companysubs.xsd new file mode 100644 index 0000000000..124960676b --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/companysubs.xsd @@ -0,0 +1,61 @@ + +<!-- + Copyright 2006 The Apache Software Foundation or its licensors, as applicable. + + Licensed 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. + --> + + <xsd:schema + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:sdo="commonj.sdo" + xmlns:sdoxml="commonj.sdo/xml" + xmlns:company="companyNS" + targetNamespace="companyNS"> + <xsd:element name="company" type="company:CompanyType"/> + <xsd:complexType name="CompanyType"> + <xsd:sequence> + <xsd:element name="departments" type="company:DepartmentType" maxOccurs="unbounded"/> + <xsd:element name="Publication" type="company:PublicationType" maxOccurs="1"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="cs" type="sdo:ChangeSummaryType"/> + <xsd:attribute name="employeeOfTheMonth" type="xsd:IDREF" sdoxml:propertyType="company:EmployeeType"/> + </xsd:complexType> + <xsd:complexType name="DepartmentType"> + <xsd:sequence> + <xsd:element name="employees" type="company:EmployeeType" maxOccurs="unbounded"/> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="location" type="xsd:string"/> + <xsd:attribute name="number" type="xsd:int"/> + </xsd:complexType> + <xsd:complexType name="EmployeeType"> + <xsd:attribute name="name" type="xsd:string"/> + <xsd:attribute name="SN" type="xsd:ID"/> + <xsd:attribute name="manager" type="xsd:boolean"/> + </xsd:complexType> + <xsd:complexType name="BookType"> + <xsd:restriction base="company:PublicationType" /> + <xsd:element name="author" type="xsd:string" maxOccurs="1"/> + </xsd:complexType> + <xsd:complexType name="MagazineType"> + <xsd:restriction base="company:PublicationType" /> + <xsd:element name="editor" type="xsd:string" maxOccurs="1"/> + </xsd:complexType> + <xsd:complexType name="PublicationType"> + <xsd:element name="title" type="xsd:string" maxOccurs="1"/> + </xsd:complexType> + <xsd:element name="Book" type="company:BookType" substitutionGroup="Publication" /> + <xsd:element name="Magazine" type="company:MagazineType" substitutionGroup="company:Publication" /> + </xsd:schema> + diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/samples.cpp b/sca-cpp/branches/cpp-M1/sdo/samples/misc/samples.cpp new file mode 100644 index 0000000000..1841d4f845 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/samples.cpp @@ -0,0 +1,34 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +/* $Rev$ $Date: 2005/12/22 16:54:14 $ */ + +#include "samples.h" + +/** + * C main to run the sample + */ + +int main (int argc, char** argv) +{ + ObjectCreation::sample(); + XSDLoading::sample(); + ChangeSummarySave::sample(); + Substitutes::sample(); + Query::sample(); + return 0; +} diff --git a/sca-cpp/branches/cpp-M1/sdo/samples/misc/samples.h b/sca-cpp/branches/cpp-M1/sdo/samples/misc/samples.h new file mode 100644 index 0000000000..4d2ddfde79 --- /dev/null +++ b/sca-cpp/branches/cpp-M1/sdo/samples/misc/samples.h @@ -0,0 +1,51 @@ +/* + * + * Copyright 2005 The Apache Software Foundation or its licensors, as applicable. + * + * Licensed 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. + */ + +/* $Rev$ $Date: 2005/12/22 16:54:14 $ */ +#pragma warning(disable:4786) + +#include "commonj/sdo/SDO.h" + + +using namespace commonj::sdo; + + + +class ObjectCreation { + public: + static void sample(); +}; + +class XSDLoading { + public: + static void sample(); +}; + +class ChangeSummarySave { + public: + static void sample(); +}; + +class Substitutes { + public: + static void sample(); +}; + +class Query { + public: + static void sample(); +};
\ No newline at end of file |