[teiid-commits] teiid SVN: r3936 - in trunk/build/kits/jboss-as7/docs/teiid/examples: dynamicvdb-twitter and 1 other directories.

teiid-commits at lists.jboss.org teiid-commits at lists.jboss.org
Tue Mar 13 15:55:07 EDT 2012


Author: rareddy
Date: 2012-03-13 15:55:06 -0400 (Tue, 13 Mar 2012)
New Revision: 3936

Added:
   trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/
   trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/README.txt
   trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/twitter-ds.xml
   trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/twitter-vdb.xml
Removed:
   trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-ws-weather/
Modified:
   trunk/build/kits/jboss-as7/docs/teiid/examples/simpleclient/run.bat
   trunk/build/kits/jboss-as7/docs/teiid/examples/simpleclient/run.sh
Log:
TEIID-1839: replacing weather with twitter web service example.

Added: trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/README.txt
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/README.txt	                        (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/README.txt	2012-03-13 19:55:06 UTC (rev 3936)
@@ -0,0 +1,30 @@
+Demonstrates how to use the WS Translator to call web services. This example also shows 
+how to define view tables in dynamic vdbs.
+
+See https://dev.twitter.com/docs/api for information on the Twitter's SOAP/REST services.  
+
+Copy the following files to the <jboss.home>/standalone/deployments directory.
+	- twitter-vdb.xml
+
+Edit the "standalone-teiid.xml" file in the "<jboss.home>/standalone/configuration" add "weather-ds.xml" file's 
+contents in resource adapter subsystem. This connection also can be created using JBoss CLI as
+./jboss-cli.sh (to do this first you need to start the JBoss AS)
+
+connect
+/subsystem=resource-adapters/resource-adapter=twitterDS:add(archive=teiid-connector-ws.rar, transaction-support=NoTransaction)
+/subsystem=resource-adapters/resource-adapter=twitterDS/connection-definitions=twitterDS:add(jndi-name=java:/twitterDS, class-name=org.teiid.resource.adapter.ws.WSManagedConnectionFactory, enabled=true, use-java-context=true)
+/subsystem=resource-adapters/resource-adapter=twitterDS/connection-definitions=twitterDS/config-properties=EndPoint:add(value=http://search.twitter.com/search.json)
+/subsystem=resource-adapters/resource-adapter=twitterDS:activate 
+
+Start the JBoss AS
+
+Mkae sure the "twitter" vdb is deployed in "active" state.
+
+Use the simple client (located one directory above) example run script, e.g. 
+
+$./run.sh localhost 31000 twitter "select * from tweet where query= 'jboss'"
+
+NOTE - depending on your OS/Shell the quoting/escaping required to run the example can be
+complicated.  It would be better to install a Java client, such as SQuirreL, to run the 
+queries below.  
+


Property changes on: trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/README.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/twitter-ds.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/twitter-ds.xml	                        (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/twitter-ds.xml	2012-03-13 19:55:06 UTC (rev 3936)
@@ -0,0 +1,14 @@
+<subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">
+    <resource-adapters>
+        <resource-adapter>
+            <archive>teiid-connector-ws.rar</archive>
+            <transaction-support>NoTransaction</transaction-support>
+            <connection-definitions>
+                <connection-definition class-name="org.teiid.resource.adapter.ws.WSManagedConnectionFactory" jndi-name="java:/twitterDS" enabled="true" use-java-context="true" pool-name="twitter-ds">
+                      <config-property name="EndPoint">http://search.twitter.com/search.json</config-property>
+                </connection-definition>
+            </connection-definitions>
+        </resource-adapter>
+    </resource-adapters>
+</subsystem>
+


Property changes on: trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/twitter-ds.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/twitter-vdb.xml
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/twitter-vdb.xml	                        (rev 0)
+++ trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/twitter-vdb.xml	2012-03-13 19:55:06 UTC (rev 3936)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<vdb name="twitter" version="1">
+
+    <description>Shows how to call Web Services</description>
+    
+    <property name="UseConnectorMetadata" value="cached" />
+
+    <model name="twitter">
+        <source name="twitter" translator-name="rest" connection-jndi-name="java:/twitterDS"/>
+    </model>
+    <model name="twitterview" type="VIRTUAL">
+         <metadata type="DDL"><![CDATA[
+             CREATE VIRTUAL PROCEDURE getTweets(query varchar) RETURNS (created_on varchar(25), from_user varchar(25), to_user varchar(25), 
+                 profile_image_url varchar(25), source varchar(25), text varchar(140)) AS 
+                select tweet.* from 
+                    (call twitter.invokeHTTP(action => 'GET', endpoint =>querystring('',query as "q"))) w, 
+                    XMLTABLE('results' passing JSONTOXML('myxml', w.result) columns 
+                    created_on string PATH 'created_at', 
+                    from_user string PATH 'from_user',
+                    to_user string PATH 'to_user',  
+                    profile_image_url string PATH 'profile_image_url',  
+                    source string PATH 'source',    
+                    text string PATH 'text') tweet;
+                CREATE VIEW Tweet AS select * FROM twitterview.getTweets;
+        ]]> </metadata>
+    </model>
+
+    <translator name="rest" type="ws">
+        <property name="DefaultBinding" value="HTTP"/>
+        <property name="DefaultServiceMode" value="MESSAGE"/>
+    </translator>
+</vdb>
\ No newline at end of file


Property changes on: trunk/build/kits/jboss-as7/docs/teiid/examples/dynamicvdb-twitter/twitter-vdb.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: trunk/build/kits/jboss-as7/docs/teiid/examples/simpleclient/run.bat
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/examples/simpleclient/run.bat	2012-03-13 16:05:28 UTC (rev 3935)
+++ trunk/build/kits/jboss-as7/docs/teiid/examples/simpleclient/run.bat	2012-03-13 19:55:06 UTC (rev 3936)
@@ -2,7 +2,7 @@
 set CLIENT_PATH=.
 
 rem Second one adds the Teiid client
-set TEIID_PATH=../../../modules/org/jboss/teiid/common-core/main/teiid-common-core-${pom.version}.jar;../../../modules/org/jboss/teiid/client/main/teiid-client-${pom.version}.jar
+set TEIID_PATH=../../../../modules/org/jboss/teiid/common-core/main/teiid-common-core-${pom.version}.jar;../../../../modules/org/jboss/teiid/client/main/teiid-client-${pom.version}.jar
 
 java -cp %CLIENT_PATH%;%TEIID_PATH% JDBCClient %*
 

Modified: trunk/build/kits/jboss-as7/docs/teiid/examples/simpleclient/run.sh
===================================================================
--- trunk/build/kits/jboss-as7/docs/teiid/examples/simpleclient/run.sh	2012-03-13 16:05:28 UTC (rev 3935)
+++ trunk/build/kits/jboss-as7/docs/teiid/examples/simpleclient/run.sh	2012-03-13 19:55:06 UTC (rev 3936)
@@ -4,6 +4,6 @@
 CLIENT_PATH=.
 
 #Second one for the Teiid client jar
-TEIID_PATH=../../../modules/org/jboss/teiid/common-core/main/teiid-common-core-${pom.version}.jar:../../../modules/org/jboss/teiid/client/main/teiid-client-${pom.version}.jar
+TEIID_PATH=../../../../modules/org/jboss/teiid/common-core/main/teiid-common-core-${pom.version}.jar:../../../../modules/org/jboss/teiid/client/main/teiid-client-${pom.version}.jar
 
 java -cp ${CLIENT_PATH}:${TEIID_PATH} JDBCClient "$@"



More information about the teiid-commits mailing list