incubator-oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattm...@apache.org
Subject svn commit: r1000710 [41/44] - in /incubator/oodt/site/components/maven: apidocs/org/apache/oodt/grid/ apidocs/org/apache/oodt/grid/class-use/ apidocs/org/apache/oodt/profile/handlers/cas/ apidocs/org/apache/oodt/profile/handlers/cas/class-use/ apidocs...
Date Fri, 24 Sep 2010 05:09:57 GMT
Added: incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/XMLPSProductHandler.html
URL: http://svn.apache.org/viewvc/incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/XMLPSProductHandler.html?rev=1000710&view=auto
==============================================================================
--- incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/XMLPSProductHandler.html (added)
+++ incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/XMLPSProductHandler.html Fri Sep 24 05:09:48 2010
@@ -0,0 +1,376 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xml:lang="en"><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>XMLPSProductHandler xref</title><link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" /></head><body>
+<div id="overview"><a href="../../../../../../apidocs/org/apache/oodt/xmlps/product/XMLPSProductHandler.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1" id="1">1</a>   <em class="jxr_javadoccomment">/**</em>
+<a name="2" href="#2" id="2">2</a>   <em class="jxr_javadoccomment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a name="3" href="#3" id="3">3</a>   <em class="jxr_javadoccomment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a name="4" href="#4" id="4">4</a>   <em class="jxr_javadoccomment"> * this work for additional information regarding copyright ownership.</em>
+<a name="5" href="#5" id="5">5</a>   <em class="jxr_javadoccomment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a name="6" href="#6" id="6">6</a>   <em class="jxr_javadoccomment"> * (the "License"); you may not use this file except in compliance with</em>
+<a name="7" href="#7" id="7">7</a>   <em class="jxr_javadoccomment"> * the License.  You may obtain a copy of the License at</em>
+<a name="8" href="#8" id="8">8</a>   <em class="jxr_javadoccomment"> *</em>
+<a name="9" href="#9" id="9">9</a>   <em class="jxr_javadoccomment"> *     <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="10" href="#10" id="10">10</a>  <em class="jxr_javadoccomment"> *</em>
+<a name="11" href="#11" id="11">11</a>  <em class="jxr_javadoccomment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="12" href="#12" id="12">12</a>  <em class="jxr_javadoccomment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="13" href="#13" id="13">13</a>  <em class="jxr_javadoccomment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="14" href="#14" id="14">14</a>  <em class="jxr_javadoccomment"> * See the License for the specific language governing permissions and</em>
+<a name="15" href="#15" id="15">15</a>  <em class="jxr_javadoccomment"> * limitations under the License.</em>
+<a name="16" href="#16" id="16">16</a>  <em class="jxr_javadoccomment"> */</em>
+<a name="17" href="#17" id="17">17</a>  
+<a name="18" href="#18" id="18">18</a>  <strong class="jxr_keyword">package</strong> org.apache.oodt.xmlps.product;
+<a name="19" href="#19" id="19">19</a>  
+<a name="20" href="#20" id="20">20</a>  <em class="jxr_comment">//OODT imports</em>
+<a name="21" href="#21" id="21">21</a>  <strong class="jxr_keyword">import</strong> java.io.FileInputStream;
+<a name="22" href="#22" id="22">22</a>  <strong class="jxr_keyword">import</strong> java.io.FileNotFoundException;
+<a name="23" href="#23" id="23">23</a>  <strong class="jxr_keyword">import</strong> java.io.IOException;
+<a name="24" href="#24" id="24">24</a>  <strong class="jxr_keyword">import</strong> java.sql.SQLException;
+<a name="25" href="#25" id="25">25</a>  <strong class="jxr_keyword">import</strong> java.util.Arrays;
+<a name="26" href="#26" id="26">26</a>  <strong class="jxr_keyword">import</strong> java.util.Iterator;
+<a name="27" href="#27" id="27">27</a>  <strong class="jxr_keyword">import</strong> java.util.List;
+<a name="28" href="#28" id="28">28</a>  <strong class="jxr_keyword">import</strong> java.util.Stack;
+<a name="29" href="#29" id="29">29</a>  <strong class="jxr_keyword">import</strong> java.util.Vector;
+<a name="30" href="#30" id="30">30</a>  <strong class="jxr_keyword">import</strong> java.util.logging.Level;
+<a name="31" href="#31" id="31">31</a>  <strong class="jxr_keyword">import</strong> java.util.logging.Logger;
+<a name="32" href="#32" id="32">32</a>  
+<a name="33" href="#33" id="33">33</a>  <em class="jxr_comment">//OODT imports</em>
+<a name="34" href="#34" id="34">34</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.mapping.DatabaseTable;
+<a name="35" href="#35" id="35">35</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.mapping.Mapping;
+<a name="36" href="#36" id="36">36</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.mapping.FieldScope;
+<a name="37" href="#37" id="37">37</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.mapping.MappingField;
+<a name="38" href="#38" id="38">38</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.mapping.MappingReader;
+<a name="39" href="#39" id="39">39</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.mapping.funcs.MappingFunc;
+<a name="40" href="#40" id="40">40</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.queryparser.Expression;
+<a name="41" href="#41" id="41">41</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.queryparser.HandlerQueryParser;
+<a name="42" href="#42" id="42">42</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.structs.CDEResult;
+<a name="43" href="#43" id="43">43</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.structs.CDERow;
+<a name="44" href="#44" id="44">44</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.structs.CDEValue;
+<a name="45" href="#45" id="45">45</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.util.XMLQueryHelper;
+<a name="46" href="#46" id="46">46</a>  
+<a name="47" href="#47" id="47">47</a>  <em class="jxr_comment">//OODT imports</em>
+<a name="48" href="#48" id="48">48</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.product.ProductException;
+<a name="49" href="#49" id="49">49</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.product.QueryHandler;
+<a name="50" href="#50" id="50">50</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlquery.QueryElement;
+<a name="51" href="#51" id="51">51</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlquery.Result;
+<a name="52" href="#52" id="52">52</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlquery.XMLQuery;
+<a name="53" href="#53" id="53">53</a>  
+<a name="54" href="#54" id="54">54</a>  <em class="jxr_javadoccomment">/**</em>
+<a name="55" href="#55" id="55">55</a>  <em class="jxr_javadoccomment"> * </em>
+<a name="56" href="#56" id="56">56</a>  <em class="jxr_javadoccomment"> * &lt;p&gt;</em>
+<a name="57" href="#57" id="57">57</a>  <em class="jxr_javadoccomment"> * An XML configurable version of a Product Server that requires no code</em>
+<a name="58" href="#58" id="58">58</a>  <em class="jxr_javadoccomment"> * to be written to plug into a local site's relational backend DBMS.</em>
+<a name="59" href="#59" id="59">59</a>  <em class="jxr_javadoccomment"> * &lt;/p&gt;.</em>
+<a name="60" href="#60" id="60">60</a>  <em class="jxr_javadoccomment"> */</em>
+<a name="61" href="#61" id="61">61</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/oodt/xmlps/product/XMLPSProductHandler.html">XMLPSProductHandler</a> implements <a href="../../../../../org/apache/oodt/product/QueryHandler.html">QueryHandler</a> {
+<a name="62" href="#62" id="62">62</a>  
+<a name="63" href="#63" id="63">63</a>      <em class="jxr_comment">/*<em class="jxr_comment"> our log stream */</em></em>
+<a name="64" href="#64" id="64">64</a>      <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> Logger LOG = Logger
+<a name="65" href="#65" id="65">65</a>              .getLogger(XMLPSProductHandler.<strong class="jxr_keyword">class</strong>.getName());
+<a name="66" href="#66" id="66">66</a>  
+<a name="67" href="#67" id="67">67</a>      <strong class="jxr_keyword">protected</strong> <a href="../../../../../org/apache/oodt/xmlps/mapping/Mapping.html">Mapping</a> mapping;
+<a name="68" href="#68" id="68">68</a>  
+<a name="69" href="#69" id="69">69</a>      <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/oodt/xmlps/product/DBMSExecutor.html">DBMSExecutor</a> executor;
+<a name="70" href="#70" id="70">70</a>  
+<a name="71" href="#71" id="71">71</a>      <strong class="jxr_keyword">protected</strong> <a href="../../../../../org/apache/oodt/xmlps/product/XMLPSProductHandler.html">XMLPSProductHandler</a>(String phony) {
+<a name="72" href="#72" id="72">72</a>          <em class="jxr_comment">/*<em class="jxr_comment"> this is to get around invoking the default constructor in sub-classes */</em></em>
+<a name="73" href="#73" id="73">73</a>      }
+<a name="74" href="#74" id="74">74</a>  
+<a name="75" href="#75" id="75">75</a>      <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/oodt/xmlps/product/XMLPSProductHandler.html">XMLPSProductHandler</a>() <strong class="jxr_keyword">throws</strong> InstantiationException {
+<a name="76" href="#76" id="76">76</a>          String MappingFilePath = System
+<a name="77" href="#77" id="77">77</a>                  .getProperty(<span class="jxr_string">"org.apache.oodt.xmlps.xml.mapFilePath"</span>);
+<a name="78" href="#78" id="78">78</a>  
+<a name="79" href="#79" id="79">79</a>          <strong class="jxr_keyword">if</strong> (MappingFilePath == <strong class="jxr_keyword">null</strong>) {
+<a name="80" href="#80" id="80">80</a>              <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> InstantiationException(
+<a name="81" href="#81" id="81">81</a>                      <span class="jxr_string">"Need to specify path to xml mapping file!"</span>);
+<a name="82" href="#82" id="82">82</a>          }
+<a name="83" href="#83" id="83">83</a>  
+<a name="84" href="#84" id="84">84</a>          <strong class="jxr_keyword">try</strong> {
+<a name="85" href="#85" id="85">85</a>              mapping = MappingReader.getMapping(MappingFilePath);
+<a name="86" href="#86" id="86">86</a>          } <strong class="jxr_keyword">catch</strong> (Exception e) {
+<a name="87" href="#87" id="87">87</a>              <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> InstantiationException(
+<a name="88" href="#88" id="88">88</a>                      <span class="jxr_string">"Unable to parse mapping xml file: ["</span>
+<a name="89" href="#89" id="89">89</a>                              + MappingFilePath + <span class="jxr_string">"]: reason: "</span>
+<a name="90" href="#90" id="90">90</a>                              + e.getMessage());
+<a name="91" href="#91" id="91">91</a>          }
+<a name="92" href="#92" id="92">92</a>  
+<a name="93" href="#93" id="93">93</a>          <em class="jxr_comment">/*<em class="jxr_comment"> load the db properties file */</em></em>
+<a name="94" href="#94" id="94">94</a>          <em class="jxr_comment">/*</em>
+<a name="95" href="#95" id="95">95</a>  <em class="jxr_comment">         * if one exists: otherwise, don't bother and just print out the SQL to</em>
+<a name="96" href="#96" id="96">96</a>  <em class="jxr_comment">         * the console.</em>
+<a name="97" href="#97" id="97">97</a>  <em class="jxr_comment">         */</em>
+<a name="98" href="#98" id="98">98</a>          String dbPropFilePath = System
+<a name="99" href="#99" id="99">99</a>                  .getProperty(<span class="jxr_string">"org.apache.oodt.xmlps.xml.dbPropFilePath"</span>);
+<a name="100" href="#100" id="100">100</a>         <strong class="jxr_keyword">if</strong> (dbPropFilePath != <strong class="jxr_keyword">null</strong>) {
+<a name="101" href="#101" id="101">101</a>             <strong class="jxr_keyword">try</strong> {
+<a name="102" href="#102" id="102">102</a>                 System.getProperties()
+<a name="103" href="#103" id="103">103</a>                         .load(<strong class="jxr_keyword">new</strong> FileInputStream(dbPropFilePath));
+<a name="104" href="#104" id="104">104</a>             } <strong class="jxr_keyword">catch</strong> (FileNotFoundException e) {
+<a name="105" href="#105" id="105">105</a>                 <em class="jxr_comment">// TODO Auto-generated catch block</em>
+<a name="106" href="#106" id="106">106</a>                 e.printStackTrace();
+<a name="107" href="#107" id="107">107</a>             } <strong class="jxr_keyword">catch</strong> (IOException e) {
+<a name="108" href="#108" id="108">108</a>                 e.printStackTrace();
+<a name="109" href="#109" id="109">109</a>                 <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> InstantiationException(e.getMessage());
+<a name="110" href="#110" id="110">110</a>             }
+<a name="111" href="#111" id="111">111</a> 
+<a name="112" href="#112" id="112">112</a>             executor = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/oodt/xmlps/product/DBMSExecutor.html">DBMSExecutor</a>();
+<a name="113" href="#113" id="113">113</a>         }
+<a name="114" href="#114" id="114">114</a>     }
+<a name="115" href="#115" id="115">115</a> 
+<a name="116" href="#116" id="116">116</a>     <em class="jxr_comment">/*</em>
+<a name="117" href="#117" id="117">117</a> <em class="jxr_comment">     * (non-Javadoc)</em>
+<a name="118" href="#118" id="118">118</a> <em class="jxr_comment">     * </em>
+<a name="119" href="#119" id="119">119</a> <em class="jxr_comment">     * @see org.apache.oodt.product.QueryHandler#query(org.apache.oodt.xmlquery.XMLQuery)</em>
+<a name="120" href="#120" id="120">120</a> <em class="jxr_comment">     */</em>
+<a name="121" href="#121" id="121">121</a>     <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/oodt/xmlquery/XMLQuery.html">XMLQuery</a> query(<a href="../../../../../org/apache/oodt/xmlquery/XMLQuery.html">XMLQuery</a> query) <strong class="jxr_keyword">throws</strong> ProductException {
+<a name="122" href="#122" id="122">122</a>         List&lt;QueryElement&gt; whereSet = query.getWhereElementSet();
+<a name="123" href="#123" id="123">123</a>         List&lt;QueryElement&gt; selectSet = query.getSelectElementSet();
+<a name="124" href="#124" id="124">124</a>         <strong class="jxr_keyword">try</strong> {
+<a name="125" href="#125" id="125">125</a>             translateToDomain(selectSet, <strong class="jxr_keyword">true</strong>);
+<a name="126" href="#126" id="126">126</a>             translateToDomain(whereSet, false);
+<a name="127" href="#127" id="127">127</a>         } <strong class="jxr_keyword">catch</strong> (Exception e) {
+<a name="128" href="#128" id="128">128</a>             e.printStackTrace();
+<a name="129" href="#129" id="129">129</a>             <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/oodt/product/ProductException.html">ProductException</a>(e.getMessage());
+<a name="130" href="#130" id="130">130</a>         }
+<a name="131" href="#131" id="131">131</a>         queryAndPackageResults(query);
+<a name="132" href="#132" id="132">132</a>         <strong class="jxr_keyword">return</strong> query;
+<a name="133" href="#133" id="133">133</a>     }
+<a name="134" href="#134" id="134">134</a> 
+<a name="135" href="#135" id="135">135</a>     <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">void</strong> main(String[] args) <strong class="jxr_keyword">throws</strong> Exception {
+<a name="136" href="#136" id="136">136</a>         String usage = <span class="jxr_string">"XMLPSProductHandler &lt;query&gt;\n"</span>;
+<a name="137" href="#137" id="137">137</a> 
+<a name="138" href="#138" id="138">138</a>         <strong class="jxr_keyword">if</strong> (args.length != 1) {
+<a name="139" href="#139" id="139">139</a>             System.err.println(usage);
+<a name="140" href="#140" id="140">140</a>             System.exit(1);
+<a name="141" href="#141" id="141">141</a>         }
+<a name="142" href="#142" id="142">142</a> 
+<a name="143" href="#143" id="143">143</a>         <a href="../../../../../org/apache/oodt/xmlps/product/XMLPSProductHandler.html">XMLPSProductHandler</a> handler = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/oodt/xmlps/product/XMLPSProductHandler.html">XMLPSProductHandler</a>();
+<a name="144" href="#144" id="144">144</a>         <a href="../../../../../org/apache/oodt/xmlquery/XMLQuery.html">XMLQuery</a> q = handler.query(<a href="../../../../../org/apache/oodt/xmlps/util/XMLQueryHelper.html">XMLQueryHelper</a>
+<a name="145" href="#145" id="145">145</a>                 .getDefaultQueryFromQueryString(args[0]));
+<a name="146" href="#146" id="146">146</a>         System.out.println(q.getXMLDocString());
+<a name="147" href="#147" id="147">147</a>     }
+<a name="148" href="#148" id="148">148</a> 
+<a name="149" href="#149" id="149">149</a>     <strong class="jxr_keyword">protected</strong> List&lt;QueryElement&gt; getElemNamesFromQueryElemSet(
+<a name="150" href="#150" id="150">150</a>             List&lt;QueryElement&gt; origSet) {
+<a name="151" href="#151" id="151">151</a>         <strong class="jxr_keyword">if</strong> (origSet == <strong class="jxr_keyword">null</strong> || (origSet != <strong class="jxr_keyword">null</strong> &amp;&amp; origSet.size() == 0))
+<a name="152" href="#152" id="152">152</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="153" href="#153" id="153">153</a> 
+<a name="154" href="#154" id="154">154</a>         List&lt;QueryElement&gt; newSet = <strong class="jxr_keyword">new</strong> Vector&lt;QueryElement&gt;();
+<a name="155" href="#155" id="155">155</a> 
+<a name="156" href="#156" id="156">156</a>         <strong class="jxr_keyword">for</strong> (Iterator&lt;QueryElement&gt; i = origSet.iterator(); i.hasNext();) {
+<a name="157" href="#157" id="157">157</a>             <a href="../../../../../org/apache/oodt/xmlquery/QueryElement.html">QueryElement</a> elem = i.next();
+<a name="158" href="#158" id="158">158</a>             <strong class="jxr_keyword">if</strong> (elem.getRole().equals(XMLQueryHelper.ROLE_ELEMNAME)
+<a name="159" href="#159" id="159">159</a>                     &amp;&amp; !mapping.constantField(elem.getValue())) {
+<a name="160" href="#160" id="160">160</a>                 newSet.add(elem);
+<a name="161" href="#161" id="161">161</a> 
+<a name="162" href="#162" id="162">162</a>             }
+<a name="163" href="#163" id="163">163</a> 
+<a name="164" href="#164" id="164">164</a>         }
+<a name="165" href="#165" id="165">165</a> 
+<a name="166" href="#166" id="166">166</a>         <strong class="jxr_keyword">return</strong> newSet;
+<a name="167" href="#167" id="167">167</a> 
+<a name="168" href="#168" id="168">168</a>     }
+<a name="169" href="#169" id="169">169</a> 
+<a name="170" href="#170" id="170">170</a>     <strong class="jxr_keyword">protected</strong> List&lt;QueryElement&gt; getConstElemNamesFromQueryElemSet(
+<a name="171" href="#171" id="171">171</a>             List&lt;QueryElement&gt; origSet) {
+<a name="172" href="#172" id="172">172</a>         <strong class="jxr_keyword">if</strong> (origSet == <strong class="jxr_keyword">null</strong> || (origSet != <strong class="jxr_keyword">null</strong> &amp;&amp; origSet.size() == 0))
+<a name="173" href="#173" id="173">173</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="174" href="#174" id="174">174</a> 
+<a name="175" href="#175" id="175">175</a>         List&lt;QueryElement&gt; newSet = <strong class="jxr_keyword">new</strong> Vector&lt;QueryElement&gt;();
+<a name="176" href="#176" id="176">176</a> 
+<a name="177" href="#177" id="177">177</a>         <strong class="jxr_keyword">for</strong> (Iterator&lt;QueryElement&gt; i = origSet.iterator(); i.hasNext();) {
+<a name="178" href="#178" id="178">178</a>             <a href="../../../../../org/apache/oodt/xmlquery/QueryElement.html">QueryElement</a> elem = i.next();
+<a name="179" href="#179" id="179">179</a>             <strong class="jxr_keyword">if</strong> (elem.getRole().equals(XMLQueryHelper.ROLE_ELEMNAME)
+<a name="180" href="#180" id="180">180</a>                     &amp;&amp; mapping.constantField(elem.getValue())) {
+<a name="181" href="#181" id="181">181</a>                 newSet.add(elem);
+<a name="182" href="#182" id="182">182</a>             }
+<a name="183" href="#183" id="183">183</a>         }
+<a name="184" href="#184" id="184">184</a> 
+<a name="185" href="#185" id="185">185</a>         <strong class="jxr_keyword">return</strong> newSet;
+<a name="186" href="#186" id="186">186</a>     }
+<a name="187" href="#187" id="187">187</a> 
+<a name="188" href="#188" id="188">188</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> queryAndPackageResults(<a href="../../../../../org/apache/oodt/xmlquery/XMLQuery.html">XMLQuery</a> query) {
+<a name="189" href="#189" id="189">189</a>         Stack&lt;QueryElement&gt; queryStack = <a href="../../../../../org/apache/oodt/xmlps/queryparser/HandlerQueryParser.html">HandlerQueryParser</a>
+<a name="190" href="#190" id="190">190</a>                 .createQueryStack(query.getWhereElementSet());
+<a name="191" href="#191" id="191">191</a>         <a href="../../../../../org/apache/oodt/xmlps/queryparser/Expression.html">Expression</a> parsedQuery = HandlerQueryParser.parse(queryStack,
+<a name="192" href="#192" id="192">192</a>                 <strong class="jxr_keyword">this</strong>.mapping);
+<a name="193" href="#193" id="193">193</a>         List&lt;QueryElement&gt; names = getElemNamesFromQueryElemSet(query
+<a name="194" href="#194" id="194">194</a>                 .getSelectElementSet());
+<a name="195" href="#195" id="195">195</a> 
+<a name="196" href="#196" id="196">196</a>         String querySelectNames = toNames(names);
+<a name="197" href="#197" id="197">197</a> 
+<a name="198" href="#198" id="198">198</a>         StringBuffer sqlBuf = <strong class="jxr_keyword">new</strong> StringBuffer(<span class="jxr_string">"SELECT "</span>);
+<a name="199" href="#199" id="199">199</a>         sqlBuf.append(querySelectNames);
+<a name="200" href="#200" id="200">200</a>         sqlBuf.append(<span class="jxr_string">" FROM "</span>);
+<a name="201" href="#201" id="201">201</a>         sqlBuf.append(mapping.getDefaultTable());
+<a name="202" href="#202" id="202">202</a>         sqlBuf.append(<span class="jxr_string">" "</span>);
+<a name="203" href="#203" id="203">203</a> 
+<a name="204" href="#204" id="204">204</a>         <strong class="jxr_keyword">if</strong> (mapping.getNumTables() &gt; 0) {
+<a name="205" href="#205" id="205">205</a>             <strong class="jxr_keyword">for</strong> (Iterator&lt;String&gt; i = mapping.getTableNames().iterator(); i
+<a name="206" href="#206" id="206">206</a>                     .hasNext();) {
+<a name="207" href="#207" id="207">207</a>                 String tableName = i.next();
+<a name="208" href="#208" id="208">208</a>                 <a href="../../../../../org/apache/oodt/xmlps/mapping/DatabaseTable.html">DatabaseTable</a> tbl = mapping.getTableByName(tableName);
+<a name="209" href="#209" id="209">209</a>                 sqlBuf.append(<span class="jxr_string">"INNER JOIN "</span>);
+<a name="210" href="#210" id="210">210</a>                 sqlBuf.append(tbl.getName());
+<a name="211" href="#211" id="211">211</a>                 sqlBuf.append(<span class="jxr_string">" ON "</span>);
+<a name="212" href="#212" id="212">212</a>                 sqlBuf.append(tbl.getName());
+<a name="213" href="#213" id="213">213</a>                 sqlBuf.append(<span class="jxr_string">"."</span>);
+<a name="214" href="#214" id="214">214</a>                 sqlBuf.append(tbl.getJoinFieldName());
+<a name="215" href="#215" id="215">215</a>                 sqlBuf.append(<span class="jxr_string">" = "</span>);
+<a name="216" href="#216" id="216">216</a>                 sqlBuf.append((tbl.getDefaultTableJoin() != <strong class="jxr_keyword">null</strong> &amp;&amp; 
+<a name="217" href="#217" id="217">217</a>                         !tbl.getDefaultTableJoin().equals(<span class="jxr_string">""</span>)) ? tbl
+<a name="218" href="#218" id="218">218</a>                         .getDefaultTableJoin() : mapping.getDefaultTable());
+<a name="219" href="#219" id="219">219</a>                 sqlBuf.append(<span class="jxr_string">"."</span>);
+<a name="220" href="#220" id="220">220</a>                 sqlBuf.append(tbl.getDefaultTableJoinFieldName());
+<a name="221" href="#221" id="221">221</a>                 sqlBuf.append(<span class="jxr_string">" "</span>);
+<a name="222" href="#222" id="222">222</a>             }
+<a name="223" href="#223" id="223">223</a>         }
+<a name="224" href="#224" id="224">224</a> 
+<a name="225" href="#225" id="225">225</a>         <strong class="jxr_keyword">if</strong>(parsedQuery != <strong class="jxr_keyword">null</strong>){
+<a name="226" href="#226" id="226">226</a>             sqlBuf.append(<span class="jxr_string">" WHERE "</span>);
+<a name="227" href="#227" id="227">227</a>             sqlBuf.append(parsedQuery.evaluate());            
+<a name="228" href="#228" id="228">228</a>         }
+<a name="229" href="#229" id="229">229</a> 
+<a name="230" href="#230" id="230">230</a>         LOG.log(Level.INFO, sqlBuf.toString());
+<a name="231" href="#231" id="231">231</a> 
+<a name="232" href="#232" id="232">232</a>         <strong class="jxr_keyword">if</strong> (executor != <strong class="jxr_keyword">null</strong>) {
+<a name="233" href="#233" id="233">233</a>             <strong class="jxr_keyword">try</strong> {
+<a name="234" href="#234" id="234">234</a>                 <a href="../../../../../org/apache/oodt/xmlps/structs/CDEResult.html">CDEResult</a> res = executor.executeLocalQuery(<strong class="jxr_keyword">this</strong>.mapping,
+<a name="235" href="#235" id="235">235</a>                         sqlBuf.toString(), Arrays.asList(querySelectNames
+<a name="236" href="#236" id="236">236</a>                                 .split(<span class="jxr_string">","</span>)));
+<a name="237" href="#237" id="237">237</a> 
+<a name="238" href="#238" id="238">238</a>                 res = addConstFields(res,
+<a name="239" href="#239" id="239">239</a>                         getConstElemNamesFromQueryElemSet(query
+<a name="240" href="#240" id="240">240</a>                                 .getSelectElementSet()));
+<a name="241" href="#241" id="241">241</a> 
+<a name="242" href="#242" id="242">242</a>                 <strong class="jxr_keyword">if</strong> (res.getRows() == <strong class="jxr_keyword">null</strong>
+<a name="243" href="#243" id="243">243</a>                         || (res.getRows() != <strong class="jxr_keyword">null</strong> &amp;&amp; res.getRows().size() == 0)) {
+<a name="244" href="#244" id="244">244</a>                 }
+<a name="245" href="#245" id="245">245</a>                 <a href="../../../../../org/apache/oodt/xmlquery/Result.html">Result</a> r = res.toResult();
+<a name="246" href="#246" id="246">246</a>                 <strong class="jxr_keyword">if</strong> (r != <strong class="jxr_keyword">null</strong>) {
+<a name="247" href="#247" id="247">247</a>                     query.getResults().add(r);
+<a name="248" href="#248" id="248">248</a>                 }
+<a name="249" href="#249" id="249">249</a>             } <strong class="jxr_keyword">catch</strong> (SQLException e) {
+<a name="250" href="#250" id="250">250</a>                 e.printStackTrace();
+<a name="251" href="#251" id="251">251</a>                 LOG.log(Level.WARNING, <span class="jxr_string">"Error executing sql: ["</span>
+<a name="252" href="#252" id="252">252</a>                         + sqlBuf.toString() + <span class="jxr_string">"]: Message: "</span> + e.getMessage());
+<a name="253" href="#253" id="253">253</a>             }
+<a name="254" href="#254" id="254">254</a>         }
+<a name="255" href="#255" id="255">255</a> 
+<a name="256" href="#256" id="256">256</a>     }
+<a name="257" href="#257" id="257">257</a> 
+<a name="258" href="#258" id="258">258</a>     <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/oodt/xmlps/structs/CDEResult.html">CDEResult</a> addConstFields(<a href="../../../../../org/apache/oodt/xmlps/structs/CDEResult.html">CDEResult</a> res,
+<a name="259" href="#259" id="259">259</a>             List&lt;QueryElement&gt; constFlds) {
+<a name="260" href="#260" id="260">260</a>         <a href="../../../../../org/apache/oodt/xmlps/structs/CDEResult.html">CDEResult</a> newRes = res;
+<a name="261" href="#261" id="261">261</a>         <strong class="jxr_keyword">if</strong> (constFlds != <strong class="jxr_keyword">null</strong> &amp;&amp; constFlds.size() &gt; 0) {
+<a name="262" href="#262" id="262">262</a>             <strong class="jxr_keyword">if</strong> (res == <strong class="jxr_keyword">null</strong>
+<a name="263" href="#263" id="263">263</a>                     || (res != <strong class="jxr_keyword">null</strong> &amp;&amp; (res.getRows() == <strong class="jxr_keyword">null</strong> || (res.getRows() != <strong class="jxr_keyword">null</strong> &amp;&amp; res
+<a name="264" href="#264" id="264">264</a>                             .getRows().size() == 0)))) {
+<a name="265" href="#265" id="265">265</a>                 newRes = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/oodt/xmlps/structs/CDEResult.html">CDEResult</a>();
+<a name="266" href="#266" id="266">266</a>                 <em class="jxr_comment">// add one row</em>
+<a name="267" href="#267" id="267">267</a>                 newRes.getRows().add(<strong class="jxr_keyword">new</strong> CDERow());
+<a name="268" href="#268" id="268">268</a>             }
+<a name="269" href="#269" id="269">269</a> 
+<a name="270" href="#270" id="270">270</a>             <strong class="jxr_keyword">for</strong> (Iterator&lt;QueryElement&gt; i = constFlds.iterator(); i.hasNext();) {
+<a name="271" href="#271" id="271">271</a>                 <a href="../../../../../org/apache/oodt/xmlquery/QueryElement.html">QueryElement</a> elem = i.next();
+<a name="272" href="#272" id="272">272</a>                 <a href="../../../../../org/apache/oodt/xmlps/mapping/MappingField.html">MappingField</a> fld = <strong class="jxr_keyword">this</strong>.mapping.getFieldByLocalName(elem
+<a name="273" href="#273" id="273">273</a>                         .getValue());
+<a name="274" href="#274" id="274">274</a> 
+<a name="275" href="#275" id="275">275</a>                 <strong class="jxr_keyword">for</strong> (Iterator&lt;CDERow&gt; j = newRes.getRows().iterator(); j
+<a name="276" href="#276" id="276">276</a>                         .hasNext();) {
+<a name="277" href="#277" id="277">277</a>                     <a href="../../../../../org/apache/oodt/xmlps/structs/CDERow.html">CDERow</a> row = j.next();
+<a name="278" href="#278" id="278">278</a>                     <a href="../../../../../org/apache/oodt/xmlps/structs/CDEValue.html">CDEValue</a> val = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/oodt/xmlps/structs/CDEValue.html">CDEValue</a>(fld.getName(), fld
+<a name="279" href="#279" id="279">279</a>                             .getConstantValue());
+<a name="280" href="#280" id="280">280</a>                     row.getVals().add(val);
+<a name="281" href="#281" id="281">281</a>                 }
+<a name="282" href="#282" id="282">282</a>             }
+<a name="283" href="#283" id="283">283</a>         }
+<a name="284" href="#284" id="284">284</a> 
+<a name="285" href="#285" id="285">285</a>         <strong class="jxr_keyword">return</strong> newRes;
+<a name="286" href="#286" id="286">286</a> 
+<a name="287" href="#287" id="287">287</a>     }
+<a name="288" href="#288" id="288">288</a> 
+<a name="289" href="#289" id="289">289</a>     <strong class="jxr_keyword">private</strong> String toNames(List&lt;QueryElement&gt; elems) {
+<a name="290" href="#290" id="290">290</a>         <strong class="jxr_keyword">if</strong> (elems == <strong class="jxr_keyword">null</strong> || (elems != <strong class="jxr_keyword">null</strong> &amp;&amp; elems.size() == 0))
+<a name="291" href="#291" id="291">291</a>             <strong class="jxr_keyword">return</strong> <strong class="jxr_keyword">null</strong>;
+<a name="292" href="#292" id="292">292</a> 
+<a name="293" href="#293" id="293">293</a>         StringBuffer buf = <strong class="jxr_keyword">new</strong> StringBuffer();
+<a name="294" href="#294" id="294">294</a>         <strong class="jxr_keyword">for</strong> (Iterator&lt;QueryElement&gt; i = elems.iterator(); i.hasNext();) {
+<a name="295" href="#295" id="295">295</a>             <a href="../../../../../org/apache/oodt/xmlquery/QueryElement.html">QueryElement</a> elem = i.next();
+<a name="296" href="#296" id="296">296</a>             buf.append(elem.getValue());
+<a name="297" href="#297" id="297">297</a>             buf.append(<span class="jxr_string">","</span>);
+<a name="298" href="#298" id="298">298</a>         }
+<a name="299" href="#299" id="299">299</a> 
+<a name="300" href="#300" id="300">300</a>         buf.deleteCharAt(buf.length() - 1);
+<a name="301" href="#301" id="301">301</a> 
+<a name="302" href="#302" id="302">302</a>         <strong class="jxr_keyword">return</strong> buf.toString();
+<a name="303" href="#303" id="303">303</a>     }
+<a name="304" href="#304" id="304">304</a> 
+<a name="305" href="#305" id="305">305</a>     <strong class="jxr_keyword">protected</strong> <strong class="jxr_keyword">void</strong> translateToDomain(List&lt;QueryElement&gt; elemSet,
+<a name="306" href="#306" id="306">306</a>             <strong class="jxr_keyword">boolean</strong> selectSet) <strong class="jxr_keyword">throws</strong> Exception {
+<a name="307" href="#307" id="307">307</a>         <em class="jxr_comment">// go through each query element: use the mapping fields</em>
+<a name="308" href="#308" id="308">308</a>         <em class="jxr_comment">// to translate the names</em>
+<a name="309" href="#309" id="309">309</a> 
+<a name="310" href="#310" id="310">310</a>         <strong class="jxr_keyword">for</strong> (Iterator&lt;QueryElement&gt; i = elemSet.iterator(); i.hasNext();) {
+<a name="311" href="#311" id="311">311</a>             <a href="../../../../../org/apache/oodt/xmlquery/QueryElement.html">QueryElement</a> elem = i.next();
+<a name="312" href="#312" id="312">312</a>             <strong class="jxr_keyword">if</strong> (elem.getRole().equals(XMLQueryHelper.ROLE_ELEMNAME)) {
+<a name="313" href="#313" id="313">313</a>                 <em class="jxr_comment">// do the translation</em>
+<a name="314" href="#314" id="314">314</a>                 String elemValue = elem.getValue();
+<a name="315" href="#315" id="315">315</a>                 <a href="../../../../../org/apache/oodt/xmlps/mapping/MappingField.html">MappingField</a> fld = <strong class="jxr_keyword">this</strong>.mapping.getFieldByName(elemValue);
+<a name="316" href="#316" id="316">316</a>                 <em class="jxr_comment">// make sure fld is not null</em>
+<a name="317" href="#317" id="317">317</a>                 <strong class="jxr_keyword">if</strong> (fld == <strong class="jxr_keyword">null</strong>) {
+<a name="318" href="#318" id="318">318</a>                     <strong class="jxr_keyword">continue</strong>;
+<a name="319" href="#319" id="319">319</a>                 }
+<a name="320" href="#320" id="320">320</a> 
+<a name="321" href="#321" id="321">321</a>                 <em class="jxr_comment">// make sure scope is null, or if it's not null, then it's</em>
+<a name="322" href="#322" id="322">322</a>                 <em class="jxr_comment">// FieldScope.QUERY</em>
+<a name="323" href="#323" id="323">323</a> 
+<a name="324" href="#324" id="324">324</a>                 <strong class="jxr_keyword">if</strong> (fld.getScope() != <strong class="jxr_keyword">null</strong>
+<a name="325" href="#325" id="325">325</a>                         &amp;&amp; fld.getScope().equals(FieldScope.RETURN)) {
+<a name="326" href="#326" id="326">326</a>                     <em class="jxr_comment">// skip</em>
+<a name="327" href="#327" id="327">327</a>                     <strong class="jxr_keyword">continue</strong>;
+<a name="328" href="#328" id="328">328</a>                 }
+<a name="329" href="#329" id="329">329</a> 
+<a name="330" href="#330" id="330">330</a>                 <em class="jxr_comment">// check to see if it has a dbname attr, if not, then the name</em>
+<a name="331" href="#331" id="331">331</a>                 <em class="jxr_comment">// stays</em>
+<a name="332" href="#332" id="332">332</a>                 <em class="jxr_comment">// the same</em>
+<a name="333" href="#333" id="333">333</a>                 String newFldName = <strong class="jxr_keyword">this</strong>.mapping.getFieldLocalName(fld);
+<a name="334" href="#334" id="334">334</a> 
+<a name="335" href="#335" id="335">335</a>                 elem.setValue(newFldName);
+<a name="336" href="#336" id="336">336</a> 
+<a name="337" href="#337" id="337">337</a>                 <em class="jxr_comment">// now translate the domain vocab if there are translate funcs</em>
+<a name="338" href="#338" id="338">338</a>                 <em class="jxr_comment">// present and this isn't the select set</em>
+<a name="339" href="#339" id="339">339</a> 
+<a name="340" href="#340" id="340">340</a>                 <strong class="jxr_keyword">if</strong> (!selectSet &amp;&amp; fld.getFuncs() != <strong class="jxr_keyword">null</strong>
+<a name="341" href="#341" id="341">341</a>                         &amp;&amp; fld.getFuncs().size() &gt; 0) {
+<a name="342" href="#342" id="342">342</a>                     <em class="jxr_comment">// the next query element should be</em>
+<a name="343" href="#343" id="343">343</a>                     <em class="jxr_comment">// XMLQueryHelper.ROLE_LITERAL</em>
+<a name="344" href="#344" id="344">344</a>                     <strong class="jxr_keyword">if</strong> (!i.hasNext())
+<a name="345" href="#345" id="345">345</a>                         <strong class="jxr_keyword">break</strong>;
+<a name="346" href="#346" id="346">346</a>                     <a href="../../../../../org/apache/oodt/xmlquery/QueryElement.html">QueryElement</a> litElem = i.next();
+<a name="347" href="#347" id="347">347</a>                     <strong class="jxr_keyword">if</strong> (!litElem.getRole().equals(XMLQueryHelper.ROLE_LITERAL)) {
+<a name="348" href="#348" id="348">348</a>                         <strong class="jxr_keyword">throw</strong> <strong class="jxr_keyword">new</strong> Exception(<span class="jxr_string">"next query element not "</span>
+<a name="349" href="#349" id="349">349</a>                                 + XMLQueryHelper.ROLE_LITERAL + <span class="jxr_string">"! role is "</span>
+<a name="350" href="#350" id="350">350</a>                                 + litElem.getRole() + <span class="jxr_string">" instead!"</span>);
+<a name="351" href="#351" id="351">351</a>                     }
+<a name="352" href="#352" id="352">352</a> 
+<a name="353" href="#353" id="353">353</a>                     <strong class="jxr_keyword">for</strong> (Iterator&lt;MappingFunc&gt; j = fld.getFuncs().iterator(); j
+<a name="354" href="#354" id="354">354</a>                             .hasNext();) {
+<a name="355" href="#355" id="355">355</a>                         <a href="../../../../../org/apache/oodt/xmlps/mapping/funcs/MappingFunc.html">MappingFunc</a> func = j.next();
+<a name="356" href="#356" id="356">356</a>                         <a href="../../../../../org/apache/oodt/xmlps/structs/CDEValue.html">CDEValue</a> origVal = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/oodt/xmlps/structs/CDEValue.html">CDEValue</a>(fld.getName(),
+<a name="357" href="#357" id="357">357</a>                                 litElem.getValue());
+<a name="358" href="#358" id="358">358</a>                         <a href="../../../../../org/apache/oodt/xmlps/structs/CDEValue.html">CDEValue</a> newVal = func.translate(origVal);
+<a name="359" href="#359" id="359">359</a>                         litElem.setValue(newVal.getVal());
+<a name="360" href="#360" id="360">360</a>                     }
+<a name="361" href="#361" id="361">361</a> 
+<a name="362" href="#362" id="362">362</a>                 }
+<a name="363" href="#363" id="363">363</a> 
+<a name="364" href="#364" id="364">364</a>             }
+<a name="365" href="#365" id="365">365</a>         }
+<a name="366" href="#366" id="366">366</a> 
+<a name="367" href="#367" id="367">367</a>     }
+<a name="368" href="#368" id="368">368</a> 
+<a name="369" href="#369" id="369">369</a> }
+</pre>
+<hr /><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body></html>
\ No newline at end of file

Added: incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/package-frame.html
URL: http://svn.apache.org/viewvc/incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/package-frame.html?rev=1000710&view=auto
==============================================================================
--- incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/package-frame.html (added)
+++ incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/package-frame.html Fri Sep 24 05:09:48 2010
@@ -0,0 +1,17 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xml:lang="en"><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>Apache OODT 0.1-incubating Reference Package org.apache.oodt.xmlps.product</title><link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" /></head><body>&#13;
+&#13;
+		<h3>&#13;
+        	<a href="package-summary.html" target="classFrame">org.apache.oodt.xmlps.product</a>&#13;
+      	</h3>&#13;
+&#13;
+      	<h3>Classes</h3>&#13;
+&#13;
+      	<ul><li>&#13;
+            	<a href="DBMSExecutor.html" target="classFrame">DBMSExecutor</a>&#13;
+          	</li>&#13;
+          	          	<li>&#13;
+            	<a href="XMLPSProductHandler.html" target="classFrame">XMLPSProductHandler</a>&#13;
+          	</li>&#13;
+          	      	</ul></body></html>
\ No newline at end of file

Added: incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/package-summary.html
URL: http://svn.apache.org/viewvc/incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/package-summary.html?rev=1000710&view=auto
==============================================================================
--- incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/package-summary.html (added)
+++ incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/product/package-summary.html Fri Sep 24 05:09:48 2010
@@ -0,0 +1,44 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xml:lang="en"><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>Apache OODT 0.1-incubating Reference Package org.apache.oodt.xmlps.product</title><link rel="stylesheet" type="text/css" href="../../../../../stylesheet.css" title="style" /></head><body>&#13;
+		      	<div class="overview">&#13;
+        	<ul><li>&#13;
+            		<a href="../../../../../overview-summary.html">Overview</a>&#13;
+          		</li>&#13;
+          		<li class="selected">Package</li>&#13;
+        	</ul></div>&#13;
+      	<div class="framenoframe">&#13;
+        	<ul><li>&#13;
+            		<a href="../../../../../index.html" target="_top">FRAMES</a>&#13;
+          		</li>&#13;
+          		<li>&#13;
+            		<a href="package-summary.html" target="_top">NO FRAMES</a>&#13;
+          		</li>&#13;
+        	</ul></div>&#13;
+		&#13;
+		      	<h2>Package org.apache.oodt.xmlps.product</h2>&#13;
+&#13;
+		<table class="summary"><thead><tr><th>Class Summary</th>&#13;
+          		</tr></thead><tbody><tr><td>&#13;
+                		<a href="DBMSExecutor.html" target="classFrame">DBMSExecutor</a>&#13;
+              		</td>&#13;
+            	</tr><tr><td>&#13;
+                		<a href="XMLPSProductHandler.html" target="classFrame">XMLPSProductHandler</a>&#13;
+              		</td>&#13;
+            	</tr></tbody></table><div class="overview">&#13;
+        	<ul><li>&#13;
+            		<a href="../../../../../overview-summary.html">Overview</a>&#13;
+          		</li>&#13;
+          		<li class="selected">Package</li>&#13;
+        	</ul></div>&#13;
+      	<div class="framenoframe">&#13;
+        	<ul><li>&#13;
+            		<a href="../../../../../index.html" target="_top">FRAMES</a>&#13;
+          		</li>&#13;
+          		<li>&#13;
+            		<a href="package-summary.html" target="_top">NO FRAMES</a>&#13;
+          		</li>&#13;
+        	</ul></div>&#13;
+				<hr />&#13;
+		Copyright © 1999-2010 Apache Incubator. All Rights Reserved.&#13;
+	</body></html>
\ No newline at end of file

Added: incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/profile/DBMSExecutor.html
URL: http://svn.apache.org/viewvc/incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/profile/DBMSExecutor.html?rev=1000710&view=auto
==============================================================================
--- incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/profile/DBMSExecutor.html (added)
+++ incubator/oodt/site/components/maven/xref/org/apache/oodt/xmlps/profile/DBMSExecutor.html Fri Sep 24 05:09:48 2010
@@ -0,0 +1,182 @@
+<?xml version='1.0' encoding='utf-8'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" xml:lang="en"><head><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><title>DBMSExecutor xref</title><link type="text/css" rel="stylesheet" href="../../../../../stylesheet.css" /></head><body>
+<div id="overview"><a href="../../../../../../apidocs/org/apache/oodt/xmlps/profile/DBMSExecutor.html">View Javadoc</a></div><pre>
+
+<a name="1" href="#1" id="1">1</a>   <em class="jxr_javadoccomment">/**</em>
+<a name="2" href="#2" id="2">2</a>   <em class="jxr_javadoccomment"> * Licensed to the Apache Software Foundation (ASF) under one or more</em>
+<a name="3" href="#3" id="3">3</a>   <em class="jxr_javadoccomment"> * contributor license agreements.  See the NOTICE file distributed with</em>
+<a name="4" href="#4" id="4">4</a>   <em class="jxr_javadoccomment"> * this work for additional information regarding copyright ownership.</em>
+<a name="5" href="#5" id="5">5</a>   <em class="jxr_javadoccomment"> * The ASF licenses this file to You under the Apache License, Version 2.0</em>
+<a name="6" href="#6" id="6">6</a>   <em class="jxr_javadoccomment"> * (the "License"); you may not use this file except in compliance with</em>
+<a name="7" href="#7" id="7">7</a>   <em class="jxr_javadoccomment"> * the License.  You may obtain a copy of the License at</em>
+<a name="8" href="#8" id="8">8</a>   <em class="jxr_javadoccomment"> *</em>
+<a name="9" href="#9" id="9">9</a>   <em class="jxr_javadoccomment"> *     <a href="http://www.apache.org/licenses/LICENSE-2.0" target="alexandria_uri">http://www.apache.org/licenses/LICENSE-2.0</a></em>
+<a name="10" href="#10" id="10">10</a>  <em class="jxr_javadoccomment"> *</em>
+<a name="11" href="#11" id="11">11</a>  <em class="jxr_javadoccomment"> * Unless required by applicable law or agreed to in writing, software</em>
+<a name="12" href="#12" id="12">12</a>  <em class="jxr_javadoccomment"> * distributed under the License is distributed on an "AS IS" BASIS,</em>
+<a name="13" href="#13" id="13">13</a>  <em class="jxr_javadoccomment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</em>
+<a name="14" href="#14" id="14">14</a>  <em class="jxr_javadoccomment"> * See the License for the specific language governing permissions and</em>
+<a name="15" href="#15" id="15">15</a>  <em class="jxr_javadoccomment"> * limitations under the License.</em>
+<a name="16" href="#16" id="16">16</a>  <em class="jxr_javadoccomment"> */</em>
+<a name="17" href="#17" id="17">17</a>  
+<a name="18" href="#18" id="18">18</a>  <strong class="jxr_keyword">package</strong> org.apache.oodt.xmlps.profile;
+<a name="19" href="#19" id="19">19</a>  
+<a name="20" href="#20" id="20">20</a>  <em class="jxr_comment">//OODT imports</em>
+<a name="21" href="#21" id="21">21</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.mapping.Mapping;
+<a name="22" href="#22" id="22">22</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.mapping.FieldType;
+<a name="23" href="#23" id="23">23</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.mapping.MappingField;
+<a name="24" href="#24" id="24">24</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.mapping.funcs.MappingFunc;
+<a name="25" href="#25" id="25">25</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.xmlps.structs.CDEValue;
+<a name="26" href="#26" id="26">26</a>  
+<a name="27" href="#27" id="27">27</a>  <em class="jxr_comment">//JDK imports</em>
+<a name="28" href="#28" id="28">28</a>  <strong class="jxr_keyword">import</strong> java.sql.Connection;
+<a name="29" href="#29" id="29">29</a>  <strong class="jxr_keyword">import</strong> java.sql.ResultSet;
+<a name="30" href="#30" id="30">30</a>  <strong class="jxr_keyword">import</strong> java.sql.SQLException;
+<a name="31" href="#31" id="31">31</a>  <strong class="jxr_keyword">import</strong> java.sql.Statement;
+<a name="32" href="#32" id="32">32</a>  <strong class="jxr_keyword">import</strong> java.util.Iterator;
+<a name="33" href="#33" id="33">33</a>  <strong class="jxr_keyword">import</strong> java.util.List;
+<a name="34" href="#34" id="34">34</a>  <strong class="jxr_keyword">import</strong> java.util.Vector;
+<a name="35" href="#35" id="35">35</a>  <strong class="jxr_keyword">import</strong> java.util.logging.Level;
+<a name="36" href="#36" id="36">36</a>  <strong class="jxr_keyword">import</strong> java.util.logging.Logger;
+<a name="37" href="#37" id="37">37</a>  <strong class="jxr_keyword">import</strong> javax.sql.DataSource;
+<a name="38" href="#38" id="38">38</a>  
+<a name="39" href="#39" id="39">39</a>  <em class="jxr_comment">//OODT imports</em>
+<a name="40" href="#40" id="40">40</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.profile.EnumeratedProfileElement;
+<a name="41" href="#41" id="41">41</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.profile.Profile;
+<a name="42" href="#42" id="42">42</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.profile.ProfileAttributes;
+<a name="43" href="#43" id="43">43</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.profile.ProfileElement;
+<a name="44" href="#44" id="44">44</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.profile.ResourceAttributes;
+<a name="45" href="#45" id="45">45</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.cas.metadata.Metadata;
+<a name="46" href="#46" id="46">46</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.cas.metadata.util.PathUtils;
+<a name="47" href="#47" id="47">47</a>  <strong class="jxr_keyword">import</strong> org.apache.oodt.commons.database.DatabaseConnectionBuilder;
+<a name="48" href="#48" id="48">48</a>  
+<a name="49" href="#49" id="49">49</a>  <em class="jxr_javadoccomment">/**</em>
+<a name="50" href="#50" id="50">50</a>  <em class="jxr_javadoccomment"> * </em>
+<a name="51" href="#51" id="51">51</a>  <em class="jxr_javadoccomment"> * &lt;p&gt;</em>
+<a name="52" href="#52" id="52">52</a>  <em class="jxr_javadoccomment"> * Executes Profile Queries against an underlying JDBC database, backed by</em>
+<a name="53" href="#53" id="53">53</a>  <em class="jxr_javadoccomment"> * Apache commons-pool and commons-dbcp.</em>
+<a name="54" href="#54" id="54">54</a>  <em class="jxr_javadoccomment"> * &lt;/p&gt;</em>
+<a name="55" href="#55" id="55">55</a>  <em class="jxr_javadoccomment"> * .</em>
+<a name="56" href="#56" id="56">56</a>  <em class="jxr_javadoccomment"> */</em>
+<a name="57" href="#57" id="57">57</a>  <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">class</strong> <a href="../../../../../org/apache/oodt/xmlps/profile/DBMSExecutor.html">DBMSExecutor</a> {
+<a name="58" href="#58" id="58">58</a>  
+<a name="59" href="#59" id="59">59</a>    <strong class="jxr_keyword">private</strong> DataSource dataSource;
+<a name="60" href="#60" id="60">60</a>  
+<a name="61" href="#61" id="61">61</a>    <strong class="jxr_keyword">private</strong> <strong class="jxr_keyword">static</strong> <strong class="jxr_keyword">final</strong> Logger LOG = Logger.getLogger(DBMSExecutor.<strong class="jxr_keyword">class</strong>
+<a name="62" href="#62" id="62">62</a>        .getName());
+<a name="63" href="#63" id="63">63</a>  
+<a name="64" href="#64" id="64">64</a>    <strong class="jxr_keyword">public</strong> <a href="../../../../../org/apache/oodt/xmlps/profile/DBMSExecutor.html">DBMSExecutor</a>() {
+<a name="65" href="#65" id="65">65</a>      String jdbcUrl = System.getProperty(<span class="jxr_string">"xmlps.datasource.jdbc.url"</span>);
+<a name="66" href="#66" id="66">66</a>      String user = System.getProperty(<span class="jxr_string">"xmlps.datasource.jdbc.user"</span>);
+<a name="67" href="#67" id="67">67</a>      String pass = System.getProperty(<span class="jxr_string">"xmlps.datasource.jdbc.pass"</span>);
+<a name="68" href="#68" id="68">68</a>      String driver = System.getProperty(<span class="jxr_string">"xmlps.datasource.jdbc.driver"</span>);
+<a name="69" href="#69" id="69">69</a>      <strong class="jxr_keyword">try</strong> {
+<a name="70" href="#70" id="70">70</a>        Class.forName(driver);
+<a name="71" href="#71" id="71">71</a>      } <strong class="jxr_keyword">catch</strong> (ClassNotFoundException ignore) {
+<a name="72" href="#72" id="72">72</a>      }
+<a name="73" href="#73" id="73">73</a>  
+<a name="74" href="#74" id="74">74</a>      <strong class="jxr_keyword">this</strong>.dataSource = DatabaseConnectionBuilder.buildDataSource(user, pass,
+<a name="75" href="#75" id="75">75</a>          driver, jdbcUrl);
+<a name="76" href="#76" id="76">76</a>  
+<a name="77" href="#77" id="77">77</a>    }
+<a name="78" href="#78" id="78">78</a>  
+<a name="79" href="#79" id="79">79</a>    <strong class="jxr_keyword">public</strong> List&lt;Profile&gt; executeLocalQuery(<a href="../../../../../org/apache/oodt/xmlps/mapping/Mapping.html">Mapping</a> map, String sql,
+<a name="80" href="#80" id="80">80</a>        String resLocationSpec) <strong class="jxr_keyword">throws</strong> SQLException {
+<a name="81" href="#81" id="81">81</a>      Connection conn = <strong class="jxr_keyword">null</strong>;
+<a name="82" href="#82" id="82">82</a>      Statement statement = <strong class="jxr_keyword">null</strong>;
+<a name="83" href="#83" id="83">83</a>  
+<a name="84" href="#84" id="84">84</a>      List&lt;Profile&gt; profiles = <strong class="jxr_keyword">null</strong>;
+<a name="85" href="#85" id="85">85</a>  
+<a name="86" href="#86" id="86">86</a>      <strong class="jxr_keyword">try</strong> {
+<a name="87" href="#87" id="87">87</a>        conn = dataSource.getConnection();
+<a name="88" href="#88" id="88">88</a>        statement = conn.createStatement();
+<a name="89" href="#89" id="89">89</a>        ResultSet rs = statement.executeQuery(sql);
+<a name="90" href="#90" id="90">90</a>  
+<a name="91" href="#91" id="91">91</a>        profiles = <strong class="jxr_keyword">new</strong> Vector&lt;Profile&gt;();
+<a name="92" href="#92" id="92">92</a>  
+<a name="93" href="#93" id="93">93</a>        <strong class="jxr_keyword">while</strong> (rs.next()) {
+<a name="94" href="#94" id="94">94</a>          <a href="../../../../../org/apache/oodt/profile/Profile.html">Profile</a> prof = toProfile(rs, map, resLocationSpec);
+<a name="95" href="#95" id="95">95</a>          profiles.add(prof);
+<a name="96" href="#96" id="96">96</a>        }
+<a name="97" href="#97" id="97">97</a>  
+<a name="98" href="#98" id="98">98</a>      } <strong class="jxr_keyword">catch</strong> (SQLException e) {
+<a name="99" href="#99" id="99">99</a>        e.printStackTrace();
+<a name="100" href="#100" id="100">100</a>       <strong class="jxr_keyword">throw</strong> e;
+<a name="101" href="#101" id="101">101</a>     } <strong class="jxr_keyword">finally</strong> {
+<a name="102" href="#102" id="102">102</a>       <strong class="jxr_keyword">if</strong> (statement != <strong class="jxr_keyword">null</strong>) {
+<a name="103" href="#103" id="103">103</a>         <strong class="jxr_keyword">try</strong> {
+<a name="104" href="#104" id="104">104</a>           statement.close();
+<a name="105" href="#105" id="105">105</a>         } <strong class="jxr_keyword">catch</strong> (Exception ignore) {
+<a name="106" href="#106" id="106">106</a>         }
+<a name="107" href="#107" id="107">107</a> 
+<a name="108" href="#108" id="108">108</a>         statement = <strong class="jxr_keyword">null</strong>;
+<a name="109" href="#109" id="109">109</a>       }
+<a name="110" href="#110" id="110">110</a> 
+<a name="111" href="#111" id="111">111</a>       <strong class="jxr_keyword">if</strong> (conn != <strong class="jxr_keyword">null</strong>) {
+<a name="112" href="#112" id="112">112</a>         <strong class="jxr_keyword">try</strong> {
+<a name="113" href="#113" id="113">113</a>           conn.close();
+<a name="114" href="#114" id="114">114</a>         } <strong class="jxr_keyword">catch</strong> (Exception ignore) {
+<a name="115" href="#115" id="115">115</a>         }
+<a name="116" href="#116" id="116">116</a> 
+<a name="117" href="#117" id="117">117</a>         conn = <strong class="jxr_keyword">null</strong>;
+<a name="118" href="#118" id="118">118</a>       }
+<a name="119" href="#119" id="119">119</a>     }
+<a name="120" href="#120" id="120">120</a> 
+<a name="121" href="#121" id="121">121</a>     <strong class="jxr_keyword">return</strong> profiles;
+<a name="122" href="#122" id="122">122</a> 
+<a name="123" href="#123" id="123">123</a>   }
+<a name="124" href="#124" id="124">124</a> 
+<a name="125" href="#125" id="125">125</a>   <strong class="jxr_keyword">private</strong> <a href="../../../../../org/apache/oodt/profile/Profile.html">Profile</a> toProfile(ResultSet rs, <a href="../../../../../org/apache/oodt/xmlps/mapping/Mapping.html">Mapping</a> map, String resLocationSpec) {
+<a name="126" href="#126" id="126">126</a>     <a href="../../../../../org/apache/oodt/profile/Profile.html">Profile</a> profile = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/oodt/profile/Profile.html">Profile</a>();
+<a name="127" href="#127" id="127">127</a>     <a href="../../../../../org/apache/oodt/profile/ResourceAttributes.html">ResourceAttributes</a> resAttr = profile.getResourceAttributes();
+<a name="128" href="#128" id="128">128</a>     <a href="../../../../../org/apache/oodt/profile/ProfileAttributes.html">ProfileAttributes</a> profAttr = profile.getProfileAttributes();
+<a name="129" href="#129" id="129">129</a>     resAttr.setResClass(<span class="jxr_string">"system.profile"</span>);
+<a name="130" href="#130" id="130">130</a>     profAttr.setStatusID(<span class="jxr_string">"active"</span>);
+<a name="131" href="#131" id="131">131</a>     profAttr.setType(<span class="jxr_string">"profile"</span>);
+<a name="132" href="#132" id="132">132</a> 
+<a name="133" href="#133" id="133">133</a>     <a href="../../../../../org/apache/oodt/cas/metadata/Metadata.html">Metadata</a> met = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/oodt/cas/metadata/Metadata.html">Metadata</a>();
+<a name="134" href="#134" id="134">134</a> 
+<a name="135" href="#135" id="135">135</a>     <strong class="jxr_keyword">for</strong> (Iterator&lt;String&gt; i = map.getFieldNames().iterator(); i.hasNext();) {
+<a name="136" href="#136" id="136">136</a>       String fldName = i.next();
+<a name="137" href="#137" id="137">137</a>       <a href="../../../../../org/apache/oodt/xmlps/mapping/MappingField.html">MappingField</a> fld = map.getFieldByName(fldName);
+<a name="138" href="#138" id="138">138</a>       <a href="../../../../../org/apache/oodt/profile/ProfileElement.html">ProfileElement</a> elem = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/oodt/profile/EnumeratedProfileElement.html">EnumeratedProfileElement</a>(profile);
+<a name="139" href="#139" id="139">139</a>       elem.setName(fld.getName());
+<a name="140" href="#140" id="140">140</a> 
+<a name="141" href="#141" id="141">141</a>       <strong class="jxr_keyword">try</strong> {
+<a name="142" href="#142" id="142">142</a>         <strong class="jxr_keyword">if</strong> (fld.getType().equals(FieldType.CONSTANT)) {
+<a name="143" href="#143" id="143">143</a>           elem.getValues().add(fld.getConstantValue());
+<a name="144" href="#144" id="144">144</a>         } <strong class="jxr_keyword">else</strong> {
+<a name="145" href="#145" id="145">145</a>           String elemDbVal = rs.getString(fld.getDbName());
+<a name="146" href="#146" id="146">146</a>           <strong class="jxr_keyword">for</strong> (Iterator&lt;MappingFunc&gt; j = fld.getFuncs().iterator(); j.hasNext();) {
+<a name="147" href="#147" id="147">147</a>             <a href="../../../../../org/apache/oodt/xmlps/mapping/funcs/MappingFunc.html">MappingFunc</a> func = j.next();
+<a name="148" href="#148" id="148">148</a>             <a href="../../../../../org/apache/oodt/xmlps/structs/CDEValue.html">CDEValue</a> origVal = <strong class="jxr_keyword">new</strong> <a href="../../../../../org/apache/oodt/xmlps/structs/CDEValue.html">CDEValue</a>(fld.getName(), elemDbVal);
+<a name="149" href="#149" id="149">149</a>             <a href="../../../../../org/apache/oodt/xmlps/structs/CDEValue.html">CDEValue</a> newVal = func.inverseTranslate(origVal);
+<a name="150" href="#150" id="150">150</a>             elemDbVal = newVal.getVal();
+<a name="151" href="#151" id="151">151</a>           }
+<a name="152" href="#152" id="152">152</a> 
+<a name="153" href="#153" id="153">153</a>           elem.getValues().add(elemDbVal);
+<a name="154" href="#154" id="154">154</a>         }
+<a name="155" href="#155" id="155">155</a>       } <strong class="jxr_keyword">catch</strong> (SQLException e) {
+<a name="156" href="#156" id="156">156</a>         e.printStackTrace();
+<a name="157" href="#157" id="157">157</a>         LOG.log(Level.WARNING, <span class="jxr_string">"Unable to obtain field: ["</span>
+<a name="158" href="#158" id="158">158</a>             + map.getFieldLocalName(fld) + <span class="jxr_string">"] from result set: message: "</span>
+<a name="159" href="#159" id="159">159</a>             + e.getMessage());
+<a name="160" href="#160" id="160">160</a>       }
+<a name="161" href="#161" id="161">161</a> 
+<a name="162" href="#162" id="162">162</a>       met.addMetadata(elem.getName(), (String) elem.getValues().get(0));
+<a name="163" href="#163" id="163">163</a> 
+<a name="164" href="#164" id="164">164</a>       profile.getProfileElements().put(fld.getName(), elem);
+<a name="165" href="#165" id="165">165</a>     }
+<a name="166" href="#166" id="166">166</a> 
+<a name="167" href="#167" id="167">167</a>     <strong class="jxr_keyword">if</strong> (resLocationSpec != <strong class="jxr_keyword">null</strong>) {
+<a name="168" href="#168" id="168">168</a>       resAttr.getResLocations().add(
+<a name="169" href="#169" id="169">169</a>           PathUtils.replaceEnvVariables(resLocationSpec, met));
+<a name="170" href="#170" id="170">170</a>     }
+<a name="171" href="#171" id="171">171</a> 
+<a name="172" href="#172" id="172">172</a>     <strong class="jxr_keyword">return</strong> profile;
+<a name="173" href="#173" id="173">173</a>   }
+<a name="174" href="#174" id="174">174</a> 
+<a name="175" href="#175" id="175">175</a> }
+</pre>
+<hr /><div id="footer">This page was automatically generated by <a href="http://maven.apache.org/">Maven</a></div></body></html>
\ No newline at end of file



Mime
View raw message