Author: rareddy
Date: 2010-06-23 16:17:49 -0400 (Wed, 23 Jun 2010)
New Revision: 2288
Modified:
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml
Log:
TEIID-973: converted the quick start to use the Dynamic VDB.
Modified:
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml
===================================================================
---
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml 2010-06-23
18:47:52 UTC (rev 2287)
+++
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/buildvdb.xml 2010-06-23
20:17:49 UTC (rev 2288)
@@ -2,65 +2,86 @@
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<chapter id="step-3">
<title>Building a VDB</title>
- <para>A VDB can be built with either the <link
linkend="designer">Designer</link> tool or through a simple XML file
called a dynamic VDB. See the dyanmicvdb-portolio for an example dynamic VDB. You can
skip the next section if you choose to use a dynamic VDB.</para>
- <sect1 id="designer">
- <title>Using Teiid Designer to build a VDB</title>
- <sect2>
- <title>Download Teiid Designer</title>
+ <para>A VDB can be built with either the <ulink
url="http://www.jboss.org/teiiddesigner.html">Designer</u... tool or
through a
+ simple XML file called a dynamic VDB. See the "dyanmicvdb-portolio" for an
example dynamic VDB.
+ for this example purpose we will use the a dynamic VDB. If you would like to use the
+ Designer to build your VDB, check out the Designer examples. If you need to build any
view layers using your source,
+ you must use Designer based approach to building the VDB. A sample Designer based VDB
is
+ available in the "teiid-examples/portfolio/PortfolioModel"
directory.</para>
+
+ <sect1 id="dynamic_vdb">
+ <title>Building Dynamic VDB</title>
+ <para>This XML file is defines a set of sources that need to treated as
single source by the client application.
+ Dynamic VDB does not yet allow for the creation of view layers. Below XML file
defines "dynamicvdb-portfolio" example
+ vdb.</para>
+ <para>portfolio-vdb.xml (copy available in
"teiid-examples/dynamicvdb-portfolio" directory)</para>
+ <programlisting><![CDATA[
+<?xml version="1.0" encoding="UTF-8"
standalone="yes"?>
+<vdb name="DynamicPortfolio" version="1">
+
+ <description>A Dynamic VDB</description>
- <note>
- <para>
- If you would like to skip building your own VDB, you can safely go to next page
and continue with the
- exercise as there is a pre-built VDB available for your convenience in the
- examples/portfolio/PortfolioModel directory of the download.
- </para>
- </note>
-
- <para>
- The Teiid Designer project provides a Eclipse based designer tool for this purpose
of building a VDB. You can
- download Teiid Designer
- <ulink
url="http://www.jboss.org/teiiddesigner/downloads.html">here...
- Once downloaded, please follow the installation instructions. Start the Teiid
Designer and return here to continue
- building the VDB.
- </para>
- </sect2>
-
- <para>Once you start the Designer, there are several steps you must perform to
create a VDB. These steps are
- summarized in the following table.</para>
+ <!--
+ Setting to use connector supplied metadata. Can be "true" or
"cached".
+ "true" will obtain metadata once for every launch of Teiid.
+ "cached" will save a file containing the metadata into
+ the deploy/<vdb name>/<vdb version/META-INF directory
+ -->
+ <property name="UseConnectorMetadata" value="cached" />
+
+
+ <!--
+ Each model represents a access to one or more sources.
+ The name of the model will be used as a top level schema name
+ for all of the metadata imported from the connector.
+
+ NOTE: Multiple model, with different import settings, can be bound to
+ the same connector binding and will be treated as the same source at
+ runtime.
+ -->
+ <model name="MarketData">
+ <!--
+ Each source represents a translator and data source. There are
+ pre-defined translators, or you can create one. ConnectionFactories
+ or DataSources in JBoss AS they are typically defined using
"xxx-ds.xml" files.
+ -->
+ <source name="text-connector" translator-name="file"
connection-jndi-name="java:marketdata-file"/>
+ </model>
+
+ <model name="Accounts">
+ <!--
+ JDBC Import settings
+
+ importer.useFullSchemaName directs the importer to drop the source
+ schema from the Teiid object name, so that the Teiid fully qualified name
+ will be in the form of <model name>.<table name>
+ -->
+ <property name="importer.useFullSchemaName"
value="false"/>
+
+ <!--
+ This connector is defined in the "derby-connector-ds.xml"
+ -->
+ <source name="derby-connector" translator-name="derby"
connection-jndi-name="java:PortfolioDS"/>
+ </model>
+
+</vdb>
+ ]]></programlisting>
+
+ <para>The XML file is explained below.</para>
<orderedlist>
- <listitem>
- <para>Switch to the Designer Perspective, by opening the
"Window->Open Perspective.."</para>
- </listitem>
- <listitem>
- <para>Create new "Model Project", using
"File->New->ModelProject"</para>
- </listitem>
- <listitem>
- <para>Import the Derby database's "account" schema into a
source model.</para>
- </listitem>
- <listitem>
- <para>Manually create the view model for the "Text File". Create
a Table called "Price" with
- "stock" and "price" as column names. In the transformation
window add the following SQL</para>
- </listitem>
- <listitem>
- <para>Create a view model called "AccountView"</para>
- </listitem>
- <listitem>
- <para>In the "AccountView" model, create a virtual table (called
as Base Table in the menu), and build
- the transformation query combining the "Accounts" tables with
"Price" table</para>
- </listitem>
- <listitem>
- <para>In the "AccountView" model, create a virtual procedure
called "buyStock", to learn about procedure
- language.</para>
- </listitem>
- <listitem>
- <para>Create a VDB based on the models created</para>
- </listitem>
- <listitem>
- <para>Test the created VDB with some ad-hoc queries inside
Designer.</para>
- </listitem>
- <listitem>
- <para>Export or copy the VDB for use in your application.</para>
- </listitem>
+ <listitem><para>The above XML file defines a "vdb" with
name "DynamicPortfolio" with version
"1"</para></listitem>
+ <listitem><para>A "model" XML element represents a schema
that being integrated. This sample
+ defines two sources, "MarketData" that represents the schema for the
text file that has the
+ stock price information and "Accounts" that represents the
"portfolio" schema in the Derby database.
+ </para></listitem>
+ <listitem><para>The "source" element inside the
"model" element defines name of the source (can be any name), and
+ name of the translator (defines the type of the source like oracle, db2, mysql,
h2, file, ws etc..) and the
+ "connection-jndi-name" defines the source's JNDI name in the JBoss
AS container.</para></listitem>
+ <listitem><para>Also note that inside the "model" elements,
some "property" elements are used to define how
+ metadata can be imported from source. For more information check out the
Reference Guide's Dynamic VDB section.</para></listitem>
+ <listitem><para>Note that you need to also create the necessary
deployment
+ files for the data sources (Connection Factories)
too.</para></listitem>
</orderedlist>
- </sect1>
+
+ </sect1>
</chapter>
\ No newline at end of file
Modified:
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml
===================================================================
---
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml 2010-06-23
18:47:52 UTC (rev 2287)
+++
trunk/documentation/quick-start-example/src/main/docbook/en-US/content/connect-vdb.xml 2010-06-23
20:17:49 UTC (rev 2288)
@@ -33,7 +33,7 @@
<emphasis>jdbc:teiid:<VDB-Name>@mm(s)://<host
name>:<port>;autoCommitTxn=DETECT</emphasis>
</para>
<para>
- You can use any of these <ulink
url="https://www.jboss.org/community/docs/DOC-13157"> optional connection
properties </ulink>
+ Check out Client Developer's guide for all the optional connection properties
in your URL. Here is sample code showing how to make JDBC connection.
</para>
<programlisting><![CDATA[public void execute() throws SQLException {
@@ -76,8 +76,7 @@
Connection connection = ds.getConnection();
...]]></programlisting>
<para>TeiidDataSource source also provides an option to set optional
parameters using the "set" methods on the
- data source look. For all the allowable properties at the
- <ulink
url="https://www.jboss.org/community/docs/DOC-13158">data
source properties</ulink>.</para>
+ data source look. For all the allowable data source properties check out Client
Developer's Guide.</para>
</sect1>
<sect1>
<title>Testing Your Teiid Deployment</title>
@@ -95,7 +94,7 @@
<para>If your application is Web based, you can create data source for your VDB
using the above and treat it as any other JDBC source using
<code>org.teiid.jdbc.TeiidDataSource</code> and assigning it a JNDI name.
- Refer to <ulink
url="https://community.jboss.org/docs/DOC-13888">deployment to application
server</ulink> for more information.
+ Refer to Client Developer's Guide deployment for more information on creating a
DataSource.
</para>
<note><para>"embedded" mode is only available in versions of
Teiid up to 6.2</para></note>
</sect1>