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-cpp-faq.html | 105 +++++++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 site/trunk/site-publish/tuscany-sdo-cpp-faq.html (limited to 'site/trunk/site-publish/tuscany-sdo-cpp-faq.html') diff --git a/site/trunk/site-publish/tuscany-sdo-cpp-faq.html b/site/trunk/site-publish/tuscany-sdo-cpp-faq.html new file mode 100644 index 0000000000..8c2abfe641 --- /dev/null +++ b/site/trunk/site-publish/tuscany-sdo-cpp-faq.html @@ -0,0 +1,105 @@ + + + + + + + Tuscany SDO CPP - FAQ : Apache Tuscany + + + + + + + + + + + + + + + + +
+ + + + +   + + + +
+ + +
+
+ + + + + + + +
+  Apache Tuscany > Home > SDO Overview > SDO CPP > Tuscany SDO CPP - FAQ + + User List | Dev List | Issue Tracker   +
+ + + + + +
+
+ +
+
+

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