From 200a40b332420f94992eb39a6d0ea1cf1490ffc4 Mon Sep 17 00:00:00 2001 From: coreyg Date: Fri, 21 Nov 2014 09:30:19 +0000 Subject: Adding tuscany's website to their svn repo for svnpubsub git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1640879 13f79535-47bb-0310-9956-ffa450edef68 --- site/trunk/site-publish/tuscany-sdo-faq.html | 146 +++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 site/trunk/site-publish/tuscany-sdo-faq.html (limited to 'site/trunk/site-publish/tuscany-sdo-faq.html') diff --git a/site/trunk/site-publish/tuscany-sdo-faq.html b/site/trunk/site-publish/tuscany-sdo-faq.html new file mode 100644 index 0000000000..6c892276ea --- /dev/null +++ b/site/trunk/site-publish/tuscany-sdo-faq.html @@ -0,0 +1,146 @@ + + + + + + + + Tuscany SDO - FAQ + + + + + + + +
+  Apache Tuscany > Home > SDO CPP > Tuscany SDO - FAQ + +
+ + + + + + +
+
+ +
+ +
+ Added by S Venkatakrishnan, last edited by haleh mahbod on Mar 12, 2007 +  (view change) + +
+ +
+
+

Tuscany SDO - Frequently Asked Questions

+ + +
    +
  1. Does SDO for C++ provide a static interface as the Java implementation does?
    +No. It is not clear that this is a useful feature in a language like C++ so we have no plans to implement it.
  2. +
  3. How do I load an XML file using SDO static type?
    +The basic pattern is fairly simple. +
    +
      // Get hold of a helper context. This holds an XMLHelper instance
    +  HelperContext scope = SDOUtil.createHelperContext();
    +   
    +  // Register all of the types we have generated into the HelperContext
    +  GenerateFactory.INSTANCE.register(scope);
    +
    +  // A normal input stream to read the XML file
    +  fis = new FileInputStream("some.xml");
    + 
    +  // Use the HelperContext to get and XMLHelper and use this to load the XML
    +  XMLDocument xmlDoc = scope.getXMLHelper().load(fis);
    +
    +  // Now we have a document we can get the root object and cast it to the expected type
    +  GenerateType generateType = (GenerateType)xmlDoc.getRootObject();
    +
    +
    +

    There are some unit tests that show how to do this. You have to look in the tools tests cases as the Java static generator is in the tools project. Try looking in sdo\tools\src\test\java\org\apache\tuscany\sdo\test*.java.

  4. +
+ +
+ + +
+
+ + + \ No newline at end of file -- cgit v1.2.3