<html>
<head>
    <base href="https://docs.jboss.org/author">
            <link rel="stylesheet" href="/author/s/en/2172/19/5/_/styles/combined.css?spaceKey=TEIID&amp;forWysiwyg=true" type="text/css">
    </head>
<body style="background: white;" bgcolor="white" class="email-body">
<div id="pageContent">
<div id="notificationFormat">
<div class="wiki-content">
<div class="email">
    <h2><a href="https://docs.jboss.org/author/display/TEIID/Dynamic+VDBs">Dynamic VDBs</a></h2>
    <h4>Page <b>edited</b> by             <a href="https://docs.jboss.org/author/display/~shawkins">Steven Hawkins</a>
    </h4>
        <br/>
                         <h4>Changes (7)</h4>
                                 
    
<div id="page-diffs">
                    <table class="diff" cellpadding="0" cellspacing="0">
    
            <tr><td class="diff-changed-lines" >Teiid integration is available via a &quot;Dynamic VDB&quot; without the need for Teiid Designer tooling.  <span class="diff-deleted-words"style="color:#999;background-color:#fdd;text-decoration:line-through;">While this mode of operation does not yet allow for the creation of view layers, the underlying sources can still be queried as if they are a single source. </span> See the kit&#39;s &quot;teiid\-example/dynamicvdb\-*&quot; for working examples. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">To build a dynamic VDB, you&#39;ll need to create a *SOME\-NAME\-vdb.xml* file.  The XML file captures information about the VDB, the sources it integrate, and preferences for importing metadata. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">Dynamic VDBs take two forms - a simple xml deployment and a full zip file. <br></td></tr>
            <tr><td class="diff-unchanged" > <br></td></tr>
            <tr><td class="diff-deleted-lines" style="color:#999;background-color:#fdd;text-decoration:line-through;">{note}VDB name pattern must adhere to &quot;\-vdb.xml&quot;  for the Teiid VDB deployer to recognize this file as a dynamic VDB. <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;">h2. XML Deployment <br> <br>You can simply create a *SOME\-NAME\-vdb.xml* file.  The XML file captures information about the VDB, the sources it integrate, and preferences for importing metadata.   <br> <br>{note}The VDB name pattern must adhere to &quot;\-vdb.xml&quot;  for the Teiid VDB deployer to recognize this file. <br></td></tr>
            <tr><td class="diff-unchanged" >{note} <br> <br></td></tr>
            <tr><td class="diff-changed-lines" ><span class="diff-changed-words"><span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">my\-vdb.xml: \(</span>The</span> vdb\-deployer.xml schema for this file is available in the schema folder under the docs with the Teiid <span class="diff-changed-words">distribution.<span class="diff-deleted-chars"style="color:#999;background-color:#fdd;text-decoration:line-through;">)</span></span> <br></td></tr>
            <tr><td class="diff-added-lines" style="background-color: #dfd;"> <br>h2. VDB Zip Deployment <br> <br>For more complicated scenarios you are not limited to just an xml file deployment.  A full zip file similar to a Designer VDB may also be deployed.  In a vdb zip deployment: <br> <br>* The deployment must end with the extension .vdb <br>* The vdb xml file must be name vdb.xml and placed in the zip under /META-INF/vdb.xml <br>* If a /lib folder exists any jars found underneath will automatically be added to the vdb classpath. <br>* For backwards compatability with Designer VDBs, ff any .INDEX file exists the default metadata repository will be assumed to be INDEX. <br>* Files within the VDB zip are accessible by a [Custom Metadata Repository] using the {{MetadataFactory.getVDBResources()}} method, which returns a map of all {{VDBResources}} in the VDB keyed by absolute path relative to the vdb root. <br>* The built-in DDL-FILE metadata repository type may be used to define DDL-based metadata in files outside of the vdb.xml.  This improves the memory footprint of the vdb metadata and the maintainability of vdb.xml. <br> <br>{code:title=Example VDB Zip Structure} <br>/META-INF <br>   vdb.xml <br>/ddl <br>   schema1.ddl <br>/lib <br>   some-udf.jar <br>{code} <br> <br>In the above example the vdb.xml could use a DDL-FILE metadata type for schema1: <br> <br>{code} <br>&lt;model name=&quot;schema1&quot; ... <br>   &lt;metadata type=&quot;DDL-FILE&quot;&gt;/ddl/schema1.ddl&lt;metadata&gt; <br>&lt;/model&gt; <br>{code} <br></td></tr>
    
            </table>
    </div>                            <h4>Full Content</h4>
                    <div class="notificationGreySide">
        <p>Teiid integration is available via a "Dynamic VDB" without the need for Teiid Designer tooling.  See the kit's "teiid&#45;example/dynamicvdb&#45;*" for working examples.</p>

<p>Dynamic VDBs take two forms - a simple xml deployment and a full zip file.</p>

<h2><a name="DynamicVDBs-XMLDeployment"></a>XML Deployment</h2>

<p>You can simply create a <b>SOME&#45;NAME&#45;vdb.xml</b> file.  The XML file captures information about the VDB, the sources it integrate, and preferences for importing metadata.  </p>

<div class='panelMacro'><table class='noteMacro'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/author/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td>The VDB name pattern must adhere to "&#45;vdb.xml"  for the Teiid VDB deployer to recognize this file.</td></tr></table></div>

<p>The vdb&#45;deployer.xml schema for this file is available in the schema folder under the docs with the Teiid distribution.</p>

<h2><a name="DynamicVDBs-VDBZipDeployment"></a>VDB Zip Deployment</h2>

<p>For more complicated scenarios you are not limited to just an xml file deployment.  A full zip file similar to a Designer VDB may also be deployed.  In a vdb zip deployment:</p>

<ul>
        <li>The deployment must end with the extension .vdb</li>
        <li>The vdb xml file must be name vdb.xml and placed in the zip under /META-INF/vdb.xml</li>
        <li>If a /lib folder exists any jars found underneath will automatically be added to the vdb classpath.</li>
        <li>For backwards compatability with Designer VDBs, ff any .INDEX file exists the default metadata repository will be assumed to be INDEX.</li>
        <li>Files within the VDB zip are accessible by a <a href="/author/display/TEIID/Custom+Metadata+Repository" title="Custom Metadata Repository">Custom Metadata Repository</a> using the <tt>MetadataFactory.getVDBResources()</tt> method, which returns a map of all <tt>VDBResources</tt> in the VDB keyed by absolute path relative to the vdb root.</li>
        <li>The built-in DDL-FILE metadata repository type may be used to define DDL-based metadata in files outside of the vdb.xml.  This improves the memory footprint of the vdb metadata and the maintainability of vdb.xml.</li>
</ul>


<div class="code panel" style="border-width: 1px;"><div class="codeHeader panelHeader" style="border-bottom-width: 1px;"><b>Example VDB Zip Structure</b></div><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
/META-INF
   vdb.xml
/ddl
   schema1.ddl
/lib
   some-udf.jar
</pre>
</div></div>

<p>In the above example the vdb.xml could use a DDL-FILE metadata type for schema1:</p>

<div class="code panel" style="border-width: 1px;"><div class="codeContent panelContent">
<pre class="theme: Confluence; brush: java; gutter: false" style="font-size:12px; font-family: ConfluenceInstalledFont,monospace;">
&lt;model name="schema1" ...
   &lt;metadata type="DDL-FILE"&gt;/ddl/schema1.ddl&lt;metadata&gt;
&lt;/model&gt;
</pre>
</div></div>
    </div>
        <div id="commentsSection" class="wiki-content pageSection">
        <div style="float: right;" class="grey">
                        <a href="https://docs.jboss.org/author/users/removespacenotification.action?spaceKey=TEIID">Stop watching space</a>
            <span style="padding: 0px 5px;">|</span>
                <a href="https://docs.jboss.org/author/users/editmyemailsettings.action">Change email notification preferences</a>
</div>
        <a href="https://docs.jboss.org/author/display/TEIID/Dynamic+VDBs">View Online</a>
        |
        <a href="https://docs.jboss.org/author/pages/diffpagesbyversion.action?pageId=18646286&revisedVersion=5&originalVersion=4">View Changes</a>
                |
        <a href="https://docs.jboss.org/author/display/TEIID/Dynamic+VDBs?showComments=true&amp;showCommentArea=true#addcomment">Add Comment</a>
            </div>
</div>
</div>
</div>
</div>
</body>
</html>