<?xml version="1.0" encoding="UTF-8"?>
<hibernate-generic datetime="2026-02-03 14:22:16">
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1069</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<collection name="children"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</element>
</collection>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1066</id>
</element>
</collection>
<collection name="outgoingLinks"><element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331460</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331461</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331462</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331463</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331464</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331465</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331466</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331467</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331468</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331469</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331470</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331471</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331472</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331473</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331474</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331475</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331476</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331477</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331478</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331479</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331480</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331481</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331482</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331483</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331484</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331485</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331486</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331487</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331488</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331489</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331490</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331491</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331492</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331493</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331494</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331495</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331496</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331497</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331498</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331499</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331500</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331501</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331502</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331503</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331504</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331505</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331506</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331507</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331508</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331509</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331510</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331511</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331512</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331513</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331514</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331515</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331516</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331517</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331518</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331519</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331520</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331521</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331522</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331523</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331524</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331525</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331526</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331527</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331528</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331529</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331530</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331531</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331532</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331533</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331534</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331535</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331536</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331537</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331538</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331539</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331540</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331541</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331542</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331543</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331544</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331545</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331546</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331547</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331548</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331549</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331550</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331551</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331552</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331553</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331554</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">331555</id>
</element>
</collection>
<property name="version">33</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.170</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">1072</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1077</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1078</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1079</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163850</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163854</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163857</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163858</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163860</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163862</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163866</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163867</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163872</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163874</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163889</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163890</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163891</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163892</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163894</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163896</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163897</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163899</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163900</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163905</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163906</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163909</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163910</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163911</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163915</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163916</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163917</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163918</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">71</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<collection name="children"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</element>
</collection>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">69</id>
</element>
</collection>
<collection name="outgoingLinks"><element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228232</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228233</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228234</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228235</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228236</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228237</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228238</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228239</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228240</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228241</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228242</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228243</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228244</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228245</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228246</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228247</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228248</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228249</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228250</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228251</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228252</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228253</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228254</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228255</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228256</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228257</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228258</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228259</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228260</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228261</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228262</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228263</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228264</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228265</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228266</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228267</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228268</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228269</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228270</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228271</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228272</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228273</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228274</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228275</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228276</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228277</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228278</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228279</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228280</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228281</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228282</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228283</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228284</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228285</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228286</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228287</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228288</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228289</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228290</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228291</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228292</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228293</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228294</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228295</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228296</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228297</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228298</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228299</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228300</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228301</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228302</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228303</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228304</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228305</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228306</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228307</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228308</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228309</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228310</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228311</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228312</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228313</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228314</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228315</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228316</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228317</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228318</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228319</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228320</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228321</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228322</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228323</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228324</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228325</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228326</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228327</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228328</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228329</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228330</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228331</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228332</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228333</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228334</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228335</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228336</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228337</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228338</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228339</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228340</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228341</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228342</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228343</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228344</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228345</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228346</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228347</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228348</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228349</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228350</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228351</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228352</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228353</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228354</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228355</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228356</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228357</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228358</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228359</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2228360</id>
</element>
</collection>
<collection name="referralLinks"><element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">31</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">51</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">53</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">54</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">55</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">68</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">171</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">221</id>
</element>
</collection>
<property name="version">71</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.693</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">72</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">73</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">74</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">145</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">147</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">182</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">222</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">223</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">229</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">232</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">234</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">235</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">236</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">237</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">238</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">239</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">240</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">241</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">242</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">275</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">276</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">366</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">368</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">487</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">570</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">742</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">860</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">861</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">862</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">864</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">865</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">866</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">867</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">908</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">909</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">910</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">911</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">912</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">913</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">932</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">934</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">935</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">942</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">947</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">948</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">951</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">952</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">953</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">954</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">956</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">957</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">969</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">971</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">972</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">974</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">975</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">983</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">985</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">988</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">989</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">990</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1002</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1003</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1007</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1008</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1009</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1020</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1043</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">589906</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">2162694</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">925</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<collection name="children"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</element>
</collection>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">922</id>
</element>
</collection>
<collection name="outgoingLinks"><element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">332997</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">332998</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">332999</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333000</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333001</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333002</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333003</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333004</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333005</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333006</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333007</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333008</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333009</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333010</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333011</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333012</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333013</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333014</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333015</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333016</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333017</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333018</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333019</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333020</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333021</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333022</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333023</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333024</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333025</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333026</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333027</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333028</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333029</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333030</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333031</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333032</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333033</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333034</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333035</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333036</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333037</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333038</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333039</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333040</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333041</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333042</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333043</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333044</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333045</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333046</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333047</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333048</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333049</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333050</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333051</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333052</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333053</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333054</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333055</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333056</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333057</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333058</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333059</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333060</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333061</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333062</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333063</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333064</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333065</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333066</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333067</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333068</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333069</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333070</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333071</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333072</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333073</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333074</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333075</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333076</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333077</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333078</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333079</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333080</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333081</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333082</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333083</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333084</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333085</id>
</element>
</collection>
<collection name="referralLinks"><element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">1933372</id>
</element>
</collection>
<property name="version">67</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.130</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">931</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">949</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">955</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">958</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">959</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">960</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">961</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">962</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">966</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">967</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">968</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">970</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">973</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">977</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">978</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">980</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">982</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">993</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">994</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">995</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">997</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">998</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">999</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1001</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1010</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1011</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1015</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1016</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1017</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1018</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1019</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1022</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1026</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1030</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1035</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1036</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1037</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1065</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1067</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1068</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1070</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1071</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1075</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1076</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1086</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1091</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1092</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1093</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1094</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1097</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1098</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163859</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163861</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163863</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163864</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163865</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163868</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163870</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163871</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163873</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163893</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163898</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163912</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163913</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163926</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163934</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="ConfluenceBandanaRecord" package="com.atlassian.confluence.setup.bandana">
<id name="id">131076</id>
<property name="context"><![CDATA[AST]]></property>
<property name="key"><![CDATA[atlassian.confluence.css.resource.counter]]></property>
<property name="value"><![CDATA[<int>1</int>]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">233</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">231</id>
</element>
</collection>
<collection name="outgoingLinks"><element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">9171</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">9172</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">9173</id>
</element>
</collection>
<collection name="referralLinks"><element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">50</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">56</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">64</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">65</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">66</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">80</id>
</element>
</collection>
<property name="version">29</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-27 13:10:51.920</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">248</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">249</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">250</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">251</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">265</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">266</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">277</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">283</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">289</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">293</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">294</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">315</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">316</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">323</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">324</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">353</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">926</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">928</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">929</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">950</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">965</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">979</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">981</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">996</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1000</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1013</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1014</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1021</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">743</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[AccessAppChanges]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">740</id>
</element>
</collection>
<collection name="referralLinks"><element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">251</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">252</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2007-02-05 09:04:52.420</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 10:49:52.853</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">745</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">746</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">747</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">748</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">749</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">933</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">984</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">986</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">24</id>
<collection name="children"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">22</id>
</element>
</collection>
<collection name="outgoingLinks"><element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2229301</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2229302</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2229303</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2229304</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2229305</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2229306</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2229307</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2229308</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2229309</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2229310</id>
</element>
</collection>
<collection name="referralLinks"><element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">30</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">33</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">36</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">39</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">42</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">46</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">48</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">52</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">63</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">67</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">82</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">94</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">97</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">136</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">165</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">172</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">249</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">250</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">1933371</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">4849669</id>
</element>
</collection>
<property name="version">19</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.957</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">65</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">70</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">143</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">144</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">146</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">148</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">150</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">169</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">170</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">185</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">208</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">231</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">243</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">350</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1059</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1060</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">2162819</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">2162820</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
<collection name="labellings"><element class="Labelling" package="com.atlassian.confluence.labels"><id name="id">3</id>
</element>
</collection>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">171</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">169</id>
</element>
</collection>
<collection name="outgoingLinks"><element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">1194</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">1195</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">1196</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">1197</id>
</element>
</collection>
<collection name="referralLinks"><element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">24</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">26</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">27</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">28</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">29</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">32</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">37</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">45</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">96</id>
</element>
</collection>
<property name="version">27</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-06 15:40:16.293</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">172</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">173</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">174</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">175</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">176</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">177</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">178</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">179</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">180</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">181</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">183</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">184</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">186</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">187</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">188</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">189</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">190</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">191</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">192</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">193</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">194</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">196</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">197</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">198</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">203</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">217</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Space" package="com.atlassian.confluence.spaces">
<id name="id">6</id>
<property name="name"><![CDATA[900626 Asset Configuration and Tracking Consolidation]]></property>
<property name="key"><![CDATA[AST]]></property>
<property name="description" class="SpaceDescription" package="com.atlassian.confluence.spaces"><id name="id">23</id>
</property>
<property name="homePage" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<collection name="permissions"><element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">164</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">165</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">166</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">167</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">168</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">169</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">170</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">171</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">172</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">173</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">174</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">175</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">176</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">177</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">4882445</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">4882446</id>
</element>
<element class="SpacePermission" package="com.atlassian.confluence.security"><id name="id">19300571</id>
</element>
</collection>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
<property name="spaceType">global</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">212</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[Approaches]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">210</id>
</element>
</collection>
<collection name="referralLinks"><element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">40</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">41</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">43</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">44</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">100</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2006-11-06 14:09:22.943</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 14:34:23.190</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">213</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">214</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">215</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">216</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163919</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294990</id>
</element>
</collection>
<collection name="outgoingLinks"><element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333086</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333087</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333088</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333089</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333090</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333091</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333092</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333093</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333094</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333095</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333096</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333097</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333098</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333099</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333100</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333101</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333102</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333103</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333104</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333105</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333106</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333107</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333108</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333109</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333110</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333111</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333112</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333113</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333114</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333115</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333116</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333117</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333118</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333119</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333120</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333121</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333122</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333123</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333124</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333125</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333126</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333127</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333128</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333129</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333130</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333131</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333132</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333133</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333134</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333135</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333136</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333137</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333138</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333139</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333140</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333141</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333142</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333143</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333144</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333145</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333146</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333147</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333148</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333149</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333150</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333151</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333152</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333153</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333154</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333155</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333156</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333157</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333158</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333159</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333160</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333161</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333162</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333163</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333164</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333165</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333166</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333167</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333168</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333169</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333170</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333171</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333172</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333173</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333174</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333175</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333176</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333177</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333178</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333179</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333180</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333181</id>
</element>
<element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">333182</id>
</element>
</collection>
<property name="version">15</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.440</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">163920</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163921</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163922</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163923</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163924</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163925</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163927</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163928</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163929</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163930</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163931</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163932</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163933</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">163935</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">489</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<collection name="children"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</element>
</collection>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">487</id>
</element>
</collection>
<collection name="outgoingLinks"><element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">8730</id>
</element>
</collection>
<collection name="referralLinks"><element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">207</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">208</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">210</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">219</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">220</id>
</element>
</collection>
<property name="version">13</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-26 13:37:35.413</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">490</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">491</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">499</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">500</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">501</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">502</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">508</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">523</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">571</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">572</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">924</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">1012</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="ConfluenceBandanaRecord" package="com.atlassian.confluence.setup.bandana">
<id name="id">32778</id>
<property name="context"><![CDATA[AST]]></property>
<property name="key"><![CDATA[atlassian.confluence.theme.settings]]></property>
<property name="value"><![CDATA[<map>
        <entry>
          <string>theme.key</string>
          <string>com.atlassian.confluence.themes.leftnavigation:leftnavigation</string>
        </entry>
      </map>]]></property>
</object>
<object class="ConfluenceBandanaRecord" package="com.atlassian.confluence.setup.bandana">
<id name="id">32779</id>
<property name="context"><![CDATA[AST]]></property>
<property name="key"><![CDATA[atlassian.confluence.space.settings]]></property>
<property name="value"><![CDATA[<com.atlassian.confluence.setup.settings.SpaceSettings>
        <spaceKey>AST</spaceKey>
        <disableLogo>false</disableLogo>
        <colourSchemesSettings>
          <colourSchemeType>global</colourSchemeType>
        </colourSchemesSettings>
      </com.atlassian.confluence.setup.settings.SpaceSettings>]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">149</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
</collection>
<collection name="comments"><element class="Comment" package="com.atlassian.confluence.pages"><id name="id">511</id>
</element>
<element class="Comment" package="com.atlassian.confluence.pages"><id name="id">514</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">147</id>
</element>
</collection>
<collection name="outgoingLinks"><element class="OutgoingLink" package="com.atlassian.confluence.links"><id name="id">2131</id>
</element>
</collection>
<collection name="referralLinks"><element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">25</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">34</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">35</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">38</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">98</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">216</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">217</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">218</id>
</element>
<element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">237</id>
</element>
</collection>
<property name="version">20</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-29 15:56:01.157</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">156</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">157</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">158</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">159</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">161</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">199</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">200</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">201</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">202</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">204</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">205</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">206</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">207</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">209</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">210</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">211</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">218</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">452</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">454</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">351</id>
<property name="parent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<collection name="ancestors"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</element>
</collection>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"><![CDATA[Design Review Notes]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">349</id>
</element>
</collection>
<collection name="referralLinks"><element class="ReferralLink" package="com.atlassian.confluence.links"><id name="id">170</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-21 08:46:29.457</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-12 16:07:42.303</property>
<property name="versionComment"><![CDATA[]]></property>
<collection name="historicalVersions"><element class="Page" package="com.atlassian.confluence.pages"><id name="id">352</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">361</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">362</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">363</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">364</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">365</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">695</id>
</element>
<element class="Page" package="com.atlassian.confluence.pages"><id name="id">863</id>
</element>
</collection>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1035</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1032</id>
</element>
</collection>
<property name="version">35</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-01 09:38:06.083</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1036</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1033</id>
</element>
</collection>
<property name="version">36</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-01 10:54:46.710</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1037</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1034</id>
</element>
</collection>
<property name="version">37</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-01 11:07:29.517</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1043</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1040</id>
</element>
</collection>
<property name="version">68</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-27 12:55:37.617</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1065</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1062</id>
</element>
</collection>
<property name="version">38</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-01 11:19:46.243</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1060</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1057</id>
</element>
</collection>
<property name="version">16</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-05 11:00:45.807</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1059</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1056</id>
</element>
</collection>
<property name="version">15</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-21 08:40:22.587</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1009</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1006</id>
</element>
</collection>
<property name="version">66</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-26 11:04:41.113</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1010</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1007</id>
</element>
</collection>
<property name="version">25</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-23 16:25:33.243</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1007</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1004</id>
</element>
</collection>
<property name="version">64</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-23 17:30:36.900</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1008</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1005</id>
</element>
</collection>
<property name="version">65</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-26 10:44:06.210</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1003</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1000</id>
</element>
</collection>
<property name="version">63</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-23 17:29:50.300</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1017</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1014</id>
</element>
</collection>
<property name="version">29</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-26 14:14:46.667</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1018</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1015</id>
</element>
</collection>
<property name="version">30</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-27 07:40:06.753</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1015</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1012</id>
</element>
</collection>
<property name="version">27</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-26 13:27:28.863</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1016</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1013</id>
</element>
</collection>
<property name="version">28</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-26 14:05:45.077</property>
<property name="versionComment"><![CDATA[serial numbers: done]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="SpaceDescription" package="com.atlassian.confluence.spaces">
<id name="id">23</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="title"/><collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">21</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="contentStatus"><![CDATA[current]]></property>
<collection name="labellings"><element class="Labelling" package="com.atlassian.confluence.labels"><id name="id">8290312</id>
</element>
</collection>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1013</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1010</id>
</element>
</collection>
<property name="version">26</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-23 16:22:53.653</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1014</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1011</id>
</element>
</collection>
<property name="version">27</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-26 13:54:38.277</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1011</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1008</id>
</element>
</collection>
<property name="version">26</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-26 12:58:16.223</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1012</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1009</id>
</element>
</collection>
<property name="version">12</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 13:08:40.207</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1026</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1023</id>
</element>
</collection>
<property name="version">33</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-28 16:02:48.313</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1022</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1019</id>
</element>
</collection>
<property name="version">32</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-27 12:07:42.563</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1021</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1018</id>
</element>
</collection>
<property name="version">28</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-26 13:59:45.637</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1020</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1017</id>
</element>
</collection>
<property name="version">67</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-26 11:11:41.160</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1019</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1016</id>
</element>
</collection>
<property name="version">31</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-27 12:06:51.893</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1030</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1027</id>
</element>
</collection>
<property name="version">34</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-01 09:07:57.727</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1070</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1067</id>
</element>
</collection>
<property name="version">41</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 12:25:21.103</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1067</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1064</id>
</element>
</collection>
<property name="version">39</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-06 16:57:19.763</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1068</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1065</id>
</element>
</collection>
<property name="version">40</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 12:17:18.110</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1071</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1068</id>
</element>
</collection>
<property name="version">42</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 12:33:47.553</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1072</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1069</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 12:29:43.503</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1077</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1074</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 13:28:55.747</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1078</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1075</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 14:25:17.963</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1075</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1072</id>
</element>
</collection>
<property name="version">43</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 13:24:59.450</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1076</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1073</id>
</element>
</collection>
<property name="version">44</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 14:21:18.080</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1079</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1076</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 14:25:50.110</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1086</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1083</id>
</element>
</collection>
<property name="version">45</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 14:21:59.443</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1094</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1091</id>
</element>
</collection>
<property name="version">49</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-08 08:48:19.187</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1093</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1090</id>
</element>
</collection>
<property name="version">48</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-08 08:42:42.877</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1092</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1089</id>
</element>
</collection>
<property name="version">47</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-08 08:36:35.370</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1091</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1088</id>
</element>
</collection>
<property name="version">46</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 16:05:32.730</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1098</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1095</id>
</element>
</collection>
<property name="version">51</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-08 13:28:55.953</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1097</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">1094</id>
</element>
</collection>
<property name="version">50</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-08 09:12:46.650</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331473</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331472</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">25</id>
<property name="viewCount">7</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/display/AST/Use+Cases]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-03 17:10:15.037</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 14:42:15.020</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331475</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">24</id>
<property name="viewCount">7</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/AssetTracking/package-summary.html]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-02 15:41:15.063</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-09 10:34:15.027</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331474</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331469</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331468</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331471</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331470</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331465</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331464</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331467</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331466</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331461</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331460</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331463</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331462</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331507</id>
<property name="destinationPageTitle"><![CDATA[Custodian]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331506</id>
<property name="destinationPageTitle"><![CDATA[Owner]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331505</id>
<property name="destinationPageTitle"><![CDATA[Purchased_for]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331504</id>
<property name="destinationPageTitle"><![CDATA[Tilt_option]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331503</id>
<property name="destinationPageTitle"><![CDATA[Release_code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331502</id>
<property name="destinationPageTitle"><![CDATA[Enable_code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331501</id>
<property name="destinationPageTitle"><![CDATA[Transmit_frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331500</id>
<property name="destinationPageTitle"><![CDATA[Receive_frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331499</id>
<property name="destinationPageTitle"><![CDATA[Memory]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331498</id>
<property name="destinationPageTitle"><![CDATA[Firmware_EPROM]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331497</id>
<property name="destinationPageTitle"><![CDATA[Depth_Rating]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331496</id>
<property name="destinationPageTitle"><![CDATA[Pressure_sensor]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331495</id>
<property name="destinationPageTitle"><![CDATA[Features]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331494</id>
<property name="destinationPageTitle"><![CDATA[Calibration_organization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331493</id>
<property name="destinationPageTitle"><![CDATA[Serial]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331492</id>
<property name="destinationPageTitle"><![CDATA[DeviceTypeID_FK]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331490</id>
<property name="destinationPageTitle"><![CDATA[infoUrlList]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331491</id>
<property name="destinationPageTitle"><![CDATA[PersonID_FK]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331488</id>
<property name="destinationPageTitle"><![CDATA[mfgModel]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331489</id>
<property name="destinationPageTitle"><![CDATA[mfgSerialNumber]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331486</id>
<property name="destinationPageTitle"><![CDATA[description]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331487</id>
<property name="destinationPageTitle"><![CDATA[mfgName]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331484</id>
<property name="destinationPageTitle"><![CDATA[uuid]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331485</id>
<property name="destinationPageTitle"><![CDATA[name]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331482</id>
<property name="destinationPageTitle"><![CDATA[Device]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331483</id>
<property name="destinationPageTitle"><![CDATA[version]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331480</id>
<property name="destinationPageTitle"><![CDATA[Northwind]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331481</id>
<property name="destinationPageTitle"><![CDATA[graybeal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331478</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331479</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331476</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331477</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331511</id>
<property name="destinationPageTitle"><![CDATA[Permanent_comment]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331510</id>
<property name="destinationPageTitle"><![CDATA[Transaction_col]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331509</id>
<property name="destinationPageTitle"><![CDATA[PO]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331508</id>
<property name="destinationPageTitle"><![CDATA[Date_new]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331515</id>
<property name="destinationPageTitle"><![CDATA[manufacture web page]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331514</id>
<property name="destinationPageTitle"><![CDATA[MBARI_ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331513</id>
<property name="destinationPageTitle"><![CDATA[osg_view]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331512</id>
<property name="destinationPageTitle"><![CDATA[document_dir]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331519</id>
<property name="destinationPageTitle"><![CDATA[Firmware/EPROM]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331518</id>
<property name="destinationPageTitle"><![CDATA[Depth Rating]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331517</id>
<property name="destinationPageTitle"><![CDATA[Pressure sensor]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331516</id>
<property name="destinationPageTitle"><![CDATA[Calibration organization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331523</id>
<property name="destinationPageTitle"><![CDATA[Release code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331522</id>
<property name="destinationPageTitle"><![CDATA[Enable code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331521</id>
<property name="destinationPageTitle"><![CDATA[Transmit frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331520</id>
<property name="destinationPageTitle"><![CDATA[Receive frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331526</id>
<property name="destinationPageTitle"><![CDATA[Date new]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331527</id>
<property name="destinationPageTitle"><![CDATA[Permanent comment]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331524</id>
<property name="destinationPageTitle"><![CDATA[Tilt option]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331525</id>
<property name="destinationPageTitle"><![CDATA[Purchased for]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331530</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331531</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331528</id>
<property name="destinationPageTitle"><![CDATA[document dir]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331529</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331534</id>
<property name="destinationPageTitle"><![CDATA[Calibration organization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331535</id>
<property name="destinationPageTitle"><![CDATA[Pressure sensor]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331532</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331533</id>
<property name="destinationPageTitle"><![CDATA[manufacture web page]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331538</id>
<property name="destinationPageTitle"><![CDATA[Receive frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331539</id>
<property name="destinationPageTitle"><![CDATA[Transmit frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331536</id>
<property name="destinationPageTitle"><![CDATA[Depth Rating]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331537</id>
<property name="destinationPageTitle"><![CDATA[Firmware/EPROM]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331541</id>
<property name="destinationPageTitle"><![CDATA[Release code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331540</id>
<property name="destinationPageTitle"><![CDATA[Enable code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331543</id>
<property name="destinationPageTitle"><![CDATA[Purchased for]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331542</id>
<property name="destinationPageTitle"><![CDATA[Tilt option]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331545</id>
<property name="destinationPageTitle"><![CDATA[Permanent comment]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331544</id>
<property name="destinationPageTitle"><![CDATA[Date new]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331547</id>
<property name="destinationPageTitle"><![CDATA[FullSerial]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331546</id>
<property name="destinationPageTitle"><![CDATA[document dir]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331549</id>
<property name="destinationPageTitle"><![CDATA[MBARI_ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331548</id>
<property name="destinationPageTitle"><![CDATA[MBARI_ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331551</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331550</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331553</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331552</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331555</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">331554</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:50:10.197</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:50:10.197</property>
</object>
<object class="Comment" package="com.atlassian.confluence.pages">
<id name="id">514</id>
<property name="page" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="title"/><collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">512</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-07 11:50:53.110</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-07 11:50:53.110</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Comment" package="com.atlassian.confluence.pages">
<id name="id">511</id>
<property name="page" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="title"/><collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">509</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[mccann]]></property>
<property name="creationDate">2006-12-05 15:07:03.790</property>
<property name="lastModifierName"><![CDATA[mccann]]></property>
<property name="lastModificationDate">2006-12-05 15:07:03.790</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2131</id>
<property name="destinationPageTitle"><![CDATA[Use Cases]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2006-11-29 15:56:01.163</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-29 15:56:01.163</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">491</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">489</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-04 12:50:48.177</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163850</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294921</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-07 15:21:52.313</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">501</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">499</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-04 15:41:06.057</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">502</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">500</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-04 16:01:44.757</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">499</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">497</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-04 12:53:33.187</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">500</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">498</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-04 15:40:42.853</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Labelling" package="com.atlassian.confluence.labels">
<id name="id">3</id>
<property name="label" class="Label" package="com.atlassian.confluence.labels"><id name="id">3</id>
</property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="spaceKey"><![CDATA[AST]]></property>
<property name="user"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-10-27 11:40:54.310</property>
<property name="lastModificationDate">2006-10-27 11:40:54.310</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">508</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">506</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-04 16:08:00.380</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">22</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Approaches]
# [Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Design]

----
# [Design Review Notes]
# [BogInstruNormalization]
# [DatabaseFields]
# [MakingData] -- detailed steps needed to transform the contents of the database

Tasks and bugs can be found in [JIRA|http://oceana.shore.mbari.org:8082/browse/AST]
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">523</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">521</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-04 16:39:25.013</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2229309</id>
<property name="destinationPageTitle"><![CDATA[MakingData]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-24 09:43:34.963</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.963</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2229308</id>
<property name="destinationPageTitle"><![CDATA[DatabaseFields]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-24 09:43:34.963</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.963</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2229310</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org:8082/browse/AST]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-24 09:43:34.963</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.963</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163867</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294938</id>
</element>
</collection>
<property name="version">12</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 15:08:33.767</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2229301</id>
<property name="destinationPageTitle"><![CDATA[Use Cases]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-24 09:43:34.963</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.963</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163868</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294939</id>
</element>
</collection>
<property name="version">57</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 14:55:02.683</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2229303</id>
<property name="destinationPageTitle"><![CDATA[Approaches]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-24 09:43:34.963</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.963</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163870</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294941</id>
</element>
</collection>
<property name="version">58</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 15:15:49.827</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2229302</id>
<property name="destinationPageTitle"><![CDATA[Requirements]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-24 09:43:34.963</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.963</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163871</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294942</id>
</element>
</collection>
<property name="version">59</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 15:36:43.743</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2229305</id>
<property name="destinationPageTitle"><![CDATA[Design]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-24 09:43:34.963</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.963</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163872</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294943</id>
</element>
</collection>
<property name="version">13</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 15:12:57.717</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2229304</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-24 09:43:34.963</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.963</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163873</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294944</id>
</element>
</collection>
<property name="version">60</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 15:40:09.513</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2229307</id>
<property name="destinationPageTitle"><![CDATA[BogInstruNormalization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-24 09:43:34.963</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.963</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163874</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294945</id>
</element>
</collection>
<property name="version">14</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 15:53:48.353</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2229306</id>
<property name="destinationPageTitle"><![CDATA[Design Review Notes]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-24 09:43:34.963</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:43:34.963</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163860</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294931</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 14:17:17.873</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163859</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294930</id>
</element>
</collection>
<property name="version">52</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-08 14:09:53.850</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163862</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294933</id>
</element>
</collection>
<property name="version">10</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 14:39:30.430</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163861</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294932</id>
</element>
</collection>
<property name="version">53</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 14:33:20.463</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163864</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294935</id>
</element>
</collection>
<property name="version">55</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 14:48:23.897</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163863</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294934</id>
</element>
</collection>
<property name="version">54</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 14:43:56.967</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163866</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294937</id>
</element>
</collection>
<property name="version">11</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 14:47:49.357</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163865</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294936</id>
</element>
</collection>
<property name="version">56</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 14:50:13.333</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163854</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294925</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 10:56:07.920</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163858</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294929</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 14:16:27.927</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163857</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294928</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 13:00:06.080</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333022</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163913</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294984</id>
</element>
</collection>
<property name="version">64</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 14:25:59.767</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333023</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333020</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163911</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294982</id>
</element>
</collection>
<property name="version">28</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 14:21:10.220</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333021</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163912</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294983</id>
</element>
</collection>
<property name="version">63</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 15:29:02.723</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163909</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294980</id>
</element>
</collection>
<property name="version">26</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 09:46:01.563</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333026</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163910</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294981</id>
</element>
</collection>
<property name="version">27</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 13:42:42.973</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333027</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333024</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333025</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163905</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294976</id>
</element>
</collection>
<property name="version">24</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 15:36:54.617</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333014</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">69</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.

h1. Current Design details
 
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '0'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.  He stated that the Transaction column was not really used and could be removed.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device LEFT OUTER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id LEFT OUTER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# The history tables store the updated values for entries as the thought is that each entry would have to be inserted before any updates so you would always have the initial state of the row.  In this case we are starting with existing data, so it is critical that we get a baseline of all the current rows.  This can be done simply by running these in SQL Query Analyzer:
{noformat}
UPDATE ssdsdba.Device SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.Person SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.DeviceType SET version = version
GO
{noformat}
This will create entries for all the rows so that we will have the current data in the history table to compare future updates/deletions against.
# Create an INSTEAD OF INSERT trigger on the view
{noformat}
CREATE TRIGGER trInstruInsert ON instru
INSTEAD OF INSERT
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Now let's make sure the MBARI_ID and SSDS_ID are null
    IF @mbari_id IS NOT NULL
      RAISERROR('The insert specified the MBARI_ID. This field is auto-generated, do not specify on insert',9,1)
    IF @ssds_id IS NOT NULL
      RAISERROR('The insert specified the SSDS_ID. This field is auto-generated, do not specify on insert',9,1)

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    INSERT INTO ssdsdba.Device 
      (
       mfgName,
       mfgModel,
       Serial,
       mfgSerialNumber,
       Calibration_organization,
       Features,
       Pressure_Sensor,
       Depth_Rating,
       Firmware_EPROM,
       Memory,
       Receive_frequency,
       Transmit_frequency,
       Enable_code,
       Release_code,
       Tilt_option,
       Purchased_for,
       Owner,
       Custodian,
       Date_new,
       PO,
       Transaction_col,
       Permanent_comment,
       infoUrlList,
       document_dir,
       PersonID_FK,
       DeviceTypeID_FK
      )
    VALUES
      (
       @mfgName,
       @mfgModel,
       @serial,
       @mfgSerialNumber,
       @calibration_organization,
       @features,
       @pressure_sensor,
       @depth_rating,
       @firmware_eprom,
       @memory,
       @receive_frequency,
       @transmit_frequency,
       @enable_code,
       @release_code,
       @tilt_option,
       @purchased_for,
       @owner,
       @custodian,
       @date_new,
       @po,
       @transaction_col,
       @permanent_comment,
       @infoUrlList,
       @document_dir,
       @person_id,
       @deviceType_id
      )
  END
END
GO{noformat}
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    UPDATE ssdsdba.Device 
      SET ssdsdba.Device.mfgName = @mfgName,
          ssdsdba.Device.mfgModel = @mfgModel,
          ssdsdba.Device.Serial = @serial,
          ssdsdba.Device.mfgSerialNumber = @mfgSerialNumber,
          ssdsdba.Device.Calibration_organization = @calibration_organization,
          ssdsdba.Device.Features = @features,
          ssdsdba.Device.Pressure_Sensor = @pressure_sensor,
          ssdsdba.Device.Depth_Rating = @depth_rating,
          ssdsdba.Device.Firmware_EPROM = @firmware_eprom,
          ssdsdba.Device.Memory = @memory,
          ssdsdba.Device.Receive_frequency = @receive_frequency,
          ssdsdba.Device.Transmit_frequency = @transmit_frequency,
          ssdsdba.Device.Enable_code = @enable_code,
          ssdsdba.Device.Release_code = @release_code,
          ssdsdba.Device.Tilt_option = @tilt_option,
          ssdsdba.Device.Purchased_for = @purchased_for,
          ssdsdba.Device.Owner = @owner,
          ssdsdba.Device.Custodian = @custodian,
          ssdsdba.Device.Date_new = @date_new,
          ssdsdba.Device.PO = @po,
          ssdsdba.Device.Transaction_col = @transaction_col,
          ssdsdba.Device.Permanent_comment = @permanent_comment,
          ssdsdba.Device.infoUrlList = @infoUrlList,
          ssdsdba.Device.document_dir = @document_dir,
          ssdsdba.Device.PersonID_FK = @person_id,
          ssdsdba.Device.DeviceTypeID_FK = @deviceType_id
      WHERE ssdsdba.Device.id = (Select [SSDS ID] from Inserted)
  END
END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
{noformat}
CREATE TRIGGER trInstruDelete ON instru
INSTEAD OF DELETE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Deleted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Deleted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Deleted

    -- Now let's make sure the SSDS_ID is not null
    IF @ssds_id IS NULL
      RAISERROR('The delete did not specify the SSDS_ID. No delete performed',9,1)

    -- Now delete the row specified
    DELETE FROM ssdsdba.Device 
      WHERE id = @ssds_id
  END
END
GO
{noformat}
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# [SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization] (JG/AM)
## All XML in puckxml will have to have matching changes made
# Custom field comparison utilities
## Serial number
### Ignore non-alphanumeric text (remove white space, punctuation)
### If existing serial number matches the end of the new serial number, consider it a (likely?) match
## Model number
### Ignore non-alphanumeric text (remove white space, punctuation)
# Put links to CVS web xml in Device listing web page (KG)

----

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163906</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294977</id>
</element>
</collection>
<property name="version">25</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 09:41:20.187</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">570</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">568</id>
</element>
</collection>
<property name="version">25</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-04 11:23:23.853</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333015</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333012</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333013</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333018</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333019</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163899</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294970</id>
</element>
</collection>
<property name="version">22</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 15:19:03.473</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333016</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163900</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294971</id>
</element>
</collection>
<property name="version">23</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 15:30:09.067</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333017</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163898</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294969</id>
</element>
</collection>
<property name="version">62</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 14:52:09.360</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333039</id>
<property name="destinationPageTitle"><![CDATA[Design]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333038</id>
<property name="destinationPageTitle"><![CDATA[SqlQueries]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163897</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294968</id>
</element>
</collection>
<property name="version">21</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 15:16:46.790</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333037</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163896</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294967</id>
</element>
</collection>
<property name="version">20</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 14:59:08.770</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333036</id>
<property name="destinationPageTitle"><![CDATA[BogInstruNormalization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333043</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163894</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294965</id>
</element>
</collection>
<property name="version">19</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 14:48:21.953</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163893</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294964</id>
</element>
</collection>
<property name="version">61</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 16:00:59.623</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333042</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333041</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163892</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294963</id>
</element>
</collection>
<property name="version">18</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 14:45:26.373</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">572</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">570</id>
</element>
</collection>
<property name="version">10</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-13 13:08:16.637</property>
<property name="versionComment"><![CDATA[Added some introductory material at top, taken from the parent page (Design)]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333040</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163891</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294962</id>
</element>
</collection>
<property name="version">17</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 14:32:27.437</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">571</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">569</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-07 14:25:07.730</property>
<property name="versionComment"><![CDATA[Minor changes]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163890</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294961</id>
</element>
</collection>
<property name="version">16</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-13 12:16:01.690</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333031</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163889</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294960</id>
</element>
</collection>
<property name="version">15</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-12 16:56:11.587</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333030</id>
<property name="destinationPageTitle"><![CDATA[SqlQueries]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333029</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333028</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333035</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333034</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333033</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333032</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163935</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">295006</id>
</element>
</collection>
<property name="version">14</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:28:44.743</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163931</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">295002</id>
</element>
</collection>
<property name="version">11</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 18:57:48.813</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163932</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">295003</id>
</element>
</collection>
<property name="version">12</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 19:16:32.397</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163933</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">295004</id>
</element>
</collection>
<property name="version">13</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:28:26.253</property>
<property name="versionComment"><![CDATA[all done!]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163934</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">295005</id>
</element>
</collection>
<property name="version">66</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 17:40:59.377</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333005</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163928</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294999</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 18:34:19.240</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333004</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163927</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294998</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 17:16:19.453</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333007</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163930</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">295001</id>
</element>
</collection>
<property name="version">10</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 18:46:42.843</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333006</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163929</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">295000</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 18:38:24.850</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333009</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163924</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294995</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 16:50:45.317</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333008</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163923</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294994</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 16:12:09.557</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163926</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294997</id>
</element>
</collection>
<property name="version">65</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 14:46:29.470</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333011</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333010</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163925</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294996</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 17:15:14.217</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">332997</id>
<property name="destinationPageTitle"><![CDATA[BogInstruNormalization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163920</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294991</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:57:22.580</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">332999</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163922</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294993</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 16:11:35.027</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">332998</id>
<property name="destinationPageTitle"><![CDATA[DatabaseFields]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163921</id>
<property name="title"><![CDATA[SqlQueriesFinal]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294992</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 15:57:22.580</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:58:06.813</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163916</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294987</id>
</element>
</collection>
<property name="version">30</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:33:42.250</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333001</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163915</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294986</id>
</element>
</collection>
<property name="version">29</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 14:23:20.967</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333000</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163918</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294989</id>
</element>
</collection>
<property name="version">32</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:47:45.627</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333003</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">163917</id>
<property name="title"><![CDATA[SqlQueries]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">294988</id>
</element>
</collection>
<property name="version">31</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-07 12:29:43.503</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 15:44:31.773</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333002</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">147</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuration and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
{quote}
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
*Deliverables* The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
{quote}
\\
As currently envisioned based on information learned to date (2006.11.05), the initial effort will not incorporate LOBO, and Paul Coenen's database is considered to be the same as the BOG 'instru' database.
# Functional Requirements
## Address Existing Problems
### {requirement:MinimizeSSDSDataErrors|Minimize errors in SSDS database|New and changed instrument data should be verified and accurate.}
### {requirement:AvoidDuplicatedSSDSEntries|Avoid duplicated entries in SSDS database|The same instrument should not appear twice in the SSDS database.}
### {requirement:SimplifyDataEntry|Simplify data entry tasks|Make user data entry operations as simple as possible (minimizes mistakes, makes user happy).}
### {requirement:MinimizeDataEntry|Minimize data entry tasks|Data entered in one interface should populate the other wherever feasible.}
## General Goals
### {requirement:ReflectInstruChangesToSSDS|Reflect Instru Changes To SSDS Database|Changes to the Instru database should be reflected in the SSDS database.}
### {requirement:ReflectSSDSChangesToInstru|Reflect SSDS Changes To Instru Database|Changes to the SSDS database should be reflected in the Instru database, to the extent they are of interest to users of the Instru database.}
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
# Interface Requirements
## The existing MS Access interface to Paul Coenen's Instru database must be supported, or its equivalent functions provided to the satisfaction of OSG.
## The existing SSDS services must remain available.
## Planned improvements to the SSDS device entry service will be implemented (e.g., authentication, validation).
## Operation of the existing SSDS device search interface should be clarified.
# Performance Requirements
## The changes must support the expected number of devices to be entered over the next 5 years, without significantly impacting usability.
# Design Constraints
## Paul Coenen must maintain authority to control changes to the instruments of interest to him (i.e., those currently in the Instru database).
## Multiple users, from OSG, Development, and Engineering will be responsible for creating and editing device metadata. The system must gracefully minimize data entry errors, and allow review processes (automated and manual) to catch errors when they do occur.
# Other non-functional attributes
## Security
### The author of each change to the SSDS database should be identifiable.
### Changes to device metadata should be reviewable by a designated authority for that device record.
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
### To the extent possible, the system should take into account the likely addition of other instrument collections in the future.
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">169</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana.shore.mbari.org:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
|
|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>After OSG Operator clicks on button to create new device, validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
http://oceana.shore.mbari.org:8081/display/AST/Requirements#OSGEditDeviceInInstru|
The OSG Operators need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store and changes show up in SSDS and Access app|
No device information was updated|
OSG Operator|
|
|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to SSDS Admin describing device information update</li>
</o>|
<ol>
<li>After OSG Operator clicks on update button, information validation fails and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
http://oceana.shore.mbari.org:8081/display/AST/Requirements#SSDSCreateDeviceInSSDS|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
OSG Operator|
A new Device needs to be put into service.|
<ol><li>Authenticate User</li><li>Authorize User</li>|
|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>include::Authenticate User</li>
<li>include::Authorize User</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information entered is checked against data store:
<ul>
<li>If no UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store.</li>
<li>SSDS Operator, SSDS Admin and OSG Operator are notified of new device creation.</li>
<li>In notification to OSG Operator, he/she is presentd option of importing to Instrument Database</li>
<li>OSG Operator clicks on link to approve transfer to Access application</li>
<li>Data is transferred to Access data store</li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
SSDS Operator or Software Agent shall have interface to edit device information in SSDS.|
http://oceana.shore.mbari.org:8081/display/AST/Requirements#SSDSCreateDeviceInSSDS|
Both human and software processes need interfaces to update device information in SSDS.|
Device already exist in data store|
Device information is updated in the data store|
No device information is updated in the data store|
<ol><ul><li>SSDS Operator</li><li>Software Agent</li></ol>|
|
Information about a device has changed or is incorrect|
<ol><li>Authenticate User</li><li>Authorize User</li>|
|
<ol>
  <li>
    <ol>
      <li>SSDS Operator logs into SSDS web application</li>
      <li>SSDS Operator searches for existing device</li>
      <li>SSDS Operator selects link to edit device</li>
      <li>include::Authenticate User</li>
      <li>include::Authorize User</li>
      <li>SSDS Operator changes the appropriate information</li>
      <li>SSDS Operator clicks on Submit to attempt to update device</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>Software Agent sends calls Device update service with device information.</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
</ol>|
<ol>
  <li>
    <ol>
      <li>If field validations fail, user is presented with another try</li>
      <li>If information entered violates rules, user is presented with another try</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>If field validations fail, service throws exception back to Software Agent</li>
      <li>If information entered violates rules, service throws exception back to Software Agent.</li>
    </ol>
  </li>
</ol>|
}
----
{use-case-table:
Authenticate User|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Authorize User|
|
|
|
|
|
|
|
|
|
|
|
|
|
}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">695</id>
<property name="title"><![CDATA[Design Review Notes]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">692</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-21 08:46:29.457</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-21 15:30:38.230</property>
<property name="versionComment"><![CDATA[semi-final notes]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">210</id>
<property name="body"><![CDATA[There are three overarching approaches to this task:

1) *Merge*  Make the necessary changes to merge the two databases (probably into SSDS) and make the merged data visible through the same interfaces (MS Access, SSDS) that are available now.

2) *Synchronize*  Synchronize the two databases so that changes in each appear in the other (though not all fields have to appear in both).  Perform synchronizations via triggers or DTS jobs as appropriate.
2a) *Dual create* Support new instrument entry on either database, synchronizing the entries as needed and validating on sync.
2b) *Unicreate* Support new instrument entry only on one database.

3)  *Sync-to-SSDS*  Push information from the Instru database on BOG to the SSDS database.  Don't bother to update the BOG database with changes that have been made to the SSDS data.  (This is like Paul "keeping his own copy," which is what we are doing today, but it provides SSDS with the information Paul enters.)


|Option|Name|Pros|Cons|Comments|
|1|Merge|fairly maintainable\\minimizes duplicate info |lots of merging required\\requires significant control security\\causes most change|must track "devices of interest" to OSG |
|2|Synchronize|simplifies interface work|lots of model changes\\triggers fear of changes\\most state complexity|checkpoints needed for some synchronized data|
|2a| Sync-dual create|most like current system for users|lots more checkpointing| |
|2b| Sync-unicreate|simple to implement|reduces functionality to other interface| |
|3|Sync-to-SSDS|simplest number of changes\\least OSG impact|no 2-way interoperability|could report differences|


]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">231</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

{anchor:Model}
{anchor:Serial}
{anchor:Name}
h3. BOG fields for Model and Serial Numbers

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* The serial number should be the most complete serial number as presented and formatted by the vendor --- as written on the invoice, written on the label, etc.  This will often include some model information.  (The short serial number in the Instru 'Serial' field is the last unique part of the full serial number. We will support that also but it will not be primary.)
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Mannufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| FullSerial | A real mess | If Instru has a full serial number, use it. If not, then if SSDS has FullSerial, use that. Lacking that, if only a (short) Serial is in BOG, use that instead.  |
| Serial | Shore serial numbers | Copy the BOG short Serial field into a similar field in SSDS.  |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

{anchor:Manufacturer}
h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded. (Go to website, how does company refer to itself?)  Abbreviations should be expanded except in extreme, well-known cases (e.g., MBARI, WHOI, HOBI Labs). 

Until we have a proper company table, we propose to update the company name to the current name whenever it's known to change.  (Better answer long term is to create Company Names and Company tables, so multiple names can reference the same company.  This can also support lookups of older names and other historical referencing.)

The following table was an initial cut at final names, and is now deprecated. (Kept only for reference.)  For the ultimate answers see the [final names list|MakingData#Manufacturer].

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

{anchor:Type}
h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | Current Sensor-ADCP | ADCP should have been deprecated in SSDS. It is a particular kind of this type of instrument. |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Meteorology Package | Although "Metsys" is used as the common parlance for this package, it is not self-explanatory and is not trivial to derive from a Google search. |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  "Inductive Modem" isn't a used category (yet).|
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | New term? Replace Bioshutter in SSDS? |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

{anchor:Technician}
h3. BOG field Technician

This field is entirely filled with 'pc' in BOG, and appears to have the same function as the PersonID_FK field in SSDS.  (This is not the 'owner' or 'custodian' functions of BOG, but is just the person who knows about this instrument and its properties.)  Suggest replacing Paul Coenen as the PersonID_FK for any device in Instru.

----
h3. Deferred to phase 2:

| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">745</id>
<property name="title"><![CDATA[AccessAppChanges]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">742</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2007-02-05 09:04:52.420</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2007-02-05 09:04:52.420</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">746</id>
<property name="title"><![CDATA[AccessAppChanges]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">743</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2007-02-05 09:04:52.420</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2007-02-05 09:42:46.743</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">742</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">739</id>
</element>
</collection>
<property name="version">26</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-13 13:07:55.160</property>
<property name="versionComment"><![CDATA[Removed some of the older discussion about field mappings and replaced with link to new subpage.]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">747</id>
<property name="title"><![CDATA[AccessAppChanges]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">744</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2007-02-05 09:04:52.420</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2007-02-05 10:29:39.477</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">748</id>
<property name="title"><![CDATA[AccessAppChanges]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">745</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2007-02-05 09:04:52.420</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2007-02-05 10:41:11.487</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">749</id>
<property name="title"><![CDATA[AccessAppChanges]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">746</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2007-02-05 09:04:52.420</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2007-02-05 10:48:05.243</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333182</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333180</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333181</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333178</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333179</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333176</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333177</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333174</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333175</id>
<property name="destinationPageTitle"><![CDATA[FullSerial]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333172</id>
<property name="destinationPageTitle"><![CDATA[Permanent comment]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333173</id>
<property name="destinationPageTitle"><![CDATA[document dir]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">349</id>
<property name="body"><![CDATA[h2. Review Meeting November 21, 2006

h3. Agenda

# Project Background (5 minutes - 2:05)
# 4 Use Case Reviews (5 minutes - 2:10)
# By Use Case Discuss Activity Diagram and Proposed Solution
## Create New Device in Instru (10 minutes - 2:20)
## Edit Device in Instru (10 minutes - 2:30)
## Create New Device in SSDS (15 minutes - 2:45)
## Edit Device in SSDS (15 minutes - 3:00)

----
h3. Attendees:
* Kevin Gomes
* Reiko Michisaki
* Neil Conner
* Francisco Chavez
* Rich Schramm
* John Graybeal
* Aaron Marburg

----
h3. Meeting Notes:

h4. Project Background

In our initial effort, we will be merging data from SSDS to BOG and back, where both databases have overlapping data.
Eventually we'll try to merge back some of Paul's unique information back into the SSDS database.

Will the information in SSDS be easy to get to?  Yes, we'll have pages.  (Desire expressed to change those.)

Clarification of databases:  "Instru" and "Trans" database in BOG is in fact Paul's database. (The MS Access database no longer exists, it has been moved into BOG although the Access interface is still used.)

This is a two-way system, but with the catch that not all the SSDS instrument entries will go into BOG. Paul will have right of refusal of an instrument into BOG (which is a subset).

Checkpoints will exist so that Paul can approve changes, before they are included.  We were trying to be non-intrusive on Paul's current processes and data store.  Someday it would be nice to have a single table in one database, but for now we aren't going to try to fit all the instruments into the operational (BOG) database.  (SSDS will contain all the devices.)

One could implement a single table with a flag to limit Paul's view?  No, because some of Paul's fields do not map gracefully to SSDS tables, e.g., the people fields.  Could you put everything from SSDS into BOG, but limit what Paul sees?  Yes, but it's a little intrusive, we wanted to have minimal impact on OSG in the first stages.

Have we talked to accounting?  They track all fixed assets, we should consider that at the same time (e.g., add a field to manage data of interest to Jim R).

What's the allowed latency?  Let's look at this in context of a use case.

Does Paul have write permission to BOG?  Just to those two tables.

Where are calibration files tracked?  In BOG Transaction table there are some calibration references.  SSDS has the Resource field, but we are not using it yet.  Keep calibration files in mind as a key capability for the end product.   We would use a URL to point to the calibration file(s) when we do implement it.  

Note it would be nice to have a physical store for all the calibration files, so they are all in a consistent location.

*Put list of variables in each table on the Wiki.*

Noted that table in BOG is not complete, not all items have values entered.

Will we be able to access this device information via an interface in SSDS?  Yes.  Why was it originally in BOG?  Just to be in a SQL database.

Would be nice for anyone to have access to BOG database (not currently the case).  There are individuals who are interested in access.  Probably leave the model with individual authenticated access.  

There is everyone/guest access to the SSDS SQL interface, and the web interface is wide open.


h4. 4 Use Case Reviews: By Use Case Discussion
h5. Create New Device in Instru

This is the shortest latency case, where a new instrument in BOG should immediately check the contents of SSDS for congruent information.

When Paul creates a new device he'll enter a new transaction.  At this time we're not trying to map the transaction data, we'll revisit that later.

Does the BOG application provide all the fields needed to search for a match, so that syntactical differences are normalized?  We'll go through the list as a first step to normalize the current entries, working with Paul to maximize consistency.  In the device creation page for SSDS it will be constrained, unlike the open field currently used.

What about fields in SSDS like instrument type that BOG doesn't care about but needs (to match keys)?  There are only 5 used for search, BOG has them although some normalization between the two is required.  We'll agree on rules with Paul and program the synchronization accordingly.

What is the server in SSDS, a SQL server? Can these talk?  Yes, they're on the same server.

h5. Edit Device in Instru

What is latency?  Probably within an hour is fine.  (We don't know of any 'side-by-side' use cases, where two people might be working simultaneously in the two tables.)

Does SSDS provide a last updated field?  No, it doesn't.  We'll be turning on history tables that would enable access to that functionality.  This is a very common question Paul asks.

h5. Create New Device in SSDS

How quickly does a new device in SSDS have to be accessible in BOG? We think not quickly.
*Confirm this.*  (See also previous section for similar question.)

Once an 'accept with edit' happens, another email will get issued once the edit happens? Yes.

*AI->* If device is rejected and later edited, it will exist in SSDS but not BOG, so the update action would get confused.
_Response: Yes, many actions may get confused if editing happens before OSG acts. Comment added (may require redesign so data does not go into table until BOG response received._ 

*AI->* Note that the "insert new instrument in instru BOG" step will trigger the other use case, so if we use triggers we'll have to trap that case.
_Response: "Insert new instrument in Instru BOG" is a trigger of both use cases, so the other use case is not triggered by this action._

We will create an access-controlled capability to create devices (not wide open like it is now).

How will trigger accomplish sending mail?  A stored procedure can do it.  We don't implement SQLMail.  Wouldn't be too hard to implement in current version, but will require investigation, and then would change for 2005 implementation (Neil will be trying to implement around January).

h5. Edit Device in SSDS

*AI->* "No" Arrow to final box comes from wrong box, should come from diamond.
_Response: Could not determine specifically what this refers to, no similar problem was found. Other improvements may have taken care of it._

*AI->* "Is change approved?" should be explicit about who approves change.
_Response: Done._

What happens if OSG accidentally rejects a change, instead of accepting it?  We can manually fire the stored procedure.

If the SSDSAdmin does not react to the notification of device edit, what happens? This introduces a latency issue, if no action is taken it introduces an unexplained discrepancy.
*AI->* Look at this more closely.
_Response: This is correct. It has been noted on the diagram._

Will a global update cause many triggers?  Umm, yes.

h3. Final Discussion

Francisco wants to answer:
 * Where is everything?
 * What is the complete history of any given thing?

Batch processing would be extremely valuable addition.  (Currently is not working, John says Paul says.)

Each one of these use cases fires companion use case, so mechanism needed to trap those (and the bulk update case).

Do you want this specifically for one SQL server, or do you want it deployable anywhere?  (Raises trigger/procedures architectural question.)

Recommendation: Keep as little work going on as possible inside the trigger.  If one database is down, trigger will fail and this will be reflected in UI.  If you don't need atomic real-time transaction, this will create headaches.  Trigger will wait for reply from stored procedures.  Dirty bit might be a better answer, with a second table to capture the row/timestamp for a later SQL or Perl job.  Making it external this way gives you a lot more control over processing and less likelihood of hosing Paul's user interface.  Stored procedures couples DBs too tightly.

Watch error paths on flow charts -- how will notification occur on failures?  (This is potentialy complex on a multiple-database system.)

If you wanted to go to one table someday, look into creating a view right now that does it. Can you even do an Access-linked table to a view?  We think so.  We think it is tractable to put things together into one table, but it is more invasive to Paul's practices.  Would make the job a lot easier to be working within a single database.  Even if we need to change it out later, it will be easy to copy it over when it is needed.

_Response: Based on the discussion, we have investigated and are currently pursuing a single-database solution. (We have successfully tested the use of Access through views.)_
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">866</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">863</id>
</element>
</collection>
<property name="version">32</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-12 16:51:32.233</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">865</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">862</id>
</element>
</collection>
<property name="version">31</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-12 16:35:19.417</property>
<property name="versionComment"><![CDATA[don't need to send out reports of diffs if only 1 database]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">864</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">861</id>
</element>
</collection>
<property name="version">30</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-12 16:03:36.033</property>
<property name="versionComment"><![CDATA[changes to reflect John's sensibility]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">863</id>
<property name="title"><![CDATA[Design Review Notes]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">860</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-21 08:46:29.457</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-01-24 15:50:57.593</property>
<property name="versionComment"><![CDATA[added responses per changes]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">862</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">859</id>
</element>
</collection>
<property name="version">29</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-12 15:55:49.487</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">861</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">858</id>
</element>
</collection>
<property name="version">28</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-12 15:06:02.673</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">860</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">857</id>
</element>
</collection>
<property name="version">27</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2007-02-05 08:44:43.323</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">867</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">864</id>
</element>
</collection>
<property name="version">33</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-12 16:59:06.770</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333096</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333097</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333098</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333099</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333092</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333093</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333094</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333095</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333104</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333105</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333106</id>
<property name="destinationPageTitle"><![CDATA[SSDS_Metadata]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333107</id>
<property name="destinationPageTitle"><![CDATA[ssdsdba]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333100</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333101</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333102</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333103</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333081</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333080</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333083</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333082</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333077</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333076</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333079</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333078</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333089</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333088</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333091</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333090</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333085</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333084</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333087</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333086</id>
<property name="destinationPageTitle"><![CDATA[SqlQueries]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">933</id>
<property name="title"><![CDATA[AccessAppChanges]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">930</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2007-02-05 09:04:52.420</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2007-02-05 10:50:06.500</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333066</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333067</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">934</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">931</id>
</element>
</collection>
<property name="version">41</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 14:15:41.863</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">931</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">928</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 13:12:51.477</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333064</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333065</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">932</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">929</id>
</element>
</collection>
<property name="version">40</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-15 12:34:32.313</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333062</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333063</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333060</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">935</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">932</id>
</element>
</collection>
<property name="version">42</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 14:24:56.960</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333061</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333074</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">926</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">923</id>
</element>
</collection>
<property name="version">17</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-21 09:43:53.960</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333075</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333072</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333073</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">924</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">921</id>
</element>
</collection>
<property name="version">11</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-13 14:03:15.137</property>
<property name="versionComment"><![CDATA[Continued fussing]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">929</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">926</id>
</element>
</collection>
<property name="version">19</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 13:32:03.317</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333070</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333071</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333068</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">928</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">925</id>
</element>
</collection>
<property name="version">18</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 13:15:11.013</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333069</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333051</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333050</id>
<property name="destinationPageTitle"><![CDATA[P]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333049</id>
<property name="destinationPageTitle"><![CDATA[BogInstruNormalization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333048</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333047</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333046</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333045</id>
<property name="destinationPageTitle"><![CDATA[BogInstruNormalization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333044</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333059</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">910</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">907</id>
</element>
</collection>
<property name="version">36</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-15 09:27:11.890</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333058</id>
<property name="destinationPageTitle"><![CDATA[BogInstruNormalization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">909</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">906</id>
</element>
</collection>
<property name="version">35</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-15 08:45:24.327</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333057</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">908</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">905</id>
</element>
</collection>
<property name="version">34</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-12 20:36:20.197</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333056</id>
<property name="destinationPageTitle"><![CDATA[SqlQueries]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333055</id>
<property name="destinationPageTitle"><![CDATA[SqlQueries]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333054</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">913</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">910</id>
</element>
</collection>
<property name="version">39</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-15 09:53:33.877</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333053</id>
<property name="destinationPageTitle"><![CDATA[]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">912</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">909</id>
</element>
</collection>
<property name="version">38</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-15 09:48:31.290</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">911</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">908</id>
</element>
</collection>
<property name="version">37</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-15 09:36:59.993</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333052</id>
<property name="destinationPageTitle"><![CDATA[SqlQueriesFinal]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:34:42.173</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:34:42.173</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">967</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">964</id>
</element>
</collection>
<property name="version">10</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 16:37:14.647</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333156</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">968</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">965</id>
</element>
</collection>
<property name="version">11</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 16:56:02.740</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333157</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">969</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">966</id>
</element>
</collection>
<property name="version">52</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 15:52:26.647</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333158</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">970</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">967</id>
</element>
</collection>
<property name="version">12</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-22 08:31:44.593</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333159</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333160</id>
<property name="destinationPageTitle"><![CDATA[manufacture web page]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333161</id>
<property name="destinationPageTitle"><![CDATA[Calibration organization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">965</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">962</id>
</element>
</collection>
<property name="version">21</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 15:35:33.073</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333162</id>
<property name="destinationPageTitle"><![CDATA[Pressure sensor]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">966</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">963</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 16:24:55.090</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333163</id>
<property name="destinationPageTitle"><![CDATA[Depth Rating]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">959</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">956</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 15:53:42.010</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333164</id>
<property name="destinationPageTitle"><![CDATA[Firmware/EPROM]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">960</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">957</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 15:55:40.257</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333165</id>
<property name="destinationPageTitle"><![CDATA[Receive frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">961</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">958</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 15:57:08.977</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333166</id>
<property name="destinationPageTitle"><![CDATA[Transmit frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">962</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">959</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 15:57:54.347</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333167</id>
<property name="destinationPageTitle"><![CDATA[Enable code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">955</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">952</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 15:34:59.420</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333168</id>
<property name="destinationPageTitle"><![CDATA[Release code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">956</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">953</id>
</element>
</collection>
<property name="version">50</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 15:48:18.943</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333169</id>
<property name="destinationPageTitle"><![CDATA[Tilt option]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">957</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">954</id>
</element>
</collection>
<property name="version">51</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 15:50:06.627</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333170</id>
<property name="destinationPageTitle"><![CDATA[Purchased for]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">958</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">955</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 15:49:25.753</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333171</id>
<property name="destinationPageTitle"><![CDATA[Date new]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">952</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">949</id>
</element>
</collection>
<property name="version">47</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 15:38:46.670</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333141</id>
<property name="destinationPageTitle"><![CDATA[manufacture web page]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">951</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">948</id>
</element>
</collection>
<property name="version">46</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 15:04:03.470</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333140</id>
<property name="destinationPageTitle"><![CDATA[MBARI_ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">954</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">951</id>
</element>
</collection>
<property name="version">49</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 15:46:25.930</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333143</id>
<property name="destinationPageTitle"><![CDATA[Pressure sensor]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">953</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">950</id>
</element>
</collection>
<property name="version">48</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 15:41:10.523</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333142</id>
<property name="destinationPageTitle"><![CDATA[Calibration organization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">948</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">945</id>
</element>
</collection>
<property name="version">45</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 15:03:25.990</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333145</id>
<property name="destinationPageTitle"><![CDATA[Firmware/EPROM]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">947</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">944</id>
</element>
</collection>
<property name="version">44</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 14:41:07.487</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333144</id>
<property name="destinationPageTitle"><![CDATA[Depth Rating]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">950</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">947</id>
</element>
</collection>
<property name="version">20</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 13:32:18.710</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333147</id>
<property name="destinationPageTitle"><![CDATA[Transmit frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">949</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">946</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 14:01:06.823</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333146</id>
<property name="destinationPageTitle"><![CDATA[Receive frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333149</id>
<property name="destinationPageTitle"><![CDATA[Release code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333148</id>
<property name="destinationPageTitle"><![CDATA[Enable code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333151</id>
<property name="destinationPageTitle"><![CDATA[Purchased for]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333150</id>
<property name="destinationPageTitle"><![CDATA[Tilt option]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333153</id>
<property name="destinationPageTitle"><![CDATA[Permanent comment]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333152</id>
<property name="destinationPageTitle"><![CDATA[Date new]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">942</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">939</id>
</element>
</collection>
<property name="version">43</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 14:26:33.147</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333155</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333154</id>
<property name="destinationPageTitle"><![CDATA[document dir]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1001</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">998</id>
</element>
</collection>
<property name="version">24</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-23 16:21:54.083</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333126</id>
<property name="destinationPageTitle"><![CDATA[Receive_frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1002</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">999</id>
</element>
</collection>
<property name="version">62</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 16:13:23.807</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333127</id>
<property name="destinationPageTitle"><![CDATA[Transmit_frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">999</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">996</id>
</element>
</collection>
<property name="version">23</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-23 16:18:48.960</property>
<property name="versionComment"><![CDATA[finished Type column]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333124</id>
<property name="destinationPageTitle"><![CDATA[Firmware_EPROM]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">1000</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">997</id>
</element>
</collection>
<property name="version">25</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-23 15:47:46.277</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333125</id>
<property name="destinationPageTitle"><![CDATA[Memory]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">997</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">994</id>
</element>
</collection>
<property name="version">21</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-23 15:46:52.403</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333130</id>
<property name="destinationPageTitle"><![CDATA[Tilt_option]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">998</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">995</id>
</element>
</collection>
<property name="version">22</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-23 15:56:48.913</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333131</id>
<property name="destinationPageTitle"><![CDATA[Purchased_for]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">995</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">992</id>
</element>
</collection>
<property name="version">20</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-23 15:36:20.627</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333128</id>
<property name="destinationPageTitle"><![CDATA[Enable_code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">996</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">993</id>
</element>
</collection>
<property name="version">24</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-22 10:21:00.433</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333129</id>
<property name="destinationPageTitle"><![CDATA[Release_code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">993</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">990</id>
</element>
</collection>
<property name="version">18</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-22 10:26:14.053</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333134</id>
<property name="destinationPageTitle"><![CDATA[Date_new]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">994</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">991</id>
</element>
</collection>
<property name="version">19</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-23 15:28:21.310</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333135</id>
<property name="destinationPageTitle"><![CDATA[PO]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333132</id>
<property name="destinationPageTitle"><![CDATA[Owner]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333133</id>
<property name="destinationPageTitle"><![CDATA[Custodian]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">989</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">986</id>
</element>
</collection>
<property name="version">60</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 15:39:48.813</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333138</id>
<property name="destinationPageTitle"><![CDATA[document_dir]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">990</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">987</id>
</element>
</collection>
<property name="version">61</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 16:10:23.677</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333139</id>
<property name="destinationPageTitle"><![CDATA[osg_view]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333136</id>
<property name="destinationPageTitle"><![CDATA[Transaction_col]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">988</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">985</id>
</element>
</collection>
<property name="version">59</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 10:44:55.087</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333137</id>
<property name="destinationPageTitle"><![CDATA[Permanent_comment]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">986</id>
<property name="title"><![CDATA[AccessAppChanges]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">983</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2007-02-05 09:04:52.420</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 10:38:13.773</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333111</id>
<property name="destinationPageTitle"><![CDATA[name]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">985</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">982</id>
</element>
</collection>
<property name="version">58</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 10:26:54.910</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333110</id>
<property name="destinationPageTitle"><![CDATA[uuid]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">984</id>
<property name="title"><![CDATA[AccessAppChanges]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">981</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2007-02-05 09:04:52.420</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-21 14:24:04.503</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333109</id>
<property name="destinationPageTitle"><![CDATA[version]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">983</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">980</id>
</element>
</collection>
<property name="version">57</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 09:45:17.557</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333108</id>
<property name="destinationPageTitle"><![CDATA[Device]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">982</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">979</id>
</element>
</collection>
<property name="version">17</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-22 10:11:56.167</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333115</id>
<property name="destinationPageTitle"><![CDATA[mfgSerialNumber]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">981</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">978</id>
</element>
</collection>
<property name="version">23</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-22 10:10:37.247</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333114</id>
<property name="destinationPageTitle"><![CDATA[mfgModel]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">487</id>
<property name="body"><![CDATA[Here's a proposal for a single database which is a union of the existing SSDS and Instru databases.  It should be possible to use a simple d/b view to translate this table to either the existing SSDS or instru formats without too many machinations.  The goal is to minimize/eliminate redundancy by combining overlapping fields without drastically affecting the use of either of the existing apps (SSDS, Access app).

The steps to actually create the data in these fields are documented in [MakingData].

This should be considered a phase one proposal to cover most of the "low hanging fruit" and start the integration process.  Subsequent phases can further integrate the two databases while taking into consideration lessons learned from phase one.

A good example is the handling of people/roles.  The instru database has a number of separate fields for different roles: owner/purchaser, technician, calibrator, etc.  Each of these fields is just freetext, allowing for inclusion of multiple people for each role, also project names instead of peoples names.  The SSDS database recognizes a single person, which is a record of type Person.  Though it's not clear how this record was intended to be used, it does not map cleanly into the instru model.

Despite this data mismatch, it isn't strictly necessary to solve this conundrum for successful use of the integrated database.  Later phases may include revisions to either or both data models (for example use of an associative array between ISO roles and Person records in SSDS).

Given the ability to "alias" fields when creating a view, name changes or mismatches should not be considered particularly serious.

Pending:
* Calibration information?  This is a new addition and not really relevant to the "merge"
* should probably settle on a word formatting sheme (i.e. starts with lower case and capitalize to make subwords) -- given we can alias when making the view it matters quite a bit less


|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | UUID | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization |
| mfgModel | | Model | | mfgModel | Needs some normalization |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter representation - often the actual sequential portion w/o any sort of model identification which may be encoded. | mfgSerialNumber, ShortSerial \\ | Keep _mfgSerialNumber_ as the full-length serial number.&nbsp; Make it a mandatory field.&nbsp; Allow an optional _ShortSerial_ to hold a shortened serial number, which is a copy of the Instru Serial field.  \\ |
| name | Typically something like manufacturer+model | | | name | \\ |
| deviceType | | Type | | deviceType | Needs some normalization |
| Description | A free text description, may&nbsp; contain some information redundant with _name_ \\ | | | Description | |
| infoUrlList | | manufacture web page | | infoUrlList | Neither database uses this field very heavily.  Best to merge into a single "place for a hyperlink" -- though should we be specific that this is to either the manufacturers' home page or to the product page.  Does it matter? |
| person | The contact person (link to the Person table) \\ | | | person | Need to figure out how (if) to map the multiple instru roles into SSDS |
| | | Purchased for | Sometimes a person, sometimes a project \\ | Purchased for|" |
| | | Owner | Typically some combination of person, group (OSG, etc) and project.&nbsp; Sometimes all three \\ | Owner | "|
| | | Custodian | One or more people \\ | Custodian | "|
| | | Technician | Currently always 'pc' (Paul Coenen) | Technician | "|
| resources | Not used currently (?).&nbsp; Could be used for storing calibration files? \\ | | | | |
| | | document dir | Not used currently \\ | | |
| version | | | | version | |
| | | Features | A free text description of features on the device \\ | Features | Simplest to just leave this in place for now? |
| | | Pressure sensor | Just freetext, left blank if irrelevant \\ | Pressure sensor \\ | " |
| | | Depth Rating | Just freetext, left blank if irrelevant | Depth Rating \\ | " |
| | | Firmware/EPROM | Just freetext, left blank if irrelevant | Firmware/EPROM | " |
| | | Memory | Just freetext, left blank if irrelevant | Memory | " |
| | | Receive Frequency | Just freetext, left blank if irrelevant | Receive Frequency \\ | " |
| | | Transmit Frequency | Just freetext, left blank if irrelevant | Transmit Frequency \\ | " |
| | | Enable Code | Just freetext, left blank if irrelevant | Enable Code \\ | " |
| | | Release Code | Just freetext, left blank if irrelevant | Release Code \\ | " |
| | | Tilt option | Just freetext, left blank if irrelevant, though heavier use of "N/A" than in other fields \\ | Tilt option \\ | " |
| | | Date new | Used infrequently \\ | Date new \\ | " \\ |
| | | Calibration organization | Typically a company, but sometimes a company and a person \\ | Calibration organization \\ | In the long run we might normalize this against the msgNames \\ |
| | | PO | | PO | " |
| | | Permanent comment | Not entirely sure what this field is used for.  I think it's meant to be some permanent and overarching state of the system, not just the latest "transaction" | ?? | Keep it?  Or discard? |
| | | MBARI_ID | Auto-incrementing key field | _(discard)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Transaction | I believe this field isn't used in instru | _(discard)_ \\ | |
| | | | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">980</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">977</id>
</element>
</collection>
<property name="version">16</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-22 10:05:02.497</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333113</id>
<property name="destinationPageTitle"><![CDATA[mfgName]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">979</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">976</id>
</element>
</collection>
<property name="version">22</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-21 16:35:55.067</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333112</id>
<property name="destinationPageTitle"><![CDATA[description]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">978</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">975</id>
</element>
</collection>
<property name="version">15</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-22 10:00:17.933</property>
<property name="versionComment"><![CDATA[finished manufacturers]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333119</id>
<property name="destinationPageTitle"><![CDATA[Serial]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">977</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">974</id>
</element>
</collection>
<property name="version">14</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-22 09:23:44.567</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333118</id>
<property name="destinationPageTitle"><![CDATA[DeviceTypeID_FK]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333117</id>
<property name="destinationPageTitle"><![CDATA[PersonID_FK]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">975</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">972</id>
</element>
</collection>
<property name="version">56</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 09:37:05.623</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333116</id>
<property name="destinationPageTitle"><![CDATA[infoUrlList]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">974</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">971</id>
</element>
</collection>
<property name="version">55</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 09:18:46.060</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333123</id>
<property name="destinationPageTitle"><![CDATA[Depth_Rating]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">973</id>
<property name="title"><![CDATA[MakingData]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">970</id>
</element>
</collection>
<property name="version">13</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-21 13:12:51.477</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-22 09:07:55.597</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333122</id>
<property name="destinationPageTitle"><![CDATA[Pressure_sensor]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">972</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">969</id>
</element>
</collection>
<property name="version">54</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 09:12:29.683</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333121</id>
<property name="destinationPageTitle"><![CDATA[Features]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">971</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">968</id>
</element>
</collection>
<property name="version">53</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-02-22 09:00:52.227</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">333120</id>
<property name="destinationPageTitle"><![CDATA[Calibration_organization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-03-14 22:40:39.467</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-14 22:40:39.467</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">222</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">220</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 16:23:54.273</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">223</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">221</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-10 08:48:45.727</property>
<property name="versionComment"><![CDATA[Transcribed John's proposed field mapping into the Wiki.]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">229</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">227</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-10 09:32:40.713</property>
<property name="versionComment"><![CDATA[Added link to original email from John in Alfresco]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">231</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">229</id>
</element>
</collection>
<property name="version">12</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 13:42:39.007</property>
<property name="versionComment"><![CDATA[add approaches]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">232</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">230</id>
</element>
</collection>
<property name="version">10</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-10 13:02:50.797</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">234</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">232</id>
</element>
</collection>
<property name="version">11</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-10 15:47:46.463</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">204</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">202</id>
</element>
</collection>
<property name="version">10</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 12:56:03.430</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">203</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">201</id>
</element>
</collection>
<property name="version">25</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-06 11:24:11.757</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">206</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">204</id>
</element>
</collection>
<property name="version">12</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 13:29:21.857</property>
<property name="versionComment"><![CDATA[adding requirements]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">205</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">203</id>
</element>
</collection>
<property name="version">11</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 13:08:52.350</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">208</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">206</id>
</element>
</collection>
<property name="version">11</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-03 08:30:50.430</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">207</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">205</id>
</element>
</collection>
<property name="version">13</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 13:40:30.453</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">210</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">208</id>
</element>
</collection>
<property name="version">15</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 13:43:55.870</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">209</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">207</id>
</element>
</collection>
<property name="version">14</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 13:41:41.633</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">211</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">209</id>
</element>
</collection>
<property name="version">16</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 13:45:43.080</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">214</id>
<property name="title"><![CDATA[Approaches]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">212</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2006-11-06 14:09:22.943</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 14:11:57.003</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">213</id>
<property name="title"><![CDATA[Approaches]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">211</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2006-11-06 14:09:22.943</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 14:09:22.943</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">216</id>
<property name="title"><![CDATA[Approaches]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">214</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2006-11-06 14:09:22.943</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 14:32:27.973</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">215</id>
<property name="title"><![CDATA[Approaches]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">213</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2006-11-06 14:09:22.943</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 14:28:03.247</property>
<property name="versionComment"><![CDATA[first real iteration]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">218</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">216</id>
</element>
</collection>
<property name="version">17</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 13:49:58.150</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">217</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">215</id>
</element>
</collection>
<property name="version">26</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 12:59:26.773</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">189</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">187</id>
</element>
</collection>
<property name="version">16</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-03 13:21:16.237</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">190</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">188</id>
</element>
</collection>
<property name="version">17</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-03 13:40:13.317</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">187</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">185</id>
</element>
</collection>
<property name="version">14</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-03 13:09:37.300</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">188</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">186</id>
</element>
</collection>
<property name="version">15</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-03 13:10:14.667</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">193</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">191</id>
</element>
</collection>
<property name="version">20</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-03 14:17:04.140</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">194</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">192</id>
</element>
</collection>
<property name="version">21</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-03 14:20:17.180</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">191</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">189</id>
</element>
</collection>
<property name="version">18</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-03 13:43:39.877</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">192</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">190</id>
</element>
</collection>
<property name="version">19</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-03 13:44:29.267</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">197</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">195</id>
</element>
</collection>
<property name="version">23</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-06 11:17:39.010</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">198</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">196</id>
</element>
</collection>
<property name="version">24</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-06 11:19:54.527</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">196</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">194</id>
</element>
</collection>
<property name="version">22</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-03 14:41:29.130</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">201</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">199</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 12:46:23.963</property>
<property name="versionComment"><![CDATA[iteration in progress]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">202</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">200</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 12:50:29.423</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">199</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">197</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 10:06:38.297</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">200</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">198</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 12:39:31.247</property>
<property name="versionComment"><![CDATA[trying out changes]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">174</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">172</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:17:12.173</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">173</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">171</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:16:39.103</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">172</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">170</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:15:05.403</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">178</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">176</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:41:43.477</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">177</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">175</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:38:38.370</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">176</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">174</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:32:49.273</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">175</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">173</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:32:15.760</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">182</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">180</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 08:12:31.717</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">181</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">179</id>
</element>
</collection>
<property name="version">10</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:48:27.973</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">180</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">178</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:43:18.663</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">179</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">177</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:42:33.197</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">186</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">184</id>
</element>
</collection>
<property name="version">13</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 16:28:34.610</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">185</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">183</id>
</element>
</collection>
<property name="version">10</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:13:41.453</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">184</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">182</id>
</element>
</collection>
<property name="version">12</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 16:24:51.213</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">183</id>
<property name="title"><![CDATA[Use Cases]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">181</id>
</element>
</collection>
<property name="version">11</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 15:15:05.403</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 15:52:23.220</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">159</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">157</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 10:01:54.657</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">161</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">159</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 10:02:41.567</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">156</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">154</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 08:15:19.237</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">157</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">155</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 09:57:43.917</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">158</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">156</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 09:59:01.067</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">169</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">167</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 08:20:46.387</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">170</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">168</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 14:19:44.040</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">144</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">142</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 08:09:06.827</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">143</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">141</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-23 11:14:14.320</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">146</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">144</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 08:12:03.093</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">145</id>
<property name="title"><![CDATA[ProjectDesign]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">143</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-23 13:58:13.767</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">2162820</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">2195587</id>
</element>
</collection>
<property name="version">18</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-24 09:40:35.340</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">2162819</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">2195586</id>
</element>
</collection>
<property name="version">17</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-03-05 11:01:01.387</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">148</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">146</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 08:12:31.713</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">147</id>
<property name="title"><![CDATA[Project Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">145</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 08:12:03.097</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">150</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">148</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-02 08:12:48.453</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">740</id>
<property name="body"><![CDATA[I'll use the term "OSG-owned" to indicate the device Paul cares about.  We haven't exactly figured out how this will be delimited in the database, but I assume we'll be able to SELECT those lines as part of the SQL query.

----
h2. Summary

* Remove all references to MBARI_ID (auto-increment key used in instru table) and replace with SSDS_ID (?) (some sort of key from the merged table).  Note: Access assumes a relatively short MBARI_ID (4 digits), not the full SSDS UUID.
{note:title=Are we sure about this?}
I am not sure we need to necessarily get rid of the MBARI_ID.  Yes, we would have two auto-incrementing fields, but that may not be all that big of a deal and the Access application expects an MBARI_ID and that would minimize our code changes to the Access app.
{note}
{warning:Title=SSDS ID Editable}
We need to make it so that the SSDS_ID is not editable in the Access application
{warning}
* Several panes in the Access app use a series of drop-downs (Manufacturer, Model, Serial Number, Type, etc) to select one-or-more devices.  Whenever possible, an "OSG-owned" checkbox could be added to limit/unlimit the search.
{info:title=Done through view}
In theory, this should be accomplished by presenting a DB view that is keyed on the OSG view flag in the database.
{info}
{warning:Title=Change Type and Technician to drop down}
Now that the Technician and Type are mapped through a view to the Person.username and DeviceType.name fields, those become editable in the current access application.  It would be better if these could be specified as drop-downs always and then were edited through the SSDS appropriate pages.
{warning}
* There are a few panels which display all of the fields of the instru database, and a few which also allow editing of those fields.  These need a clear and concise way of indicating and editing the "OSG-ownership"
{info:title=Also done through view}
In theory, this should be accomplished by presenting a DB view that is keyed on the OSG view flag in the database.
{info}
Overall impact to the Access app would be surprisingly light. The only truly obstrusive change would be to the "Instrumentation Data Entry" pane which is primarily for new instrument entry.  At present it's just a flat pane with fields for data entry (some drop-downs to normalize answers), but we're proposing changing it to a two-step process where some key information is entered, then checked for an existing records, before proceeding.

There will also be the introduction of a number of checkboxes which select if a particular search should be limited OSG-owned devices (the default) or expanded to the full SSDS database.
{note:title=I think we can ignore this}
I think we can safely ignore this and just assume that OSG will only want to search/work on entries that have the OSG flag enabled and we will just use the view for that.  If they want to expose the device through to the OSG app, they will have to use another interface to flip the bit to make it visible.
{note}
There's likely to be more impacts in changes to the meaning and function of some of the database fields.

There are also some loose ends in data normalization and field mapping (i.e. ensuring the FullSerial is always filled out, even if the user has only entered a Serial).  That sort of data verification and manipulation could be encoded in Access or pushed off to the SQL server as a trigger/job.

----
h2. More detail

From the front index page, there are nine sub-pages:

h3. Transactions Data Entry

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* I'm a little confused by the usage of this pane -- it's a combination of some instrumentation entries and the transaction entries.

h3. Instruments Data Entry

* Replace MBARI_ID with SSDS_ID.
* Add a way to indicate "OSG-owned"
* Need to put in an explicit step where the first few key fields are filled out and the database is check for duplicates before filling out the remaining fields.  This function should probably ignore the "OSG-owned" field.   This window may expand to include both the add and edit functions.

h3. Current Info

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Transaction History

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Find Location of Calibration

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID (takes information from trans table?)

h3. Query by Location

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID on list.
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"  (may be same detail window used in "Find Model")

h3. Find Model

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections.
* Replace MBARI_ID with SSDS_ID on list
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"

h3. Deployment Update

(this feature may not be functional or as functional as Paul would like.)
* At checkbox to filter list on "OSG-owned" -- affects list of instruments
* Change MBARI_ID to SSDS_ID (?)

h3. Edit Instruments and Transactions Table

* Add checkbox in top pane to filter out OSG-owned devices -- affects drop-down selections.
* Add entry box in lower pane to toggle "OSG-owned"
* Remove references to MBARI_ID in text boxes and transaction table.  Replace with SSDS ID.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">1195</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org:8081/display/AST/Requirements]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-06 15:40:16.303</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-06 15:40:16.303</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">1194</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org:8081/display/AST/Requirements]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-06 15:40:16.303</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-06 15:40:16.303</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">1197</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org:8081/display/AST/Requirements]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-06 15:40:16.303</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-06 15:40:16.303</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">1196</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org:8081/display/AST/Requirements]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-06 15:40:16.303</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-06 15:40:16.303</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">70</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">68</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 19:01:47.357</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">8730</id>
<property name="destinationPageTitle"><![CDATA[MakingData]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-26 13:37:35.437</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-26 13:37:35.437</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">74</id>
<property name="title"><![CDATA[ProjectDesign]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">72</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-23 11:49:26.593</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">73</id>
<property name="title"><![CDATA[ProjectDesign]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">71</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-23 11:48:35.383</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">72</id>
<property name="title"><![CDATA[ProjectDesign]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">70</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-23 11:17:00.563</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">65</id>
<property name="title"><![CDATA[Home]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">63</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.837</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">2162694</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">2195461</id>
</element>
</collection>
<property name="version">70</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-04-04 09:25:59.703</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">490</id>
<property name="title"><![CDATA[DatabaseFields]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">488</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-12-04 12:00:58.297</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-12-04 12:00:58.297</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">19300571</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[VIEWSPACE]]></property>
<property name="group"><![CDATA[U_Employees]]></property>
<property name="userName"/><property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2012-06-18 17:09:23.830</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2012-06-18 17:09:23.830</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">487</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">485</id>
</element>
</collection>
<property name="version">24</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-27 15:23:49.150</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">452</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">450</id>
</element>
</collection>
<property name="version">18</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-06 15:46:08.820</property>
<property name="versionComment"><![CDATA[added SSDS device entry interface reqts]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">454</id>
<property name="title"><![CDATA[Requirements]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">452</id>
</element>
</collection>
<property name="version">19</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-02 08:15:19.237</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-29 15:52:55.657</property>
<property name="versionComment"><![CDATA[added problem list]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294990</id>
<property name="body"><![CDATA[{note}These queries have been tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries], but realize that those queries are somewhat older, and may work for John G but not others (because the tables were created for John G).{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only) 

This finds full serial matches to Device mfgSerialNumber. (/)


{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices (/)
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}


{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column
Should be done before Instru merge. (/)
{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Test Entry-System', 'entry created for purpose of testing the system')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Unknown', 'an actual device for which the device type is not known (and not knowable)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-TBD', 'entry for which the device type will be provided later')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Undefined', 'used for a device entry which does not yet define a specific device')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Controller-CTD', 'controls CTD data acquisition')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

These statements fix the newly added Device Descriptions (for the deprecated device types). (/)

{code:sql}
UPDATE ssdsdba.DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

Fix a spelling mistake. (/)

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
UPDATE ssdsdba.DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where name LIKE '%Fluor%Nep%'
{code}


{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names 

This isn't needed until later, but we're getting it out of the way now. (/)
{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','Axys Environmental Systems','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Nortek AS','Nortek AS','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments | RDI',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy

This script creates new Device entries for the instru devices not already in SSDS. (/)

{note}
Double-check for Erich R's name in the Technician field before setting everything to 126. 
Kevin: Paul says he sees Erich's name in the Technician field, but I just copied the latest instru from BOG and I don't see it.  Can you resolve this apparent conflict?  -- jbg 3/14 6 PM.
{note}
Note this is updated now to set the device type to an actual entry. 
This fails if the DeviceType table has not been updated.

{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType as the TBD entry, to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later in scripts
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later can set it to id
  **/
  SELECT 
  0,NEWID(),null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, (select id from ssdsdba.DeviceType where name LIKE '%TBD%'), i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/* Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. */
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND (i.[SSDS ID] is null OR i.[SSDS ID] = 0)

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices

This updates the Device table for the instru entries that we know are SSDS entries. (/)
{code:sql}

/** Update all instruCopy devices that have SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
/* If osg_view = 1 then this device was created in the steps above, no need to recopy. */
WHERE      d.id = i.[SSDS ID] AND d.osg_view = 0
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

The short serial was copied in the merge step above, if it existed. This overwrites with FullSerial from instru, if it exists. (/)
This version corrects a bug from the Northwind version, where it only tested for MBARI_IDs matching.

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.id = i.[SSDS ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')
{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

This makes the TempDevFld table, which is used to cache completed mfgName and deviceType data. (/)

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}


{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

Makes the Manufacturer names consistent. (/)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null 
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, ssdsdba.Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null 

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM TempDevFld t JOIN instruCopy i
      ON (t.id = i.[SSDS ID]), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Copy the results back to Device table */
UPDATE d
SET d.MfgName = t.tempMfg
FROM ssdsdba.Device d, TempDevFld t
WHERE d.id = t.id AND t.tempMfg is not null

/* Do manual corrections */
/** Manual MfgName -- we now update in the Device table directly **/

/* This appears to have no effect, item likely corrected in solstice Device table */
UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Axys Technologies'
WHERE mfgName LIKE
'AXYS Technologies'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

/* Pick up some ASIMETs that are wrong in Device */
UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE id = 1250 OR id = 1251

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'Teledyne RD Instruments'
WHERE mfgName =
'RDI'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.  It would have to be run before copying the data back to the Device table above, and would not include the final adjustments shown below that.  (/)

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables. (/)


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}


{anchor:MergeDeviceType}
h2. UPDATE temporary device type Column by Merging

This works on the temporary table TempDevFld. (/)

{code:sql}
/* UPDATE temporary Device Type column */
/* Grab names from Device that already exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

UPDATE i
SET i.Type = 'Inductive Modem-Surface'
FROM instruCopy i
WHERE Type = 'modem' AND Model ='SIM'

UPDATE i
SET i.Type = 'Fluorometer/Nephelometer'
FROM instruCopy i
WHERE Type = 'fluor/turbidity' 

UPDATE i
SET i.Type = 'Backscatterometer/Fluorometer'
FROM instruCopy i
WHERE Type = 'backscatter/fluorometer' 

UPDATE i
SET i.Type = 'Metereology Package'
FROM instruCopy i
WHERE Type = 'temperature/humidity' 

UPDATE i
SET i.Type = 'Nitrogen Sensor/ISUS'
FROM instruCopy i
WHERE Type = 'Nitrate' 

UPDATE i
SET i.Type = 'Nitrogen Sensor (this is Satlantic unit)'
FROM instruCopy i
WHERE Type = 'Nitrate analyzer' 

UPDATE i
SET i.Type = 'Oxygen Sensor'
FROM instruCopy i
WHERE Type = 'Oxygen optode' 

UPDATE i
SET i.Type = 'Toroid'
FROM instruCopy i
WHERE Type = 'Platform' 

UPDATE i
SET i.Type = 'Power Supply-Electric'
FROM instruCopy i
WHERE Type = 'power source' 

UPDATE i
SET i.Type = 'CO2 Monitor'
FROM instruCopy i
WHERE Type = 'pCO2' 

UPDATE i
SET i.Type = 'Transponder'
FROM instruCopy i
WHERE Type = 'transducer' 

UPDATE i
SET i.Type = 'Echo Sounder-Singlebeam'
FROM instruCopy i
WHERE Type = 'sounder' 

UPDATE i
SET i.Type = 'Shutter-Antifouling'
FROM instruCopy i
WHERE Type = 'shutter' 

UPDATE i
SET i.Type = 'Inductive Modem Cable Coupler'
FROM instruCopy i
WHERE Type = 'ICC' 

UPDATE i
SET i.Type = 'Pump'
FROM instruCopy i
WHERE Type = 'pump' 

UPDATE i
SET i.Type = 'Release'
FROM instruCopy i
WHERE Type = 'release' 

UPDATE i
SET i.Type = 'Backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' OR Type = 'backscatterometer'

UPDATE i
SET i.Type = 'Battery'
FROM instruCopy i
WHERE Type = 'battery' 

UPDATE i
SET i.Type = 'Transmissometer'
FROM instruCopy i
WHERE Type = 'transmissometer' 


/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND (t.tempType is null OR t.tempType = 'Not Specified-TBD')
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

This updaets all the errant device types (still in the temporary table). (/)

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Modem-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Currents Sensor-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'



{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs). (/)

{code:sql}
UPDATE d2
SET d2.DeviceTypeID_FK = r1.typeid
FROM ssdsdba.Device d2, 
(
select t.id as id, d.id as typeid 
from TempDevFld t left outer join ssdsdba.DeviceType d 
on t.tempType = d.name 
) r1
WHERE d2.id = r1.id
{code}

For information only, here is code to look at the final device types to see if they are sensible. (/)

{code:sql}
/* Final check to see if it's all working */

select d.id, dtv.id, dtv.devType, d.name, d.mfgName, d.mfgModel, d.description  
from
devTypeView as dtv JOIN ssdsdba.Device as d
on dtv.id = d.id
order by devType, d.id
{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163919</id>
</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">9171</id>
<property name="destinationPageTitle"><![CDATA[MakingData]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-27 13:10:51.943</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-27 13:10:51.943</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">368</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">366</id>
</element>
</collection>
<property name="version">23</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-27 14:29:21.420</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">364</id>
<property name="title"><![CDATA[Design Review Notes]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">362</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-21 08:46:29.457</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-21 14:50:36.107</property>
<property name="versionComment"><![CDATA[interim save]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">363</id>
<property name="title"><![CDATA[Design Review Notes]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">361</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-21 08:46:29.457</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-21 14:27:55.673</property>
<property name="versionComment"><![CDATA[interim save]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">366</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">364</id>
</element>
</collection>
<property name="version">22</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-16 08:41:54.910</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">365</id>
<property name="title"><![CDATA[Design Review Notes]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">363</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-21 08:46:29.457</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-21 14:57:21.747</property>
<property name="versionComment"><![CDATA[interim save]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">9172</id>
<property name="destinationPageTitle"><![CDATA[MakingData]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-27 13:10:51.943</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-27 13:10:51.943</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">9173</id>
<property name="destinationPageTitle"><![CDATA[//www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="creatorName"><![CDATA[graybeal]]></property>
<property name="creationDate">2007-02-27 13:10:51.943</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2007-02-27 13:10:51.943</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">362</id>
<property name="title"><![CDATA[Design Review Notes]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">360</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-21 08:46:29.457</property>
<property name="lastModifierName"><![CDATA[graybeal]]></property>
<property name="lastModificationDate">2006-11-21 14:16:04.187</property>
<property name="versionComment"><![CDATA[interim save]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">361</id>
<property name="title"><![CDATA[Design Review Notes]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">359</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-21 08:46:29.457</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-21 08:46:46.057</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">350</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">348</id>
</element>
</collection>
<property name="version">14</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-12 06:05:35.417</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">353</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">351</id>
</element>
</collection>
<property name="version">16</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-20 09:44:06.913</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">352</id>
<property name="title"><![CDATA[Design Review Notes]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">350</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-11-21 08:46:29.457</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-21 08:46:29.457</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">167</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[SETSPACEPERMISSIONS]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">168</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[REMOVEPAGE]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">165</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[COMMENT]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">166</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[EDITSPACE]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">171</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[CREATEATTACHMENT]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">172</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[REMOVEATTACHMENT]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">169</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[REMOVECOMMENT]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">170</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[REMOVEBLOG]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">175</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[EXPORTSPACE]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.837</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">176</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[REMOVEMAIL]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.837</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">173</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[EDITBLOG]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">174</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[EXPORTPAGE]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">177</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[SETPAGEPERMISSIONS]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.837</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">324</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">322</id>
</element>
</collection>
<property name="version">15</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-20 09:39:25.893</property>
<property name="versionComment"><![CDATA[Still fussing]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">323</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">321</id>
</element>
</collection>
<property name="version">14</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-17 15:10:03.783</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">316</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">314</id>
</element>
</collection>
<property name="version">13</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-17 13:38:58.270</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">315</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">313</id>
</element>
</collection>
<property name="version">12</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-17 09:15:52.053</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">164</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[VIEWSPACE]]></property>
<property name="group"/><property name="userName"><![CDATA[kgomes]]></property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.833</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-10-18 08:22:55.833</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">277</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">275</id>
</element>
</collection>
<property name="version">7</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-15 12:08:54.587</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">275</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">273</id>
</element>
</collection>
<property name="version">20</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-12 06:05:08.413</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">276</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">274</id>
</element>
</collection>
<property name="version">21</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-16 08:41:24.630</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">294</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">292</id>
</element>
</collection>
<property name="version">11</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-17 08:52:40.333</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">293</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">291</id>
</element>
</collection>
<property name="version">10</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-16 16:57:17.783</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">289</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">287</id>
</element>
</collection>
<property name="version">9</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-16 09:38:10.773</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">283</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">281</id>
</element>
</collection>
<property name="version">8</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-16 08:46:40.033</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">248</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">246</id>
</element>
</collection>
<property name="version">1</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-10 15:49:26.227</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">249</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">247</id>
</element>
</collection>
<property name="version">2</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-14 09:33:21.850</property>
<property name="versionComment"><![CDATA[Trying to line up fields in BOG and SSDS]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">250</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">248</id>
</element>
</collection>
<property name="version">3</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-14 09:36:00.743</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">243</id>
<property name="title"><![CDATA[Asset Configuration and Tracking Consolidation]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">241</id>
</element>
</collection>
<property name="version">13</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-18 08:22:55.837</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-10 15:34:18.417</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">239</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">237</id>
</element>
</collection>
<property name="version">16</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-11 10:28:41.373</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">240</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">238</id>
</element>
</collection>
<property name="version">17</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-11 10:38:46.777</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">241</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">239</id>
</element>
</collection>
<property name="version">18</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-11 11:13:39.067</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">242</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">240</id>
</element>
</collection>
<property name="version">19</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-11 11:21:45.607</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">235</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">233</id>
</element>
</collection>
<property name="version">12</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-10 15:55:21.010</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">236</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">234</id>
</element>
</collection>
<property name="version">13</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-11 09:53:57.237</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">922</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
#* Must make copy of this table as a different name (Instru is name of view)
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueriesFinal#AddDeviceTypes] is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueriesFinal#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerial (mfgSerialNumber)
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueriesFinal#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueriesFinal#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS. (This can happen after everything else is done.)
 * _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 * prepare any associated changes to the FK in Trans.
 * Set the MBARI ID in Device to the SSDS ID.  
 * Will also have to set appropriate constraints on MBARI_ID column

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueriesFinal#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> Axys Technologies
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueriesFinal#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our interim table (TempDevFld) using the mfgName column, from Instru or Device as appropriate, using the rules above. 

At this point, all the mfgName rows should be filled in. 

Manual changes will be done to the interim table.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.

This is shown in [SqlQueriesFinal#UpdateMfgName].

[Back to table...|#table]

{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [#DeviceMerge].
# Do manual corrections as listed above (code in [SqlQueriesFinal#ManualModel]).


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueriesFinal#updateToFullSerial].

{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller         
* Controller-CTD *(new)*             
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following device types are also supported
* Test Entry-System
* Not Specific-Unknown
* Not Specified-TBD
* Not Specified-Undefined


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'
# 'ICC' to 'Inductive Modem Cable Coupler'
# 'pump' to 'Pump'
# 'release' to 'Release'

{note}The questions below were mostly unsettled as of press time.
{note}
Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 
# How to change 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Controller-CTD: controls acquisition of CTD data
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Also, Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.
Code to do all this is in [SqlQueriesFinal#DeviceTypeInsert].  

I have also created code to update the descriptions of the erroneously added deprecated terms at [SqlQueriesFinal#UpdateDeprecated].


h4. Implementation

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.

These are coded in [SqlQueriesFinal#DeviceTypeMerge].

# Perform explicit corrections listed above.


We will copy the appropriate information over to our InterimTable (using the tempType column), from Instru or Device as appropriate, using the rules above. 

Then we will do the entries requiring 'manual' correction (assuming Paul has OK'd the above), code for which is in [SqlQueriesFinal#FixDeviceTypes]:

At this point, all the tempType cells should be filled in. 

Finally, the InterimTable will be used to overwrite the Device table.


[Back to table...|#table]

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueriesFinal#insertNewDevices] and [SqlQueriesFinal#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">237</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">235</id>
</element>
</collection>
<property name="version">14</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-11 10:09:12.037</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">238</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">236</id>
</element>
</collection>
<property name="version">15</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2006-11-11 10:21:39.500</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">266</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">264</id>
</element>
</collection>
<property name="version">6</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-15 12:08:00.003</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">265</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">263</id>
</element>
</collection>
<property name="version">5</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-14 11:44:36.287</property>
<property name="versionComment"><![CDATA[More fussing.]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">251</id>
<property name="title"><![CDATA[BogInstruNormalization]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">249</id>
</element>
</collection>
<property name="version">4</property>
<property name="creatorName"><![CDATA[amarburg]]></property>
<property name="creationDate">2006-11-10 15:49:26.227</property>
<property name="lastModifierName"><![CDATA[amarburg]]></property>
<property name="lastModificationDate">2006-11-14 11:39:20.967</property>
<property name="versionComment"><![CDATA[Just a little cleanup.]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228251</id>
<property name="destinationPageTitle"><![CDATA[Memory\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228250</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228249</id>
<property name="destinationPageTitle"><![CDATA[Firmware_EPROM\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228248</id>
<property name="destinationPageTitle"><![CDATA[int\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228247</id>
<property name="destinationPageTitle"><![CDATA[Depth_Rating\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228246</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228245</id>
<property name="destinationPageTitle"><![CDATA[Pressure_sensor\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228244</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228259</id>
<property name="destinationPageTitle"><![CDATA[Release_code\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228258</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228257</id>
<property name="destinationPageTitle"><![CDATA[Enable_code\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228256</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228255</id>
<property name="destinationPageTitle"><![CDATA[Transmit_frequency\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228254</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228253</id>
<property name="destinationPageTitle"><![CDATA[Receive_frequency\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228252</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228266</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228267</id>
<property name="destinationPageTitle"><![CDATA[Custodian\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228264</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228265</id>
<property name="destinationPageTitle"><![CDATA[Owner\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228262</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228263</id>
<property name="destinationPageTitle"><![CDATA[Purchased_for\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228260</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228261</id>
<property name="destinationPageTitle"><![CDATA[Tilt_option\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228274</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228275</id>
<property name="destinationPageTitle"><![CDATA[Permanent_comment\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228272</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228273</id>
<property name="destinationPageTitle"><![CDATA[Transaction_col\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228270</id>
<property name="destinationPageTitle"><![CDATA[datetime\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228271</id>
<property name="destinationPageTitle"><![CDATA[PO\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228268</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228269</id>
<property name="destinationPageTitle"><![CDATA[Date_new\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228232</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228233</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org:8081/display/AST/Use+Cases]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228234</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org:8081/display/AST/Use+Cases]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228235</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org:8081/display/AST/Use+Cases]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228240</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228241</id>
<property name="destinationPageTitle"><![CDATA[Calibration_organization\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228242</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228243</id>
<property name="destinationPageTitle"><![CDATA[Features\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228236</id>
<property name="destinationPageTitle"><![CDATA[//oceana.shore.mbari.org:8081/display/AST/Use+Cases]]></property>
<property name="destinationSpaceKey"><![CDATA[http]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228237</id>
<property name="destinationPageTitle"><![CDATA[MBARI_ID\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228238</id>
<property name="destinationPageTitle"><![CDATA[int\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228239</id>
<property name="destinationPageTitle"><![CDATA[Serial\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228311</id>
<property name="destinationPageTitle"><![CDATA[Pressure sensor]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228310</id>
<property name="destinationPageTitle"><![CDATA[Calibration organization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228309</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228308</id>
<property name="destinationPageTitle"><![CDATA[AccessAppChanges]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228315</id>
<property name="destinationPageTitle"><![CDATA[Transmit Frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228314</id>
<property name="destinationPageTitle"><![CDATA[Receive Frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228313</id>
<property name="destinationPageTitle"><![CDATA[Firmware/EPROM]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228312</id>
<property name="destinationPageTitle"><![CDATA[Depth Rating]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228319</id>
<property name="destinationPageTitle"><![CDATA[Purchased for]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228318</id>
<property name="destinationPageTitle"><![CDATA[Tilt option]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228317</id>
<property name="destinationPageTitle"><![CDATA[Release code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228316</id>
<property name="destinationPageTitle"><![CDATA[Enable code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228323</id>
<property name="destinationPageTitle"><![CDATA[manufacture web page]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228322</id>
<property name="destinationPageTitle"><![CDATA[Permanent comment]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228321</id>
<property name="destinationPageTitle"><![CDATA[Transaction]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228320</id>
<property name="destinationPageTitle"><![CDATA[Date new]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228326</id>
<property name="destinationPageTitle"><![CDATA[Calibration organization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228327</id>
<property name="destinationPageTitle"><![CDATA[Pressure sensor]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228324</id>
<property name="destinationPageTitle"><![CDATA[document dir]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228325</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228330</id>
<property name="destinationPageTitle"><![CDATA[Receive Frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228331</id>
<property name="destinationPageTitle"><![CDATA[Transmit Frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228328</id>
<property name="destinationPageTitle"><![CDATA[Depth Rating]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228329</id>
<property name="destinationPageTitle"><![CDATA[Firmware/EPROM]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228334</id>
<property name="destinationPageTitle"><![CDATA[Tilt option]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228335</id>
<property name="destinationPageTitle"><![CDATA[Purchased for]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228332</id>
<property name="destinationPageTitle"><![CDATA[Enable code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228333</id>
<property name="destinationPageTitle"><![CDATA[Release code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228338</id>
<property name="destinationPageTitle"><![CDATA[Permanent comment]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228339</id>
<property name="destinationPageTitle"><![CDATA[manufacture web page]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228336</id>
<property name="destinationPageTitle"><![CDATA[Date new]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228337</id>
<property name="destinationPageTitle"><![CDATA[Transaction]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228277</id>
<property name="destinationPageTitle"><![CDATA[document_dir\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228276</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1066</id>
<property name="body"><![CDATA[{note}These queries were tested against Northwind databases.  For queries configured for SSDS_Metadata, see [SqlQueriesFinal].{note}

{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. Update Device Type Column by Merging

{code:sql}
/* Update Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instru entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM Instru i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instru i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instru i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instru names */
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'

UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1069</id>
</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228279</id>
<property name="destinationPageTitle"><![CDATA[osg_view\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228278</id>
<property name="destinationPageTitle"><![CDATA[nvarchar\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228281</id>
<property name="destinationPageTitle"><![CDATA[dbo]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228280</id>
<property name="destinationPageTitle"><![CDATA[bit\]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.797</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.797</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228283</id>
<property name="destinationPageTitle"><![CDATA[dbo]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228282</id>
<property name="destinationPageTitle"><![CDATA[instru]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228285</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228284</id>
<property name="destinationPageTitle"><![CDATA[instru]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228287</id>
<property name="destinationPageTitle"><![CDATA[Pressure sensor]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228286</id>
<property name="destinationPageTitle"><![CDATA[Calibration organization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228289</id>
<property name="destinationPageTitle"><![CDATA[Firmware/EPROM]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228288</id>
<property name="destinationPageTitle"><![CDATA[Depth Rating]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228291</id>
<property name="destinationPageTitle"><![CDATA[Transmit frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228290</id>
<property name="destinationPageTitle"><![CDATA[Receive frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228292</id>
<property name="destinationPageTitle"><![CDATA[Enable code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228293</id>
<property name="destinationPageTitle"><![CDATA[Release code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228294</id>
<property name="destinationPageTitle"><![CDATA[Tilt option]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228295</id>
<property name="destinationPageTitle"><![CDATA[Purchased for]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228296</id>
<property name="destinationPageTitle"><![CDATA[Date new]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228297</id>
<property name="destinationPageTitle"><![CDATA[Transaction]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228298</id>
<property name="destinationPageTitle"><![CDATA[Permanent comment]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228299</id>
<property name="destinationPageTitle"><![CDATA[manufacture web page]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228300</id>
<property name="destinationPageTitle"><![CDATA[document dir]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228301</id>
<property name="destinationPageTitle"><![CDATA[dbo]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228302</id>
<property name="destinationPageTitle"><![CDATA[trans]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228303</id>
<property name="destinationPageTitle"><![CDATA[FK_trans_instru]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228304</id>
<property name="destinationPageTitle"><![CDATA[MBARI ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228305</id>
<property name="destinationPageTitle"><![CDATA[ssdsdba]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228306</id>
<property name="destinationPageTitle"><![CDATA[Device]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228307</id>
<property name="destinationPageTitle"><![CDATA[MBARI_ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228352</id>
<property name="destinationPageTitle"><![CDATA[Purchased for]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228353</id>
<property name="destinationPageTitle"><![CDATA[Date new]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228354</id>
<property name="destinationPageTitle"><![CDATA[Transaction]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228355</id>
<property name="destinationPageTitle"><![CDATA[Permanent comment]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228348</id>
<property name="destinationPageTitle"><![CDATA[Transmit Frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228349</id>
<property name="destinationPageTitle"><![CDATA[Enable code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228350</id>
<property name="destinationPageTitle"><![CDATA[Release code]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228351</id>
<property name="destinationPageTitle"><![CDATA[Tilt option]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228344</id>
<property name="destinationPageTitle"><![CDATA[Pressure sensor]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228345</id>
<property name="destinationPageTitle"><![CDATA[Depth Rating]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228346</id>
<property name="destinationPageTitle"><![CDATA[Firmware/EPROM]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228347</id>
<property name="destinationPageTitle"><![CDATA[Receive Frequency]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228340</id>
<property name="destinationPageTitle"><![CDATA[document dir]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228341</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228342</id>
<property name="destinationPageTitle"><![CDATA[SSDS ID]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228343</id>
<property name="destinationPageTitle"><![CDATA[Calibration organization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228360</id>
<property name="destinationPageTitle"><![CDATA[AccessAppChanges]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228357</id>
<property name="destinationPageTitle"><![CDATA[document dir]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228356</id>
<property name="destinationPageTitle"><![CDATA[manufacture web page]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228359</id>
<property name="destinationPageTitle"><![CDATA[DatabaseFields]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="OutgoingLink" package="com.atlassian.confluence.links">
<id name="id">2228358</id>
<property name="destinationPageTitle"><![CDATA[BogInstruNormalization]]></property>
<property name="destinationSpaceKey"><![CDATA[AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2007-10-10 13:22:50.800</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-10-10 13:22:50.800</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">1933372</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">925</id>
</property>
<property name="creatorName"/><property name="creationDate">2007-10-04 11:52:15.050</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-10-04 11:52:15.050</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">1933371</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Use+Cases]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2007-10-04 11:52:15.047</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-10-04 11:52:15.047</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">98</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-16 08:59:15.023</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-16 08:59:15.023</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">100</id>
<property name="viewCount">4</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-16 09:09:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-12-06 09:25:15.043</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">94</id>
<property name="viewCount">3</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Design]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-16 08:47:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-01-08 15:00:15.027</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">97</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Asset+Configuration+and+Tracking+Consolid]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-16 08:58:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-16 08:58:15.017</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">96</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-16 08:58:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-21 13:56:15.057</property>
</object>
<object class="Page" package="com.atlassian.confluence.pages">
<id name="id">589906</id>
<property name="title"><![CDATA[Design]]></property>
<collection name="bodyContents"><element class="BodyContent" package="com.atlassian.confluence.core"><id name="id">622673</id>
</element>
</collection>
<property name="version">69</property>
<property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2006-10-23 11:17:00.563</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2007-03-02 08:45:16.997</property>
<property name="versionComment"><![CDATA[]]></property>
<property name="originalVersion" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="contentStatus"><![CDATA[current]]></property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">4882446</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[COMMENT]]></property>
<property name="group"><![CDATA[Onsite Distribution List]]></property>
<property name="userName"/><property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2008-06-03 12:41:34.217</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2008-06-03 12:41:34.217</property>
</object>
<object class="SpacePermission" package="com.atlassian.confluence.security">
<id name="id">4882445</id>
<property name="space" class="Space" package="com.atlassian.confluence.spaces"><id name="id">6</id>
</property>
<property name="type"><![CDATA[VIEWSPACE]]></property>
<property name="group"><![CDATA[Onsite Distribution List]]></property>
<property name="userName"/><property name="creatorName"><![CDATA[kgomes]]></property>
<property name="creationDate">2008-06-03 12:41:28.873</property>
<property name="lastModifierName"><![CDATA[kgomes]]></property>
<property name="lastModificationDate">2008-06-03 12:41:28.873</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">136</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/dashboard.action?spacesSelectedTab=my]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-17 08:33:15.053</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-17 08:33:15.053</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">39</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/editpage.action?pageId=24]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 13:43:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 13:43:15.027</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">38</id>
<property name="viewCount">8</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/editpage.action?pageId=149]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 13:09:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 15:46:15.020</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">41</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/editpage.action?pageId=212]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 14:12:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 14:33:15.030</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">40</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/docreatepage.action]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 14:10:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 14:10:15.020</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">35</id>
<property name="viewCount">3</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/doeditpage.action?pageId=149]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 12:40:15.030</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 12:51:15.030</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">34</id>
<property name="viewCount">4</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 12:32:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 15:44:15.027</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">37</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/display/AST/Requirements]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 12:51:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 13:00:15.030</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">36</id>
<property name="viewCount">3</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/display/AST/Requirements]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 12:47:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 13:57:15.030</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">31</id>
<property name="viewCount">3</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 12:17:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-09 14:12:15.023</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">30</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/dosearchsite.action]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 12:16:15.047</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 12:16:15.047</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">33</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 12:20:15.030</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 12:20:15.030</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">32</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation?showChildren=true]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 12:20:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 12:20:15.027</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">27</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/display/AST/Use+Cases]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-03 17:12:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-03 17:14:15.027</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">26</id>
<property name="viewCount">4</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-03 17:10:15.080</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-09 15:57:15.027</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">29</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/login.action?os_destination=%2Fdisplay%2FAST%2FUse%2BCases]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-03 17:13:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-03 17:13:15.027</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">28</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/diffpages.action?pageId=194&originalId=193]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-03 17:12:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-03 17:12:15.020</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">54</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8082/browse/AST-3]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-11 11:18:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-11 11:18:15.017</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">55</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8082/browse/AST-10]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-12 06:16:15.070</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-12 06:16:15.070</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">56</id>
<property name="viewCount">13</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Design]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-13 09:09:15.023</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-21 15:01:15.020</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">50</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-11 09:52:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-11 09:52:15.020</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">51</id>
<property name="viewCount">33</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-11 11:09:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-02-05 08:44:15.123</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">52</id>
<property name="viewCount">15</property>
<property name="url"><![CDATA[http://oceana:8081/dashboard.action]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-11 11:09:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-10-04 11:52:15.050</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">53</id>
<property name="viewCount">8</property>
<property name="url"><![CDATA[http://oceana:8081/pages/editpage.action?pageId=71]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-11 11:14:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-02-05 08:45:15.017</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">46</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/editpage.action?pageId=171]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 14:45:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 14:45:15.017</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">48</id>
<property name="viewCount">6</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/dashboard.action]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-09 14:11:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-11 09:52:15.067</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">42</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/recentlyupdated.action?key=AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 14:21:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 14:21:15.017</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">43</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/recentlyupdated.action?key=AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 14:22:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 14:22:15.020</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">44</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/doeditpage.action?pageId=212]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">212</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 14:28:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 14:35:15.017</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">45</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8081/pages/editpage.action?pageId=171]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">171</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-06 14:42:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-06 14:42:15.020</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">68</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8082/browse/AST-9]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-14 11:39:15.030</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-14 11:39:15.030</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">67</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/pages/pageinfo.action?pageId=233]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-14 09:37:15.033</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-14 09:37:15.033</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">66</id>
<property name="viewCount">14</property>
<property name="url"><![CDATA[http://oceana:8081/pages/editpage.action?pageId=233]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-14 09:36:15.023</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-21 09:44:15.023</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">65</id>
<property name="viewCount">3</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/BogInstruNormalization]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-14 09:36:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-14 09:37:15.033</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">64</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/pages/editpage.action]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-14 09:34:15.140</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-14 09:34:15.140</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">63</id>
<property name="viewCount">7</property>
<property name="url"><![CDATA[http://oceana:8081/dashboard.action?spacesSelectedTab=all]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-14 08:19:15.037</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-08-10 09:01:15.040</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">82</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-15 13:04:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-15 13:04:15.027</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">80</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/pages/editpage.action?useDraft=true&pageId=233&spaceKey=AST]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">233</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-15 12:08:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-15 12:08:15.020</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">218</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Requirements?showComments=true&showCommentArea=true]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-12-07 11:51:15.013</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-12-07 12:37:15.027</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">219</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Design]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-12-13 12:55:15.030</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-12-13 12:55:15.030</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">220</id>
<property name="viewCount">4</property>
<property name="url"><![CDATA[http://oceana:8081/dashboard.action]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-12-20 12:44:15.050</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-01-02 10:13:15.080</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">221</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Design]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"/><property name="creationDate">2007-01-02 14:53:15.053</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-01-02 14:53:15.053</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">237</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Use+Cases]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="creatorName"/><property name="creationDate">2007-01-19 15:28:15.333</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-01-19 15:28:15.333</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">249</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/dashboard.action?spacesSelectedTab=new]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2007-02-05 08:44:15.093</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-02-05 08:44:15.093</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">252</id>
<property name="viewCount">5</property>
<property name="url"><![CDATA[http://oceana:8081/pages/editpage.action?pageId=743]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
<property name="creatorName"/><property name="creationDate">2007-02-05 09:43:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-02-05 10:50:15.017</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">250</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/pages/createpage.action?spaceKey=AST&title=AccessAppChanges&linkCreation=true&fromPageId=71]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2007-02-05 08:53:15.030</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-02-05 08:53:15.030</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">251</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/pages/createpage.action?spaceKey=AST&title=AccessAppChanges&linkCreation=true&fromPageId=71]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">743</id>
</property>
<property name="creatorName"/><property name="creationDate">2007-02-05 09:05:15.023</property>
<property name="lastModifierName"/><property name="lastModificationDate">2007-02-05 09:05:15.023</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">165</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/BogInstruNormalization]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-21 09:49:15.033</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-21 09:49:15.033</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">4849669</id>
<property name="viewCount">3</property>
<property name="url"><![CDATA[https://oceana.mbari.org/confluence/dashboard.action]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2008-06-03 12:42:15.060</property>
<property name="lastModifierName"/><property name="lastModificationDate">2008-06-03 12:42:15.060</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">171</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana.shore.mbari.org:8082/browse/AST-4]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">71</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-29 15:59:15.093</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-29 15:59:15.093</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">170</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Asset+Configuration+and+Tracking+Consolidation]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">351</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-29 08:31:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-29 08:31:15.017</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">172</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/dashboard.action?maxRecentlyUpdatedPageCount=20&spacesSelectedTab=my]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">24</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-11-30 09:56:15.043</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-11-30 09:56:15.043</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">208</id>
<property name="viewCount">9</property>
<property name="url"><![CDATA[http://oceana:8081/pages/editpage.action?pageId=489]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-12-04 12:51:15.017</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-12-13 14:04:16.520</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">207</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/pages/createpage.action?spaceKey=AST&title=DatabaseFields&linkCreation=true&fromPageId=71]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-12-04 12:01:15.027</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-12-04 12:01:15.027</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">217</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/display/AST/Requirements?focusedCommentId=511]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-12-07 11:50:15.020</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-12-07 11:50:15.020</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">216</id>
<property name="viewCount">2</property>
<property name="url"><![CDATA[http://oceana:8081/dashboard.action?spacesSelectedTab=all]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">149</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-12-07 11:49:15.037</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-12-07 11:49:15.037</property>
</object>
<object class="ReferralLink" package="com.atlassian.confluence.links">
<id name="id">210</id>
<property name="viewCount">1</property>
<property name="url"><![CDATA[http://oceana:8081/pages/editpage.action]]></property>
<property name="sourceContent" class="Page" package="com.atlassian.confluence.pages"><id name="id">489</id>
</property>
<property name="creatorName"/><property name="creationDate">2006-12-04 15:41:15.043</property>
<property name="lastModifierName"/><property name="lastModificationDate">2006-12-04 15:41:15.043</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">2195587</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Approaches]
# [Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Design]

----
# [Design Review Notes]
# [BogInstruNormalization]
# [DatabaseFields]
# [MakingData] -- detailed steps needed to transform the contents of the database

Tasks and bugs can be found in [JIRA|http://oceana.shore.mbari.org:8082/browse/AST]

Here is web access to the project files [http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">2162820</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">2195586</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Approaches]
# [Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Design]

----
# [Design Review Notes]
# [BogInstruNormalization]
# [DatabaseFields]
# [MakingData] -- detailed steps needed to transform the contents of the database

Tasks and bugs can be found in [JIRA|http://oceana.shore.mbari.org:8082/browse/AST]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">2162819</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">2195461</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.

h1. Current Design details
 
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '0'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.  He stated that the Transaction column was not really used and could be removed.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device LEFT OUTER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id LEFT OUTER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# The history tables store the updated values for entries as the thought is that each entry would have to be inserted before any updates so you would always have the initial state of the row.  In this case we are starting with existing data, so it is critical that we get a baseline of all the current rows.  This can be done simply by running these in SQL Query Analyzer:
{noformat}
UPDATE ssdsdba.Device SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.Person SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.DeviceType SET version = version
GO
{noformat}
This will create entries for all the rows so that we will have the current data in the history table to compare future updates/deletions against.
# Create an INSTEAD OF INSERT trigger on the view
{noformat}
CREATE TRIGGER trInstruInsert ON instru
INSTEAD OF INSERT
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Now let's make sure the MBARI_ID and SSDS_ID are null
    IF @mbari_id IS NOT NULL
      RAISERROR('The insert specified the MBARI_ID. This field is auto-generated, do not specify on insert',9,1)
    IF @ssds_id IS NOT NULL
      RAISERROR('The insert specified the SSDS_ID. This field is auto-generated, do not specify on insert',9,1)

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    INSERT INTO ssdsdba.Device 
      (
       mfgName,
       mfgModel,
       Serial,
       mfgSerialNumber,
       Calibration_organization,
       Features,
       Pressure_Sensor,
       Depth_Rating,
       Firmware_EPROM,
       Memory,
       Receive_frequency,
       Transmit_frequency,
       Enable_code,
       Release_code,
       Tilt_option,
       Purchased_for,
       Owner,
       Custodian,
       Date_new,
       PO,
       Transaction_col,
       Permanent_comment,
       infoUrlList,
       document_dir,
       PersonID_FK,
       DeviceTypeID_FK
      )
    VALUES
      (
       @mfgName,
       @mfgModel,
       @serial,
       @mfgSerialNumber,
       @calibration_organization,
       @features,
       @pressure_sensor,
       @depth_rating,
       @firmware_eprom,
       @memory,
       @receive_frequency,
       @transmit_frequency,
       @enable_code,
       @release_code,
       @tilt_option,
       @purchased_for,
       @owner,
       @custodian,
       @date_new,
       @po,
       @transaction_col,
       @permanent_comment,
       @infoUrlList,
       @document_dir,
       @person_id,
       @deviceType_id
      )
  END
END
GO{noformat}
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    UPDATE ssdsdba.Device 
      SET ssdsdba.Device.mfgName = @mfgName,
          ssdsdba.Device.mfgModel = @mfgModel,
          ssdsdba.Device.Serial = @serial,
          ssdsdba.Device.mfgSerialNumber = @mfgSerialNumber,
          ssdsdba.Device.Calibration_organization = @calibration_organization,
          ssdsdba.Device.Features = @features,
          ssdsdba.Device.Pressure_Sensor = @pressure_sensor,
          ssdsdba.Device.Depth_Rating = @depth_rating,
          ssdsdba.Device.Firmware_EPROM = @firmware_eprom,
          ssdsdba.Device.Memory = @memory,
          ssdsdba.Device.Receive_frequency = @receive_frequency,
          ssdsdba.Device.Transmit_frequency = @transmit_frequency,
          ssdsdba.Device.Enable_code = @enable_code,
          ssdsdba.Device.Release_code = @release_code,
          ssdsdba.Device.Tilt_option = @tilt_option,
          ssdsdba.Device.Purchased_for = @purchased_for,
          ssdsdba.Device.Owner = @owner,
          ssdsdba.Device.Custodian = @custodian,
          ssdsdba.Device.Date_new = @date_new,
          ssdsdba.Device.PO = @po,
          ssdsdba.Device.Transaction_col = @transaction_col,
          ssdsdba.Device.Permanent_comment = @permanent_comment,
          ssdsdba.Device.infoUrlList = @infoUrlList,
          ssdsdba.Device.document_dir = @document_dir,
          ssdsdba.Device.PersonID_FK = @person_id,
          ssdsdba.Device.DeviceTypeID_FK = @deviceType_id
      WHERE ssdsdba.Device.id = (Select [SSDS ID] from Inserted)
  END
END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
{noformat}
CREATE TRIGGER trInstruDelete ON instru
INSTEAD OF DELETE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Deleted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Deleted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Deleted

    -- Now let's make sure the SSDS_ID is not null
    IF @ssds_id IS NULL
      RAISERROR('The delete did not specify the SSDS_ID. No delete performed',9,1)

    -- Now delete the row specified
    DELETE FROM ssdsdba.Device 
      WHERE id = @ssds_id
  END
END
GO
{noformat}
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Custom field comparison utilities
## Serial number
### Ignore non-alphanumeric text (remove white space, punctuation)
### If existing serial number matches the end of the new serial number, consider it a (likely?) match
## Model number
### Ignore non-alphanumeric text (remove white space, punctuation)
# Put links to CVS web xml in Device listing web page (KG)

----

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">2162694</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">21</id>
<property name="body"><![CDATA[]]></property>
<property name="content" class="SpaceDescription" package="com.atlassian.confluence.spaces"><id name="id">23</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">63</id>
<property name="body"><![CDATA[This is the home page for the 900626 Asset Configuration and Tracking Consolidation space.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">65</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">70</id>
<property name="body"><![CDATA[John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5].]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">72</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">68</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">70</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">72</id>
<property name="body"><![CDATA[John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">74</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">71</id>
<property name="body"><![CDATA[John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg].]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">73</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">145</id>
<property name="body"><![CDATA[John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">147</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">146</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Project Requirements]
# [Design]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">148</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">143</id>
<property name="body"><![CDATA[John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">145</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">144</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Project Requirements]
# [Project Design]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">146</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">141</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [ProjectDesign]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">143</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">142</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Project Requirements]
# [ProjectDesign]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">144</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">154</id>
<property name="body"><![CDATA[h3. Requirements

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">156</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">148</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Requirements]
# [Design]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">150</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">159</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
# General Description
# Functional Requirements
## {requirement:OSGCreateDevice|OSG Operator Creates New Device|Requirement text}
# Interface Requirements
# Performance Requirements
# Design Constraints
# Other non-functional attributes
## Security
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">161</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">157</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
# General Description
# Functional Requirements
## {requirement:OSGCreateDevice|OSG Operator Creates New Device|Requirement text}</div>
# Interface Requirements
# Performance Requirements
# Design Constraints
# Other non-functional attributes
## Security
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">159</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">156</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
# General Description
# Functional Requirements
## <div id="OSGCreateDevice">OSG Operator Creates New Device</div>
# Interface Requirements
# Performance Requirements
# Design Constraints
# Other non-functional attributes
## Security
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">158</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">155</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
# General Description
# Functional Requirements
# Interface Requirements
# Performance Requirements
# Design Constraints
# Other non-functional attributes
## Security
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">157</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">167</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Design]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">169</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">168</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases and Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Requirements]
# [Design]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">170</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">170</id>
<property name="body"><![CDATA[{use-case-table:Create New Device in Instru| | | | | | | | | |}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">172</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">175</id>
<property name="body"><![CDATA[{use-case-table:Create New Device in Instru|OSG Operator can create a new device in the Instument database (BOG)|http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru| | | | | | | |}
----
{use-case-table:Edit Device in Instru|OSG Operator can edit device information in the Instument database (BOG)|| | | | | | | |}
----
{use-case-table:Create New Device in SSDS|SSDS Operator can create a new device in the SSDS system|| | | | | | | |}
----
{use-case-table:Edit Device in SSDS|SSDS Operator can edit device information in the SSDS system|| | | | | | | |}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">177</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">176</id>
<property name="body"><![CDATA[{use-case-table:Create New Device in Instru|OSG Operator can create a new device in the Instument database (BOG)|http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru| | | | | | | |}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can edit device information in the Instument database (BOG)|
| | | | | | | |}
----
{use-case-table:Create New Device in SSDS|SSDS Operator can create a new device in the SSDS system|| | | | | | | |}
----
{use-case-table:Edit Device in SSDS|SSDS Operator can edit device information in the SSDS system|| | | | | | | |}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">178</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">177</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
|
|
|
|
|
|
|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can edit device information in the Instument database (BOG)|
|
|
|
|
|
|
|
|
}
----
{use-case-table:Create New Device in SSDS|SSDS Operator can create a new device in the SSDS system|| | | | | | | |}
----
{use-case-table:Edit Device in SSDS|SSDS Operator can edit device information in the SSDS system|| | | | | | | |}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">179</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">178</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
|
|
|
|
|
|
|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can edit device information in the Instument database (BOG)|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator can create a new device in the SSDS system|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Edit Device in SSDS|
SSDS Operator can edit device information in the SSDS system|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">180</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">171</id>
<property name="body"><![CDATA[{use-case-table:Create New Device in Instru|OSG Operator can create a new device in the Instument database (BOG)| | | | | | | | |}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">173</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">172</id>
<property name="body"><![CDATA[{use-case-table:Create New Device in Instru|OSG Operator can create a new device in the Instument database (BOG)|http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru| | | | | | | |}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">174</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">173</id>
<property name="body"><![CDATA[{use-case-table:Create New Device in Instru|OSG Operator can create a new device in the Instument database (BOG)|http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru| | | | | | | |}
<hr>
{use-case-table:Edit Device in Instru|OSG Operator can edit device information in the Instument database (BOG)|| | | | | | | |}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">175</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">174</id>
<property name="body"><![CDATA[{use-case-table:Create New Device in Instru|OSG Operator can create a new device in the Instument database (BOG)|http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru| | | | | | | |}
----
{use-case-table:Edit Device in Instru|OSG Operator can edit device information in the Instument database (BOG)|| | | | | | | |}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">176</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">184</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator a device creation</li>
</ol>|
|
}
----
{use-case-table:
Edit Device in Instru|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Create New Device in SSDS|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Edit Device in SSDS|
|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">186</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">183</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Design]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">185</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">186</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>Validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store|
No device information was updated|
OSG Operator|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
</o>
|}
----
{use-case-table:
Create New Device in SSDS|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Edit Device in SSDS|
|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">188</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">185</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>Validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store|
No device information was updated|
|
OSG Operator|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
</o>|}
----
{use-case-table:
Create New Device in SSDS|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Edit Device in SSDS|
|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">187</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">180</id>
<property name="body"><![CDATA[John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">182</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">179</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
|
}
----
{use-case-table:
Edit Device in Instru|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Create New Device in SSDS|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Edit Device in SSDS|
|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">181</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">182</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
</ol>|
|
}
----
{use-case-table:
Edit Device in Instru|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Create New Device in SSDS|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Edit Device in SSDS|
|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">184</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">181</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol><li>OSG Operator opens Access Application</li><li>OSG Operator clicks on button to insert new Device</li></ol>|
|
}
----
{use-case-table:
Edit Device in Instru|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Create New Device in SSDS|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Edit Device in SSDS|
|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">183</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">192</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>After OSG Operator clicks on button to create new device, validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store|
No device information was updated|
OSG Operator|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>After OSG Operator clicks on update button, information validation fails and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
MBARI LDAP Service|
A new Device needs to be put into service.|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>SSDS checks authorization of user</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information entered is checked against data store:
<ul>
<li>If no UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store.</li>
<li>SSDS Operator, SSDS Admin and OSG Admin are notified of new device creation.</li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
SSDS Operator or Software Agent shall have interface to edit device information in SSDS.|
|
Both human and software processes need interfaces to update device information in SSDS.|
Device already exist in data store|
Device information is updated in the data store|
No device information is updated in the data store|
<ol><ul><li>SSDS Operator</li><li>Software Agent</li></ol>|
MBARI LDAP Service|
Information about a device has changed or is incorrect|
<ol>
  <li>
    <ol>
      <li>SSDS Operator logs into SSDS web application</li>
      <li>SSDS Operator searches for existing device</li>
      <li>SSDS Operator selects link to edit device</li>
      <li>SSDS checks authorization of user</li>
      <li>SSDS Operator changes the appropriate information</li>
      <li>SSDS Operator clicks on Submit to attempt to update device</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator, SSDS Admin and OSG Admin are notified of change in device information.</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>Software Agent sends calls Device update service with device information.</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator, SSDS Admin and OSG Admin are notified of change in device information.</li>
    </ol>
  </li>
</ol>|
<ol>
  <li>
    <ol>
      <li>If field validations fail, user is presented with another try</li>
      <li>If information entered violates rules, user is presented with another try</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>If field validations fail, service throws exception back to Software Agent</li>
      <li>If information entered violates rules, service throws exception back to Software Agent.</li>
    </ol>
  </li>
</ol>|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">194</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">191</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>After OSG Operator clicks on button to create new device, validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store|
No device information was updated|
OSG Operator|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>After OSG Operator clicks on update button, information validation fails and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
MBARI LDAP Service|
A new Device needs to be put into service.|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>SSDS checks authorization of user</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information entered is checked against data store:
<ul>
<li>If no UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store.</li>
<li>SSDS Operator, SSDS Admin and OSG Admin are notified of new device creation.</li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
SSDS Operator or Software Agent shall have interface to edit device information in SSDS.|
|
Both human and software processes need interfaces to update device information in SSDS.|
Device already exist in data store|
Device information is updated in the data store|
No device information is updated in the data store|
<ol><ul><li>SSDS Operator</li><li>Software Agent</li></ol>|
MBARI LDAP Service|
Information about a device has changed or is incorrect|
<ol>
  <li>
    <ol>
      <li>SSDS Operator logs into SSDS web application</li>
      <li>SSDS Operator searches for existing device</li>
      <li>SSDS Operator selects link to edit device</li>
      <li>SSDS checks authorization of user</li>
      <li>SSDS Operator changes the appropriate information</li>
      <li>SSDS Operator clicks on Submit to attempt to update device</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator, SSDS Admin and OSG Admin are notified of change in device information.</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>SSDS Operator logs into SSDS web application</li>
      <li>SSDS Operator searches for existing device</li>
      <li>SSDS Operator selects link to edit device</li>
      <li>SSDS checks authorization of user</li>
      <li>SSDS Operator changes the appropriate information</li>
      <li>SSDS Operator clicks on Submit to attempt to update device</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator, SSDS Admin and OSG Admin are notified of change in device information.</li>
    </ol>
  </li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">193</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">194</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>After OSG Operator clicks on button to create new device, validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store and changes show up in SSDS and Access app|
No device information was updated|
OSG Operator|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>After OSG Operator clicks on update button, information validation fails and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
<ol><li>MBARI LDAP Service</li><li>OSG Operator</li></ol>|
A new Device needs to be put into service.|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>SSDS checks authorization of user</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information entered is checked against data store:
<ul>
<li>If no UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store.</li>
<li>SSDS Operator, SSDS Admin and OSG Operator are notified of new device creation.</li>
<li>In notification to OSG Operator, he/she is presentd option of importing to Instrument Database</li>
<li>OSG Operator clicks on link to approve transfer to Access application</li>
<li>Data is transferred to Access data store</li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
SSDS Operator or Software Agent shall have interface to edit device information in SSDS.|
|
Both human and software processes need interfaces to update device information in SSDS.|
Device already exist in data store|
Device information is updated in the data store|
No device information is updated in the data store|
<ol><ul><li>SSDS Operator</li><li>Software Agent</li></ol>|
MBARI LDAP Service|
Information about a device has changed or is incorrect|
<ol>
  <li>
    <ol>
      <li>SSDS Operator logs into SSDS web application</li>
      <li>SSDS Operator searches for existing device</li>
      <li>SSDS Operator selects link to edit device</li>
      <li>SSDS checks authorization of user</li>
      <li>SSDS Operator changes the appropriate information</li>
      <li>SSDS Operator clicks on Submit to attempt to update device</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>Software Agent sends calls Device update service with device information.</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
</ol>|
<ol>
  <li>
    <ol>
      <li>If field validations fail, user is presented with another try</li>
      <li>If information entered violates rules, user is presented with another try</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>If field validations fail, service throws exception back to Software Agent</li>
      <li>If information entered violates rules, service throws exception back to Software Agent.</li>
    </ol>
  </li>
</ol>|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">196</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">188</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>Validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store|
No device information was updated|
OSG Operator|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Information fails validation and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
MBARI LDAP Service|
A new Device needs to be put into service.|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>SSDS checks authorization of user</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information is checked:
<ul>
<li>If not UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store</li>
<li>SSDS Operator, SSDS Admin and OSG Admin are notified of new device creation</li>
</ol>|
<ol>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">190</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">187</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>Validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store|
No device information was updated|
OSG Operator|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Information fails validation and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Edit Device in SSDS|
|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">189</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">190</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>After OSG Operator clicks on button to create new device, validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store|
No device information was updated|
OSG Operator|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>After OSG Operator clicks on update button, information validation fails and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
MBARI LDAP Service|
A new Device needs to be put into service.|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>SSDS checks authorization of user</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information entered is checked against data store:
<ul>
<li>If no UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store.</li>
<li>SSDS Operator, SSDS Admin and OSG Admin are notified of new device creation.</li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">192</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">189</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>After OSG Operator clicks on button to create new device, validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store|
No device information was updated|
OSG Operator|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Information fails validation and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
MBARI LDAP Service|
A new Device needs to be put into service.|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>SSDS checks authorization of user</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information entered is checked against data store:
<ul>
<li>If no UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store.</li>
<li>SSDS Operator, SSDS Admin and OSG Admin are notified of new device creation.</li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
|
|
|
|
|
|
|
|
|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">191</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">197</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
# General Description
# Functional Requirements
## {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
# Interface Requirements
# Performance Requirements
# Design Constraints
# Other non-functional attributes
## Security
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">199</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">198</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuratino and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.
# Functional Requirements
## {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
# Interface Requirements
# Performance Requirements
# Design Constraints
# Other non-functional attributes
## Security
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">200</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">195</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
|
|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>After OSG Operator clicks on button to create new device, validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store and changes show up in SSDS and Access app|
No device information was updated|
OSG Operator|
|
|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>After OSG Operator clicks on update button, information validation fails and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
<ol><li>MBARI LDAP Service</li><li>OSG Operator</li></ol>|
A new Device needs to be put into service.|
|
|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>SSDS checks authorization of user</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information entered is checked against data store:
<ul>
<li>If no UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store.</li>
<li>SSDS Operator, SSDS Admin and OSG Operator are notified of new device creation.</li>
<li>In notification to OSG Operator, he/she is presentd option of importing to Instrument Database</li>
<li>OSG Operator clicks on link to approve transfer to Access application</li>
<li>Data is transferred to Access data store</li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
SSDS Operator or Software Agent shall have interface to edit device information in SSDS.|
|
Both human and software processes need interfaces to update device information in SSDS.|
Device already exist in data store|
Device information is updated in the data store|
No device information is updated in the data store|
<ol><ul><li>SSDS Operator</li><li>Software Agent</li></ol>|
MBARI LDAP Service|
Information about a device has changed or is incorrect|
|
|
<ol>
  <li>
    <ol>
      <li>SSDS Operator logs into SSDS web application</li>
      <li>SSDS Operator searches for existing device</li>
      <li>SSDS Operator selects link to edit device</li>
      <li>SSDS checks authorization of user</li>
      <li>SSDS Operator changes the appropriate information</li>
      <li>SSDS Operator clicks on Submit to attempt to update device</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>Software Agent sends calls Device update service with device information.</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
</ol>|
<ol>
  <li>
    <ol>
      <li>If field validations fail, user is presented with another try</li>
      <li>If information entered violates rules, user is presented with another try</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>If field validations fail, service throws exception back to Software Agent</li>
      <li>If information entered violates rules, service throws exception back to Software Agent.</li>
    </ol>
  </li>
</ol>|
}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">197</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">196</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
|
|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>After OSG Operator clicks on button to create new device, validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store and changes show up in SSDS and Access app|
No device information was updated|
OSG Operator|
|
|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>After OSG Operator clicks on update button, information validation fails and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
<ol><li>MBARI LDAP Service</li><li>OSG Operator</li></ol>|
A new Device needs to be put into service.|
|
|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>SSDS checks authorization of user</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information entered is checked against data store:
<ul>
<li>If no UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store.</li>
<li>SSDS Operator, SSDS Admin and OSG Operator are notified of new device creation.</li>
<li>In notification to OSG Operator, he/she is presentd option of importing to Instrument Database</li>
<li>OSG Operator clicks on link to approve transfer to Access application</li>
<li>Data is transferred to Access data store</li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
SSDS Operator or Software Agent shall have interface to edit device information in SSDS.|
|
Both human and software processes need interfaces to update device information in SSDS.|
Device already exist in data store|
Device information is updated in the data store|
No device information is updated in the data store|
<ol><ul><li>SSDS Operator</li><li>Software Agent</li></ol>|
MBARI LDAP Service|
Information about a device has changed or is incorrect|
|
|
<ol>
  <li>
    <ol>
      <li>SSDS Operator logs into SSDS web application</li>
      <li>SSDS Operator searches for existing device</li>
      <li>SSDS Operator selects link to edit device</li>
      <li>SSDS checks authorization of user</li>
      <li>SSDS Operator changes the appropriate information</li>
      <li>SSDS Operator clicks on Submit to attempt to update device</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>Software Agent sends calls Device update service with device information.</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
</ol>|
<ol>
  <li>
    <ol>
      <li>If field validations fail, user is presented with another try</li>
      <li>If information entered violates rules, user is presented with another try</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>If field validations fail, service throws exception back to Software Agent</li>
      <li>If information entered violates rules, service throws exception back to Software Agent.</li>
    </ol>
  </li>
</ol>|
}
----
{use-case-table:
Authenticate User|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Authorize User|
|
|
|
|
|
|
|
|
|
|
|
|
|
}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">198</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">201</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
|
|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>After OSG Operator clicks on button to create new device, validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
|
The OSG Operator's need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store and changes show up in SSDS and Access app|
No device information was updated|
OSG Operator|
|
|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>After OSG Operator clicks on update button, information validation fails and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
OSG Operator|
A new Device needs to be put into service.|
<ol><li>Authenticate User</li><li>Authorize User</li>|
|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>include::Authenticate User</li>
<li>include::Authorize User</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information entered is checked against data store:
<ul>
<li>If no UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store.</li>
<li>SSDS Operator, SSDS Admin and OSG Operator are notified of new device creation.</li>
<li>In notification to OSG Operator, he/she is presentd option of importing to Instrument Database</li>
<li>OSG Operator clicks on link to approve transfer to Access application</li>
<li>Data is transferred to Access data store</li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
SSDS Operator or Software Agent shall have interface to edit device information in SSDS.|
|
Both human and software processes need interfaces to update device information in SSDS.|
Device already exist in data store|
Device information is updated in the data store|
No device information is updated in the data store|
<ol><ul><li>SSDS Operator</li><li>Software Agent</li></ol>|
|
Information about a device has changed or is incorrect|
<ol><li>Authenticate User</li><li>Authorize User</li>|
|
<ol>
  <li>
    <ol>
      <li>SSDS Operator logs into SSDS web application</li>
      <li>SSDS Operator searches for existing device</li>
      <li>SSDS Operator selects link to edit device</li>
      <li>include::Authenticate User</li>
      <li>include::Authorize User</li>
      <li>SSDS Operator changes the appropriate information</li>
      <li>SSDS Operator clicks on Submit to attempt to update device</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>Software Agent sends calls Device update service with device information.</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
</ol>|
<ol>
  <li>
    <ol>
      <li>If field validations fail, user is presented with another try</li>
      <li>If information entered violates rules, user is presented with another try</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>If field validations fail, service throws exception back to Software Agent</li>
      <li>If information entered violates rules, service throws exception back to Software Agent.</li>
    </ol>
  </li>
</ol>|
}
----
{use-case-table:
Authenticate User|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Authorize User|
|
|
|
|
|
|
|
|
|
|
|
|
|
}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">203</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">202</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuratino and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
# Functional Requirements
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
# Interface Requirements
# Performance Requirements
# Design Constraints
# Other non-functional attributes
## Security
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">204</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">199</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuratino and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
# Functional Requirements
## Use Cases
The following use cases are all described in
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
# Interface Requirements
# Performance Requirements
# Design Constraints
# Other non-functional attributes
## Security
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">201</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">200</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuratino and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
# Functional Requirements
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
# Interface Requirements
# Performance Requirements
# Design Constraints
# Other non-functional attributes
## Security
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">202</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">205</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuration and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
{quote}
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
*Deliverables* The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
{quote}
\\
As currently envisioned based on information learned to date (2006.11.05), the initial effort will not incorporate LOBO, and Paul Coenen's database is considered to be the same as the BOG 'instru' database.
# Functional Requirements
## General
### {requirement:ReflectInstruChangesToSSDS|Reflect Instru Changes To SSDS Database|Changes to the Instru database should be reflected in the SSDS database.}
### {requirement:ReflectSSDSChangesToInstru|Reflect SSDS Changes To Instru Database|Changes to the SSDS database should be reflected in the Instru database, to the extent they are of interest to users of the Instru database.}
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
# Interface Requirements
## The existing MS Access interface to Paul Coenen's Instru database must be supported, or its equivalent functions provided to the satisfaction of OSG.
## The existing SSDS services must remain available.
## (?) Operation of the existing SSDS device search interface should be clarified.
# Performance Requirements
## The changes must support the expected number of devices to be entered over the next 5 years, without significantly impacting usability.
# Design Constraints
## Paul Coenen must maintain authority to control changes to the instruments of interest to him (i.e., those currently in the Instru database).
## Multiple users, from OSG, Development, and Engineering will be responsible for creating and editing device metadata. The system must gracefully minimize data entry errors, and allow review processes (automated and manual) to catch errors when they do occur.
# Other non-functional attributes
## Security
### The author of each change to the SSDS database should be identifiable.
### Changes to device metadata should be reviewable by a designated authority for that device record.
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
### To the extent possible, the system should take into account the likely addition of other instrument collections in the future.
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">207</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">206</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Design]

Tasks and bugs can be found in [JIRA|http://oceana:8082/browse/AST]
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">208</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">203</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuratino and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.\\
As currently envisioned based on information learned to date (2006.11.05), the initial effort will not incorporate LOBO, and Paul Coenen's database is considered to be the same as the BOG 'instru' database.
# Functional Requirements
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
## General
### {requirement:ReflectChangesToSSDS|Reflect Changes In Each Database|Changes to }
# Interface Requirements
## The existing Access interface to Paul Coenen's Instru database must be supported.
## 
# Performance Requirements
# Design Constraints
## Paul Coenen must maintain authority to control changes to the instruments of interest to him (i.e., those currently in the Instru database).
# Other non-functional attributes
## Security
### The author of each change to the SSDS database should be identifiable.
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">205</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">204</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuratino and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.\\
\\
As currently envisioned based on information learned to date (2006.11.05), the initial effort will not incorporate LOBO, and Paul Coenen's database is considered to be the same as the BOG 'instru' database.
# Functional Requirements
## General
### {requirement:ReflectInstruChangesToSSDS|Reflect Instru Changes To SSDS Database|Changes to the Instru database should be reflected in the SSDS database.}
### {requirement:ReflectSSDSChangesToInstru|Reflect SSDS Changes To Instru Database|Changes to the SSDS database should be reflected in the Instru database, to the extent they are of interest to users of the Instru database.}
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
# Interface Requirements
## The existing MS Access interface to Paul Coenen's Instru database must be supported, or its equivalent functions provided to the satisfaction of OSG.
## 
# Performance Requirements
# Design Constraints
## Paul Coenen must maintain authority to control changes to the instruments of interest to him (i.e., those currently in the Instru database).
# Other non-functional attributes
## Security
### The author of each change to the SSDS database should be identifiable.
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">206</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">209</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuration and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
{quote}
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
*Deliverables* The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
{quote}
\\
As currently envisioned based on information learned to date (2006.11.05), the initial effort will not incorporate LOBO, and Paul Coenen's database is considered to be the same as the BOG 'instru' database.
# Functional Requirements
## General
### {requirement:ReflectInstruChangesToSSDS|Reflect Instru Changes To SSDS Database|Changes to the Instru database should be reflected in the SSDS database.}
###{requirement:ReflectSSDSChangesToInstru|(?) Reflect SSDS Changes To Instru Database|Changes to the SSDS database should be reflected in the Instru database, to the extent they are of interest to users of the Instru database.}
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
# Interface Requirements
## The existing MS Access interface to Paul Coenen's Instru database must be supported, or its equivalent functions provided to the satisfaction of OSG.
## The existing SSDS services must remain available.
## (?) Operation of the existing SSDS device search interface should be clarified.
# Performance Requirements
## The changes must support the expected number of devices to be entered over the next 5 years, without significantly impacting usability.
# Design Constraints
## Paul Coenen must maintain authority to control changes to the instruments of interest to him (i.e., those currently in the Instru database).
## Multiple users, from OSG, Development, and Engineering will be responsible for creating and editing device metadata. The system must gracefully minimize data entry errors, and allow review processes (automated and manual) to catch errors when they do occur.
# Other non-functional attributes
## Security
### The author of each change to the SSDS database should be identifiable.
### Changes to device metadata should be reviewable by a designated authority for that device record.
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
### To the extent possible, the system should take into account the likely addition of other instrument collections in the future.
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">211</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">207</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuration and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
{quote}
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
*Deliverables* The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
{quote}
\\
As currently envisioned based on information learned to date (2006.11.05), the initial effort will not incorporate LOBO, and Paul Coenen's database is considered to be the same as the BOG 'instru' database.
# Functional Requirements
## General
### {requirement:ReflectInstruChangesToSSDS|Reflect Instru Changes To SSDS Database|Changes to the Instru database should be reflected in the SSDS database.}
###{requirement:ReflectSSDSChangesToInstru|(?) Reflect SSDS Changes To Instru Database|Changes to the SSDS database should be reflected in the Instru database, to the extent they are of interest to users of the Instru database.}
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
# Interface Requirements
## The existing MS Access interface to Paul Coenen's Instru database must be supported, or its equivalent functions provided to the satisfaction of OSG.
## The existing SSDS services must remain available.
## (?) Operation of the existing SSDS device search interface should be clarified.
# Performance Requirements
## The changes must support the expected number of devices to be entered over the next 5 years, without significantly impacting usability.
# Design Constraints
## Paul Coenen must maintain authority to control changes to the instruments of interest to him (i.e., those currently in the Instru database).
## Multiple users, from OSG, Development, and Engineering will be responsible for creating and editing device metadata. The system must gracefully minimize data entry errors, and allow review processes (automated and manual) to catch errors when they do occur.
# Other non-functional attributes
## Security
### The author of each change to the SSDS database should be identifiable.
### Changes to device metadata should be reviewable by a designated authority for that device record.
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
### To the extent possible, the system should take into account the likely addition of other instrument collections in the future.
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">209</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">208</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuration and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the [Project Proposal|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/Project.Documents/Project.Proposal].  The tasks as described in that proposal are:
{quote}
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
*Deliverables* The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
{quote}
\\
As currently envisioned based on information learned to date (2006.11.05), the initial effort will not incorporate LOBO, and Paul Coenen's database is considered to be the same as the BOG 'instru' database.
# Functional Requirements
## General
### {requirement:ReflectInstruChangesToSSDS|Reflect Instru Changes To SSDS Database|Changes to the Instru database should be reflected in the SSDS database.}
###{requirement:ReflectSSDSChangesToInstru|(?) Reflect SSDS Changes To Instru Database|Changes to the SSDS database should be reflected in the Instru database, to the extent they are of interest to users of the Instru database.}
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
# Interface Requirements
## The existing MS Access interface to Paul Coenen's Instru database must be supported, or its equivalent functions provided to the satisfaction of OSG.
## The existing SSDS services must remain available.
## (?) Operation of the existing SSDS device search interface should be clarified.
# Performance Requirements
## The changes must support the expected number of devices to be entered over the next 5 years, without significantly impacting usability.
# Design Constraints
## Paul Coenen must maintain authority to control changes to the instruments of interest to him (i.e., those currently in the Instru database).
## Multiple users, from OSG, Development, and Engineering will be responsible for creating and editing device metadata. The system must gracefully minimize data entry errors, and allow review processes (automated and manual) to catch errors when they do occur.
# Other non-functional attributes
## Security
### The author of each change to the SSDS database should be identifiable.
### Changes to device metadata should be reviewable by a designated authority for that device record.
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
### To the extent possible, the system should take into account the likely addition of other instrument collections in the future.
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">210</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">214</id>
<property name="body"><![CDATA[There are three overarching approaches to this task:

1) *Merge*  Make the necessary changes to merge the two databases (probably into SSDS) and make the merged data visible through the same interfaces (MS Access, SSDS) that are available now.

2) *Synchronize*  Synchronize the two databases so that changes in each appear in the other (though not all fields have to appear in both).  Perform synchronizations via triggers or DTS jobs as appropriate.
2a) *Dual create* Support new instrument entry on either database, synchronizing the entries as needed and validating on sync.
2b) *Uni-creaet* Support new instrument entry only on one database.

3)  *Sync-to-SSDS*  Push information from the Instru database on BOG to the SSDS database.  Don't bother to update the BOG database with changes that have been made to the SSDS data.  (This is like Paul "keeping his own copy," which is what we are doing today, but it provides SSDS with the information Paul enters.)


|Option|Name|Pros|Cons|Comments|
|1|Merge|fairly maintainable\\minimizes duplicate info |lots of merging required\\requires significant control security\\causes most change|must track "devices of interest" to OSG |
|2a| Dual create|most like current system for users|lots more checkpointing| |
|2b| Uni-create|simple to implement|reduces functionality to other interface| |
|2|Synchronize|simplifies interface work|lots of model changes\\triggers fear of changes\\most state complexity|checkpoints needed for some synchronized data|
|3|Sync-to-SSDS|simplest number of changes\\least OSG impact|no 2-way interoperability|could report differences|


]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">216</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">213</id>
<property name="body"><![CDATA[There are three overarching approaches to this task:

1) *Merge*  Make the necessary changes to merge the two databases (probably into SSDS) and make the merged data visible through the same interfaces (MS Access, SSDS) that are available now.

2) *Synchronize*  Synchronize the two databases so that changes in each appear in the other (though not all fields have to appear in both).  Perform synchronizations via triggers or DTS jobs as appropriate.
2a) Support new instrument entry on either database, synchronizing the entries as needed and validating on sync.
2b) Support new instrument entry only on one database.

3)  *Sync-to-SSDS*  Push information from the Instru database on BOG to the SSDS database.  Don't bother to update the BOG database with changes that have been made to the SSDS data.  (This is like Paul "keeping his own copy," which is what we are doing today, but it provides SSDS with the information Paul enters.)


|Option|Name|Pros|Cons|Comments|
|1|Merge|fairly maintainable\\minimizes duplicate info |lots of merging required\\requires significant control security\\causes most change|must track "devices of interest" to OSG |
|2|Synchronize|simplifies interface work|lots of model changes\\triggers fear of changes\\most state complexity|checkpoints needed for some synchronized data|
|3|Sync-to-SSDS|simplest number of changes\\least OSG impact|no 2-way interoperability|could report differences|


]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">215</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">212</id>
<property name="body"><![CDATA[There are three overarching approaches to this task:

1) *Merge*  Make the necessary changes to merge the two databases (probably into SSDS) and make the merged data visible through the same interfaces (MS Access, SSDS) that are available now.

2) *Synchronize*  Synchronize the two databases so that changes in each appear in the other (though not all fields have to appear in both).  Perform synchronizations via triggers or DTS jobs as appropriate.
2a) Support new instrument entry on either database, synchronizing the entries as needed and validating on sync.
2b) Support new instrument entry only on one database.

3)  *Sync-to-SSDS*  Push information from the Instru database on BOG to the SSDS database.  Don't bother to update the BOG database with changes that have been made to the SSDS data.  (This is like Paul "keeping his own copy," which is what we are doing today, but it provides SSDS with the information Paul enters.)

|Option|Name|Pros|Cons|Comments|
|1|Merge| | |must track "devices of interest" to OSG |
|2|Synchronize| | |checkpoints needed for some synchronized data|
|3|Sync-to-SSDS| | | |

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">214</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">211</id>
<property name="body"><![CDATA[There are three overarching approaches to this task:

1) *Merge*  Make the necessary changes to merge the two databases (probably into SSDS) and make the merged data visible through the same interfaces (MS Access, SSDS) that are available now.

2) *Synchronize*  Synchronize the two databases so that changes in each appear in the other (though not all fields have to appear in both).  Perform synchronizations via triggers or DTS jobs as appropriate.
2a) Support new instrument entry on either database, synchronizing the entries as needed and validating on sync.
2b) Support new instrument entry only on one database.

3)  *Sync-to-SSDS*  Push information from the Instru database on BOG to the SSDS database.  Don't bother to update the BOG database with changes that have been made to the SSDS data.  (This is like Paul "keeping his own copy," which is what we are doing today, but it provides SSDS with the information Paul enters.)

|Option|Name|Pros|Cons|Comments|
|1|Merge||||
|2|Synchronize||||
|3|Sync-to-SSDS||||

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">213</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">216</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuration and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
{quote}
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
*Deliverables* The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
{quote}
\\
As currently envisioned based on information learned to date (2006.11.05), the initial effort will not incorporate LOBO, and Paul Coenen's database is considered to be the same as the BOG 'instru' database.
# Functional Requirements
## General
### {requirement:ReflectInstruChangesToSSDS|Reflect Instru Changes To SSDS Database|Changes to the Instru database should be reflected in the SSDS database.}
### {requirement:ReflectSSDSChangesToInstru|(?) Reflect SSDS Changes To Instru Database|Changes to the SSDS database should be reflected in the Instru database, to the extent they are of interest to users of the Instru database.}
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
# Interface Requirements
## The existing MS Access interface to Paul Coenen's Instru database must be supported, or its equivalent functions provided to the satisfaction of OSG.
## The existing SSDS services must remain available.
## (?) Operation of the existing SSDS device search interface should be clarified.
# Performance Requirements
## The changes must support the expected number of devices to be entered over the next 5 years, without significantly impacting usability.
# Design Constraints
## Paul Coenen must maintain authority to control changes to the instruments of interest to him (i.e., those currently in the Instru database).
## Multiple users, from OSG, Development, and Engineering will be responsible for creating and editing device metadata. The system must gracefully minimize data entry errors, and allow review processes (automated and manual) to catch errors when they do occur.
# Other non-functional attributes
## Security
### The author of each change to the SSDS database should be identifiable.
### Changes to device metadata should be reviewable by a designated authority for that device record.
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
### To the extent possible, the system should take into account the likely addition of other instrument collections in the future.
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">218</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">215</id>
<property name="body"><![CDATA[{use-case-table:
Create New Device in Instru|
OSG Operator can create a new device in the Instrument database (BOG)|
http://oceana.shore.mbari.org:8081/display/AST/Requirements#OSGCreateDeviceInInstru|
An OSG operator needs to be able to enter a new device in the insrument Microsoft Access application|
Device does not already exist in the data store|
New device entry is inserted and information shows up in both Access app and SSDS|
The device does not show up in either application|
OSG Operator|
|
New Device will be put in use|
|
|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator clicks on button to insert new device</li>
<li>OSG Operator fills out fields to describe new device</li>
<li>OSG Operator clicks button to create new device</li>
<li>A notification is sent to the OSG Operator and SSDS Administrator of device creation</li>
</ol>|
<ol>
<li>After OSG Operator clicks on button to create new device, validation fails and creation is rejected</li>
</ol>|
}
----
{use-case-table:
Edit Device in Instru|
OSG Operator can update device information in Instrument Database (BOG)|
http://oceana.shore.mbari.org:8081/display/AST/Requirements#OSGEditDeviceInInstru|
The OSG Operators need to be able to change the information about a device in the Instrument Database Access application|
Device needs to exist in the data store where the Access application reads from|
Device information is updated in the data store and changes show up in SSDS and Access app|
No device information was updated|
OSG Operator|
|
|
|
OSG Operator finds incorrect or out of date device information|
<ol>
<li>OSG Operator opens Access Application</li>
<li>OSG Operator searches for device</li>
<li>OSG Operator changes form fields</li>
<li>OSG Operator clicks button to udpate device</li>
<li>Device information is updated in the data store</li>
<li>Notification of change is sent to OSG Operator and SSDS Admin describing device information update</li>
</o>|
<ol>
<li>After OSG Operator clicks on update button, information validation fails and no update takes place</li>
</ol>
|}
----
{use-case-table:
Create New Device in SSDS|
SSDS Operator shall be able to create a new device in SSDS.|
http://oceana.shore.mbari.org:8081/display/AST/Requirements#SSDSCreateDeviceInSSDS|
The system needs to have the capability for users (with appropriate permissions) add new devices to the data store.|
<ol><li>Device not already stored in the data store</li>
<li>SSDS Operator has appropriate permissions to create new device</li></ol>|
New device is entered in the data store|
No new device is entered in the data store|
SSDS Operator|
OSG Operator|
A new Device needs to be put into service.|
<ol><li>Authenticate User</li><li>Authorize User</li>|
|
<ol>
<li>SSDS Operator logs into SSDS web application</li>
<li>SSDS Operator selects link to create new device</li>
<li>include::Authenticate User</li>
<li>include::Authorize User</li>
<li>SSDS Operator fills out the appropriate information</li>
<li>SSDS Operator clicks on Submit to attempt to create new device</li>
<li>Fields are validated</li>
<li>Information entered is checked against data store:
<ul>
<li>If no UUID was entered, create one automatically</li>
<li>Make sure serial number is not null</li>
<li>Make sure manufacturer name, model and serial number do not already exist</li>
</ul>
</li>
<li>New device is entered in data store.</li>
<li>SSDS Operator, SSDS Admin and OSG Operator are notified of new device creation.</li>
<li>In notification to OSG Operator, he/she is presentd option of importing to Instrument Database</li>
<li>OSG Operator clicks on link to approve transfer to Access application</li>
<li>Data is transferred to Access data store</li>
</ol>|
<ol>
<li>If field validations fail, user is presented with another try</li>
<li>If information entered violates rule, user is presented with another try</li>
</ol>|
}
----
{use-case-table:
Edit Device in SSDS|
SSDS Operator or Software Agent shall have interface to edit device information in SSDS.|
http://oceana.shore.mbari.org:8081/display/AST/Requirements#SSDSCreateDeviceInSSDS|
Both human and software processes need interfaces to update device information in SSDS.|
Device already exist in data store|
Device information is updated in the data store|
No device information is updated in the data store|
<ol><ul><li>SSDS Operator</li><li>Software Agent</li></ol>|
|
Information about a device has changed or is incorrect|
<ol><li>Authenticate User</li><li>Authorize User</li>|
|
<ol>
  <li>
    <ol>
      <li>SSDS Operator logs into SSDS web application</li>
      <li>SSDS Operator searches for existing device</li>
      <li>SSDS Operator selects link to edit device</li>
      <li>include::Authenticate User</li>
      <li>include::Authorize User</li>
      <li>SSDS Operator changes the appropriate information</li>
      <li>SSDS Operator clicks on Submit to attempt to update device</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>Software Agent sends calls Device update service with device information.</li>
      <li>Fields are validated</li>
      <li>Information entered is checked against data store:
         <ul>
           <li>Make sure UUID is valid if changed.</li>
           <li>If manufacturer information is changed, make sure it does not match up with another device already in the system.</li>
         </ul>
      </li>
      <li>Device information is changed in the data store.</li>
      <li>SSDS Operator and SSDS Admin are notified of change in device information.</li>
      <li>If device present in Instrument Database store, OSG Operator is notified of changes in SSDS and has option of approving or editing SSDS changes, if editing takes place, OSG Operator becomes SSDS Operator and starts Main Flow again.  If changes are approved, edits are propogated to the Instrument Database.</li>
    </ol>
  </li>
</ol>|
<ol>
  <li>
    <ol>
      <li>If field validations fail, user is presented with another try</li>
      <li>If information entered violates rules, user is presented with another try</li>
    </ol>
  </li>
  <li>
    <ol>
      <li>If field validations fail, service throws exception back to Software Agent</li>
      <li>If information entered violates rules, service throws exception back to Software Agent.</li>
    </ol>
  </li>
</ol>|
}
----
{use-case-table:
Authenticate User|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
----
{use-case-table:
Authorize User|
|
|
|
|
|
|
|
|
|
|
|
|
|
}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">217</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">221</id>
<property name="body"><![CDATA[John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----

Current (proposed) mapping table between SSDS and the BOG-intru table.  _I'm starting with text from an email from John. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG: 

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID. 

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.


h3. From BOG to SSDS:  

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.

|| BOG || SSDS || Comment ||
|Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType |(after aligning DB vocabularies)|
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial.  |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator'  | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |

Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">223</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">220</id>
<property name="body"><![CDATA[John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).
----
During our design, questions were raised:

# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">222</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">227</id>
<property name="body"><![CDATA[John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John ([email in Alfresco|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">229</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">229</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Approaches]
# [Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Design]

Tasks and bugs can be found in [JIRA|http://oceana.shore.mbari.org:8082/browse/AST]
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">231</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">230</id>
<property name="body"><![CDATA[Meeting Notes:

# [2006-11-10 Meeting Notes]

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John ([email in Alfresco|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">232</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">232</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:

# [Create New Device in Instru|http://oceana:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for 
# [Edit Device in Instru|http://oceana:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
# [Create New Device in SSDS|http://oceana:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
# [Edit Device in SSDS|http://oceana:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John ([email in Alfresco|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">234</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">233</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:

# [Create New Device in Instru|http://oceana:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG

# [Edit Device in SSDS|http://oceana:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John ([email in Alfresco|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">235</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">234</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:

# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG

# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John ([email in Alfresco|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">236</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">235</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:

# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:

# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID


h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John ([email in Alfresco|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">237</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">236</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:

# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:

# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
# History Trigger on Device Table (KG)
# SQL to perform database normalization between BOG and SSDS (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)


h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John ([email in Alfresco|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">238</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">237</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:

# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:

# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# SQL to perform database normalization between BOG and SSDS (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)


h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John ([email in Alfresco|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">239</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">238</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# SQL to perform database normalization between BOG and SSDS (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John (__[_email in Alfresco_|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]__. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">240</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">239</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<div id="devcreate">{html}Device Creation Page (KG){html}</div>{html}
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# SQL to perform database normalization between BOG and SSDS (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John (__[_email in Alfresco_|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]__. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">241</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">240</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<div id="devcreate">{html}Device Creation Page (KG){html}</div>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<div id="devedit">{html}Device Edit Page (KG){html}</div>{html}
# {html}<div id="triggers">{html}4 Triggers (JG/AM){html}</div>{html}
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# {html}<div id="storedprocs">{html}2 Stored procedures (JG/AM){html}</div>{html}
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# {html}<div id="servlets">{html}2 Servlets (KG){html}</div>{html}
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# {html}<div id="historytrigger">{html}History Trigger on Device Table (KG){html}</div>{html}
# {html}<div id="sqlnormal">{html}SQL to perform database normalization between BOG and SSDS (JG/AM){html}</div>{html}
## All XML in puckxml will have to have matching changes made
# {html}<div id="sqlreport">{html}Create reporting SQL and schedule to send out reports of differences (AM){html}</div>{html}
# {html}<div id="xmllinks">{html}Put links to CVS web xml in Device listing web page (KG){html}</div>{html}

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John (__[_email in Alfresco_|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]__. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">242</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">241</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Approaches]
# [Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Design]

# [BogInstruNormalization]

Tasks and bugs can be found in [JIRA|http://oceana.shore.mbari.org:8082/browse/AST]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">243</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">246</id>
<property name="body"><![CDATA[

||Field||Current Values||Suggested Value||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Manufacturer | Aanderaa, Asimet, Benthos, Biospherical, Garmin, HOBI Labs, MBARI, RD Instruments, Satlantic, Sea-Bird, SeaTech, Simrad, WET Labs, Xantrex | _surprisingly, no change_ |
| Type | ADCP, backscatter, backscatter/fluorometer, battery, \[Cc]ontroller, CTD, e-meter, fluor/turbidity, fluorometer, GPS, ICC, Meteorological, modem, Nitrate, Nitrate analyzer, Oxygen \[Oo]ptode, pCO2, Platform, power source, pump, radiometer, release, shutter, sounder, temperature/humidity, Transducer, transmissometer | |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | |
| Custodian | _some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">248</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">248</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |

h5. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | ASIMET |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | Hobi Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h5. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | |
| backscatter/fluorometer | ? | ? | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | battery | RDI battery packs |
| controller; Controller | ? | ? | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | ? | CTD |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | ICC | Inductive Cable Coupler |
| Meteorological | Metsys | Meteorological | MBARI Metsys |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem ? | |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | ? | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor? | |
| pCO2 | CO2 Monitor | ? | |
| Platform | Mooring | Mooring | |
| power source | ? | | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | | Not called out in SSDS |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | ... | |
| release | n/a | release | Not reg. in SSDS |
| shutter | n/a | shutter | Not reg. in SSDS |
| temperature/humidity | Meteorology Package | ? | Asimet HRH packages |
| Transducer | n/a | | Not reg in SSDS |
| transmissometer | n/a | | Can't find matching instruments in SSDS |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">250</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">247</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Type | ADCP, backscatter, backscatter/fluorometer, battery, \[Cc\]ontroller, CTD, e-meter, fluor/turbidity, fluorometer, GPS, ICC, Meteorological, modem, Nitrate, Nitrate analyzer, Oxygen \[Oo\]ptode, pCO2, Platform, power source, pump, radiometer, release, shutter, sounder, temperature/humidity, Transducer, transmissometer | |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |

h5. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | ASIMET |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | Hobi Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h5. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | |
| backscatter/fluorometer | ? | ? | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | battery | RDI battery packs |
| controller; Controller | ? | ? | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | ? | CTD |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | ICC | Inductive Cable Coupler |
| Meteorological | Metsys | Meteorological | MBARI Metsys |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem ? | |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | ? | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor? | |
| pCO2 | CO2 Monitor | ? | |
| Platform | Mooring | Mooring | |
| power source | ? | | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | | Not called out in SSDS |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave| ... | |
| release | n/a | release | Not reg. in SSDS |
| shutter | n/a | shutter | Not reg. in SSDS |
| temperature/humidity | Meteorology Package | ? | Asimet HRH packages |
| Transducer | n/a | | Not reg in SSDS |
| transmissometer | n/a | | Can't find matching instruments in SSDS |
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">249</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">249</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |

h5. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | ASIMET |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | Hobi Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h5. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | |
| backscatter/fluorometer | ? | ? | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | battery | RDI battery packs |
| controller; Controller | ? | ? | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | ICC | Inductive Cable Coupler |
| Meteorological | Metsys | Meteorological | MBARI Metsys |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem ? | |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | ? | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor? | |
| pCO2 | CO2 Monitor | ? | |
| Platform | Mooring | Mooring | |
| power source | ? | | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | | Not called out in SSDS |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | ... | |
| release | n/a | release | Not reg. in SSDS |
| shutter | n/a | shutter | Not reg. in SSDS |
| temperature/humidity | Meteorology Package | ? | Asimet HRH packages |
| Transducer | n/a | | Not reg in SSDS |
| transmissometer | n/a | | Can't find matching instruments in SSDS |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">251</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">287</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
| Model, Serial, FullSerial | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer.&nbsp; As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc... |

h3. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | ASIMET |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Fluorometer-Backscatter_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | _Controller_ | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS.  Are some ECO-FLNT incorrectly identified at Fluorometers?) |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Cable Coupler_ | Inductive Cable Coupler |
| Meteorological | Metsys | Meteorological | I wonder if "Meteorological" is actually more correct.  How is this different from Meteorological Package, though? |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem ? | |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | ? | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor? | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | _Power Source_ | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | ... | Is the additional detail necessary in BOG?  Or is it simpler to consider them all "radiometers".  It might be that it doesn't matter because noone searches on "Radiometers" |
| release | n/a | _Release_ | |
| shutter | n/a | _Shutter_ | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transducer_ | |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field "Model"]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">289</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">281</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
| Model, Serial, FullSerial | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer.&nbsp; As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc... |

h3. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | ASIMET |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Fluorometer-Backscatter_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | _Controller_ | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS.  Are some ECO-FLNT incorrectly identified at Fluorometers?) |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Cable Coupler_ | Inductive Cable Coupler |
| Meteorological | Metsys | Meteorological | I wonder if "Meteorological" is actually more correct.  How is this different from Meteorological Package, though? |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem ? | |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | ? | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor? | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | _Power Source_ | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | ... | Is the additional detail necessary in BOG?  Or is it simpler to consider them all "radiometers".  It might be that it doesn't matter because noone searches on "Radiometers" |
| release | n/a | _Release_ | |
| shutter | n/a | _Shutter_ | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transducer_ | |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field "Type"]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">283</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">275</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
| Model, Serial, FullSerial | A real mess | May not matter as much.  As long as the two tables agree (initially), it doesn't matter as much if every 37IM is "37IM" not "37 IM" or "37-IM" etc... |

h3. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | ASIMET |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Fluorometer-Backscatter_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | _Controller_ | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS.  Are some ECO-FLNT incorrectly identified at Fluorometers?) |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Cable Coupler_ | Inductive Cable Coupler |
| Meteorological | Metsys | Meteorological | I wonder if "Meteorological" is actually more correct.  How is this different from Meteorological Package, though? |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem ? | |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | ? | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor? | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | _Power Source_ | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | ... | Is the additional detail necessary in BOG?  Or is it simpler to consider them all "radiometers".  It might be that it doesn't matter because noone searches on "Radiometers" |
| release | n/a | _Release_ | |
| shutter | n/a | _Shutter_ | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transducer_ | |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field "Type"]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">277</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">274</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<div id="devcreate">{html}Device Creation Page (KG){html}</div>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<div id="devedit">{html}Device Edit Page (KG){html}</div>{html}
# {html}<div id="triggers">{html}4 Triggers (JG/AM){html}</div>{html}
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# {html}<div id="storedprocs">{html}2 Stored procedures (JG/AM){html}</div>{html}
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# {html}<div id="servlets">{html}2 Servlets (KG){html}</div>{html}
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# {html}<div id="historytrigger">{html}History Trigger on Device Table (KG){html}</div>{html}
# {html}<div id="sqlnormal">{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization] (JG/AM){html}</div>{html}
## All XML in puckxml will have to have matching changes made
# {html}<div id="sqlreport">{html}Create reporting SQL and schedule to send out reports of differences (AM){html}</div>{html}
# {html}<div id="xmllinks">{html}Put links to CVS web xml in Device listing web page (KG){html}</div>{html}

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/webdav/ProjectLibrary/900626%20%20Asset%20Configuration%20and%20Tracking%20Consolidation/Project.Memos.Minutes/Project.Email.Archive/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
.

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John (__[_email in Alfresco_|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]__. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">276</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">273</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<div id="devcreate">{html}Device Creation Page (KG){html}</div>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<div id="devedit">{html}Device Edit Page (KG){html}</div>{html}
# {html}<div id="triggers">{html}4 Triggers (JG/AM){html}</div>{html}
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# {html}<div id="storedprocs">{html}2 Stored procedures (JG/AM){html}</div>{html}
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# {html}<div id="servlets">{html}2 Servlets (KG){html}</div>{html}
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# {html}<div id="historytrigger">{html}History Trigger on Device Table (KG){html}</div>{html}
# {html}<div id="sqlnormal">{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization] (JG/AM){html}</div>{html}
## All XML in puckxml will have to have matching changes made
# {html}<div id="sqlreport">{html}Create reporting SQL and schedule to send out reports of differences (AM){html}</div>{html}
# {html}<div id="xmllinks">{html}Put links to CVS web xml in Device listing web page (KG){html}</div>{html}

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/download/attach/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5/SSDSBOG%20transform%20for%20the%20instrument%20table.msg]
([Email Details|http://oceana:8080/alfresco/navigate/showDocDetails/workspace/SpacesStore/bfc65da9-62c1-11db-b335-d303beca4db5]).

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John (__[_email in Alfresco_|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]__. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">275</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">264</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
| Model, Serial, FullSerial | A real mess | May not matter as much.  As long as the two tables agree (initially), it doesn't matter as much if every 37IM is "37IM" not "37 IM" or "37-IM" etc... |

h3. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | ASIMET |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Fluorometer-Backscatter_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | _Controller_ | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS.  Are some ECO-FLNT incorrectly identified at Fluorometers?) |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Cable Coupler_ | Inductive Cable Coupler |
| Meteorological | Metsys | Meteorological | I wonder if "Meteorological" is actually more correct.  How is this different from Meteorological Package, though? |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem ? | |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | ? | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor? | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | _Power Source_ | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | ... | Is the additional detail necessary in BOG?  Or is it simpler to consider them all "radiometers" |
| release | n/a | _Release_ | |
| shutter | n/a | _Shutter_ | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transducer_ | |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field "Type"

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">266</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">263</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |

h5. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | ASIMET |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | Hobi Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h5. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | |
| backscatter/fluorometer | ? | ? | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | battery | RDI battery packs |
| controller; Controller | ? | ? | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | ICC | Inductive Cable Coupler |
| Meteorological | Metsys | Meteorological | MBARI Metsys |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem ? | |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | ? | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor? | |
| pCO2 | CO2 Monitor | ? | |
| Platform | Mooring | Mooring | |
| power source | ? | | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | | Not in SSDS |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | ... | |
| release | n/a | release | Not in SSDS |
| shutter | n/a | shutter | Not in SSDS |
| temperature/humidity | Meteorology Package | ? | Asimet HRH packages |
| Transducer | n/a | | Not reg. in SSDS |
| transmissometer | n/a | | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">265</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">321</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
| Model, Serial, FullSerial | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer.&nbsp; As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc... |

h3. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |
Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer  | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS.  Are some ECO-FLNT incorrectly identified at Fluorometers?) |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future).  Either delete from BOG or add to SSDS. |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field "Model"]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">323</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">322</id>
<property name="body"><![CDATA[|| BOG Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so.  There's sure to be a lot of hand-alignment. |
| Model | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc.  It's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. |

h3. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |
Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field "Model"]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">324</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">313</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
| Model, Serial, FullSerial | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer.&nbsp; As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc... |

h3. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |
Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS.  Are some ECO-FLNT incorrectly identified at Fluorometers?) |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Cable Coupler_ | Inductive Cable Coupler, need to determine if this is really a distinct piece of equipment from the other inductive modem parts |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | _Power Source_ | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transducer_ | |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field "Model"]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">315</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">314</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
| Model, Serial, FullSerial | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer.&nbsp; As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc... |

h3. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |
Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS.  Are some ECO-FLNT incorrectly identified at Fluorometers?) |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future).  Either delete from BOG or add to SSDS. |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | _Power Source_ | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field "Model"]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">316</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">292</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
| Model, Serial, FullSerial | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer.&nbsp; As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc... |

h3. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |
Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS.  Are some ECO-FLNT incorrectly identified at Fluorometers?) |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Cable Coupler_ | Inductive Cable Coupler, need to determine if this is really a distinct piece of equipment from the other inductive modem parts |
| Meteorological | Metsys | Meteorological | I wonder if "Meteorological" is actually more correct.  How is this different from Meteorological Package, though? |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | _Power Source_ | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transducer_ | |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field "Model"]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">294</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">291</id>
<property name="body"><![CDATA[|| Field || Current Values || Suggested Value ||
| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
| Model, Serial, FullSerial | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer.&nbsp; As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc... |

h3. BOG field "Manufacturer"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa Instruments\\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

Open questions:

* WHOI v Woods Hole Oceanographic Institute
* MBARI v. Monterey Bay Aquarium Research Institute

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Backscatterometer; Scatterometer | ? | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephalometer | WET Labs ECO-FLNTUS.  Are some ECO-FLNT incorrectly identified at Fluorometers?) |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Cable Coupler_ | Inductive Cable Coupler, need to determine if this is really a distinct piece of equipment from the other inductive modem parts |
| Meteorological | Metsys | Meteorological | I wonder if "Meteorological" is actually more correct.  How is this different from Meteorological Package, though? |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | ? | BOG uses "Nitrate analyzer" for the Satlantic models |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor? | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | _Power Source_ | MBARI WH-CPS-I and WH-CPS-E |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | _Shutter_ | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transducer_ | |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field "Model"]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">293</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">348</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Approaches]
# [Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Design]

Tasks and bugs can be found in [JIRA|http://oceana.shore.mbari.org:8082/browse/AST]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">350</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">350</id>
<property name="body"><![CDATA[h1. Design Review Notes

h3. Review Meeting November 21, 2006

h5. Agenda

# Project Background (5 minutes - 2:05)
# 4 Use Case Reviews (5 minutes - 2:10)
# By Use Case Discuss Activity Diagram and Proposed Solution
## Create New Device in Instru (10 minutes - 2:20)
## Edit Device in Instru (10 minutes - 2:30)
## Create New Device in SSDS (15 minutes - 2:45)
## Edit Device in SSDS (15 minutes - 3:00)

----
Attendees:

----
Meeting Notes:

# Project Background
# 4 Use Case Reviews
# By Use Case Discussion
## Create New Device in Instru
## Edit Device in Instru
## Create New Device in SSDS
## Edit Device in SSDS
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">352</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">351</id>
<property name="body"><![CDATA[|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so.  There's sure to be a lot of hand-alignment. |
| Model | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc.  It's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. |

h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded.  I.e. go to website, how does company refer to itself?  Abbreviations should be expanded.

Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Anderaa; Anderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

----

h3. Deferred to phase 2:

| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">353</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">366</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:

{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set flag to show through view to true)
## Job is fired every 5 minutes to crawl DB and look for new devices
## Send email to SSDS Admin notifying of new device(s)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<div id="devcreate">{html}Device Creation Page (KG){html}</div>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<div id="devedit">{html}Device Edit Page (KG){html}</div>{html}
# {html}<div id="triggers">{html}4 Triggers (JG/AM){html}</div>{html}
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# {html}<div id="storedprocs">{html}2 Stored procedures (JG/AM){html}</div>{html}
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# {html}<div id="servlets">{html}2 Servlets (KG){html}</div>{html}
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# {html}<div id="historytrigger">{html}History Trigger on Device Table (KG){html}</div>{html}
# {html}<div id="sqlnormal">{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization] (JG/AM){html}</div>{html}
## All XML in puckxml will have to have matching changes made
# {html}<div id="sqlreport">{html}Create reporting SQL and schedule to send out reports of differences (AM){html}</div>{html}
# {html}<div id="xmllinks">{html}Put links to CVS web xml in Device listing web page (KG){html}</div>{html}
{tip}
----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<div id="devcreate">{html}Device Creation Page (KG){html}</div>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<div id="devedit">{html}Device Edit Page (KG){html}</div>{html}
# {html}<div id="triggers">{html}4 Triggers (JG/AM){html}</div>{html}
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# {html}<div id="storedprocs">{html}2 Stored procedures (JG/AM){html}</div>{html}
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# {html}<div id="servlets">{html}2 Servlets (KG){html}</div>{html}
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# {html}<div id="historytrigger">{html}History Trigger on Device Table (KG){html}</div>{html}
# {html}<div id="sqlnormal">{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization] (JG/AM){html}</div>{html}
## All XML in puckxml will have to have matching changes made
# {html}<div id="sqlreport">{html}Create reporting SQL and schedule to send out reports of differences (AM){html}</div>{html}
# {html}<div id="xmllinks">{html}Put links to CVS web xml in Device listing web page (KG){html}</div>{html}
{info}

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/webdav/ProjectLibrary/900626%20%20Asset%20Configuration%20and%20Tracking%20Consolidation/Project.Memos.Minutes/Project.Email.Archive/SSDSBOG%20transform%20for%20the%20instrument%20table.msg].

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John (__[_email in Alfresco_|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]__. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">368</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">364</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<div id="devcreate">{html}Device Creation Page (KG){html}</div>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<div id="devedit">{html}Device Edit Page (KG){html}</div>{html}
# {html}<div id="triggers">{html}4 Triggers (JG/AM){html}</div>{html}
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# {html}<div id="storedprocs">{html}2 Stored procedures (JG/AM){html}</div>{html}
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# {html}<div id="servlets">{html}2 Servlets (KG){html}</div>{html}
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# {html}<div id="historytrigger">{html}History Trigger on Device Table (KG){html}</div>{html}
# {html}<div id="sqlnormal">{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization] (JG/AM){html}</div>{html}
## All XML in puckxml will have to have matching changes made
# {html}<div id="sqlreport">{html}Create reporting SQL and schedule to send out reports of differences (AM){html}</div>{html}
# {html}<div id="xmllinks">{html}Put links to CVS web xml in Device listing web page (KG){html}</div>{html}

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/webdav/ProjectLibrary/900626%20%20Asset%20Configuration%20and%20Tracking%20Consolidation/Project.Memos.Minutes/Project.Email.Archive/SSDSBOG%20transform%20for%20the%20instrument%20table.msg].

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John (__[_email in Alfresco_|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]__. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">366</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">363</id>
<property name="body"><![CDATA[h2. Review Meeting November 21, 2006

h3. Agenda

# Project Background (5 minutes - 2:05)
# 4 Use Case Reviews (5 minutes - 2:10)
# By Use Case Discuss Activity Diagram and Proposed Solution
## Create New Device in Instru (10 minutes - 2:20)
## Edit Device in Instru (10 minutes - 2:30)
## Create New Device in SSDS (15 minutes - 2:45)
## Edit Device in SSDS (15 minutes - 3:00)

----
h3. Attendees:
* Kevin Gomes
* Reiko Michisaki
* Neil Conner
* Francisco Chavez
* Rich Schramm
* John Graybeal
* Aaron Marburg

----
h3. Meeting Notes:

h4. Project Background

In our initial effort, we will be merging data from SSDS to BOG and back, where both databases have overlapping data.
Eventually we'll try to merge back some of Paul's unique information back into the SSDS database.

Will the information in SSDS be easy to get to?  Yes, we'll have pages.  (Desire expressed to change those.)

Clarification of databases:  "Instru" and "Trans" database in BOG is in fact Paul's database. (The MS Access database no longer exists, it has been moved into BOG although the Access interface is still used.)

This is a two-way system, but with the catch that not all the SSDS instrument entries will go into BOG. Paul will have right of refusal of an instrument into BOG (which is a subset).

Checkpoints will exist so that Paul can approve changes, before they are included.  We were trying to be non-intrusive on Paul's current processes and data store.  Someday it would be nice to have a single table in one database, but for now we aren't going to try to fit all the instruments into the operational (BOG) database.  (SSDS will contain all the devices.)

One could implement a single table with a flag to limit Paul's view?  No, because some of Paul's fields do not map gracefully to SSDS tables, e.g., the people fields.  Could you put everything from SSDS into BOG, but limit what Paul sees?  Yes, but it's a little intrusive, we wanted to have minimal impact on OSG in the first stages.

Have we talked to accounting?  They track all fixed assets, we should consider that at the same time (e.g., add a field to manage data of interest to Jim R).

What's the allowed latency?  Let's look at this in context of a use case.

Does Paul have write permission to BOG?  Just to those two tables.

Where are calibration files tracked?  In BOG Transaction table there are some calibration references.  SSDS has the Resource field, but we are not using it yet.  Keep calibration files in mind as a key capability for the end product.   We would use a URL to point to the calibration file(s) when we do implement it.  

Note it would be nice to have a physical store for all the calibration files, so they are all in a consistent location.

*Put list of variables in each table on the Wiki.*

Noted that table in BOG is not complete, not all items have values entered.

Will we be able to access this device information via an interface in SSDS?  Yes.  Why was it originally in BOG?  Just to be in a SQL database.

Would be nice for anyone to have access to BOG database (not currently the case).  There are individuals who are interested in access.  Probably leave the model with individual authenticated access.  

There is everyone/guest access to the SSDS SQL interface, and the web interface is wide open.

h4. 4 Use Case Reviews
h4. By Use Case Discussion
h5. Create New Device in Instru

This is the shortest latency case, where a new instrument in BOG should immediately check the contents of SSDS for congruent information.

When Paul creates a new device he'll enter a new transaction.  At this time we're not trying to map the transaction data, we'll revisit that later.

Does the BOG application provide all the fields needed to search for a match, so that syntactical differences are normalized?  We'll go through the list as a first step to normalize the current entries, working with Paul to maximize consistency.  In the device creation page for SSDS it will be constrained, unlike the open field currently used.

What about fields in SSDS like instrument type that BOG doesn't care about but needs (to match keys)?  There are only 5 used for search, BOG has them although some normalization between the two is required.  We'll agree on rules with Paul and program the synchronization accordingly.

What is the server in SSDS, a SQL server? Can these talk?  Yes, they're on the same server.

h5. Edit Device in Instru

What is latency?  Probably within an hour is fine.  (We don't know of any 'side-by-side' use cases, where two people might be working simultaneously in the two tables.)

Does SSDS provide a last updated field?  No, it doesn't.  We'll be turning on history tables that would enable access to that functionality.  This is a very common question Paul asks.

h5. Create New Device in SSDS

How quickly does a new device in SSDS have to be accessible in BOG? We think not quickly.
*Confirm this.*  (See also previous section for similar question.)

Once an 'accept with edit' happens, another email will get issued once the edit happens? Yes.

If device is rejected and later edited, it will exist in SSDS but not BOG, so the update action would get confused. 
*Address this.*

Note that the "insert new instrument in instru BOG" step will trigger the other use case, so if we use triggers we'll have to trap that case.
*Address this.*

We will create an access-controlled capability to create devices (not wide open like it is now).

How will trigger accomplish sending mail?  A stored procedure can do it.  We don't implement SQLMail.  Wouldn't be too hard to implement in current version, but will require investigation, and then would change for 2005 implementation (Neil will be trying to implement around January).

h5. Edit Device in SSDS

*"No" Arrow to final box comes from wrong box, should come from diamond.*

*"Is change approved?" should be explicit about who approves change.
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">365</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">362</id>
<property name="body"><![CDATA[h2. Review Meeting November 21, 2006

h3. Agenda

# Project Background (5 minutes - 2:05)
# 4 Use Case Reviews (5 minutes - 2:10)
# By Use Case Discuss Activity Diagram and Proposed Solution
## Create New Device in Instru (10 minutes - 2:20)
## Edit Device in Instru (10 minutes - 2:30)
## Create New Device in SSDS (15 minutes - 2:45)
## Edit Device in SSDS (15 minutes - 3:00)

----
h3. Attendees:
* Kevin Gomes
* Reiko Michisaki
* Neil Conner
* Francisco Chavez
* Rich Schramm
* John Graybeal
* Aaron Marburg

----
h3. Meeting Notes:

h4. Project Background

In our initial effort, we will be merging data from SSDS to BOG and back, where both databases have overlapping data.
Eventually we'll try to merge back some of Paul's unique information back into the SSDS database.

Will the information in SSDS be easy to get to?  Yes, we'll have pages.  (Desire expressed to change those.)

Clarification of databases:  "Instru" and "Trans" database in BOG is in fact Paul's database. (The MS Access database no longer exists, it has been moved into BOG although the Access interface is still used.)

This is a two-way system, but with the catch that not all the SSDS instrument entries will go into BOG. Paul will have right of refusal of an instrument into BOG (which is a subset).

Checkpoints will exist so that Paul can approve changes, before they are included.  We were trying to be non-intrusive on Paul's current processes and data store.  Someday it would be nice to have a single table in one database, but for now we aren't going to try to fit all the instruments into the operational (BOG) database.  (SSDS will contain all the devices.)

One could implement a single table with a flag to limit Paul's view?  No, because some of Paul's fields do not map gracefully to SSDS tables, e.g., the people fields.  Could you put everything from SSDS into BOG, but limit what Paul sees?  Yes, but it's a little intrusive, we wanted to have minimal impact on OSG in the first stages.

Have we talked to accounting?  They track all fixed assets, we should consider that at the same time (e.g., add a field to manage data of interest to Jim R).

What's the allowed latency?  Let's look at this in context of a use case.

Does Paul have write permission to BOG?  Just to those two tables.

Where are calibration files tracked?  In BOG Transaction table there are some calibration references.  SSDS has the Resource field, but we are not using it yet.  Keep calibration files in mind as a key capability for the end product.   We would use a URL to point to the calibration file(s) when we do implement it.  

* Note it would be nice to have a physical store for all the calibration files, so they are all in a consistent location.

* Put list of variables in each table on the Wiki.

Noted that table in BOG is not complete, not all items have values entered.

Will we be able to access this device information via an interface in SSDS?  Yes.  Why was it originally in BOG?  Just to be in a SQL database.

Would be nice for anyone to have access to BOG database (not currently the case).  There are individuals who are interested in access.  Probably leave the model with individual authenticated access.  

There is everyone/guest access to the SSDS SQL interface, and the web interface is wide open.

h4. 4 Use Case Reviews
h4. By Use Case Discussion
h5. Create New Device in Instru

This is the shortest latency case, where a new instrument in BOG should immediately check the contents of SSDS for congruent information.

When Paul creates a new device he'll enter a new transaction.  At this time we're not trying to map the transaction data, we'll revisit that later.

Does the BOG application provide all the fields needed to search for a match, so that syntactical differences are normalized?  We'll go through the list as a first step to normalize the current entries, working with Paul to maximize consistency.  In the device creation page for SSDS it will be constrained, unlike the open field currently used.

What about fields in SSDS like instrument type that BOG doesn't care about but needs (to match keys)?  There are only 5 used for search, BOG has them although some normalization between the two is required.  We'll agree on rules with Paul and program the synchronization accordingly.

What is the server in SSDS, a SQL server? Can these talk?  Yes, they're on the same server.

h5. Edit Device in Instru

What is latency?  Probably within an hour is fine.  (We don't know of any 'side-by-side' use cases, where two people might be working simultaneously in the two tables.)

Does SSDS provide a last updated field?  No, it doesn't.  We'll be turning on history tables that would enable access to that functionality.  This is a very common question Paul asks.

h5. Create New Device in SSDS

How quickly does a new device in SSDS have to be accessible in BOG? We think not quickly.
*Confirm this.*  (See also previous section for similar question.)

Once an 'accept with edit' happens, another email will get issued once the edit happens? Yes.

If device is rejected and later edited, it will exist in SSDS but not BOG, so the update action would get confused.

Note that the "insert new instrument in instru BOG" step will trigger the other use case, so if we use triggers we'll have to trap that case.

We will create an access-controlled capability to create devices (not wide open like it is now).

How will trigger accomplish sending mail?  A stored procedure can do it.  We don't implement SQLMail.

h5. Edit Device in SSDS
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">364</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">361</id>
<property name="body"><![CDATA[h3. Review Meeting November 21, 2006

h5. Agenda

# Project Background (5 minutes - 2:05)
# 4 Use Case Reviews (5 minutes - 2:10)
# By Use Case Discuss Activity Diagram and Proposed Solution
## Create New Device in Instru (10 minutes - 2:20)
## Edit Device in Instru (10 minutes - 2:30)
## Create New Device in SSDS (15 minutes - 2:45)
## Edit Device in SSDS (15 minutes - 3:00)

----
Attendees:

----
Meeting Notes:

# Project Background

In our initial effort, we will be merging data from SSDS to BOG and back, where both databases have overlapping data.
Eventually we'll try to merge back some of Paul's unique information back into the SSDS database.

Will the information in SSDS be easy to get to?  Yes, we'll have pages.  (Desire expressed to change those.)

Clarification of databases:  "Instru" and "Trans" database in BOG is in fact Paul's database. (The MS Access database no longer exists, it has been moved into BOG although the Access interface is still used.)

This is a two-way system, but with the catch that not all the SSDS instrument entries will go into BOG. Paul will have right of refusal of an instrument into BOG (which is a subset).

Checkpoints will exist so that Paul can approve changes, before they are included.  We were trying to be non-intrusive on Paul's current processes and data store.  Someday it would be nice to have a single table in one database, but for now we aren't going to try to fit all the instruments into the operational (BOG) database.  (SSDS will contain all the devices.)

One could implement a single table with a flag to limit Paul's view?  No, because some of Paul's fields do not map gracefully to SSDS tables, e.g., the people fields.  Could you put everything from SSDS into BOG, but limit what Paul sees?  Yes, but it's a little intrusive, we wanted to have minimal impact on OSG in the first stages.

Have we talked to accounting?  They track all fixed assets, we should consider that at the same time (e.g., add a field to manage data of interest to Jim R).

What's the allowed latency?  Let's look at this in context of a use case.

Does Paul have write permission to BOG?  Just to those two tables.

Where are calibration files tracked?  In BOG Transaction table there are some calibration references.  SSDS has the Resource field, but we are not using it yet.  Keep calibration files in mind as a key capability for the end product.   We would use a URL to point to the calibration file(s) when we do implement it.  

* Note it would be nice to have a physical store for all the calibration files, so they are all in a consistent location.

# 4 Use Case Reviews
# By Use Case Discussion
## Create New Device in Instru

This is the shortest latency case, where a new instrument in BOG should immediately check the contents of SSDS for congruent information.

When Paul creates a new device he'll enter a new transaction.  At this time we're not trying to map the transaction data, we'll revisit that later.

Does the BOG application provide all the fields needed to search for a match, so that syntactical differences are normalized?  We'll go through the list as a first step to normalize the current entries, working with Paul to maximize consistency.  In the device creation page for SSDS it will be constrained, unlike the open field currently used.

What about fields in SSDS like instrument type that BOG doesn't care about but needs (to match keys)?  There are only 5 used for search, BOG has them although some normalization between the two is required.  We'll agree on rules with Paul and program the synchronization accordingly.

What is the server in SSDS, a SQL server? Can these talk?  Yes, they're on the same server.

## Edit Device in Instru
## Create New Device in SSDS

How quickly does a new device in SSDS have to be accessible in BOG? We think not quickly.
* Confirm this.

## Edit Device in SSDS
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">363</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">360</id>
<property name="body"><![CDATA[h3. Review Meeting November 21, 2006

h5. Agenda

# Project Background (5 minutes - 2:05)
# 4 Use Case Reviews (5 minutes - 2:10)
# By Use Case Discuss Activity Diagram and Proposed Solution
## Create New Device in Instru (10 minutes - 2:20)
## Edit Device in Instru (10 minutes - 2:30)
## Create New Device in SSDS (15 minutes - 2:45)
## Edit Device in SSDS (15 minutes - 3:00)

----
Attendees:

----
Meeting Notes:

# Project Background

Eventually we'll try to merge back some of Paul's information back into the SSDS database.

Will the information in SSDS be easy to get to?  Yes, we'll have pages.  (Desire expressed to change those.)

Clarification of databases:  "Instru" and "Trans" database in BOG is in fact Paul's database. (The MS Access database no longer exists, it has been moved into BOG although the Access interface is still used.)

This is a two-way system, but with the catch that not all the SSDS instrument entries will go into BOG. Paul will have right of refusal of an instrument into BOG (which is a subset).

Checkpoints will exist so that Paul can approve changes, before they are included.  We were trying to be non-intrusive on Paul's current processes and data store.  Someday it would be nice to have a single table in one database, but for now we aren't going to try to fit all the instruments into the operational (BOG) database.  (SSDS will contain all the devices.)

One could implement a single table with a flag to limit Paul's view?  No, because some of Paul's fields do not map gracefully to SSDS tables, e.g., the people fields.  Could you put everything from SSDS into BOG, but limit what Paul sees?  Yes, but it's a little intrusive, we wanted to have minimal impact on OSG in the first stages.

Have we talked to accounting?  They track all fixed assets, we should consider that at the same time (e.g., add a field to manage data of interest to Jim R).

What's the allowed latency?  Let's look at this in context of a use case.

# 4 Use Case Reviews
# By Use Case Discussion
## Create New Device in Instru
## Edit Device in Instru
## Create New Device in SSDS
## Edit Device in SSDS
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">362</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">359</id>
<property name="body"><![CDATA[h3. Review Meeting November 21, 2006

h5. Agenda

# Project Background (5 minutes - 2:05)
# 4 Use Case Reviews (5 minutes - 2:10)
# By Use Case Discuss Activity Diagram and Proposed Solution
## Create New Device in Instru (10 minutes - 2:20)
## Edit Device in Instru (10 minutes - 2:30)
## Create New Device in SSDS (15 minutes - 2:45)
## Edit Device in SSDS (15 minutes - 3:00)

----
Attendees:

----
Meeting Notes:

# Project Background
# 4 Use Case Reviews
# By Use Case Discussion
## Create New Device in Instru
## Edit Device in Instru
## Create New Device in SSDS
## Edit Device in SSDS
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">361</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">450</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuration and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
{quote}
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
*Deliverables* The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
{quote}
\\
As currently envisioned based on information learned to date (2006.11.05), the initial effort will not incorporate LOBO, and Paul Coenen's database is considered to be the same as the BOG 'instru' database.
# Functional Requirements
## General
### {requirement:ReflectInstruChangesToSSDS|Reflect Instru Changes To SSDS Database|Changes to the Instru database should be reflected in the SSDS database.}
### {requirement:ReflectSSDSChangesToInstru|(?) Reflect SSDS Changes To Instru Database|Changes to the SSDS database should be reflected in the Instru database, to the extent they are of interest to users of the Instru database.}
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
# Interface Requirements
## The existing MS Access interface to Paul Coenen's Instru database must be supported, or its equivalent functions provided to the satisfaction of OSG.
## The existing SSDS services must remain available.
## Planned improvements to the SSDS device entry service will be implemented (e.g., authentication, validation).
## (?) Operation of the existing SSDS device search interface should be clarified.
# Performance Requirements
## The changes must support the expected number of devices to be entered over the next 5 years, without significantly impacting usability.
# Design Constraints
## Paul Coenen must maintain authority to control changes to the instruments of interest to him (i.e., those currently in the Instru database).
## Multiple users, from OSG, Development, and Engineering will be responsible for creating and editing device metadata. The system must gracefully minimize data entry errors, and allow review processes (automated and manual) to catch errors when they do occur.
# Other non-functional attributes
## Security
### The author of each change to the SSDS database should be identifiable.
### Changes to device metadata should be reviewable by a designated authority for that device record.
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
### To the extent possible, the system should take into account the likely addition of other instrument collections in the future.
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">452</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">452</id>
<property name="body"><![CDATA[h3. Requirements

# Introduction
This document outlines the requirements for the Asset Configuration and Tracking Consolidation task, 2006 proposal with charge number 900626.
# General Description
A general description of the task is found in the Project Proposal.  The tasks as described in that proposal are:
{quote}
The first step in solving this issue is to locate and document the different systems that are currently handling asset tracking and information. These systems include: SSDS, Paul Coenen's Database, BOG, and LOBO. After identifying the different systems, the information that is contained in those projects must also be detailed. From these details duplicated information can be identified.
The next step is to then identify the different applications that are utilized to edit and maintain this information. The functionality of these interfaces will be documented to make sure that the coordinated solution meets all the needs of the individual applications and their users. 
With these pieces in hand, a decision can be made on how to best handle the coordinated system and a design will be created for this purpose. The solution will be reviewed and then implemented.
*Deliverables* The final deliverable should be an application (or small set of applications) that can handle the asset tracking and configuration information so all users will go to one location to find out information about various instruments that MBARI maintains.
{quote}
\\
As currently envisioned based on information learned to date (2006.11.05), the initial effort will not incorporate LOBO, and Paul Coenen's database is considered to be the same as the BOG 'instru' database.
# Functional Requirements
## Address Existing Problems
### {requirement:MinimizeSSDSDataErrors|Minimize errors in SSDS database|New and changed instrument data should be verified and accurate.}
### {requirement:AvoidDuplicatedSSDSEntries|Avoid duplicated entries in SSDS database|The same instrument should not appear twice in the SSDS database.}
### {requirement:SimplifyDataEntry|Simplify data entry tasks|Make user data entry operations as simple as possible (minimizes mistakes, makes user happy).}
### {requirement:MinimizeDataEntry|Minimize data entry tasks|Data entered in one interface should populate the other wherever feasible.}
## General Goals
### {requirement:ReflectInstruChangesToSSDS|Reflect Instru Changes To SSDS Database|Changes to the Instru database should be reflected in the SSDS database.}
### {requirement:ReflectSSDSChangesToInstru|(?) Reflect SSDS Changes To Instru Database|Changes to the SSDS database should be reflected in the Instru database, to the extent they are of interest to users of the Instru database.}
## Use Cases
The following requirements can be mapped to corresponding use cases on the [Use Cases] page.
### {requirement:OSGCreateDeviceInInstru|OSG Operator Creates New Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to enter a new device in the Instru data table in BOG database.}
### {requirement:OSGEditDeviceInInstru|OSG Operator Edits A Device in Instru Database|An OSG operator will use the Instru datbase application (MS Access) to edit existing device information in the Instru data table in BOG database.}
### {requirement:SSDSCreateDeviceInSSDS|SSDS Operator Creates New Device in SSDS Database|An SSDS (or other) operator will enter a new device in the SSDS device table in the SSDS database.}
### {requirement:SSDSEditDeviceInSSDS|SSDS Operator Edits A Device in SSDS Database|An SSDS (or other) operator will edit existing device information in the Device data table in the SSDS database.}
# Interface Requirements
## The existing MS Access interface to Paul Coenen's Instru database must be supported, or its equivalent functions provided to the satisfaction of OSG.
## The existing SSDS services must remain available.
## Planned improvements to the SSDS device entry service will be implemented (e.g., authentication, validation).
## (?) Operation of the existing SSDS device search interface should be clarified.
# Performance Requirements
## The changes must support the expected number of devices to be entered over the next 5 years, without significantly impacting usability.
# Design Constraints
## Paul Coenen must maintain authority to control changes to the instruments of interest to him (i.e., those currently in the Instru database).
## Multiple users, from OSG, Development, and Engineering will be responsible for creating and editing device metadata. The system must gracefully minimize data entry errors, and allow review processes (automated and manual) to catch errors when they do occur.
# Other non-functional attributes
## Security
### The author of each change to the SSDS database should be identifiable.
### Changes to device metadata should be reviewable by a designated authority for that device record.
## Binary Compatibility
## Reliability
## Maintainability
## Portability
## Extensibility
### To the extent possible, the system should take into account the likely addition of other instrument collections in the future.
## Reusability
## Application Affinity/Compatibility
## Resource Utilization
## Serviceability]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">454</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">500</id>
<property name="body"><![CDATA[|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | UUID | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization |
| mfgModel | | Model | | mfgModel | Needs some normalization |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter (4-ish digit) representation - often the actual sequence number. | mfgSerialNumber, ShortSerial \\ | Keep _mfgSerialNumber_ as the full-length serial number.&nbsp; Make it a mandatory field.&nbsp; Allow an optional _ShortSerial_ to hold a shortened serial number (how is this used in the Access app?) \\ |
| name | Typically something like manufacturer+model | | | name | \\ |
| deviceType | | Type | | deviceType | Needs some normalization |
| Description | A free text description, may&nbsp; contain some information redundant with _name_ \\ | | | Description | |
| infoUrlList | | manufacture web page | | infoUrlList | neither it particularly well used right now, probably pretty simple to merge |
| person | The contact person | | | | Need to figure out how (if) to map the multiple instru roles into SSDS |
| | | Purchased for | | | |
| | | Owner | | | |
| | | Custodian | | | |
| | | Technician | Currently always 'pc' (Paul Coenen) | | |
| resources | Not used currently (?)\\ | | | | |
| | | document dir | Not used currently \\ | | |
| version | | | | version | |
| | | Features | A free text description of features on the device\\ | Features | Simplest to just leave this in place for now? |
| | | Pressure sensor | | Pressure sensor \\ | " |
| | | Depth Rating | | Depth Rating \\ | " |
| | | Firmware/EPROM | | Firmware/EPROM | " |
| | | Memory | | Memory | " |
| | | Receive Frequency | | Receive Frequency \\ | " |
| | | Transmit Frequency | | Transmit Frequency \\ | " |
| | | Enable Code | | Enable Code \\ | " |
| | | Release Code | | Release Code \\ | " |
| | | Tilt option | | Tilt option \\ | " |
| | | Date new | | Date new \\ | " \\ |
| | | Calibration organization | Typically a company, but sometimes a company and a person\\ | Calibration organization\\ | In the long run we might normalize this against the msgNames \\ |
| | | PO | | PO | " |
| | | Permanent comment | Not entirely sure what this field is used for.  I think it's meant to be some permanent and overarching state of the system, not just the latest "transaction" | ?? | Keep it?  Or discard? |
| | | MBARI_ID | Auto-incrementing key field | _(discard)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Transaction | I believe this field isn't used in instru | _(discard)_ \\ | |
| | | | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">502</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">499</id>
<property name="body"><![CDATA[|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization |
| mfgModel | | Model | | mfgModel | Needs some normalization |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter (4-ish digit) representation - often the actual sequence number. | ... | ... |
| name | Typically something like manufacturer+model | | | name | Keep |
| deviceType | | Type | | | Needs some normalization |
| Description | | | | | |
| infoUrlList | | manufacture web page | | infoUrlList | neither it particularly well used right now, probably pretty simple to merge |
| person | The contact person | | | | Need to figure out how (if) to map the multiple instru roles into SSDS |
| | | Purchased for | | | |
| | | Owner | | | |
| | | Custodian | | | |
| | | Technician | Currently always 'pc' (Paul Coenen) | | |
| resources | | | | | |
| | | document dir | | | |
| version | | | | | |
| | | Features | | | Simplest to just leave this in place for now? |
| | | Pressure sensor | | | " |
| | | Depth Rating | | | " |
| | | Firmware/EPROM | | | " |
| | | Memory | | | " |
| | | Receive Frequency | | | " |
| | | Transmit Frequency | | | " |
| | | Enable Code | | | " |
| | | Release Code | | | " |
| | | Tilt option | | | " |
| | | Date new | | | " |
| | | PO | | | " |
| | | Permanent comment | Not entirely sure what this field is used for.  I think it's meant to be some permanent and overarching state of the system, not just the latest "transaction" | ?? | Keep it?  Or discard? |
| | | MBARI_ID | Auto-incrementing key field | _(not used)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Transaction | I believe this field isn't used in instru | | |
| | | | | | |
| | | Calibration organization | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">501</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">506</id>
<property name="body"><![CDATA[|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | UUID | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization |
| mfgModel | | Model | | mfgModel | Needs some normalization |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter (4-ish digit) representation - often the actual sequence number. | mfgSerialNumber, ShortSerial \\ | Keep _mfgSerialNumber_ as the full-length serial number.&nbsp; Make it a mandatory field.&nbsp; Allow an optional _ShortSerial_ to hold a shortened serial number (how is this used in the Access app?) \\ |
| name | Typically something like manufacturer+model | | | name | \\ |
| deviceType | | Type | | deviceType | Needs some normalization |
| Description | A free text description, may&nbsp; contain some information redundant with _name_ \\ | | | Description | |
| infoUrlList | | manufacture web page | | infoUrlList | neither it particularly well used right now, probably pretty simple to merge |
| person | The contact person (link to the Person table)\\ | | | | Need to figure out how (if) to map the multiple instru roles into SSDS |
| | | Purchased for | Sometimes a person, sometimes a project\\ | | |
| | | Owner | Typically some combination of person, group (OSG, etc) and project.&nbsp; Sometimes all three\\ | | |
| | | Custodian | One or more people\\ | | |
| | | Technician | Currently always 'pc' (Paul Coenen) | | |
| resources | Not used currently (?)\\ | | | | |
| | | document dir | Not used currently \\ | | |
| version | | | | version | |
| | | Features | A free text description of features on the device \\ | Features | Simplest to just leave this in place for now? |
| | | Pressure sensor | Just freetext, left blank if irrelevant\\ | Pressure sensor \\ | " |
| | | Depth Rating | Just freetext, left blank if irrelevant | Depth Rating \\ | " |
| | | Firmware/EPROM | Just freetext, left blank if irrelevant | Firmware/EPROM | " |
| | | Memory | Just freetext, left blank if irrelevant | Memory | " |
| | | Receive Frequency | Just freetext, left blank if irrelevant | Receive Frequency \\ | " |
| | | Transmit Frequency | Just freetext, left blank if irrelevant | Transmit Frequency \\ | " |
| | | Enable Code | Just freetext, left blank if irrelevant | Enable Code \\ | " |
| | | Release Code | Just freetext, left blank if irrelevant | Release Code \\ | " |
| | | Tilt option | Just freetext, left blank if irrelevant, though heavier use of "N/A" than in other fields\\ | Tilt option \\ | " |
| | | Date new | Note used all the time\\ | Date new \\ | " \\ |
| | | Calibration organization | Typically a company, but sometimes a company and a person \\ | Calibration organization \\ | In the long run we might normalize this against the msgNames \\ |
| | | PO | | PO | " |
| | | Permanent comment | Not entirely sure what this field is used for.  I think it's meant to be some permanent and overarching state of the system, not just the latest "transaction" | ?? | Keep it?  Or discard? |
| | | MBARI_ID | Auto-incrementing key field | _(discard)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Transaction | I believe this field isn't used in instru | _(discard)_ \\ | |
| | | | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">508</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">509</id>
<property name="body"><![CDATA[I'd like to see a capability for managing calibartion information that people who process data from instruments currently may keep in properties files.&nbsp; Cases where this is done include data for the radiometers and fluorometers.]]></property>
<property name="content" class="Comment" package="com.atlassian.confluence.pages"><id name="id">511</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">512</id>
<property name="body"><![CDATA[This sounds like a great functionality.&nbsp; Any reason it can't be done within the current SSDS data model using the "Resource" field?]]></property>
<property name="content" class="Comment" package="com.atlassian.confluence.pages"><id name="id">514</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">485</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:

{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set flag to show through view to true)
## Job is fired every 5(?) minutes to crawl DB and look for new devices
## Send email to SSDS Admin notifying of new device(s)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Job is fired every 5(?) minutes to crawl DB and look for edited devices (history tables?)
## If edited device(s) found, send notification to SSDS Administrator.
## If device is exposed through instru view, send notification to SSDS Administrator
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table
## Job is fired every 5(?) minutes to check and see if new devices have been entered.
## If new device found, send SSDS administrator a notification
## If new device found and it was entered by SSDS operator, send notfication to OSG Operator and embed link to expose through instru view
### If OSG operator clicks link, servlet is called that sets instru view flag on that device
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table
## Job is fired every 5(?) minutes to check for edits.
## If edit found, send notification to SSDS admin detailing changes.
## If edit found and device exposed through instru view, send notification to OSG Operator

So based on these steps the following components need to be built:
# {html}<div id="devcreate">{html}Device Creation Page (KG){html}</div>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<div id="devedit">{html}Device Edit Page (KG){html}</div>{html}
# {html}<div id="triggers">{html}External application (JG/AM){html}</div>{html}
## Runs on interval (5 minutes (?))
## Checks for new devices
## Checks for edited devices
## Constructs proper notifications and emails (needs history tables)
# {html}<div id="servlets">{html}1 Servlet (KG){html}</div>{html}
## Change instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the instru view
# {html}<div id="historytrigger">{html}History Trigger on Device Table (KG){html}</div>{html}
# {html}<div id="sqlnormal">{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization] (JG/AM){html}</div>{html}
## All XML in puckxml will have to have matching changes made
# {html}<div id="sqlreport">{html}Create reporting SQL and schedule to send out reports of differences (AM){html}</div>{html}
# {html}<div id="xmllinks">{html}Put links to CVS web xml in Device listing web page (KG){html}</div>{html}
{tip}

----

{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<div id="devcreate">{html}Device Creation Page (KG){html}</div>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<div id="devedit">{html}Device Edit Page (KG){html}</div>{html}
# {html}<div id="triggers">{html}4 Triggers (JG/AM){html}</div>{html}
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# {html}<div id="storedprocs">{html}2 Stored procedures (JG/AM){html}</div>{html}
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# {html}<div id="servlets">{html}2 Servlets (KG){html}</div>{html}
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# {html}<div id="historytrigger">{html}History Trigger on Device Table (KG){html}</div>{html}
# {html}<div id="sqlnormal">{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization] (JG/AM){html}</div>{html}
## All XML in puckxml will have to have matching changes made
# {html}<div id="sqlreport">{html}Create reporting SQL and schedule to send out reports of differences (AM){html}</div>{html}
# {html}<div id="xmllinks">{html}Put links to CVS web xml in Device listing web page (KG){html}</div>{html}
{info}

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/webdav/ProjectLibrary/900626%20%20Asset%20Configuration%20and%20Tracking%20Consolidation/Project.Memos.Minutes/Project.Email.Archive/SSDSBOG%20transform%20for%20the%20instrument%20table.msg].

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John (__[_email in Alfresco_|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]__. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">487</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">489</id>
<property name="body"><![CDATA[|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization in both d/b |
| mfgModel | | Model | | mfgModel | Needs some normalization in both d/b |
| mfgSerialNumber | | | | | |
| name | | | | | |
| deviceType | | | | | |
| Description | | | | | |
| infoUrlList | | | | | |
| person | | | | | |
| resources | | | | | |
| version | | | | | |
| | | MBARI_ID | Auto-incrementing key field | _(not used)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Technician | Currently always 'pc' (Paul Coenen) | | |
| | | Manufacturer | | | |
| | | Type | | | |
| | |  | | | |
| | | Serial | | | |
| | | FullSerial | | | |
| | | Calibration organization | | | |
| | | Features | | | |
| | | Pressure sensor | | | |
| | | Depth Rating | | | |
| | | Firmware/EPROM | | | |
| | | Memory | | | |
| | | Receive Frequency | | | |
| | | Transmit Frequency | | | |
| | | Enable Code | | | |
| | | Release Code | | | |
| | | Tilt option | | | |
| | | Purchased for | | | |
| | | Owner | | | |
| | | Custodian | | | |
| | | Date new | | | |
| | | PO | | | |
| | | Transaction | | | |
| | | Permanent comment | | | |
| | | manufacture web page | | | |
| | | document dir | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">491</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">488</id>
<property name="body"><![CDATA[

|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | | | | | |
| UUID | | | | | |
| mfgName | | | | | |
| mfgModel | | | | | |
| mfgSerialNumber | | | | | |
| name | | | | | |
| deviceType | | | | | |
| Description | | | | | |
| infoUrlList | | | | | |
| person | | | | | |
| resources | | | | | |
| version | | | | | |
| | | MBARI_ID | | | |
| | | SSDS ID | | | |
| | | Technician | | | |
| | | Manufacturer | | | |
| | | Type | | | |
| | | Model | | | |
| | | Serial | | | |
| | | FullSerial | | | |
| | | Calibration organization | | | |
| | | Features | | | |
| | | Pressure sensor | | | |
| | | Depth Rating | | | |
| | | Firmware/EPROM | | | |
| | | Memory | | | |
| | | Receive Frequency | | | |
| | | Transmit Frequency | | | |
| | | Enable Code | | | |
| | | Release Code | | | |
| | | Tilt option | | | |
| | | Purchased for | | | |
| | | Owner | | | |
| | | Custodian | | | |
| | | Date new | | | |
| | | PO | | | |
| | | Transaction | | | |
| | | Permanent comment | | | |
| | | manufacture web page | | | |
| | | document dir | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">490</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">497</id>
<property name="body"><![CDATA[|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization in both d/b |
| mfgModel | | Model | | mfgModel | Needs some normalization in both d/b |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter (4-ish digit) representation -- often the actual sequence number. | ... | ... |
| name | Typically something like manufacturer+model | | | name | Keep |
| deviceType | | | | | |
| Description | | | | | |
| infoUrlList | | | | | |
| person | | | | | |
| resources | | | | | |
| version | | | | | |
| | | MBARI_ID | Auto-incrementing key field | _(not used)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Technician | Currently always 'pc' (Paul Coenen) | | |
| | | Manufacturer | | | |
| | | Type | | | |
| | | | | | |
| | | | | | |
| | |  | | | |
| | | Calibration organization | | | |
| | | Features | | | |
| | | Pressure sensor | | | |
| | | Depth Rating | | | |
| | | Firmware/EPROM | | | |
| | | Memory | | | |
| | | Receive Frequency | | | |
| | | Transmit Frequency | | | |
| | | Enable Code | | | |
| | | Release Code | | | |
| | | Tilt option | | | |
| | | Purchased for | | | |
| | | Owner | | | |
| | | Custodian | | | |
| | | Date new | | | |
| | | PO | | | |
| | | Transaction | | | |
| | | Permanent comment | | | |
| | | manufacture web page | | | |
| | | document dir | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">499</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">498</id>
<property name="body"><![CDATA[|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization |
| mfgModel | | Model | | mfgModel | Needs some normalization |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter (4-ish digit) representation -- often the actual sequence number. | ... | ... |
| name | Typically something like manufacturer+model | | | name | Keep |
| deviceType | | Type | | | Needs some normalization |
| Description | | | | | |
| infoUrlList | | manufacture web page | | infoUrlList | neither it particularly well used right now, probably pretty simple to merge |
| person | The contact person | | | | Need to figure out how (if) to map the multiple instru roles into SSDS |
| | | Purchased for | | | |
| | | Owner | | | |
| | | Custodian | | | |
| | | Technician | Currently always 'pc' (Paul Coenen) | | |
| resources | | | | | |
| | | document dir | | | |
| version | | | | | |
| | | Features | | | Simplest to just leave this in place for now?|
| | | Pressure sensor | | | " |
| | | Depth Rating | | | :" |
| | | Firmware/EPROM | | | " |
| | | Memory | | | " |
| | | Receive Frequency | | | " |
| | | Transmit Frequency | | | " |
| | | Enable Code | | | " |
| | | Release Code | | | " |
| | | Tilt option | | | " |
| | | Date new | | | " |
| | | PO | | |  " |
| | | Permanent comment | Not entirely sure what this field is used for.  I think it's meant to be some permanent and overarching state of the system, not just the latest "transaction"  | ?? | Keep it?  Or discard? |
| | | MBARI_ID | Auto-incrementing key field | _(not used)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Transaction | I believe this field isn't used in instru | | |
| | | | | | |
| | | Calibration organization | | | |
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">500</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">568</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set flag to show through view to true)
## Job is fired every 5(?) minutes to crawl DB and look for new devices
## Send email to SSDS Admin notifying of new device(s)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Job is fired every 5(?) minutes to crawl DB and look for edited devices (history tables?)
## If edited device(s) found, send notification to SSDS Administrator.
## If device is exposed through instru view, send notification to SSDS Administrator
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table
## Job is fired every 5(?) minutes to check and see if new devices have been entered.
## If new device found, send SSDS administrator a notification
## If new device found and it was entered by SSDS operator, send notfication to OSG Operator and embed link to expose through instru view
### If OSG operator clicks link, servlet is called that sets instru view flag on that device
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table
## Job is fired every 5(?) minutes to check for edits.
## If edit found, send notification to SSDS admin detailing changes.
## If edit found and device exposed through instru view, send notification to OSG Operator

So based on these steps the following components need to be built:
# {html}<DIV id="devcreate"></DIV><DIV class="wikisrc">{html}</DIV>Device Creation Page (KG)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<DIV id="devedit"></DIV><DIV class="wikisrc">{html}</DIV>Device Edit Page (KG)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="triggers"></DIV><DIV class="wikisrc">{html}</DIV>External application (JG/AM)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Runs on interval (5 minutes (?))
## Checks for new devices
## Checks for edited devices
## Constructs proper notifications and emails (needs history tables)
# {html}<DIV id="servlets"></DIV><DIV class="wikisrc">{html}</DIV>1 Servlet (KG)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Change instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the instru view
# {html}<DIV id="historytrigger"></DIV><DIV class="wikisrc">{html}</DIV>History Trigger on Device Table (KG)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="sqlnormal"></DIV><DIV class="wikisrc">{html}</DIV><A href="/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">SQL to perform database normalization between BOG and SSDS</A> (JG/AM)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
## All XML in puckxml will have to have matching changes made
# {html}<DIV id="sqlreport"></DIV><DIV class="wikisrc">{html}</DIV>Create reporting SQL and schedule to send out reports of differences (AM)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="xmllinks"></DIV><DIV class="wikisrc">{html}</DIV>Put links to CVS web xml in Device listing web page (KG)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<DIV id="devcreate"></DIV><DIV class="wikisrc">{html}</DIV>Device Creation Page (KG)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<DIV id="devedit"></DIV><DIV class="wikisrc">{html}</DIV>Device Edit Page (KG)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="triggers"></DIV><DIV class="wikisrc">{html}</DIV>4 Triggers (JG/AM)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# {html}<DIV id="storedprocs"></DIV><DIV class="wikisrc">{html}</DIV>2 Stored procedures (JG/AM)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# {html}<DIV id="servlets"></DIV><DIV class="wikisrc">{html}</DIV>2 Servlets (KG)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# {html}<DIV id="historytrigger"></DIV><DIV class="wikisrc">{html}</DIV>History Trigger on Device Table (KG)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="sqlnormal"></DIV><DIV class="wikisrc">{html}</DIV><A href="/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">SQL to perform database normalization between BOG and SSDS</A> (JG/AM)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
## All XML in puckxml will have to have matching changes made
# {html}<DIV id="sqlreport"></DIV><DIV class="wikisrc">{html}</DIV>Create reporting SQL and schedule to send out reports of differences (AM)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="xmllinks"></DIV><DIV class="wikisrc">{html}</DIV>Put links to CVS web xml in Device listing web page (KG)<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV>{html}
{info}

h2. Notes:

John, Aaron and I sat down to talk about the goals for the project and it was decided that small incremental steps would be best especially with the limited time at hand.&nbsp; Aaron sat down and put together a first pass at mapping the fields between Paul Coenen's DB and the SSDS data model.&nbsp; The email Aaron sent out (with the associated attachment) can be found [here|http://oceana:8080/alfresco/webdav/ProjectLibrary/900626%20%20Asset%20Configuration%20and%20Tracking%20Consolidation/Project.Memos.Minutes/Project.Email.Archive/SSDSBOG%20transform%20for%20the%20instrument%20table.msg].

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----
Current (proposed) mapping table between SSDS and the BOG-intru table. _I'm starting with text from an email from John (__[_email in Alfresco_|http://oceana:8080/alfresco/download/direct/workspace/SpacesStore/b2e74e82-70e0-11db-96dd-bbaf04db6a83/Proposed%20%27final%27%20set%20of%20transforms.msg ]__. -- AaronMarburg_

This is the phase 1 list.  If this works then we talk about phase 2, which would bring in the other fields, and consider 2-way synchronization or combining databases into 1.

h3. From SSDS to BOG:

The only field routinely copied from SSDS to BOG-Instru will be SSDS ID.

The mfgName-mfgModel-mfgSerialNumbers will be compared.  If equal, this will be copied only if the BOG-Instru SSDS ID is empty.

h3. From BOG to SSDS:

BOG-Instru date from the following fields will be copied to corresponding SSDS fields.
|| BOG || SSDS || Comment ||
| Technician | Person with Role 'processor' (the ISO term) | I'd like to confirm this with Paul. I suspect there is overlap between Technician and Custodian. |
| Manufacturer | mfgName | (after aligning DB vocabularies) |
| Type | deviceType | (after aligning DB vocabularies) |
| Manufacturer + Type | name | |
| Model | mfgModel | |
| Serial, FullSerial | mfgSerialNumber | Ignore Serial if FullSerial is set, else use in lieu of FullSerial. |
| Owner | Person with Role 'owner' | |
| Custodian | Person with Role 'custodian' | |
| Features | 'features' | (new field) |
| Calibration organization | Organization with role 'calibrator' | Note 'calibrator' is not an ISO term. I use it to distinguish from 'processor', which is used for Technician. |
Using the same model for Organizations as for Persons -- that is, an association using Roles -- makes sense to me.  But that's a question for Kevin, perhaps.

If any of the entries in BOG-Instru under Technician, Owner, or Custodian fields are organizations or projects, either create a new field in BOG-Instru (i.e. "OwningOrg" ?) for them, or if that's not possible, treat them as people (since auto-detecting the difference will be too hard).  If the new field is possible, map the contents to an SSDS Organization with Role processor/owner/custodian.

Similarly for "Calibration organization" (most of these are organizations but some also append a name) -- in BOG-Instru, create a new field for "Calibration person", and map it to Person with Role 'calibrator'.

For reference, the BOG-Instru fields which are not covered above are:  Features, Pressure Sensor,  Depth Rating, Firmware/EPROM, Memory, Receive freq, Transmit freq, Enable code, Release code, tilt option, Purchased for, Date new,Transaction, Permanent comment, manufacturer web page, document dir.

----

[DatabaseFields]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">570</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">569</id>
<property name="body"><![CDATA[|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | UUID | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization |
| mfgModel | | Model | | mfgModel | Needs some normalization |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter (4-ish digit) representation - often the actual sequence number. | mfgSerialNumber, ShortSerial \\ | Keep _mfgSerialNumber_ as the full-length serial number.&nbsp; Make it a mandatory field.&nbsp; Allow an optional _ShortSerial_ to hold a shortened serial number (how is this used in the Access app?) \\ |
| name | Typically something like manufacturer+model | | | name | \\ |
| deviceType | | Type | | deviceType | Needs some normalization |
| Description | A free text description, may&nbsp; contain some information redundant with _name_ \\ | | | Description | |
| infoUrlList | | manufacture web page | | infoUrlList | neither it particularly well used right now, probably pretty simple to merge |
| person | The contact person (link to the Person table) \\ | | | | Need to figure out how (if) to map the multiple instru roles into SSDS |
| | | Purchased for | Sometimes a person, sometimes a project \\ | | |
| | | Owner | Typically some combination of person, group (OSG, etc) and project.&nbsp; Sometimes all three \\ | | |
| | | Custodian | One or more people \\ | | |
| | | Technician | Currently always 'pc' (Paul Coenen) | | |
| resources | Not used currently (?).&nbsp; Could be used for storing calibration files? \\ | | | | |
| | | document dir | Not used currently \\ | | |
| version | | | | version | |
| | | Features | A free text description of features on the device \\ | Features | Simplest to just leave this in place for now? |
| | | Pressure sensor | Just freetext, left blank if irrelevant \\ | Pressure sensor \\ | " |
| | | Depth Rating | Just freetext, left blank if irrelevant | Depth Rating \\ | " |
| | | Firmware/EPROM | Just freetext, left blank if irrelevant | Firmware/EPROM | " |
| | | Memory | Just freetext, left blank if irrelevant | Memory | " |
| | | Receive Frequency | Just freetext, left blank if irrelevant | Receive Frequency \\ | " |
| | | Transmit Frequency | Just freetext, left blank if irrelevant | Transmit Frequency \\ | " |
| | | Enable Code | Just freetext, left blank if irrelevant | Enable Code \\ | " |
| | | Release Code | Just freetext, left blank if irrelevant | Release Code \\ | " |
| | | Tilt option | Just freetext, left blank if irrelevant, though heavier use of "N/A" than in other fields \\ | Tilt option \\ | " |
| | | Date new | Used infrequently \\ | Date new \\ | " \\ |
| | | Calibration organization | Typically a company, but sometimes a company and a person \\ | Calibration organization \\ | In the long run we might normalize this against the msgNames \\ |
| | | PO | | PO | " |
| | | Permanent comment | Not entirely sure what this field is used for.  I think it's meant to be some permanent and overarching state of the system, not just the latest "transaction" | ?? | Keep it?  Or discard? |
| | | MBARI_ID | Auto-incrementing key field | _(discard)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Transaction | I believe this field isn't used in instru | _(discard)_ \\ | |
| | | | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">571</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">570</id>
<property name="body"><![CDATA[Here's a proposal for a single database which is an intelligent union of the existing SSDS and Instru databases.  It should be possible to use a simple d/b view to translate this table to either the existing SSDS or instru formats without too many machinations.  The goal is to minimize/eliminate redundancy by combining overlapping fields without drastically affecting the use of either of the existing apps (SSDS, Access app).

This should be considered a phase one proposal to cover most of the "low hanging fruit" and start the integration process.  Subsequent phases can further integrate the two databases while taking into consideration lessons learned from phase one.  

A good example is the handling of people/roles.  The instru database has a number of separate fields for different rols: owner/purchaser, technician, calibrator, etc.  Each of these fields is just freetext, allowing for inclusion of multiple people for each role, also project names instead of peoples names.  The SSDS database recognizes a single person, which is a record of type Person.  Though it's not clear how this record was intended to be used, it does not map cleanly into the instru model.

Despite this data mismatch, it isn't strictly necessary to solve this conundrum for successful use of the integrated database.  Later phases may include revisions to either or both data models (for example use of an associative array between ISO roles and Person records in SSDS).

|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | UUID | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization |
| mfgModel | | Model | | mfgModel | Needs some normalization |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter (4-ish digit) representation - often the actual sequence number. | mfgSerialNumber, ShortSerial \\ | Keep _mfgSerialNumber_ as the full-length serial number.&nbsp; Make it a mandatory field.&nbsp; Allow an optional _ShortSerial_ to hold a shortened serial number (how is this used in the Access app?) \\ |
| name | Typically something like manufacturer+model | | | name | \\ |
| deviceType | | Type | | deviceType | Needs some normalization |
| Description | A free text description, may&nbsp; contain some information redundant with _name_ \\ | | | Description | |
| infoUrlList | | manufacture web page | | infoUrlList | neither it particularly well used right now, probably pretty simple to merge |
| person | The contact person (link to the Person table) \\ | | | | Need to figure out how (if) to map the multiple instru roles into SSDS |
| | | Purchased for | Sometimes a person, sometimes a project \\ | | |
| | | Owner | Typically some combination of person, group (OSG, etc) and project.&nbsp; Sometimes all three \\ | | |
| | | Custodian | One or more people \\ | | |
| | | Technician | Currently always 'pc' (Paul Coenen) | | |
| resources | Not used currently (?).&nbsp; Could be used for storing calibration files? \\ | | | | |
| | | document dir | Not used currently \\ | | |
| version | | | | version | |
| | | Features | A free text description of features on the device \\ | Features | Simplest to just leave this in place for now? |
| | | Pressure sensor | Just freetext, left blank if irrelevant \\ | Pressure sensor \\ | " |
| | | Depth Rating | Just freetext, left blank if irrelevant | Depth Rating \\ | " |
| | | Firmware/EPROM | Just freetext, left blank if irrelevant | Firmware/EPROM | " |
| | | Memory | Just freetext, left blank if irrelevant | Memory | " |
| | | Receive Frequency | Just freetext, left blank if irrelevant | Receive Frequency \\ | " |
| | | Transmit Frequency | Just freetext, left blank if irrelevant | Transmit Frequency \\ | " |
| | | Enable Code | Just freetext, left blank if irrelevant | Enable Code \\ | " |
| | | Release Code | Just freetext, left blank if irrelevant | Release Code \\ | " |
| | | Tilt option | Just freetext, left blank if irrelevant, though heavier use of "N/A" than in other fields \\ | Tilt option \\ | " |
| | | Date new | Used infrequently \\ | Date new \\ | " \\ |
| | | Calibration organization | Typically a company, but sometimes a company and a person \\ | Calibration organization \\ | In the long run we might normalize this against the msgNames \\ |
| | | PO | | PO | " |
| | | Permanent comment | Not entirely sure what this field is used for.  I think it's meant to be some permanent and overarching state of the system, not just the latest "transaction" | ?? | Keep it?  Or discard? |
| | | MBARI_ID | Auto-incrementing key field | _(discard)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Transaction | I believe this field isn't used in instru | _(discard)_ \\ | |
| | | | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">572</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">521</id>
<property name="body"><![CDATA[|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | UUID | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization |
| mfgModel | | Model | | mfgModel | Needs some normalization |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter (4-ish digit) representation - often the actual sequence number. | mfgSerialNumber, ShortSerial \\ | Keep _mfgSerialNumber_ as the full-length serial number.&nbsp; Make it a mandatory field.&nbsp; Allow an optional _ShortSerial_ to hold a shortened serial number (how is this used in the Access app?) \\ |
| name | Typically something like manufacturer+model | | | name | \\ |
| deviceType | | Type | | deviceType | Needs some normalization |
| Description | A free text description, may&nbsp; contain some information redundant with _name_ \\ | | | Description | |
| infoUrlList | | manufacture web page | | infoUrlList | neither it particularly well used right now, probably pretty simple to merge |
| person | The contact person (link to the Person table) \\ | | | | Need to figure out how (if) to map the multiple instru roles into SSDS |
| | | Purchased for | Sometimes a person, sometimes a project \\ | | |
| | | Owner | Typically some combination of person, group (OSG, etc) and project.&nbsp; Sometimes all three \\ | | |
| | | Custodian | One or more people \\ | | |
| | | Technician | Currently always 'pc' (Paul Coenen) | | |
| resources | Not used currently (?)\\ | | | | |
| | | document dir | Not used currently \\ | | |
| version | | | | version | |
| | | Features | A free text description of features on the device \\ | Features | Simplest to just leave this in place for now? |
| | | Pressure sensor | Just freetext, left blank if irrelevant \\ | Pressure sensor \\ | " |
| | | Depth Rating | Just freetext, left blank if irrelevant | Depth Rating \\ | " |
| | | Firmware/EPROM | Just freetext, left blank if irrelevant | Firmware/EPROM | " |
| | | Memory | Just freetext, left blank if irrelevant | Memory | " |
| | | Receive Frequency | Just freetext, left blank if irrelevant | Receive Frequency \\ | " |
| | | Transmit Frequency | Just freetext, left blank if irrelevant | Transmit Frequency \\ | " |
| | | Enable Code | Just freetext, left blank if irrelevant | Enable Code \\ | " |
| | | Release Code | Just freetext, left blank if irrelevant | Release Code \\ | " |
| | | Tilt option | Just freetext, left blank if irrelevant, though heavier use of "N/A" than in other fields \\ | Tilt option \\ | " |
| | | Date new | Used infrequently \\ | Date new \\ | " \\ |
| | | Calibration organization | Typically a company, but sometimes a company and a person \\ | Calibration organization \\ | In the long run we might normalize this against the msgNames \\ |
| | | PO | | PO | " |
| | | Permanent comment | Not entirely sure what this field is used for.  I think it's meant to be some permanent and overarching state of the system, not just the latest "transaction" | ?? | Keep it?  Or discard? |
| | | MBARI_ID | Auto-incrementing key field | _(discard)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Transaction | I believe this field isn't used in instru | _(discard)_ \\ | |
| | | | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">523</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">743</id>
<property name="body"><![CDATA[I'll use the term "OSG-owned" to indicate the device Paul cares about.  We haven't exactly figured out how this will be delimited in the database, but I assume we'll be able to SELECT those lines as part of the SQL query.

----
h2. Summary

 * Remove all references to MBARI_ID (auto-increment key used in instru table) and replace with SSDS_ID (?) (some sort of key from the merged table).  Note: Access assumes a relatively short MBARI_ID (4 digits), not the full SSDS ID.

 * Several panes in the Access app use a series of drop-downs (Manufacturer, Model, Serial Number, Type, etc) to select one-or-more devices.  Whenever possible, an "OSG-owned" checkbox could be added to restrict/unrestrict the search.

 * There are a few panels which display all of the fields of the instru database, and a few which display all of the panels and allow editing.  These need a clear and concise way of indicating and editing the "OSG-ownership"

----

From the front index page, there are nine sub-pages:

h3. Transactions Data Entry

 * Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
 * I'm a little confused by the usage of this pane -- it's a combination of some instrumentation entries and the transaction entries.

h3. Instruments Data Entry

 * Replace MBARI_ID with SSDS_ID.
 * Add a way to indicate "OSG-owned"  
 * Need to put in an explicit step where the first few key fields are filled out and the database is check for duplicates before filling out the remaining fields.  This function should probably ignore the "OSG-owned" field.   This window may expand to include both the add and edit functions.

h3. Current Info

 * Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
 * Replace MBARI_ID with SSDS_ID 

h3. Transaction History

 * Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
 * Replace MBARI_ID with SSDS_ID 

h3. Find Location of Calibration

 * Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
 * Replace MBARI_ID with SSDS_ID (takes information from trans table?)

h3. Query by Location

 * Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
 * Replace MBARI_ID with SSDS_ID on list.
 * Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"  (may be same detail window used in "Find Model")

h3. Find Model

 * Add checkbox to filter list on "OSG-owned" -- affects drop-down selections.
 * Replace MBARI_ID with SSDS_ID on list
 * Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"

h3. Deployment Update
(this feature may not be functional or as functional as Paul would like.)

 * At checkbox to filter list on "OSG-owned" -- affects list of instruments
 * Change MBARI_ID to SSDS_ID (?)

h3. Edit Instruments and Transactions Table

 * Add checkbox in top pane to filter out OSG-owned devices -- affects drop-down selections.
 * Add entry box in lower pane to toggle "OSG-owned"
 * Remove references to MBARI_ID in text boxes and transaction table.  Replace with SSDS ID.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">746</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">744</id>
<property name="body"><![CDATA[I'll use the term "OSG-owned" to indicate the device Paul cares about.  We haven't exactly figured out how this will be delimited in the database, but I assume we'll be able to SELECT those lines as part of the SQL query.

----
h2. Summary

* Remove all references to MBARI_ID (auto-increment key used in instru table) and replace with SSDS_ID (?) (some sort of key from the merged table).  Note: Access assumes a relatively short MBARI_ID (4 digits), not the full SSDS UUID.

* Several panes in the Access app use a series of drop-downs (Manufacturer, Model, Serial Number, Type, etc) to select one-or-more devices.  Whenever possible, an "OSG-owned" checkbox could be added to restrict/unrestrict the search.

* There are a few panels which display all of the fields of the instru database, and a few which display all of the panels and allow editing.  These need a clear and concise way of indicating and editing the "OSG-ownership"

----
From the front index page, there are nine sub-pages:

h3. Transactions Data Entry

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* I'm a little confused by the usage of this pane -- it's a combination of some instrumentation entries and the transaction entries.

h3. Instruments Data Entry

* Replace MBARI_ID with SSDS_ID.
* Add a way to indicate "OSG-owned"
* Need to put in an explicit step where the first few key fields are filled out and the database is check for duplicates before filling out the remaining fields.  This function should probably ignore the "OSG-owned" field.   This window may expand to include both the add and edit functions.

h3. Current Info

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Transaction History

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Find Location of Calibration

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID (takes information from trans table?)

h3. Query by Location

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID on list.
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"  (may be same detail window used in "Find Model")

h3. Find Model

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections.
* Replace MBARI_ID with SSDS_ID on list
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"

h3. Deployment Update

(this feature may not be functional or as functional as Paul would like.)
* At checkbox to filter list on "OSG-owned" -- affects list of instruments
* Change MBARI_ID to SSDS_ID (?)

h3. Edit Instruments and Transactions Table

* Add checkbox in top pane to filter out OSG-owned devices -- affects drop-down selections.
* Add entry box in lower pane to toggle "OSG-owned"
* Remove references to MBARI_ID in text boxes and transaction table.  Replace with SSDS ID.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">747</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">745</id>
<property name="body"><![CDATA[I'll use the term "OSG-owned" to indicate the device Paul cares about.  We haven't exactly figured out how this will be delimited in the database, but I assume we'll be able to SELECT those lines as part of the SQL query.

----
h2. Summary

* Remove all references to MBARI_ID (auto-increment key used in instru table) and replace with SSDS_ID (?) (some sort of key from the merged table).  Note: Access assumes a relatively short MBARI_ID (4 digits), not the full SSDS UUID.

* Several panes in the Access app use a series of drop-downs (Manufacturer, Model, Serial Number, Type, etc) to select one-or-more devices.  Whenever possible, an "OSG-owned" checkbox could be added to restrict/unrestrict the search.

* There are a few panels which display all of the fields of the instru database, and a few which display all of the panels and allow editing.  These need a clear and concise way of indicating and editing the "OSG-ownership"

Overall impact to the Access app would be surprisingly light. The only truly obstrusive change would be to the "Instrumentation Data Entry" pane which is primarily for new instrument entry.  At present it's a flat card, but we're proposing changing it to a two-step process where some key information is entered, then checked for an existing records, before proceeding.

There will also be the introduction of a number of checkboxes which select if a particular search should be limited OSG-owned devices (the default) or expanded to the full SSDS database.

There's likely to be more impacts in changes to the meaning and function of some of the database fields.

----
h2. More detail
From the front index page, there are nine sub-pages:

h3. Transactions Data Entry

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* I'm a little confused by the usage of this pane -- it's a combination of some instrumentation entries and the transaction entries.

h3. Instruments Data Entry

* Replace MBARI_ID with SSDS_ID.
* Add a way to indicate "OSG-owned"
* Need to put in an explicit step where the first few key fields are filled out and the database is check for duplicates before filling out the remaining fields.  This function should probably ignore the "OSG-owned" field.   This window may expand to include both the add and edit functions.

h3. Current Info

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Transaction History

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Find Location of Calibration

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID (takes information from trans table?)

h3. Query by Location

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID on list.
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"  (may be same detail window used in "Find Model")

h3. Find Model

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections.
* Replace MBARI_ID with SSDS_ID on list
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"

h3. Deployment Update

(this feature may not be functional or as functional as Paul would like.)
* At checkbox to filter list on "OSG-owned" -- affects list of instruments
* Change MBARI_ID to SSDS_ID (?)

h3. Edit Instruments and Transactions Table

* Add checkbox in top pane to filter out OSG-owned devices -- affects drop-down selections.
* Add entry box in lower pane to toggle "OSG-owned"
* Remove references to MBARI_ID in text boxes and transaction table.  Replace with SSDS ID.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">748</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">746</id>
<property name="body"><![CDATA[I'll use the term "OSG-owned" to indicate the device Paul cares about.  We haven't exactly figured out how this will be delimited in the database, but I assume we'll be able to SELECT those lines as part of the SQL query.

----
h2. Summary

* Remove all references to MBARI_ID (auto-increment key used in instru table) and replace with SSDS_ID (?) (some sort of key from the merged table).  Note: Access assumes a relatively short MBARI_ID (4 digits), not the full SSDS UUID.

* Several panes in the Access app use a series of drop-downs (Manufacturer, Model, Serial Number, Type, etc) to select one-or-more devices.  Whenever possible, an "OSG-owned" checkbox could be added to limit/unlimit the search.

* There are a few panels which display all of the fields of the instru database, and a few which also allow editing of those fields.  These need a clear and concise way of indicating and editing the "OSG-ownership"

Overall impact to the Access app would be surprisingly light. The only truly obstrusive change would be to the "Instrumentation Data Entry" pane which is primarily for new instrument entry.  At present it's just a flat pane with fields for data entry (some drop-downs to normalize answers), but we're proposing changing it to a two-step process where some key information is entered, then checked for an existing records, before proceeding.

There will also be the introduction of a number of checkboxes which select if a particular search should be limited OSG-owned devices (the default) or expanded to the full SSDS database.

There's likely to be more impacts in changes to the meaning and function of some of the database fields.

----
h2. More detail

From the front index page, there are nine sub-pages:

h3. Transactions Data Entry

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* I'm a little confused by the usage of this pane -- it's a combination of some instrumentation entries and the transaction entries.

h3. Instruments Data Entry

* Replace MBARI_ID with SSDS_ID.
* Add a way to indicate "OSG-owned"
* Need to put in an explicit step where the first few key fields are filled out and the database is check for duplicates before filling out the remaining fields.  This function should probably ignore the "OSG-owned" field.   This window may expand to include both the add and edit functions.

h3. Current Info

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Transaction History

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Find Location of Calibration

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID (takes information from trans table?)

h3. Query by Location

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID on list.
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"  (may be same detail window used in "Find Model")

h3. Find Model

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections.
* Replace MBARI_ID with SSDS_ID on list
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"

h3. Deployment Update

(this feature may not be functional or as functional as Paul would like.)
* At checkbox to filter list on "OSG-owned" -- affects list of instruments
* Change MBARI_ID to SSDS_ID (?)

h3. Edit Instruments and Transactions Table

* Add checkbox in top pane to filter out OSG-owned devices -- affects drop-down selections.
* Add entry box in lower pane to toggle "OSG-owned"
* Remove references to MBARI_ID in text boxes and transaction table.  Replace with SSDS ID.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">749</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">739</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set flag to show through view to true)
## Job is fired every 5(?) minutes to crawl DB and look for new devices
## Send email to SSDS Admin notifying of new device(s)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Job is fired every 5(?) minutes to crawl DB and look for edited devices (history tables?)
## If edited device(s) found, send notification to SSDS Administrator.
## If device is exposed through instru view, send notification to SSDS Administrator
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table
## Job is fired every 5(?) minutes to check and see if new devices have been entered.
## If new device found, send SSDS administrator a notification
## If new device found and it was entered by SSDS operator, send notfication to OSG Operator and embed link to expose through instru view
### If OSG operator clicks link, servlet is called that sets instru view flag on that device
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table
## Job is fired every 5(?) minutes to check for edits.
## If edit found, send notification to SSDS admin detailing changes.
## If edit found and device exposed through instru view, send notification to OSG Operator

So based on these steps the following components need to be built:
# {html}<DIV id="devcreate"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>Device Creation Page (KG)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<DIV id="devedit"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>Device Edit Page (KG)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="triggers"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>External application (JG/AM)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Runs on interval (5 minutes (?))
## Checks for new devices
## Checks for edited devices
## Constructs proper notifications and emails (needs history tables)
# {html}<DIV id="servlets"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>1 Servlet (KG)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Change instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the instru view
# {html}<DIV id="historytrigger"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>History Trigger on Device Table (KG)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="sqlnormal"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV><A href="/display/AST/BogInstruNormalization"  linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">SQL to perform database normalization between BOG and SSDS</A> (JG/AM)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## All XML in puckxml will have to have matching changes made
# {html}<DIV id="sqlreport"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>Create reporting SQL and schedule to send out reports of differences (AM)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="xmllinks"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>Put links to CVS web xml in Device listing web page (KG)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<DIV id="devcreate"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>Device Creation Page (KG)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<DIV id="devedit"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>Device Edit Page (KG)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="triggers"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>4 Triggers (JG/AM)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# {html}<DIV id="storedprocs"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>2 Stored procedures (JG/AM)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# {html}<DIV id="servlets"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>2 Servlets (KG)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# {html}<DIV id="historytrigger"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>History Trigger on Device Table (KG)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="sqlnormal"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV><A href="/display/AST/BogInstruNormalization"  linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">SQL to perform database normalization between BOG and SSDS</A> (JG/AM)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## All XML in puckxml will have to have matching changes made
# {html}<DIV id="sqlreport"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>Create reporting SQL and schedule to send out reports of differences (AM)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="xmllinks"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV>Put links to CVS web xml in Device listing web page (KG)<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
{info}

h2. Notes:


A proposal for an integrated set of database fields: [DatabaseFields]

----

During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----



]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">742</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">742</id>
<property name="body"><![CDATA[I'll use the term "OSG-owned" to indicate the device Paul cares about.  We haven't exactly figured out how this will be delimited in the database, but I assume we'll be able to SELECT those lines as part of the SQL query.

Off the front page, there are nine sub-pages:

 * Transactions Data Entry

 * Instruments Data Entry 

 * Current Info

 * Transaction History

 * Find Location of Calibration

 * Query by Location

 * Find Model

 * Deployment Update

 * Edit Instruments and Transactions Table

  Add checkbox in top pane to filter out OSG-owned devices. 
  Add entry box in lower pane to toggle "OSG-owned"
  Remove references to MBARI_ID in text boxes and transaction table.  Replace with SSDS ID.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">745</id>
</property>
</object>
<object class="Labelling" package="com.atlassian.confluence.labels">
<id name="id">8290312</id>
<property name="label" class="Label" package="com.atlassian.confluence.labels"><id name="id">2</id>
</property>
<property name="content" class="SpaceDescription" package="com.atlassian.confluence.spaces"><id name="id">23</id>
</property>
<property name="spaceKey"><![CDATA[AST]]></property>
<property name="user"><![CDATA[kgomes]]></property>
<property name="creationDate">2008-12-26 21:19:43.770</property>
<property name="lastModificationDate">2008-12-26 21:19:43.770</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">692</id>
<property name="body"><![CDATA[h2. Review Meeting November 21, 2006

h3. Agenda

# Project Background (5 minutes - 2:05)
# 4 Use Case Reviews (5 minutes - 2:10)
# By Use Case Discuss Activity Diagram and Proposed Solution
## Create New Device in Instru (10 minutes - 2:20)
## Edit Device in Instru (10 minutes - 2:30)
## Create New Device in SSDS (15 minutes - 2:45)
## Edit Device in SSDS (15 minutes - 3:00)

----
h3. Attendees:
* Kevin Gomes
* Reiko Michisaki
* Neil Conner
* Francisco Chavez
* Rich Schramm
* John Graybeal
* Aaron Marburg

----
h3. Meeting Notes:

h4. Project Background

In our initial effort, we will be merging data from SSDS to BOG and back, where both databases have overlapping data.
Eventually we'll try to merge back some of Paul's unique information back into the SSDS database.

Will the information in SSDS be easy to get to?  Yes, we'll have pages.  (Desire expressed to change those.)

Clarification of databases:  "Instru" and "Trans" database in BOG is in fact Paul's database. (The MS Access database no longer exists, it has been moved into BOG although the Access interface is still used.)

This is a two-way system, but with the catch that not all the SSDS instrument entries will go into BOG. Paul will have right of refusal of an instrument into BOG (which is a subset).

Checkpoints will exist so that Paul can approve changes, before they are included.  We were trying to be non-intrusive on Paul's current processes and data store.  Someday it would be nice to have a single table in one database, but for now we aren't going to try to fit all the instruments into the operational (BOG) database.  (SSDS will contain all the devices.)

One could implement a single table with a flag to limit Paul's view?  No, because some of Paul's fields do not map gracefully to SSDS tables, e.g., the people fields.  Could you put everything from SSDS into BOG, but limit what Paul sees?  Yes, but it's a little intrusive, we wanted to have minimal impact on OSG in the first stages.

Have we talked to accounting?  They track all fixed assets, we should consider that at the same time (e.g., add a field to manage data of interest to Jim R).

What's the allowed latency?  Let's look at this in context of a use case.

Does Paul have write permission to BOG?  Just to those two tables.

Where are calibration files tracked?  In BOG Transaction table there are some calibration references.  SSDS has the Resource field, but we are not using it yet.  Keep calibration files in mind as a key capability for the end product.   We would use a URL to point to the calibration file(s) when we do implement it.  

Note it would be nice to have a physical store for all the calibration files, so they are all in a consistent location.

*Put list of variables in each table on the Wiki.*

Noted that table in BOG is not complete, not all items have values entered.

Will we be able to access this device information via an interface in SSDS?  Yes.  Why was it originally in BOG?  Just to be in a SQL database.

Would be nice for anyone to have access to BOG database (not currently the case).  There are individuals who are interested in access.  Probably leave the model with individual authenticated access.  

There is everyone/guest access to the SSDS SQL interface, and the web interface is wide open.


h4. 4 Use Case Reviews: By Use Case Discussion
h5. Create New Device in Instru

This is the shortest latency case, where a new instrument in BOG should immediately check the contents of SSDS for congruent information.

When Paul creates a new device he'll enter a new transaction.  At this time we're not trying to map the transaction data, we'll revisit that later.

Does the BOG application provide all the fields needed to search for a match, so that syntactical differences are normalized?  We'll go through the list as a first step to normalize the current entries, working with Paul to maximize consistency.  In the device creation page for SSDS it will be constrained, unlike the open field currently used.

What about fields in SSDS like instrument type that BOG doesn't care about but needs (to match keys)?  There are only 5 used for search, BOG has them although some normalization between the two is required.  We'll agree on rules with Paul and program the synchronization accordingly.

What is the server in SSDS, a SQL server? Can these talk?  Yes, they're on the same server.

h5. Edit Device in Instru

What is latency?  Probably within an hour is fine.  (We don't know of any 'side-by-side' use cases, where two people might be working simultaneously in the two tables.)

Does SSDS provide a last updated field?  No, it doesn't.  We'll be turning on history tables that would enable access to that functionality.  This is a very common question Paul asks.

h5. Create New Device in SSDS

How quickly does a new device in SSDS have to be accessible in BOG? We think not quickly.
*Confirm this.*  (See also previous section for similar question.)

Once an 'accept with edit' happens, another email will get issued once the edit happens? Yes.

*AI->* If device is rejected and later edited, it will exist in SSDS but not BOG, so the update action would get confused. 

*AI->* Note that the "insert new instrument in instru BOG" step will trigger the other use case, so if we use triggers we'll have to trap that case.


We will create an access-controlled capability to create devices (not wide open like it is now).

How will trigger accomplish sending mail?  A stored procedure can do it.  We don't implement SQLMail.  Wouldn't be too hard to implement in current version, but will require investigation, and then would change for 2005 implementation (Neil will be trying to implement around January).

h5. Edit Device in SSDS

*AI->* "No" Arrow to final box comes from wrong box, should come from diamond.

*AI->* "Is change approved?" should be explicit about who approves change.

What happens if OSG accidentally rejects a change, instead of accepting it?  We can manually fire the stored procedure.

If the SSDSAdmin does not react to the notification of device edit, what happens? This introduces a latency issue, if no action is taken it introduces an unexplained discrepancy.
*AI->* Look at this more closely.

Will a global update cause many triggers?  Umm, yes.

h3. Final Discussion

Francisco wants to answer:
 * Where is everything?
 * What is the complete history of any given thing?

Batch processing would be extremely valuable addition.  (Currently is not working, John says Paul says.)

Each one of these use cases fires companion use case, so mechanism needed to trap those (and the bulk update case).

Do you want this specifically for one SQL server, or do you want it deployable anywhere?  (Raises trigger/procedures architectural question.)

Recommendation: Keep as little work going on as possible inside the trigger.  If one database is down, trigger will fail and this will be reflected in UI.  If you don't need atomic real-time transaction, this will create headaches.  Trigger will wait for reply from stored procedures.  Dirty bit might be a better answer, with a second table to capture the row/timestamp for a later SQL or Perl job.  Making it external this way gives you a lot more control over processing and less likelihood of hosing Paul's user interface.  Stored procedures couples DBs too tightly.

Watch error paths on flow charts -- how will notification occur on failures?  (This is potentialy complex on a multiple-database system.)

If you wanted to go to one table someday, look into creating a view right now that does it. Can you even do an Access-linked table to a view?  We think so.  We think it is tractable to put things together into one table, but it is more invasive to Paul's practices.  Would make the job a lot easier to be working within a single database.  Even if we need to change it out later, it will be easy to copy it over when it is needed.
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">695</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">295000</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries], but realize that those queries are somewhat older, and may work for John G but not others (because the tables were created for John G).{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only) 

This finds full serial matches to Device mfgSerialNumber. (/)


{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices (/)
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}


{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column
Should be done before Instru merge. (/)
{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Test Entry-System', 'entry created for purpose of testing the system')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Unknown', 'an actual device for which the device type is not known (and not knowable)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-TBD', 'entry for which the device type will be provided later')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Undefined', 'used for a device entry which does not yet define a specific device')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

These statements fix the newly added Device Descriptions (for the deprecated device types). (/)

{code:sql}
UPDATE ssdsdba.DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

Fix a spelling mistake. (/)

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
UPDATE ssdsdba.DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where name LIKE '%Fluor%Nep%'
{code}


{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names 

This isn't needed until later, but we're getting it out of the way now. (/)
{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy

This script creates new Device entries for the instru devices not already in SSDS. (/)

{note}
Double-check for Erich R's name in the Technician field before setting everything to 126. 
Kevin: Paul says he sees Erich's name in the Technician field, but I just copied the latest instru from BOG and I don't see it.  Can you resolve this apparent conflict?  -- jbg 3/14 6 PM.
{note}
Note this is updated to set the device type to an actual device. 
This fails if the DeviceType table has not been updated.

{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType as the TBD entry, to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later in scripts
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later can set it to id
  **/
  SELECT 
  0,NEWID(),null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, (select id from ssdsdba.DeviceType where name LIKE '%TBD%'), i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/* Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. */
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND (i.[SSDS ID] is null OR i.[SSDS ID] = 0)

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices

This updates the Device table for the instru entries that we know are SSDS entries. (/)
{code:sql}

/** Update all instruCopy devices that have SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
/* If osg_view = 1 then this device was created in the steps above, no need to recopy. */
WHERE      d.id = i.[SSDS ID] AND d.osg_view = 0
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

The short serial was copied in the merge step above, if it existed. This overwrites with FullSerial from instru, if it exists. (/)
This version corrects a bug from the Northwind version, where it only tested for MBARI_IDs matching.

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.id = i.[SSDS ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')
{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instruCopy i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}


{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'


UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163929</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294999</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries], but realize that those queries are somewhat older, and may work for John G but not others (because the tables were created for John G).{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only) 

This finds full serial matches to Device mfgSerialNumber. (/)


{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices (/)
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}


{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column
Should be done before Instru merge. (/)
{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Test Entry-System', 'entry created for purpose of testing the system')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Unknown', 'an actual device for which the device type is not known (and not knowable)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-TBD', 'entry for which the device type will be provided later')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Undefined', 'used for a device entry which does not yet define a specific device')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

These statements fix the newly added Device Descriptions (for the deprecated device types). (/)

{code:sql}
UPDATE ssdsdba.DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

Fix a spelling mistake. (/)

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
UPDATE ssdsdba.DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where name LIKE '%Fluor%Nep%'
{code}


{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names 

This isn't needed until later, but we're getting it out of the way now. (/)
{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy

This script creates new Device entries for the instru devices not already in SSDS. (/)

{note}
Double-check for Erich R's name in the Technician field before setting everything to 126. Kevin: Paul says he sees Erich's name in the Technician field, but I just copied the latest instru from BOG and I don't see it.  Can you resolve this apparent conflict?  -- jbg 3/14 6 PM.
{note}
Note this is updated to set the device type to an actual device. 
This fails if the DeviceType table has not been updated.

{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType as the TBD entry, to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later in scripts
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later can set it to id
  **/
  SELECT 
  0,NEWID(),null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, (select id from ssdsdba.DeviceType where name LIKE '%TBD%'), i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/* Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. */
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND (i.[SSDS ID] is null OR i.[SSDS ID] = 0)

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices

This updates the Device table for the instru entries that we know are SSDS entries. (/)
{code:sql}

/** Update all instruCopy devices that have SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
/* If osg_view = 1 then this device was created in the steps above, no need to recopy. */
WHERE      d.id = i.[SSDS ID] AND d.osg_view = 0
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instruCopy i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}


{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'


UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163928</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">295002</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries], but realize that those queries are somewhat older, and may work for John G but not others (because the tables were created for John G).{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only) 

This finds full serial matches to Device mfgSerialNumber. (/)


{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices (/)
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}


{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column
Should be done before Instru merge. (/)
{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Test Entry-System', 'entry created for purpose of testing the system')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Unknown', 'an actual device for which the device type is not known (and not knowable)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-TBD', 'entry for which the device type will be provided later')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Undefined', 'used for a device entry which does not yet define a specific device')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

These statements fix the newly added Device Descriptions (for the deprecated device types). (/)

{code:sql}
UPDATE ssdsdba.DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

Fix a spelling mistake. (/)

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
UPDATE ssdsdba.DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where name LIKE '%Fluor%Nep%'
{code}


{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names 

This isn't needed until later, but we're getting it out of the way now. (/)
{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','Axys Environmental Systems','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Nortek AS','Nortek AS','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments | RDI',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy

This script creates new Device entries for the instru devices not already in SSDS. (/)

{note}
Double-check for Erich R's name in the Technician field before setting everything to 126. 
Kevin: Paul says he sees Erich's name in the Technician field, but I just copied the latest instru from BOG and I don't see it.  Can you resolve this apparent conflict?  -- jbg 3/14 6 PM.
{note}
Note this is updated to set the device type to an actual device. 
This fails if the DeviceType table has not been updated.

{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType as the TBD entry, to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later in scripts
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later can set it to id
  **/
  SELECT 
  0,NEWID(),null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, (select id from ssdsdba.DeviceType where name LIKE '%TBD%'), i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/* Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. */
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND (i.[SSDS ID] is null OR i.[SSDS ID] = 0)

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices

This updates the Device table for the instru entries that we know are SSDS entries. (/)
{code:sql}

/** Update all instruCopy devices that have SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
/* If osg_view = 1 then this device was created in the steps above, no need to recopy. */
WHERE      d.id = i.[SSDS ID] AND d.osg_view = 0
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

The short serial was copied in the merge step above, if it existed. This overwrites with FullSerial from instru, if it exists. (/)
This version corrects a bug from the Northwind version, where it only tested for MBARI_IDs matching.

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.id = i.[SSDS ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')
{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

This makes the TempDevFld table, which is used to cache completed mfgName and deviceType data. (/)

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}


{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

Makes the Manufacturer names consistent. (/)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null 
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, ssdsdba.Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null 

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM TempDevFld t JOIN instruCopy i
      ON (t.id = i.[SSDS ID]), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

/* This appears to have no effect, item likely corrected in solstice Device table */
UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}


{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'


UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163931</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">857</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set flag to show through view to true)
## Job is fired every 5(?) minutes to crawl DB and look for new devices
## Send email to SSDS Admin notifying of new device(s)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Job is fired every 5(?) minutes to crawl DB and look for edited devices (history tables?)
## If edited device(s) found, send notification to SSDS Administrator.
## If device is exposed through instru view, send notification to SSDS Administrator
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table
## Job is fired every 5(?) minutes to check and see if new devices have been entered.
## If new device found, send SSDS administrator a notification
## If new device found and it was entered by SSDS operator, send notfication to OSG Operator and embed link to expose through instru view
### If OSG operator clicks link, servlet is called that sets instru view flag on that device
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table
## Job is fired every 5(?) minutes to check for edits.
## If edit found, send notification to SSDS admin detailing changes.
## If edit found and device exposed through instru view, send notification to OSG Operator

So based on these steps the following components need to be built:
# {html}<DIV id="devcreate"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>Device Creation Page (KG)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<DIV id="devedit"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>Device Edit Page (KG)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="triggers"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>External application (JG/AM)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Runs on interval (5 minutes (?))
## Checks for new devices
## Checks for edited devices
## Constructs proper notifications and emails (needs history tables)
# {html}<DIV id="servlets"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>1 Servlet (KG)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Change instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the instru view
# {html}<DIV id="historytrigger"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>History Trigger on Device Table (KG)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="sqlnormal"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV><A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">SQL to perform database normalization between BOG and SSDS</A> (JG/AM)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## All XML in puckxml will have to have matching changes made
# {html}<DIV id="sqlreport"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>Create reporting SQL and schedule to send out reports of differences (AM)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="xmllinks"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>Put links to CVS web xml in Device listing web page (KG)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# {html}<DIV id="devcreate"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>Device Creation Page (KG)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Authenticates against LDAP group
## JSF Validation
# {html}<DIV id="devedit"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>Device Edit Page (KG)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="triggers"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>4 Triggers (JG/AM)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# {html}<DIV id="storedprocs"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>2 Stored procedures (JG/AM)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# {html}<DIV id="servlets"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>2 Servlets (KG)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# {html}<DIV id="historytrigger"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>History Trigger on Device Table (KG)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="sqlnormal"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV><A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">SQL to perform database normalization between BOG and SSDS</A> (JG/AM)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
## All XML in puckxml will have to have matching changes made
# {html}<DIV id="sqlreport"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>Create reporting SQL and schedule to send out reports of differences (AM)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
# {html}<DIV id="xmllinks"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc"></DIV><DIV class="wikisrc">{html}</DIV></DIV></DIV>Put links to CVS web xml in Device listing web page (KG)<DIV class="wikisrc"><BR></BR>
<DIV class="wikisrc">
<DIV class="wikisrc">
{html}</DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV><DIV wysiwyg="macro:html"></DIV>{html}
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">860</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">295001</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries], but realize that those queries are somewhat older, and may work for John G but not others (because the tables were created for John G).{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only) 

This finds full serial matches to Device mfgSerialNumber. (/)


{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices (/)
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}


{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column
Should be done before Instru merge. (/)
{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Test Entry-System', 'entry created for purpose of testing the system')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Unknown', 'an actual device for which the device type is not known (and not knowable)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-TBD', 'entry for which the device type will be provided later')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Undefined', 'used for a device entry which does not yet define a specific device')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

These statements fix the newly added Device Descriptions (for the deprecated device types). (/)

{code:sql}
UPDATE ssdsdba.DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

Fix a spelling mistake. (/)

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
UPDATE ssdsdba.DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where name LIKE '%Fluor%Nep%'
{code}


{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names 

This isn't needed until later, but we're getting it out of the way now. (/)
{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy

This script creates new Device entries for the instru devices not already in SSDS. (/)

{note}
Double-check for Erich R's name in the Technician field before setting everything to 126. 
Kevin: Paul says he sees Erich's name in the Technician field, but I just copied the latest instru from BOG and I don't see it.  Can you resolve this apparent conflict?  -- jbg 3/14 6 PM.
{note}
Note this is updated to set the device type to an actual device. 
This fails if the DeviceType table has not been updated.

{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType as the TBD entry, to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later in scripts
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later can set it to id
  **/
  SELECT 
  0,NEWID(),null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, (select id from ssdsdba.DeviceType where name LIKE '%TBD%'), i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/* Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. */
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND (i.[SSDS ID] is null OR i.[SSDS ID] = 0)

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices

This updates the Device table for the instru entries that we know are SSDS entries. (/)
{code:sql}

/** Update all instruCopy devices that have SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
/* If osg_view = 1 then this device was created in the steps above, no need to recopy. */
WHERE      d.id = i.[SSDS ID] AND d.osg_view = 0
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

The short serial was copied in the merge step above, if it existed. This overwrites with FullSerial from instru, if it exists. (/)
This version corrects a bug from the Northwind version, where it only tested for MBARI_IDs matching.

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.id = i.[SSDS ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')
{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

This makes the TempDevFld table, which is used to cache completed mfgName and deviceType data. (/)

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}


{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

Makes the Manufacturer names consistent. (/)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null 
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, ssdsdba.Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null 

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM TempDevFld t JOIN instruCopy i
      ON (t.id = i.[SSDS ID]), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

/* This appears to have no effect, item likely corrected in solstice Device table */
UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}


{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'


UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163930</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">858</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set flag to show through view to true)
## Job is fired every 5(?) minutes to crawl DB and look for new devices
## Send email to SSDS Admin notifying of new device(s)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Job is fired every 5(?) minutes to crawl DB and look for edited devices (history tables?)
## If edited device(s) found, send notification to SSDS Administrator.
## If device is exposed through instru view, send notification to SSDS Administrator
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table
## Job is fired every 5(?) minutes to check and see if new devices have been entered.
## If new device found, send SSDS administrator a notification
## If new device found and it was entered by SSDS operator, send notfication to OSG Operator and embed link to expose through instru view
### If OSG operator clicks link, servlet is called that sets instru view flag on that device
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table
## Job is fired every 5(?) minutes to check for edits.
## If edit found, send notification to SSDS admin detailing changes.
## If edit found and device exposed through instru view, send notification to OSG Operator

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)<DIV class="wikisrc">
# External application (JG/AM)<DIV class="wikisrc"><BR></BR>
## Runs on interval (5 minutes (?))
## Checks for new devices
## Checks for edited devices
## Constructs proper notifications and emails (needs history tables)
# 1 Servlet (KG)
## Change instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the instru view
# History Trigger on Device Table (KG)<DIV class="wikisrc">
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:

# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)

{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">861</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294996</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries].{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only)

This finds full serial matches to Device mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all instruCopy devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instruCopy i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE ssdsdba.DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
UPDATE ssdsdba.DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'


UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163925</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294995</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries].{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only)

This finds full serial matches to Device mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all instruCopy devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instruCopy i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'


UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}


]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163924</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294998</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries], but realize that those queries are somewhat older, and may work for John G but not others (because the tables were created for John G).{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only)

This finds full serial matches to Device mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all instruCopy devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instruCopy i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE ssdsdba.DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
UPDATE ssdsdba.DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'


UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163927</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294997</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
#* Must make copy of this table as a different name (Instru is name of view)
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerial (mfgSerialNumber)
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS. (This can happen after everything else is done.)
 * _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 * prepare any associated changes to the FK in Trans.
 * Set the MBARI ID in Device to the SSDS ID.  
 * Will also have to set appropriate constraints on MBARI_ID column

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our interim table (TempDevFld) using the mfgName column, from Instru or Device as appropriate, using the rules above. 

At this point, all the mfgName rows should be filled in. 

Manual changes will be done to the interim table.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.

This is shown in [SqlQueries#UpdateMfgName].

[Back to table...|#table]

{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [#DeviceMerge].
# Do manual corrections as listed above (code in [SqlQueries#ManualModel]).


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'
# 'ICC' to 'Inductive Modem Cable Coupler'
# 'pump' to 'Pump'
# 'release' to 'Release'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 
# How to change 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Also, Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.
Code to do all this is in [SqlQueries#DeviceTypeInsert].  

I have also created code to update the descriptions of the erroneously added deprecated terms at [SqlQueries#UpdateDeprecated].


h4. Implementation

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.

These are coded in [SqlQueries#DeviceTypeMerge].

# Perform explicit corrections listed above.


We will copy the appropriate information over to our InterimTable (using the tempType column), from Instru or Device as appropriate, using the rules above. 

Then we will do the entries requiring 'manual' correction (assuming Paul has OK'd the above), code for which is in [SqlQueries#FixDeviceTypes]:

At this point, all the tempType cells should be filled in. 

Finally, the InterimTable will be used to overwrite the Device table.


[Back to table...|#table]

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163926</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">863</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set flag to show through Instru view to true)
## Job is fired every 5(?) minutes to crawl DB and look for new devices
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Job is fired every 5(?) minutes to crawl DB and look for edited devices (history tables?)
## If edited device(s) found, send notification to SSDS Administrator.
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table
## Job is fired every 5(?) minutes to check and see if new devices have been entered.
## If new device found, send SSDS administrator a notification
### Mail contains key fields, who added device.
### Indicate whether device is exposed through Instru view
### If new device is not exposed through Instru, send notification to OSG Operator and embed link to expose through Instru view
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table
## Job is fired every 5(?) minutes to check for edits.
## If edit found, send notification to SSDS admin detailing changes.
### Mail contains key fields, who added device.
### Indicate whether device is exposed through Instru view
### If device exposed through Instru view, send notification to OSG Operator
# Trigger on addition or change
## Every time a device is added, a trigger writes to the history table
### Information includes key, the alternate key fields, who made the change, and when
## Every time a device is edited, a trigger writes to the history table
### Information includes key, old record, new record (or old field, new field if atomic), who, when

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# External application (JG/AM)
## Runs on interval (5 minutes (?)) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### if not exposed through Instru view, send mail to OSG admin (with link to expose it)
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit 
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
# 1 Servlet (KG)
## Change instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the instru view
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:

# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)

{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">866</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">864</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.

{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve unique alternate keys) 
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table
# Trigger on addition or change
## Every time a device is added, a trigger writes to the history table
### Information includes key, the alternate key fields, who made the change, and when
## Every time a device is edited, a trigger writes to the history table
### Information includes key, old record, new record (or old field, new field if atomic), who, when

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# External application (JG/AM)
## Runs on interval (5 minutes (?)) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### if not exposed through Instru view, send mail to OSG admin (with link to expose it)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit 
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
# 1 Servlet (KG)
## Change instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the instru view
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:

# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)

{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">867</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">295004</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries], but realize that those queries are somewhat older, and may work for John G but not others (because the tables were created for John G).{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only) 

This finds full serial matches to Device mfgSerialNumber. (/)


{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices (/)
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}


{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column
Should be done before Instru merge. (/)
{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Test Entry-System', 'entry created for purpose of testing the system')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Unknown', 'an actual device for which the device type is not known (and not knowable)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-TBD', 'entry for which the device type will be provided later')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Undefined', 'used for a device entry which does not yet define a specific device')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Controller-CTD', 'controls CTD data acquisition')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

These statements fix the newly added Device Descriptions (for the deprecated device types). (/)

{code:sql}
UPDATE ssdsdba.DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

Fix a spelling mistake. (/)

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
UPDATE ssdsdba.DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where name LIKE '%Fluor%Nep%'
{code}


{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names 

This isn't needed until later, but we're getting it out of the way now. (/)
{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','Axys Environmental Systems','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Nortek AS','Nortek AS','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments | RDI',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy

This script creates new Device entries for the instru devices not already in SSDS. (/)

{note}
Double-check for Erich R's name in the Technician field before setting everything to 126. 
Kevin: Paul says he sees Erich's name in the Technician field, but I just copied the latest instru from BOG and I don't see it.  Can you resolve this apparent conflict?  -- jbg 3/14 6 PM.
{note}
Note this is updated to set the device type to an actual device. 
This fails if the DeviceType table has not been updated.

{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType as the TBD entry, to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later in scripts
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later can set it to id
  **/
  SELECT 
  0,NEWID(),null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, (select id from ssdsdba.DeviceType where name LIKE '%TBD%'), i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/* Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. */
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND (i.[SSDS ID] is null OR i.[SSDS ID] = 0)

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices

This updates the Device table for the instru entries that we know are SSDS entries. (/)
{code:sql}

/** Update all instruCopy devices that have SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
/* If osg_view = 1 then this device was created in the steps above, no need to recopy. */
WHERE      d.id = i.[SSDS ID] AND d.osg_view = 0
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

The short serial was copied in the merge step above, if it existed. This overwrites with FullSerial from instru, if it exists. (/)
This version corrects a bug from the Northwind version, where it only tested for MBARI_IDs matching.

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.id = i.[SSDS ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')
{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

This makes the TempDevFld table, which is used to cache completed mfgName and deviceType data. (/)

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}


{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

Makes the Manufacturer names consistent. (/)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null 
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, ssdsdba.Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null 

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM TempDevFld t JOIN instruCopy i
      ON (t.id = i.[SSDS ID]), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Copy the results back to Device table */
UPDATE d
SET d.MfgName = t.tempMfg
FROM ssdsdba.Device d, TempDevFld t
WHERE d.id = t.id AND t.tempMfg is not null

/* Do manual corrections */
/** Manual MfgName -- we now update in the Device table directly **/

/* This appears to have no effect, item likely corrected in solstice Device table */
UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Axys Technologies'
WHERE mfgName LIKE
'AXYS Technologies'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

/* Pick up some ASIMETs that are wrong in Device */
UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE id = 1250 OR id = 1251

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'Teledyne RD Instruments'
WHERE mfgName =
'RDI'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.  It would have to be run before copying the data back to the Device table above, and would not include the final adjustments shown below that.  (/)

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables. (/)


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}


{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that already exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

UPDATE i
SET i.Type = 'Inductive Modem-Surface'
FROM instruCopy i
WHERE Type = 'modem' AND Model ='SIM'

UPDATE i
SET i.Type = 'Fluorometer/Nephelometer'
FROM instruCopy i
WHERE Type = 'fluor/turbidity' 

UPDATE i
SET i.Type = 'Backscatterometer/Fluorometer'
FROM instruCopy i
WHERE Type = 'backscatter/fluorometer' 

UPDATE i
SET i.Type = 'Metereology Package'
FROM instruCopy i
WHERE Type = 'temperature/humidity' 

UPDATE i
SET i.Type = 'Nitrogen Sensor/ISUS'
FROM instruCopy i
WHERE Type = 'Nitrate' 

UPDATE i
SET i.Type = 'Nitrogen Sensor (this is Satlantic unit)'
FROM instruCopy i
WHERE Type = 'Nitrate analyzer' 

UPDATE i
SET i.Type = 'Oxygen Sensor'
FROM instruCopy i
WHERE Type = 'Oxygen optode' 

UPDATE i
SET i.Type = 'Toroid'
FROM instruCopy i
WHERE Type = 'Platform' 

UPDATE i
SET i.Type = 'Power Supply-Electric'
FROM instruCopy i
WHERE Type = 'power source' 

UPDATE i
SET i.Type = 'CO2 Monitor'
FROM instruCopy i
WHERE Type = 'pCO2' 

UPDATE i
SET i.Type = 'Transponder'
FROM instruCopy i
WHERE Type = 'transducer' 

UPDATE i
SET i.Type = 'Echo Sounder-Singlebeam'
FROM instruCopy i
WHERE Type = 'sounder' 

UPDATE i
SET i.Type = 'Shutter-Antifouling'
FROM instruCopy i
WHERE Type = 'shutter' 

UPDATE i
SET i.Type = 'Inductive Modem Cable Coupler'
FROM instruCopy i
WHERE Type = 'ICC' 

UPDATE i
SET i.Type = 'Pump'
FROM instruCopy i
WHERE Type = 'pump' 

UPDATE i
SET i.Type = 'Release'
FROM instruCopy i
WHERE Type = 'release' 

UPDATE i
SET i.Type = 'Backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' OR Type = 'backscatterometer'

UPDATE i
SET i.Type = 'Battery'
FROM instruCopy i
WHERE Type = 'battery' 

UPDATE i
SET i.Type = 'Transmissometer'
FROM instruCopy i
WHERE Type = 'transmissometer' 


/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND (t.tempType is null OR t.tempType = 'Not Specified-TBD')
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Modem-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Currents Sensor-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'



{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE d2
SET d2.DeviceTypeID_FK = r1.typeid
FROM ssdsdba.Device d2, 
(
select t.id as id, d.id as typeid 
from TempDevFld t left outer join ssdsdba.DeviceType d 
on t.tempType = d.name 
) r1
WHERE d2.id = r1.id
{code}

For information only, here is code to look at the final device types to see if they are sensible.

{code:sql}
/* Final check to see if it's all working */

select d.id, dtv.id, dtv.devType, d.name, d.mfgName, d.mfgModel, d.description  
from
devTypeView as dtv JOIN ssdsdba.Device as d
on dtv.id = d.id
order by devType, d.id
{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163933</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">859</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set flag to show through view to true)
## Job is fired every 5(?) minutes to crawl DB and look for new devices
## Send email to SSDS Admin notifying of new device(s)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Job is fired every 5(?) minutes to crawl DB and look for edited devices (history tables?)
## If edited device(s) found, send notification to SSDS Administrator.
## If device is exposed through instru view, send notification to SSDS Administrator
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table
## Job is fired every 5(?) minutes to check and see if new devices have been entered.
## If new device found, send SSDS administrator a notification
## If new device found and it was entered by SSDS operator, send notfication to OSG Operator and embed link to expose through instru view
### If OSG operator clicks link, servlet is called that sets instru view flag on that device
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table
## Job is fired every 5(?) minutes to check for edits.
## If edit found, send notification to SSDS admin detailing changes.
## If edit found and device exposed through instru view, send notification to OSG Operator

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# External application (JG/AM)
## Runs on interval (5 minutes (?))
## Checks for new devices
## Checks for edited devices
## Constructs proper notifications and emails (needs history tables)
# 1 Servlet (KG)
## Change instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the instru view
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:

# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)

{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">862</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">295003</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries], but realize that those queries are somewhat older, and may work for John G but not others (because the tables were created for John G).{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only) 

This finds full serial matches to Device mfgSerialNumber. (/)


{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices (/)
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}


{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column
Should be done before Instru merge. (/)
{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Test Entry-System', 'entry created for purpose of testing the system')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Unknown', 'an actual device for which the device type is not known (and not knowable)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-TBD', 'entry for which the device type will be provided later')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Undefined', 'used for a device entry which does not yet define a specific device')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

These statements fix the newly added Device Descriptions (for the deprecated device types). (/)

{code:sql}
UPDATE ssdsdba.DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

Fix a spelling mistake. (/)

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
UPDATE ssdsdba.DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where name LIKE '%Fluor%Nep%'
{code}


{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names 

This isn't needed until later, but we're getting it out of the way now. (/)
{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','Axys Environmental Systems','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Nortek AS','Nortek AS','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments | RDI',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy

This script creates new Device entries for the instru devices not already in SSDS. (/)

{note}
Double-check for Erich R's name in the Technician field before setting everything to 126. 
Kevin: Paul says he sees Erich's name in the Technician field, but I just copied the latest instru from BOG and I don't see it.  Can you resolve this apparent conflict?  -- jbg 3/14 6 PM.
{note}
Note this is updated to set the device type to an actual device. 
This fails if the DeviceType table has not been updated.

{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType as the TBD entry, to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later in scripts
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later can set it to id
  **/
  SELECT 
  0,NEWID(),null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, (select id from ssdsdba.DeviceType where name LIKE '%TBD%'), i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/* Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. */
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND (i.[SSDS ID] is null OR i.[SSDS ID] = 0)

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices

This updates the Device table for the instru entries that we know are SSDS entries. (/)
{code:sql}

/** Update all instruCopy devices that have SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
/* If osg_view = 1 then this device was created in the steps above, no need to recopy. */
WHERE      d.id = i.[SSDS ID] AND d.osg_view = 0
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

The short serial was copied in the merge step above, if it existed. This overwrites with FullSerial from instru, if it exists. (/)
This version corrects a bug from the Northwind version, where it only tested for MBARI_IDs matching.

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.id = i.[SSDS ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')
{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

This makes the TempDevFld table, which is used to cache completed mfgName and deviceType data. (/)

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}


{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

Makes the Manufacturer names consistent. (/)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null 
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, ssdsdba.Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null 

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM TempDevFld t JOIN instruCopy i
      ON (t.id = i.[SSDS ID]), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Copy the results back to Device table */
UPDATE d
SET d.MfgName = t.tempMfg
FROM ssdsdba.Device d, TempDevFld t
WHERE d.id = t.id AND t.tempMfg is not null

/* Do manual corrections */
/** Manual MfgName -- we now update in the Device table directly **/

/* This appears to have no effect, item likely corrected in solstice Device table */
UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Axys Technologies'
WHERE mfgName LIKE
'AXYS Technologies'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

/* Pick up some ASIMETs that are wrong in Device */
UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE id = 1250 OR id = 1251

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'Teledyne RD Instruments'
WHERE mfgName =
'RDI'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.  It would have to be run before copying the data back to the Device table above, and would not include the final adjustments show following that.  (/)

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables. (/)


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}


{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'


UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163932</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">860</id>
<property name="body"><![CDATA[h2. Review Meeting November 21, 2006

h3. Agenda

# Project Background (5 minutes - 2:05)
# 4 Use Case Reviews (5 minutes - 2:10)
# By Use Case Discuss Activity Diagram and Proposed Solution
## Create New Device in Instru (10 minutes - 2:20)
## Edit Device in Instru (10 minutes - 2:30)
## Create New Device in SSDS (15 minutes - 2:45)
## Edit Device in SSDS (15 minutes - 3:00)

----
h3. Attendees:
* Kevin Gomes
* Reiko Michisaki
* Neil Conner
* Francisco Chavez
* Rich Schramm
* John Graybeal
* Aaron Marburg

----
h3. Meeting Notes:

h4. Project Background

In our initial effort, we will be merging data from SSDS to BOG and back, where both databases have overlapping data.
Eventually we'll try to merge back some of Paul's unique information back into the SSDS database.

Will the information in SSDS be easy to get to?  Yes, we'll have pages.  (Desire expressed to change those.)

Clarification of databases:  "Instru" and "Trans" database in BOG is in fact Paul's database. (The MS Access database no longer exists, it has been moved into BOG although the Access interface is still used.)

This is a two-way system, but with the catch that not all the SSDS instrument entries will go into BOG. Paul will have right of refusal of an instrument into BOG (which is a subset).

Checkpoints will exist so that Paul can approve changes, before they are included.  We were trying to be non-intrusive on Paul's current processes and data store.  Someday it would be nice to have a single table in one database, but for now we aren't going to try to fit all the instruments into the operational (BOG) database.  (SSDS will contain all the devices.)

One could implement a single table with a flag to limit Paul's view?  No, because some of Paul's fields do not map gracefully to SSDS tables, e.g., the people fields.  Could you put everything from SSDS into BOG, but limit what Paul sees?  Yes, but it's a little intrusive, we wanted to have minimal impact on OSG in the first stages.

Have we talked to accounting?  They track all fixed assets, we should consider that at the same time (e.g., add a field to manage data of interest to Jim R).

What's the allowed latency?  Let's look at this in context of a use case.

Does Paul have write permission to BOG?  Just to those two tables.

Where are calibration files tracked?  In BOG Transaction table there are some calibration references.  SSDS has the Resource field, but we are not using it yet.  Keep calibration files in mind as a key capability for the end product.   We would use a URL to point to the calibration file(s) when we do implement it.  

Note it would be nice to have a physical store for all the calibration files, so they are all in a consistent location.

*Put list of variables in each table on the Wiki.*

Noted that table in BOG is not complete, not all items have values entered.

Will we be able to access this device information via an interface in SSDS?  Yes.  Why was it originally in BOG?  Just to be in a SQL database.

Would be nice for anyone to have access to BOG database (not currently the case).  There are individuals who are interested in access.  Probably leave the model with individual authenticated access.  

There is everyone/guest access to the SSDS SQL interface, and the web interface is wide open.


h4. 4 Use Case Reviews: By Use Case Discussion
h5. Create New Device in Instru

This is the shortest latency case, where a new instrument in BOG should immediately check the contents of SSDS for congruent information.

When Paul creates a new device he'll enter a new transaction.  At this time we're not trying to map the transaction data, we'll revisit that later.

Does the BOG application provide all the fields needed to search for a match, so that syntactical differences are normalized?  We'll go through the list as a first step to normalize the current entries, working with Paul to maximize consistency.  In the device creation page for SSDS it will be constrained, unlike the open field currently used.

What about fields in SSDS like instrument type that BOG doesn't care about but needs (to match keys)?  There are only 5 used for search, BOG has them although some normalization between the two is required.  We'll agree on rules with Paul and program the synchronization accordingly.

What is the server in SSDS, a SQL server? Can these talk?  Yes, they're on the same server.

h5. Edit Device in Instru

What is latency?  Probably within an hour is fine.  (We don't know of any 'side-by-side' use cases, where two people might be working simultaneously in the two tables.)

Does SSDS provide a last updated field?  No, it doesn't.  We'll be turning on history tables that would enable access to that functionality.  This is a very common question Paul asks.

h5. Create New Device in SSDS

How quickly does a new device in SSDS have to be accessible in BOG? We think not quickly.
*Confirm this.*  (See also previous section for similar question.)

Once an 'accept with edit' happens, another email will get issued once the edit happens? Yes.

*AI->* If device is rejected and later edited, it will exist in SSDS but not BOG, so the update action would get confused.
_Response: Yes, many actions may get confused if editing happens before OSG acts. Comment added (may require redesign so data does not go into table until BOG response received._ 

*AI->* Note that the "insert new instrument in instru BOG" step will trigger the other use case, so if we use triggers we'll have to trap that case.
_Response: "Insert new instrument in Instru BOG" is a trigger of both use cases, so the other use case is not triggered by this action._

We will create an access-controlled capability to create devices (not wide open like it is now).

How will trigger accomplish sending mail?  A stored procedure can do it.  We don't implement SQLMail.  Wouldn't be too hard to implement in current version, but will require investigation, and then would change for 2005 implementation (Neil will be trying to implement around January).

h5. Edit Device in SSDS

*AI->* "No" Arrow to final box comes from wrong box, should come from diamond.
_Response: Could not determine specifically what this refers to, no similar problem was found. Other improvements may have taken care of it._

*AI->* "Is change approved?" should be explicit about who approves change.
_Response: Done._

What happens if OSG accidentally rejects a change, instead of accepting it?  We can manually fire the stored procedure.

If the SSDSAdmin does not react to the notification of device edit, what happens? This introduces a latency issue, if no action is taken it introduces an unexplained discrepancy.
*AI->* Look at this more closely.
_Response: This is correct. It has been noted on the diagram._

Will a global update cause many triggers?  Umm, yes.

h3. Final Discussion

Francisco wants to answer:
 * Where is everything?
 * What is the complete history of any given thing?

Batch processing would be extremely valuable addition.  (Currently is not working, John says Paul says.)

Each one of these use cases fires companion use case, so mechanism needed to trap those (and the bulk update case).

Do you want this specifically for one SQL server, or do you want it deployable anywhere?  (Raises trigger/procedures architectural question.)

Recommendation: Keep as little work going on as possible inside the trigger.  If one database is down, trigger will fail and this will be reflected in UI.  If you don't need atomic real-time transaction, this will create headaches.  Trigger will wait for reply from stored procedures.  Dirty bit might be a better answer, with a second table to capture the row/timestamp for a later SQL or Perl job.  Making it external this way gives you a lot more control over processing and less likelihood of hosing Paul's user interface.  Stored procedures couples DBs too tightly.

Watch error paths on flow charts -- how will notification occur on failures?  (This is potentialy complex on a multiple-database system.)

If you wanted to go to one table someday, look into creating a view right now that does it. Can you even do an Access-linked table to a view?  We think so.  We think it is tractable to put things together into one table, but it is more invasive to Paul's practices.  Would make the job a lot easier to be working within a single database.  Even if we need to change it out later, it will be easy to copy it over when it is needed.

_Response: Based on the discussion, we have investigated and are currently pursuing a single-database solution. (We have successfully tested the use of Access through views.)
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">863</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">295006</id>
<property name="body"><![CDATA[{note}These queries have been tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries], but realize that those queries are somewhat older, and may work for John G but not others (because the tables were created for John G).{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only) 

This finds full serial matches to Device mfgSerialNumber. (/)


{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices (/)
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}


{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column
Should be done before Instru merge. (/)
{code:sql}

/* Insert new devices */
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Test Entry-System', 'entry created for purpose of testing the system')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Unknown', 'an actual device for which the device type is not known (and not knowable)')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-TBD', 'entry for which the device type will be provided later')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Not Specified-Undefined', 'used for a device entry which does not yet define a specific device')
INSERT INTO ssdsdba.DeviceType(version ,Name, Description)
VALUES(0, 'Controller-CTD', 'controls CTD data acquisition')
{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

These statements fix the newly added Device Descriptions (for the deprecated device types). (/)

{code:sql}
UPDATE ssdsdba.DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

Fix a spelling mistake. (/)

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
UPDATE ssdsdba.DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where name LIKE '%Fluor%Nep%'
{code}


{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names 

This isn't needed until later, but we're getting it out of the way now. (/)
{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','Axys Environmental Systems','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Nortek AS','Nortek AS','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments | RDI',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy

This script creates new Device entries for the instru devices not already in SSDS. (/)

{note}
Double-check for Erich R's name in the Technician field before setting everything to 126. 
Kevin: Paul says he sees Erich's name in the Technician field, but I just copied the latest instru from BOG and I don't see it.  Can you resolve this apparent conflict?  -- jbg 3/14 6 PM.
{note}
Note this is updated to set the device type to an actual device. 
This fails if the DeviceType table has not been updated.

{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType as the TBD entry, to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later in scripts
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later can set it to id
  **/
  SELECT 
  0,NEWID(),null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, (select id from ssdsdba.DeviceType where name LIKE '%TBD%'), i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/* Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. */
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND (i.[SSDS ID] is null OR i.[SSDS ID] = 0)

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices

This updates the Device table for the instru entries that we know are SSDS entries. (/)
{code:sql}

/** Update all instruCopy devices that have SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
/* If osg_view = 1 then this device was created in the steps above, no need to recopy. */
WHERE      d.id = i.[SSDS ID] AND d.osg_view = 0
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

The short serial was copied in the merge step above, if it existed. This overwrites with FullSerial from instru, if it exists. (/)
This version corrects a bug from the Northwind version, where it only tested for MBARI_IDs matching.

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.id = i.[SSDS ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')
{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

This makes the TempDevFld table, which is used to cache completed mfgName and deviceType data. (/)

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}


{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

Makes the Manufacturer names consistent. (/)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null 
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, ssdsdba.Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null 

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM TempDevFld t JOIN instruCopy i
      ON (t.id = i.[SSDS ID]), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Copy the results back to Device table */
UPDATE d
SET d.MfgName = t.tempMfg
FROM ssdsdba.Device d, TempDevFld t
WHERE d.id = t.id AND t.tempMfg is not null

/* Do manual corrections */
/** Manual MfgName -- we now update in the Device table directly **/

/* This appears to have no effect, item likely corrected in solstice Device table */
UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Axys Technologies'
WHERE mfgName LIKE
'AXYS Technologies'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

/* Pick up some ASIMETs that are wrong in Device */
UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE id = 1250 OR id = 1251

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'Teledyne RD Instruments'
WHERE mfgName =
'RDI'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.  It would have to be run before copying the data back to the Device table above, and would not include the final adjustments shown below that.  (/)

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables. (/)


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}


{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that already exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

UPDATE i
SET i.Type = 'Inductive Modem-Surface'
FROM instruCopy i
WHERE Type = 'modem' AND Model ='SIM'

UPDATE i
SET i.Type = 'Fluorometer/Nephelometer'
FROM instruCopy i
WHERE Type = 'fluor/turbidity' 

UPDATE i
SET i.Type = 'Backscatterometer/Fluorometer'
FROM instruCopy i
WHERE Type = 'backscatter/fluorometer' 

UPDATE i
SET i.Type = 'Metereology Package'
FROM instruCopy i
WHERE Type = 'temperature/humidity' 

UPDATE i
SET i.Type = 'Nitrogen Sensor/ISUS'
FROM instruCopy i
WHERE Type = 'Nitrate' 

UPDATE i
SET i.Type = 'Nitrogen Sensor (this is Satlantic unit)'
FROM instruCopy i
WHERE Type = 'Nitrate analyzer' 

UPDATE i
SET i.Type = 'Oxygen Sensor'
FROM instruCopy i
WHERE Type = 'Oxygen optode' 

UPDATE i
SET i.Type = 'Toroid'
FROM instruCopy i
WHERE Type = 'Platform' 

UPDATE i
SET i.Type = 'Power Supply-Electric'
FROM instruCopy i
WHERE Type = 'power source' 

UPDATE i
SET i.Type = 'CO2 Monitor'
FROM instruCopy i
WHERE Type = 'pCO2' 

UPDATE i
SET i.Type = 'Transponder'
FROM instruCopy i
WHERE Type = 'transducer' 

UPDATE i
SET i.Type = 'Echo Sounder-Singlebeam'
FROM instruCopy i
WHERE Type = 'sounder' 

UPDATE i
SET i.Type = 'Shutter-Antifouling'
FROM instruCopy i
WHERE Type = 'shutter' 

UPDATE i
SET i.Type = 'Inductive Modem Cable Coupler'
FROM instruCopy i
WHERE Type = 'ICC' 

UPDATE i
SET i.Type = 'Pump'
FROM instruCopy i
WHERE Type = 'pump' 

UPDATE i
SET i.Type = 'Release'
FROM instruCopy i
WHERE Type = 'release' 

UPDATE i
SET i.Type = 'Backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' OR Type = 'backscatterometer'

UPDATE i
SET i.Type = 'Battery'
FROM instruCopy i
WHERE Type = 'battery' 

UPDATE i
SET i.Type = 'Transmissometer'
FROM instruCopy i
WHERE Type = 'transmissometer' 


/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND (t.tempType is null OR t.tempType = 'Not Specified-TBD')
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Modem-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Currents Sensor-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'



{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE d2
SET d2.DeviceTypeID_FK = r1.typeid
FROM ssdsdba.Device d2, 
(
select t.id as id, d.id as typeid 
from TempDevFld t left outer join ssdsdba.DeviceType d 
on t.tempType = d.name 
) r1
WHERE d2.id = r1.id
{code}

For information only, here is code to look at the final device types to see if they are sensible.

{code:sql}
/* Final check to see if it's all working */

select d.id, dtv.id, dtv.devType, d.name, d.mfgName, d.mfgModel, d.description  
from
devTypeView as dtv JOIN ssdsdba.Device as d
on dtv.id = d.id
order by devType, d.id
{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163935</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">861</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set flag to show through Instru view to true)
## Job is fired every 5(?) minutes to crawl DB and look for new devices
## Send email to SSDS Admin notifying of new device(s)
### Mail contains key fields, who added device.
### Indicate that device is exposed through Instru view
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Job is fired every 5(?) minutes to crawl DB and look for edited devices (history tables?)
## If edited device(s) found, send notification to SSDS Administrator.
### Mail contains changed fields (from and to?), who changed.
### Indicate whether device is exposed through instru view
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table
## Job is fired every 5(?) minutes to check and see if new devices have been entered.
## If new device found, send SSDS administrator a notification
### Mail contains key fields, who added device.
### Indicate whether device is exposed through Instru view
### If new device is not exposed through Instru, send notification to OSG Operator and embed link to expose through Instru view
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table
## Job is fired every 5(?) minutes to check for edits.
## If edit found, send notification to SSDS admin detailing changes.
### Mail contains key fields, who added device.
### Indicate whether device is exposed through Instru view
### If device exposed through Instru view, send notification to OSG Operator

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# External application (JG/AM)
## Runs on interval (5 minutes (?))
## Checks for new devices
## Checks for edited devices
## Constructs proper notifications and emails (needs history tables)
# 1 Servlet (KG)
## Change instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the instru view
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:

# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)

{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">864</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">295005</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
#* Must make copy of this table as a different name (Instru is name of view)
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerial (mfgSerialNumber)
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS. (This can happen after everything else is done.)
 * _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 * prepare any associated changes to the FK in Trans.
 * Set the MBARI ID in Device to the SSDS ID.  
 * Will also have to set appropriate constraints on MBARI_ID column

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our interim table (TempDevFld) using the mfgName column, from Instru or Device as appropriate, using the rules above. 

At this point, all the mfgName rows should be filled in. 

Manual changes will be done to the interim table.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.

This is shown in [SqlQueries#UpdateMfgName].

[Back to table...|#table]

{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [#DeviceMerge].
# Do manual corrections as listed above (code in [SqlQueries#ManualModel]).


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following device types are also supported
* Test Entry-System
* Not Specific-Unknown
* Not Specified-TBD
* Not Specified-Undefined


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'
# 'ICC' to 'Inductive Modem Cable Coupler'
# 'pump' to 'Pump'
# 'release' to 'Release'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 
# How to change 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Also, Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.
Code to do all this is in [SqlQueries#DeviceTypeInsert].  

I have also created code to update the descriptions of the erroneously added deprecated terms at [SqlQueries#UpdateDeprecated].


h4. Implementation

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.

These are coded in [SqlQueries#DeviceTypeMerge].

# Perform explicit corrections listed above.


We will copy the appropriate information over to our InterimTable (using the tempType column), from Instru or Device as appropriate, using the rules above. 

Then we will do the entries requiring 'manual' correction (assuming Paul has OK'd the above), code for which is in [SqlQueries#FixDeviceTypes]:

At this point, all the tempType cells should be filled in. 

Finally, the InterimTable will be used to overwrite the Device table.


[Back to table...|#table]

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163934</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">862</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are:
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## New entry is inserted into the Device table (set flag to show through Instru view to true)
## Job is fired every 5(?) minutes to crawl DB and look for new devices
## Send email to SSDS Admin notifying of new device(s)
### Mail contains key fields, who added device.
### Indicate that device is exposed through Instru view
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Job is fired every 5(?) minutes to crawl DB and look for edited devices (history tables?)
## If edited device(s) found, send notification to SSDS Administrator.
### Mail contains changed fields (from and to?), who changed.
### Indicate whether device is exposed through instru view
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table
## Job is fired every 5(?) minutes to check and see if new devices have been entered.
## If new device found, send SSDS administrator a notification
### Mail contains key fields, who added device.
### Indicate whether device is exposed through Instru view
### If new device is not exposed through Instru, send notification to OSG Operator and embed link to expose through Instru view
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table
## Job is fired every 5(?) minutes to check for edits.
## If edit found, send notification to SSDS admin detailing changes.
### Mail contains key fields, who added device.
### Indicate whether device is exposed through Instru view
### If device exposed through Instru view, send notification to OSG Operator

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# External application (JG/AM)
## Runs on interval (5 minutes (?))
## Checks for new devices
## Checks for edited devices
## Constructs proper notifications and emails (needs history tables)
# 1 Servlet (KG)
## Change instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the instru view
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:

# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)

{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">865</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294983</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
#* Must make copy of this table as a different name (Instru is name of view)
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerial (mfgSerialNumber)
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS. (This can happen after everything else is done.)
 * _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 * prepare any associated changes to the FK in Trans.
 * Set the MBARI ID in Device to the SSDS ID.  
 * Will also have to set appropriate constraints on MBARI_ID column

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our interim table (TempDevFld) using the mfgName column, from Instru or Device as appropriate, using the rules above. 

At this point, all the mfgName rows should be filled in. 

Manual changes will be done to the interim table.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.

This is shown in [SqlQueries#UpdateMfgName].

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [#DeviceMerge].
# Do manual corrections as listed above (code in [SqlQueries#ManualModel]).


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163912</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294984</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
#* Must make copy of this table as a different name (Instru is name of view)
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerial (mfgSerialNumber)
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS. (This can happen after everything else is done.)
 * _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 * prepare any associated changes to the FK in Trans.
 * Set the MBARI ID in Device to the SSDS ID.  
 * Will also have to set appropriate constraints on MBARI_ID column

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our interim table (TempDevFld) using the mfgName column, from Instru or Device as appropriate, using the rules above. 

At this point, all the mfgName rows should be filled in. 

Manual changes will be done to the interim table.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.

This is shown in [SqlQueries#UpdateMfgName].

[Back to table...|#table]

{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [#DeviceMerge].
# Do manual corrections as listed above (code in [SqlQueries#ManualModel]).


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'
# 'ICC' to 'Inductive Modem Cable Coupler'
# 'pump' to 'Pump'
# 'release' to 'Release'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 
# How to change 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Code to do this is in [SqlQueries#DeviceTypeInsert].  I have also created code to update the descriptions of the erroneously added deprecated terms at [SqlQueries#UpdateDeprecated].

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

These are coded in [SqlQueries#DeviceTypeMerge].

The following entries require 'manual' correction (assuming Paul has OK'd the above), code for which is in [SqlQueries#FixDeviceTypes]:

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163913</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294986</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. Update Device Type Column by Merging

{code:sql}
/* Update Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change 2 instru entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM Instru i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

/* Find matching instru names */
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'

UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'


{code}

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163915</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294980</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}


/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163909</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294981</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. Update Device Type Column by Merging

{code:sql}
/* Update Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change 2 instru entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM Instru i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

/* Find matching instru names */
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:MergeDeviceType}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    tempDevFld
SET       tempDevFld.tempType = 'Radiometer-Multispectral'
WHERE      tempDevFld.id = 1381
UPDATE    tempDevFld
SET       tempDevFld.tempType = 'Inductive Model-Surface'
WHERE      tempDevFld.id = 1319
UPDATE    tempDevFld
SET       tempDevFld.tempType = 'Controller-CTD'
WHERE      tempDevFld.id = 1224
UPDATE    tempDevFld
SET       tempDevFld.tempType = 'Communication/GPS'
WHERE      tempDevFld.id = 1323
UPDATE    tempDevFld
SET       tempDevFld.tempType = 'Current Sensors-ADCP'
WHERE     tempDevFld.tempType = 'ADCP'

{code}

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163910</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294982</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. Update Device Type Column by Merging

{code:sql}
/* Update Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change 2 instru entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM Instru i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

/* Find matching instru names */
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:MergeDeviceType}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'

UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'


{code}

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163911</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294991</id>
<property name="body"><![CDATA[{note}These queries were tested against SSDS_Metadata databases.  For queries configured for SSDS_Metadata, see [SqlQueriesFinal].{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only)

This finds full serial matches to Device mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM Device
WHERE Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM Device
WHERE Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from instruCopy Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all instruCopy devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instruCopy i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instruCopy i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instruCopy i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. Update Device Type Column by Merging

{code:sql}
/* Update Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'

UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}


]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163920</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294992</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries].{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only)

This finds full serial matches to Device mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM Device
WHERE Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM Device
WHERE Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from instruCopy Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all instruCopy devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instruCopy i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instruCopy i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instruCopy i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. Update Device Type Column by Merging

{code:sql}
/* Update Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'

UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}


]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163921</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294993</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries].{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only)

This finds full serial matches to Device mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM Device
WHERE Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM Device
WHERE Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from instruCopy Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all instruCopy devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instruCopy i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instruCopy i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instruCopy i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. Update Device Type Column by Merging

{code:sql}
/* Update Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'


UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}


]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163922</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294994</id>
<property name="body"><![CDATA[{note}These queries are being tested against the SSDS_Metadata database.  For queries configured for Northwind, see [SqlQueries].{note}

{anchor:FindMatchingDevices}
h2. Finding Matching instruCopy Devices in Device (Information Only)

This finds full serial matches to Device mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM ssdsdba.Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instruCopy
WHERE     not exists (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.id = instruCopy.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM ssdsdba.Device
WHERE ssdsdba.Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match instruCopy to SSDS Devices
{code:sql}
UPDATE instruCopy SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE instruCopy SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE instruCopy SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE instruCopy SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE instruCopy SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE instruCopy SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE instruCopy SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE instruCopy SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE instruCopy SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE instruCopy SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE instruCopy SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE instruCopy SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE instruCopy SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE instruCopy SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE instruCopy SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE instruCopy SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE instruCopy SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','',
                                                                         'Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from instruCopy
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all instruCopy devices without SSDS IDs **/
INSERT INTO [SSDS_Metadata].[ssdsdba].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM instruCopy as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of instruCopy. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM ssdsdba.Device d, instruCopy i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. UPDATE ssdsdba.Device Table Entries from instruCopy Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all instruCopy devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instruCopy model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM ssdsdba.Device d, instruCopy i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from instruCopy

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM ssdsdba.Device d, instruCopy i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM ssdsdba.Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instruCopy */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instruCopy i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN ssdsdba.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE ssdsdba.Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE ssdsdba.Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE ssdsdba.Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE ssdsdba.Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE ssdsdba.Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE ssdsdba.Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN ssdsdba.Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instruCopy i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE ssdsdba.Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE ssdsdba.Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE ssdsdba.Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE ssdsdba.Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE ssdsdba.Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE ssdsdba.Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE ssdsdba.Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE ssdsdba.Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters' +
            ' into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water'+
                   ' to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. UPDATE ssdsdba.Device Type Column by Merging

{code:sql}
/* UPDATE ssdsdba.Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instruCopy entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM instruCopy i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instruCopy i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instruCopy names */
/* Grab names from instruCopy that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instruCopy i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'


UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}


]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163923</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294987</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. Update Device Type Column by Merging

{code:sql}
/* Update Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instru entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM Instru i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instru i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instru i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instru names */
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'

UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'




{code}

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163916</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294988</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. Update Device Type Column by Merging

{code:sql}
/* Update Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instru entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM Instru i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instru i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instru i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instru names */
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'

UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163917</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294989</id>
<property name="body"><![CDATA[{note}These queries were tested against Northwind databases.  For queries configured for SSDS_Metadata, see [SqlQueriesFinal].{note}

{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateNephelometer}
h2. Update Nephelometer

{code:sql}
/* Update the nephelometer spelling in DeviceType table */
update DeviceType
set name='Fluorometer/Nephelometer', description='fluorometer configured to also do nephelometry (turbidity sensing)'
where id=158
{code}

{anchor:MergeDeviceType}
h2. Update Device Type Column by Merging

{code:sql}
/* Update Device Type column */
/* Grab names from Device that exist (but do it through view) */
UPDATE    t
SET       t.tempType = dv.devType
FROM      TempDevFld t, devTypeView dv
WHERE      t.id = dv.id AND dv.devType is not null AND t.tempType is null
/* Grab names from Device that match exactly */

/* Change instru entries to be 'right' */
UPDATE i
SET i.Type = 'Controller-Mooring Node'
FROM Instru i
WHERE i.Type = 'Controller' AND (i.Model LIKE 'OASIS%' OR i.Model = 'MMC')

UPDATE i
SET i.Type = 'backscatterometer'
FROM instru i
WHERE Type = 'backscatter' AND (Model ='HS2' OR Model='VSFS')

UPDATE i
SET i.Type = 'scatterometer'
FROM instru i
WHERE Type = 'backscatter' AND Model ='ECO BBSB'

/* Find matching instru names */
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempType = i.Type
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID]
          AND i.Type in (SELECT devType from devTypeView) 
          AND t.tempType is null
{code}

{anchor:FixDeviceTypes}
h2. Manual Device Type Fixes

{code:sql}
UPDATE    t
SET       t.tempType = 'Radiometer-Multispectral'
FROM      TempDevFld t
WHERE      t.id = 1381
UPDATE    t
SET       t.tempType = 'Inductive Model-Surface'
FROM      TempDevFld t
WHERE      t.id = 1319
UPDATE    t
SET       t.tempType = 'Controller-CTD'
FROM      TempDevFld t
WHERE      t.id = 1224
UPDATE    t
SET       t.tempType = 'Communication/GPS'
FROM      TempDevFld t
WHERE      t.id = 1323
UPDATE    t
SET       t.tempType = 'Current Sensors-ADCP'
FROM      TempDevFld t
WHERE     t.tempType = 'ADCP'

UPDATE t
set t.tempType = 'Fluorometer/Nephelometer'
FROM TempDevFld t
WHERE t.tempType = 'fluor/turbidity'
UPDATE t
set t.tempType = 'Backscatterometer/Fluorometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter/fluorometer'
UPDATE t
set t.tempType = 'Metereology Package'
FROM TempDevFld t
WHERE t.tempType = 'temperature/humidity'
UPDATE t
set t.tempType = 'Nitrogen Sensor/ISUS'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate'
UPDATE t
set t.tempType = 'Nitrogen Sensor (this is Satlantic unit)'
FROM TempDevFld t
WHERE t.tempType = 'Nitrate analyzer'
UPDATE t
set t.tempType = 'Oxygen Sensor'
FROM TempDevFld t
WHERE t.tempType = 'Oxygen optode'
UPDATE t
set t.tempType = 'Toroid'
FROM TempDevFld t
WHERE t.tempType = 'Platform'
UPDATE t
set t.tempType = 'Power Supply-Electric'
FROM TempDevFld t
WHERE t.tempType = 'power source'
UPDATE t
set t.tempType = 'CO2 Monitor'
FROM TempDevFld t
WHERE t.tempType = 'pCO2'
UPDATE t
set t.tempType = 'Transponder'
FROM TempDevFld t
WHERE t.tempType = 'transducer'
UPDATE t
set t.tempType = 'Echo Sounder-Singlebeam'
FROM TempDevFld t
WHERE t.tempType = 'sounder'
UPDATE t
set t.tempType = 'Shutter-Antifouling'
FROM TempDevFld t
WHERE t.tempType = 'shutter'
UPDATE t
set t.tempType = 'Inductive Modem Cable Coupler'
FROM TempDevFld t
WHERE t.tempType = 'ICC'
UPDATE t
set t.tempType = 'Pump'
FROM TempDevFld t
WHERE t.tempType = 'pump'
UPDATE t
set t.tempType = 'Release'
FROM TempDevFld t
WHERE t.tempType = 'release'
set t.tempType = 'Backscatterometer'
FROM TempDevFld t
WHERE t.tempType = 'backscatter'
set t.tempType = 'Battery'
FROM TempDevFld t
WHERE t.tempType = 'battery'
set t.tempType = 'Transmissometer'
FROM TempDevFld t
WHERE t.tempType = 'transmissometer'

{code}

The final copy of device information back into the Device table (through the view, so it uses the FKs).

{code:sql}
UPDATE dv
SET dv.devType = t.tempType
FROM devTypeView dv, TempDevFld t
WHERE dv.id = t.id
{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163918</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294965</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempModel varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
select top 2000 t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
(
TempDevFld t 
FULL OUTER JOIN Device d 
  ON t.id = d.id 
)
FULL OUTER JOIN instru i
  ON i.[SSDS ID] = t.id
ORDER BY tempMfg

{code}


{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

{code:sql}

/* Update  */


{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163894</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294964</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
#* Must make copy of this table as a different name (Instru is name of view)
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerial (mfgSerialNumber)
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS. (This can happen after everything else is done.)
 * _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 * prepare any associated changes to the FK in Trans.
 * Set the MBARI ID in Device to the SSDS ID.  
 * Will also have to set appropriate constraints on MBARI_ID column

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our interim table (TempDevFld) using the mfgName column, from Instru or Device as appropriate, using the rules above. 

At this point, all the mfgName rows should be filled in. 

Manual changes will be done to the interim table.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.

This is shown in [SqlQueries#UpdateMfgName].

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [SqlQueries#DeviceMerge].
# Do manual corrections as listed above.


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163893</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294963</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempModel varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'test'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
select top 2000 t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
(
TempDevFld t 
FULL OUTER JOIN Device d 
  ON t.id = d.id 
)
FULL OUTER JOIN instru i
  ON i.[SSDS ID] = t.id
ORDER BY tempMfg

{code}


{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

{code:sql}

/* Update  */


{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163892</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294970</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */

{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163899</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294969</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
#* Must make copy of this table as a different name (Instru is name of view)
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerial (mfgSerialNumber)
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS. (This can happen after everything else is done.)
 * _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 * prepare any associated changes to the FK in Trans.
 * Set the MBARI ID in Device to the SSDS ID.  
 * Will also have to set appropriate constraints on MBARI_ID column

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our interim table (TempDevFld) using the mfgName column, from Instru or Device as appropriate, using the rules above. 

At this point, all the mfgName rows should be filled in. 

Manual changes will be done to the interim table.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.

This is shown in [SqlQueries#UpdateMfgName].

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [#DeviceMerge].
# Do manual corrections as listed above.


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163898</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294968</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempModel varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */

{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163897</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294967</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempModel varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */

{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163896</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294971</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163900</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294977</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:DeviceTypeInsert}
h2. Insert Additional Devices in Device Type Column

{code:sql}

/* Insert new devices */
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Backscatterometer/Fluorometer', 'backscatterometer that additionally provides fluorescence data')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Battery', 'device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Communication/GPS', 'transmits signals from one place to another, and contains GPS locator')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Singlebeam', 'acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Echo Sounder-Multibeam', 'acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Inductive Modem Cable Coupler', 'connector for indcutive modems (ICC)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Power Supply-Electric', 'power supply (delivers power to other equipment) that does not store energy')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Pump', 'mechanical device used to move liquids or gases')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Release', 'mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Sidescan Swath Bathymetry', 'fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Scanning', 'acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Sonar-Subbottom', 'acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transmissometer', 'device to measure the optical transparency of water (also turbidity sensor)')
INSERT INTO graybeal.DeviceType(version ,Name, Description)
VALUES(0, 'Transponder', 'electrical device designed to receive a specific signal and automatically transmit a specific reply')

{code}

{anchor:UpdateDeprecated}
h2. Update Deprecated Device Descriptions

{code:sql}
UPDATE DeviceType
SET description='Deprecated, please choose another type'
WHERE description is null
{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}


/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163906</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294976</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] is null

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET      
/* Don't overwrite the model in Device if instru model is null */       
d.mfgModel = 
  case when i.Model is not null then i.Model else d.mfgModel end,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

UPDATE Device 
SET mfgName =
'testing'
WHERE mfgName LIKE
'Fraben%'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
/** Get relevant ID and manufacturer information from 3 tables **/
SELECT t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
  (
  TempDevFld t 
  FULL OUTER JOIN Device d 
    ON t.id = d.id 
  )
  FULL OUTER JOIN instru i
    ON i.[SSDS ID] = t.id
ORDER BY tempMfg, mfgName
{code}


{anchor:ManualModel}
h2. Update Model (mfgModel)

mfgModel column already contains BOG Model if any existed; this was 
done in initial merge of the two tables.


{code:sql}

/* Update mfgModel to reflect manual corrections */
UPDATE Device
SET mfgModel = 
'GPC16-HVS'
WHERE id = 1313

UPDATE Device
SET mfgModel = 
'ECO FLNTUSB'
WHERE id = 1395

UPDATE Device
SET mfgModel = 
null
WHERE mfgModel =
'(null)'

UPDATE Device
SET mfgModel = 
replace (mfgModel, '-', ' ')
WHERE mfgModel LIKE 'ECO-FLNT%'

UPDATE Device
SET mfgModel = 
'ECO Triplet'
WHERE mfgModel =
'triplet'

UPDATE Device
SET mfgModel = 
'MMCv4'
WHERE mfgModel LIKE
'MMC v%'

UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa R%'


UPDATE Device
SET mfgModel = 
'Medusa Rev 2'
WHERE mfgModel LIKE
'Medusa v%'

UPDATE Device
SET mfgModel = 
'OASIS Buoy'
WHERE mfgModel LIKE
'Fiberglass tor%'

UPDATE Device
SET mfgModel = 
'E-meter'
WHERE mfgModel =
'Emeter'

{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163905</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294961</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] <> d.id

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempModel varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names **/
/* Grab matching names from Instru */
UPDATE    t
SET             
t.tempMfg = i.Manufacturer
FROM TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers)
/* Grab matching names from Device */
UPDATE    t
SET             
t.tempMfg = d.mfgName
FROM TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers)

/* Find names that are like the correct names */


/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
select top 2000 t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
(
TempDevFld t 
FULL OUTER JOIN Device d 
  ON t.id = d.id 
)
FULL OUTER JOIN instru i
  ON i.[SSDS ID] = t.id
ORDER BY tempMfg

{code}


{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

{code:sql}

/* Update  */


{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163890</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294962</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] <> d.id

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempModel varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names to ones in Manufacturers table **/
/* Grab names from Instru that match exactly */
UPDATE    t
SET       t.tempMfg = i.Manufacturer
FROM      TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers) AND t.tempMfg is null
/* Grab names from Device that match exactly */
UPDATE    t
SET       t.tempMfg = d.mfgName
FROM      TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers) AND t.tempMfg is null

/* Find names that are like the correct names */
/* First from instru */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, i.[SSDS ID] as iid, i.Manufacturer, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.instru i
      ON (t.id = i.[SSDS ID]), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(i.Manufacturer,1,3) = substring(m.label,1,3) 
            AND i.Manufacturer <> m.label 
            AND i.Manufacturer <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(i.Manufacturer,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null

/* Then from Device */
UPDATE    t 
SET       t.tempMfg = r1.label 
FROM TempDevFld t, 
(     
  SELECT t.id as tid, t.tempMfg, d.id as did, d.mfgName, m.label
    FROM graybeal.TempDevFld t JOIN graybeal.Device d
      ON (t.id = d.id), graybeal.Manufacturers m
  WHERE t.tempMfg is null AND
     ((substring(d.mfgName,1,3) = substring(m.label,1,3) AND (d.mfgName <> m.label) 
            AND d.mfgName <> 'SeaTech' AND m.label <> 'SeaTech') OR
         CHARINDEX(d.mfgName,m.label) > 1)
) r1
WHERE t.id = r1.tid AND t.tempMfg is null



/* Do manual corrections */
/** Manual MfgName **/

UPDATE Device
SET mfgName = 'Aanderaa Instruments'
WHERE mfgName = 'Anderraa Instruments'

UPDATE Device
SET mfgName = 
'Magellan Navigation'
WHERE mfgName LIKE
'Ashtech%'

UPDATE Device
SET mfgName = 
'Star Engineering for WHOI-Asimet'
WHERE mfgName LIKE
'Asimet%'

UPDATE Device
SET mfgName = 
'AXYS Technologies'
WHERE mfgName LIKE
'Triaxys%'

UPDATE Device
SET mfgName = 
'UC Santa Barbara'
WHERE mfgName =
'UCSB'

{code}

For information only, this report generates a list of the original mfgName/Manufacturer against the newly created tempMfg.

{code:sql}
select top 2000 t.tempMfg, d.mfgName, i.Manufacturer, t.id, d.id, i.[SSDS ID], i.MBARI_ID
FROM 
(
TempDevFld t 
FULL OUTER JOIN Device d 
  ON t.id = d.id 
)
FULL OUTER JOIN instru i
  ON i.[SSDS ID] = t.id
ORDER BY tempMfg

{code}


{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

{code:sql}

/* Update  */


{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163891</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294960</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] <> d.id

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempModel varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/** Update manufacturer names **/
/* Grab matching names from Instru */
UPDATE    t
SET             
t.tempMfg = i.Manufacturer
FROM TempDevFld t, instru i
WHERE      t.id = i.[SSDS ID] and i.Manufacturer in (SELECT label from Manufacturers)
/* Grab matching names from Device */
UPDATE    t
SET             
t.tempMfg = d.mfgName
FROM TempDevFld t, Device d
WHERE      t.id = d.id and d.MfgName in (SELECT label from Manufacturers)

/* Find names that are like the correct names */


/* Do manual corrections */

{code}

{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

{code:sql}

/* Update  */


{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163889</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294932</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices]. 


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our InterimTable (using the workingText column), from Instru or Device as appropriate, using the rules above. 

At this point, all the workingText rows should be filled in. 

Manual changes will be done to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163861</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294931</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru

{code:sql}

/** Copy all Instru devices without SSDS IDs **/
/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices

{code:sql}


/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

/* Update mfgSerialNmber column with any FullSerial value */

/* Update Device Type column */

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163860</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294934</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our InterimTable (using the workingText column), from Instru or Device as appropriate, using the rules above. 

At this point, all the workingText rows should be filled in. 

Manual changes will be done to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163863</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294933</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru

{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] <> d.id

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:UpdateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

/* Update Device Type column */

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163862</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294936</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our InterimTable (using the workingText column), from Instru or Device as appropriate, using the rules above. 

At this point, all the workingText rows should be filled in. 

Manual changes will be done to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163865</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294935</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our InterimTable (using the workingText column), from Instru or Device as appropriate, using the rules above. 

At this point, all the workingText rows should be filled in. 

Manual changes will be done to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163864</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294938</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru

{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] <> d.id

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempModel varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO

{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/* Update  */


{code}

{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

{code:sql}

/* Update  */


{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163867</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294937</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru

{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] <> d.id

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

/* Update Device Type column */

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163866</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294939</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our InterimTable (using the workingText column), from Instru or Device as appropriate, using the rules above. 

At this point, all the workingText rows should be filled in. 

Manual changes will be done to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [SqlQueries#DeviceMerge].
# Do manual corrections as listed above.


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163868</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294942</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
#* Must make copy of this table as a different name (Instru is name of view)
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our interim table (TempDevFld) using the mfgName column, from Instru or Device as appropriate, using the rules above. 

At this point, all the mfgName rows should be filled in. 

Manual changes will be done to the interim table.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.

This is shown in [SqlQueries#UpdateMfgName].

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [SqlQueries#DeviceMerge].
# Do manual corrections as listed above.


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163871</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294941</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our interim table (TempDevFld) using the mfgName column, from Instru or Device as appropriate, using the rules above. 

At this point, all the mfgName rows should be filled in. 

Manual changes will be done to the interim table.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.

This is shown in [SqlQueries#UpdateMfgName].

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [SqlQueries#DeviceMerge].
# Do manual corrections as listed above.


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163870</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294944</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
#* Must make copy of this table as a different name (Instru is name of view)
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerial (mfgSerialNumber)
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Use this [Detailed SQL|SqlQueries#InsertNewDevices] for everything in this section.  


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Use this [Detailed SQL|SqlQueries#UpdateExistingDevices]. 


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our interim table (TempDevFld) using the mfgName column, from Instru or Device as appropriate, using the rules above. 

At this point, all the mfgName rows should be filled in. 

Manual changes will be done to the interim table.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.

This is shown in [SqlQueries#UpdateMfgName].

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model 

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel. This step is accomplished in [SqlQueries#DeviceMerge].
# Do manual corrections as listed above.


[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.  The former is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices]; the latter is done in [SqlQueries#updateToFullSerial].

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.  This is done in [SqlQueries#insertNewDevices] and [SqlQueries#updateExistingDevices].

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163873</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294943</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru

{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] <> d.id

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempModel varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/* Update  */


{code}

{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

{code:sql}

/* Update  */


{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163872</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294945</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}
{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/** Copy SSDS ID for new devices back into the SSDS ID column of Instru. **/
UPDATE    i
  SET              [SSDS ID] = d.id
  FROM Device d, instru i
  WHERE      d.MBARI_ID = i.MBARI_ID AND i.[SSDS ID] <> d.id

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices
{note}
Double-check for Erich R's name in the Technician field before setting everything to 126.
{note}

{code:sql}

/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}

{anchor:updateToFullSerial}
h2. Update mfgSerialNumber to Full Serial from Instru

{code:sql}

/* Update mfgSerialNmber column with any FullSerial value */
UPDATE    d
SET              mfgSerialNumber = i.[FullSerial]
FROM Device d, instru i
WHERE      d.[MBARI_ID] = i.[MBARI_ID] 
AND NOT (i.FullSerial is null OR i.FullSerial = '')

{code}

{anchor:MakeInterimtTable}
h2. Create an Interim Working Table

{code:sql}

/** Make Interim table **/
DROP TABLE TempDevFld
CREATE TABLE TempDevFld
 (id int PRIMARY KEY,
  tempMfg varchar (255) NULL,
  tempModel varchar (255) NULL,
  tempType varchar (255) NULL
 )
GO
/* Populate with all the device IDs */
INSERT INTO TempDevFld
  (id)
SELECT d.id 
FROM Device as d
{code}

{anchor:UpdateMfgName}
h2. Update Manufacturer (mfgName)

{code:sql}

/* Update  */


{code}

{anchor:UpdateMfgModel}
h2. Update Model (mfgModel)

{code:sql}

/* Update  */


{code}

{anchor:UpdateDeviceType}
h2. Update Device Type Column

{code:sql}

/* Update Device Type column */

{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163874</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294921</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163850</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294925</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Insert New Instru Devices

{code:sql}

/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163854</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294928</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Insert New Instru Devices

{code:sql}

/** Copy all Instru devices without SSDS IDs **/
/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/* Update mfgSerialNmber column with any FullSerial value */

/* Update Device Type column */

{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163857</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294929</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}

{anchor:CreateMfgTable}
h2. Create Table of Legal Manufacturer Names

{code:sql}
CREATE TABLE Manufacturers
 (id int IDENTITY PRIMARY KEY,
  label varchar (100) NOT NULL,
  fullName varchar(100) NOT NULL, 
  oldNames varchar(250) NULL,
  comments varchar(250) NULL)
GO

INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Aanderaa Data Instruments','Aanderaa Data Instruments','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Axys Technologies','Axys Technologies Inc.','','Axys Environmental Systems')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Biospherical Instruments','Biospherical Instruments Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Bluefin Robotics','Bluefin Robotics Corporation','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Brook Ocean Technology','Brook Ocean Technology Limited','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Crossbow Technology','Crossbow Technology Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Garmin','Garmin','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('HOBI Labs','Hydro-Optics, Biology, & Instrumentation Laboratories','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Magellan Navigation','Magellan Navigation, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('MBARI','Monterey Bay Aquarium Research Institute','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('McLane Research Laboratories','McLane Research Laboratories, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('NOBSKA','NOBSKA','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('ORBCOMM','ORBCOMM, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Paroscientific','Paroscientific, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('QUAKE Global','QUAKE Global, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Satlantic','Satlantic Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Sea-Bird Electronics','Sea-Bird Electronics, Inc.','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('SeaTech','SeaTech, Inc.','','no longer exists')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Simrad','Simrad, Inc','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Star Engineering for WHOI-Asimet','Star Engineering','','Star Engineering is only authorized seller of ASIMETs')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('tbd','to be determined value for manufacturer','','if totally unknown use unknown')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne Benthos','Teledyne Benthos','Benthos','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Teledyne RD Instruments','Teledyne RD Instruments','RD Instruments',''	)
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('testing','test entry','','use for test entries')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('UC Santa Barbara','University of California, Santa Barbara','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('unknown','unknown manufacturer','','use for permanently unknown values, else use tbd')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WET Labs','WET Labs','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('WHOI','Woods Hole Oceanographic Institution','','')
INSERT INTO Manufacturers (label, fullName, oldNames, comments) values ('Xantrex Technology','Xantrex Technology Inc.','','')
{code}

{anchor:insertNewDevices}
h2. Add New Device Table Entries from Instru

{code:sql}

/** Copy all Instru devices without SSDS IDs **/
/** Copy all Instru devices without SSDS IDs **/
INSERT INTO [Northwind].[graybeal].[Device]
([version], [uuid], [name], [description], [mfgName], [mfgModel], [mfgSerialNumber], 
[infoUrlList], [PersonID_FK], [DeviceTypeID_FK], [Serial], 
[Calibration_organization], [Features], [Pressure_sensor], [Depth_Rating], 
[Firmware_EPROM], [Memory], [Receive_frequency], [Transmit_frequency], 
[Enable_code], [Release_code], [Tilt_option], [Purchased_for], 
[Owner], [Custodian], [Date_new], [PO], [Transaction_col], 
[Permanent_comment], [document_dir], [osg_view], [MBARI_ID])

  /** Notes for following:
  Set Version, UUID to 0
  Set name to null and description to Mfg + Model
  * Leaving DeviceType to fix up later
  * mfgSerialNumber gets Serial; overwrite with FullSerial (if exists) later
  Transaction_col is set to null (always null anyway)
  * Leaving MBARI_ID unchanged for now; later set it to id
  **/
  SELECT 
  0,'0',null,i.Manufacturer + ' ' + i.Model , i.Manufacturer, i.Model, i.Serial, 
  CAST (i.[manufacture web page]AS varchar(2048)), 126, 0, i.Serial,
  i.[Calibration organization], i.Features, i.[Pressure sensor], i.[Depth Rating],
  i.[Firmware/EPROM], i.Memory, i.[Receive frequency], i.[Transmit frequency],
  i.[Enable code], i.[Release code], i.[Tilt option], i.[Purchased for],
  i.Owner, i.Custodian, i.[Date new], i.PO, null,
  i.[Permanent comment], i.[document dir], 1, i.MBARI_ID
  
  FROM Instru as i
  WHERE i.[SSDS ID] is null OR i.[SSDS ID] = 0

/* Update mfgSerialNmber column with any FullSerial value */

/* Update Device Type column */

{code}
{anchor:updateExistingDevices}
h2. Update Device Table Entries from Instru Devices

{code:sql}


/** Update all Instru devices with SSDS IDs **/
UPDATE    d
SET             
d.mfgModel = i.Model,
d.mfgSerialNumber = i.Serial,
d.infoUrlList = CAST (i.[manufacture web page]AS varchar(2048)),
d.PersonID_FK = 126,
d.Serial = i.Serial,
d.Calibration_organization = i.[Calibration organization],
d.Features = i.Features,
d.Pressure_sensor = i.[Pressure sensor],
d.Depth_Rating = i.[Depth Rating],
d.Firmware_EPROM = i.[Firmware/EPROM],
d.Memory = i.Memory,
d.Receive_frequency = i.[Receive frequency],
d.Transmit_frequency = i.[Transmit frequency],
d.Enable_code = i.[Enable code],
d.Release_code = i.[Release code],
d.Tilt_option = i.[Tilt option],
d.Purchased_for = i.[Purchased for],
d.Owner = i.Owner,
d.Custodian = i.Custodian,
d.Date_new = i.[Date new],
d.PO = i.PO,
d.Transaction_col = null,
d.Permanent_comment = i.[Permanent comment],
d.document_dir = i.[document dir],
d.osg_view = 1,
d.MBARI_ID = i.MBARI_ID
FROM Device d, instru i
WHERE      d.MBARI_ID = i.MBARI_ID
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163858</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">294930</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

h3. Assumptions

The scripts make the following assumptions:
# The Device table has had columns added to match the list under [#DeviceMerge].
# An up-to-date copy of the Instru table is in the SQL Server where these changes will be made.
#* It is OK to change the copy of the Instru table.
# The person running the script has permissions to:
#* Change Device.
#* Change Instru.
#* Create new tables and leave them (Manufacturers) or delete them later.
# Either DeviceTypes has been updated to reflect the changes in [#Type], or the SQL at [SqlQueries#AddDeviceTypes] (pending) is run to make the necessary changes.

In some cases the steps are 'smart' about using existing data to assess changes, but in other cases it was necessary to assign the values directly for some of the devices. SSDS ID is used as the key for most of these changes; barring unusual changes this should not break.

I made the following assumptions:
# Paul C approves of all these changes.
# Someone will quickly look over the code to see if there may be bad side effects.  I was careful but I'm not that skillful yet.

h3. The Columns

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Detailed SQL to be provided.


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Detailed SQL to be provided.


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our InterimTable (using the workingText column), from Instru or Device as appropriate, using the rules above. 

At this point, all the workingText rows should be filled in. 

Manual changes will be done to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">163859</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1023</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: 
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)

* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> IMCTD (120) from CommDevice (119)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1026</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1019</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: acoustic system which produces (usually) short acoustic pulses, transmits them into the water column and then detects echoes from impedance discontinuities (e.g., fish, the bottom, or plankton) 
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
#* BPG devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Rename the field in SSDS to ShortSerial, but present it to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1022</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1018</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

{anchor:Model}
{anchor:Serial}
{anchor:Name}
h3. BOG fields for Model and Serial Numbers

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* The serial number should be the most complete serial number as presented and formatted by the vendor --- as written on the invoice, written on the label, etc.  This will often include some model information.  (The short serial number in the Instru 'Serial' field is the last unique part of the full serial number. We will support that also but it will not be primary.)
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Mannufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| FullSerial | A real mess | If Instru has a full serial number, use it. If not, then if SSDS has FullSerial, use that. Lacking that, if only a (short) Serial is in BOG, use that instead.  |
| Serial | Shore serial numbers | Copy the BOG short Serial field into a similar field in SSDS.  |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

{anchor:Manufacturer}
h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded. (Go to website, how does company refer to itself?)  Abbreviations should be expanded except in extreme, well-known cases (e.g., MBARI, WHOI, HOBI Labs). 

Until we have a proper company table, we propose to update the company name to the current name whenever it's known to change.  (Better answer long term is to create Company Names and Company tables, so multiple names can reference the same company.  This can also support lookups of older names and other historical referencing.)

The following table was an initial cut at final names, and is now deprecated. (Kept only for reference.)  For the ultimate answers see the [final names list|MakingData#Manufacturer].

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

{anchor:Type}
h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Meteorology Package | Although "Metsys" is used as the common parlance for this package, it is not self-explanatory and is not trivial to derive from a Google search. |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  "Inductive Modem" isn't a used category (yet).|
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | New term? Replace Bioshutter in SSDS? |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

{anchor:Technician}
h3. BOG field Technician

This field is entirely filled with 'pc' in BOG, and appears to have the same function as the PersonID_FK field in SSDS.  (This is not the 'owner' or 'custodian' functions of BOG, but is just the person who knows about this instrument and its properties.)  Suggest replacing Paul Coenen as the PersonID_FK for any device in Instru.

----
h3. Deferred to phase 2:

| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1021</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1017</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device LEFT OUTER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id LEFT OUTER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# The history tables store the updated values for entries as the thought is that each entry would have to be inserted before any updates so you would always have the initial state of the row.  In this case we are starting with existing data, so it is critical that we get a baseline of all the current rows.  This can be done simply by running these in SQL Query Analyzer:
{noformat}
UPDATE ssdsdba.Device SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.Person SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.DeviceType SET version = version
GO
{noformat}
This will create entries for all the rows so that we will have the current data in the history table to compare future updates/deletions against.
# Create an INSTEAD OF INSERT trigger on the view
{noformat}
CREATE TRIGGER trInstruInsert ON instru
INSTEAD OF INSERT
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Now let's make sure the MBARI_ID and SSDS_ID are null
    IF @mbari_id IS NOT NULL
      RAISERROR('The insert specified the MBARI_ID. This field is auto-generated, do not specify on insert',9,1)
    IF @ssds_id IS NOT NULL
      RAISERROR('The insert specified the SSDS_ID. This field is auto-generated, do not specify on insert',9,1)

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    INSERT INTO ssdsdba.Device 
      (
       mfgName,
       mfgModel,
       Serial,
       mfgSerialNumber,
       Calibration_organization,
       Features,
       Pressure_Sensor,
       Depth_Rating,
       Firmware_EPROM,
       Memory,
       Receive_frequency,
       Transmit_frequency,
       Enable_code,
       Release_code,
       Tilt_option,
       Purchased_for,
       Owner,
       Custodian,
       Date_new,
       PO,
       Transaction_col,
       Permanent_comment,
       infoUrlList,
       document_dir,
       PersonID_FK,
       DeviceTypeID_FK
      )
    VALUES
      (
       @mfgName,
       @mfgModel,
       @serial,
       @mfgSerialNumber,
       @calibration_organization,
       @features,
       @pressure_sensor,
       @depth_rating,
       @firmware_eprom,
       @memory,
       @receive_frequency,
       @transmit_frequency,
       @enable_code,
       @release_code,
       @tilt_option,
       @purchased_for,
       @owner,
       @custodian,
       @date_new,
       @po,
       @transaction_col,
       @permanent_comment,
       @infoUrlList,
       @document_dir,
       @person_id,
       @deviceType_id
      )
  END
END
GO{noformat}
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    UPDATE ssdsdba.Device 
      SET ssdsdba.Device.mfgName = @mfgName,
          ssdsdba.Device.mfgModel = @mfgModel,
          ssdsdba.Device.Serial = @serial,
          ssdsdba.Device.mfgSerialNumber = @mfgSerialNumber,
          ssdsdba.Device.Calibration_organization = @calibration_organization,
          ssdsdba.Device.Features = @features,
          ssdsdba.Device.Pressure_Sensor = @pressure_sensor,
          ssdsdba.Device.Depth_Rating = @depth_rating,
          ssdsdba.Device.Firmware_EPROM = @firmware_eprom,
          ssdsdba.Device.Memory = @memory,
          ssdsdba.Device.Receive_frequency = @receive_frequency,
          ssdsdba.Device.Transmit_frequency = @transmit_frequency,
          ssdsdba.Device.Enable_code = @enable_code,
          ssdsdba.Device.Release_code = @release_code,
          ssdsdba.Device.Tilt_option = @tilt_option,
          ssdsdba.Device.Purchased_for = @purchased_for,
          ssdsdba.Device.Owner = @owner,
          ssdsdba.Device.Custodian = @custodian,
          ssdsdba.Device.Date_new = @date_new,
          ssdsdba.Device.PO = @po,
          ssdsdba.Device.Transaction_col = @transaction_col,
          ssdsdba.Device.Permanent_comment = @permanent_comment,
          ssdsdba.Device.infoUrlList = @infoUrlList,
          ssdsdba.Device.document_dir = @document_dir,
          ssdsdba.Device.PersonID_FK = @person_id,
          ssdsdba.Device.DeviceTypeID_FK = @deviceType_id
      WHERE ssdsdba.Device.id = (Select [SSDS ID] from Inserted)
  END
END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
{noformat}
CREATE TRIGGER trInstruDelete ON instru
INSTEAD OF DELETE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Deleted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Deleted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Deleted

    -- Now let's make sure the SSDS_ID is not null
    IF @ssds_id IS NULL
      RAISERROR('The delete did not specify the SSDS_ID. No delete performed',9,1)

    -- Now delete the row specified
    DELETE FROM ssdsdba.Device 
      WHERE id = @ssds_id
  END
END
GO
{noformat}
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1020</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1016</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: acoustic system which produces (usually) short acoustic pulses, transmits them into the water column and then detects echoes from impedance discontinuities (e.g., fish, the bottom, or plankton) 
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
#* BPG devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Rename the field in SSDS to ShortSerial, but present it to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1019</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1015</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: acoustic system which produces (usually) short acoustic pulses, transmits them into the water column and then detects echoes from impedance discontinuities (e.g., fish, the bottom, or plankton) 
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
#* BPG devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete 1509 (test entry)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# 

Questions for Paul/research:
# SBE in front of Seabirds? 

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that.
# Do manual corrections as listed below


#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* all '(null)' to null
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Rename the field in SSDS to ShortSerial, but present it to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1018</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1014</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: acoustic system which produces (usually) short acoustic pulses, transmits them into the water column and then detects echoes from impedance discontinuities (e.g., fish, the bottom, or plankton) 
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
#* BPG devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Rename the field in SSDS to ShortSerial, but present it to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1017</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1013</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: acoustic system which produces (usually) short acoustic pulses, transmits them into the water column and then detects echoes from impedance discontinuities (e.g., fish, the bottom, or plankton) 
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
#* BPG devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Rename the field in SSDS to ShortSerial, but present it to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1016</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1012</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: acoustic system which produces (usually) short acoustic pulses, transmits them into the water column and then detects echoes from impedance discontinuities (e.g., fish, the bottom, or plankton) 
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
#* BPG devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1015</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1011</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

{anchor:Model}
{anchor:Serial}
{anchor:Name}
h3. BOG fields for Model and Serial Numbers

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* The serial number should be the most complete serial number as presented and formatted by the vendor --- as written on the invoice, written on the label, etc.  This will often include some model information.  (The short serial number in the Instru 'Serial' field is the last unique part of the full serial number. We will support that also but it will not be primary.
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Mannufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| FullSerial | A real mess | If SSDS has a full serial number, use it. If not, then if SSDS has FullSerial, use that. Lacking that, if only a (short) Serial is in BOG, use that instead.  |
| Serial | Shore serial numbers | Copy the BOG short Serial field into a similar field in SSDS.  |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

{anchor:Manufacturer}
h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded. (Go to website, how does company refer to itself?)  Abbreviations should be expanded except in extreme, well-known cases (e.g., MBARI, WHOI, HOBI Labs). 

Until we have a proper company table, we propose to update the company name to the current name whenever it's known to change.  (Better answer long term is to create Company Names and Company tables, so multiple names can reference the same company.  This can also support lookups of older names and other historical referencing.)

The following table was an initial cut at final names, and is now deprecated. (Kept only for reference.)  For the ultimate answers see the [final names list|MakingData#Manufacturer].

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

{anchor:Type}
h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Meteorology Package | Although "Metsys" is used as the common parlance for this package, it is not self-explanatory and is not trivial to derive from a Google search. |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  "Inductive Modem" isn't a used category (yet).|
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | New term? Replace Bioshutter in SSDS? |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

{anchor:Technician}
h3. BOG field Technician

This field is entirely filled with 'pc' in BOG, and appears to have the same function as the PersonID_FK field in SSDS.  (This is not the 'owner' or 'custodian' functions of BOG, but is just the person who knows about this instrument and its properties.)  Suggest replacing Paul Coenen as the PersonID_FK for any device in Instru.

----
h3. Deferred to phase 2:

| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1014</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1009</id>
<property name="body"><![CDATA[Here's a proposal for a single database which is a union of the existing SSDS and Instru databases.  It should be possible to use a simple d/b view to translate this table to either the existing SSDS or instru formats without too many machinations.  The goal is to minimize/eliminate redundancy by combining overlapping fields without drastically affecting the use of either of the existing apps (SSDS, Access app).

The steps to actually create the data in these fields are documented in [MakingData].

This should be considered a phase one proposal to cover most of the "low hanging fruit" and start the integration process.  Subsequent phases can further integrate the two databases while taking into consideration lessons learned from phase one.

A good example is the handling of people/roles.  The instru database has a number of separate fields for different roles: owner/purchaser, technician, calibrator, etc.  Each of these fields is just freetext, allowing for inclusion of multiple people for each role, also project names instead of peoples names.  The SSDS database recognizes a single person, which is a record of type Person.  Though it's not clear how this record was intended to be used, it does not map cleanly into the instru model.

Despite this data mismatch, it isn't strictly necessary to solve this conundrum for successful use of the integrated database.  Later phases may include revisions to either or both data models (for example use of an associative array between ISO roles and Person records in SSDS).

Given the ability to "alias" fields when creating a view, name changes or mismatches should not be considered particularly serious.

Pending:
* Calibration information?  This is a new addition and not really relevant to the "merge"
* should probably settle on a word formatting sheme (i.e. starts with lower case and capitalize to make subwords) -- given we can alias when making the view it matters quite a bit less

|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | UUID | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization |
| mfgModel | | Model | | mfgModel | Needs some normalization |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter representation - often the actual sequential portion w/o any sort of model identification which may be encoded. | mfgSerialNumber, ShortSerial \\ | Keep _mfgSerialNumber_ as the full-length serial number.&nbsp; Make it a mandatory field.&nbsp; Allow an optional _ShortSerial_ to hold a shortened serial number (how is this used in the Access app?) \\ |
| name | Typically something like manufacturer+model | | | name | \\ |
| deviceType | | Type | | deviceType | Needs some normalization |
| Description | A free text description, may&nbsp; contain some information redundant with _name_ \\ | | | Description | |
| infoUrlList | | manufacture web page | | infoUrlList | Neither database uses this field very heavily.  Best to merge into a single "place for a hyperlink" -- though should we be specific that this is to either the manufacturers' home page or to the product page.  Does it matter? |
| person | The contact person (link to the Person table) \\ | | | person | Need to figure out how (if) to map the multiple instru roles into SSDS |
| | | Purchased for | Sometimes a person, sometimes a project \\ | Purchased for|" |
| | | Owner | Typically some combination of person, group (OSG, etc) and project.&nbsp; Sometimes all three \\ | Owner | "|
| | | Custodian | One or more people \\ | Custodian | "|
| | | Technician | Currently always 'pc' (Paul Coenen) | Technician | "|
| resources | Not used currently (?).&nbsp; Could be used for storing calibration files? \\ | | | | |
| | | document dir | Not used currently \\ | | |
| version | | | | version | |
| | | Features | A free text description of features on the device \\ | Features | Simplest to just leave this in place for now? |
| | | Pressure sensor | Just freetext, left blank if irrelevant \\ | Pressure sensor \\ | " |
| | | Depth Rating | Just freetext, left blank if irrelevant | Depth Rating \\ | " |
| | | Firmware/EPROM | Just freetext, left blank if irrelevant | Firmware/EPROM | " |
| | | Memory | Just freetext, left blank if irrelevant | Memory | " |
| | | Receive Frequency | Just freetext, left blank if irrelevant | Receive Frequency \\ | " |
| | | Transmit Frequency | Just freetext, left blank if irrelevant | Transmit Frequency \\ | " |
| | | Enable Code | Just freetext, left blank if irrelevant | Enable Code \\ | " |
| | | Release Code | Just freetext, left blank if irrelevant | Release Code \\ | " |
| | | Tilt option | Just freetext, left blank if irrelevant, though heavier use of "N/A" than in other fields \\ | Tilt option \\ | " |
| | | Date new | Used infrequently \\ | Date new \\ | " \\ |
| | | Calibration organization | Typically a company, but sometimes a company and a person \\ | Calibration organization \\ | In the long run we might normalize this against the msgNames \\ |
| | | PO | | PO | " |
| | | Permanent comment | Not entirely sure what this field is used for.  I think it's meant to be some permanent and overarching state of the system, not just the latest "transaction" | ?? | Keep it?  Or discard? |
| | | MBARI_ID | Auto-incrementing key field | _(discard)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Transaction | I believe this field isn't used in instru | _(discard)_ \\ | |
| | | | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1012</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1010</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

{anchor:Model}
{anchor:Serial}
{anchor:Name}
h3. BOG fields for Model and Serial Numbers

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* Serial number should be the most complete as presented and formatted by the manufacturer. There's sure to be a lot of hand-alignment.
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Mannufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so. |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

{anchor:Manufacturer}
h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded. (Go to website, how does company refer to itself?)  Abbreviations should be expanded except in extreme, well-known cases (e.g., MBARI, WHOI, HOBI Labs). 

Until we have a proper company table, we propose to update the company name to the current name whenever it's known to change.  (Better answer long term is to create Company Names and Company tables, so multiple names can reference the same company.  This can also support lookups of older names and other historical referencing.)

The following table was an initial cut at final names, and is now deprecated. (Kept only for reference.)  For the ultimate answers see the [final names list|MakingData#Manufacturer].

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

{anchor:Type}
h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Meteorology Package | Although "Metsys" is used as the common parlance for this package, it is not self-explanatory and is not trivial to derive from a Google search. |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  "Inductive Modem" isn't a used category (yet).|
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | New term? Replace Bioshutter in SSDS? |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

{anchor:Technician}
h3. BOG field Technician

This field is entirely filled with 'pc' in BOG, and appears to have the same function as the PersonID_FK field in SSDS.  (This is not the 'owner' or 'custodian' functions of BOG, but is just the person who knows about this instrument and its properties.)  Suggest replacing Paul Coenen as the PersonID_FK for any device in Instru.

----
h3. Deferred to phase 2:

| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1013</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1007</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* ADCP                            
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: acoustic system which produces (usually) short acoustic pulses, transmits them into the water column and then detects echoes from impedance discontinuities (e.g., fish, the bottom, or plankton) 
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1010</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1008</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: acoustic system which produces (usually) short acoustic pulses, transmits them into the water column and then detects echoes from impedance discontinuities (e.g., fish, the bottom, or plankton) 
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
#* BPG devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1011</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1005</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device LEFT OUTER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id LEFT OUTER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# Create an INSTEAD OF INSERT trigger on the view
{noformat}
CREATE TRIGGER trInstruInsert ON instru
INSTEAD OF INSERT
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Now let's make sure the MBARI_ID and SSDS_ID are null
    IF @mbari_id IS NOT NULL
      RAISERROR('The insert specified the MBARI_ID. This field is auto-generated, do not specify on insert',9,1)
    IF @ssds_id IS NOT NULL
      RAISERROR('The insert specified the SSDS_ID. This field is auto-generated, do not specify on insert',9,1)

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    INSERT INTO ssdsdba.Device 
      (
       mfgName,
       mfgModel,
       Serial,
       mfgSerialNumber,
       Calibration_organization,
       Features,
       Pressure_Sensor,
       Depth_Rating,
       Firmware_EPROM,
       Memory,
       Receive_frequency,
       Transmit_frequency,
       Enable_code,
       Release_code,
       Tilt_option,
       Purchased_for,
       Owner,
       Custodian,
       Date_new,
       PO,
       Transaction_col,
       Permanent_comment,
       infoUrlList,
       document_dir,
       PersonID_FK,
       DeviceTypeID_FK
      )
    VALUES
      (
       @mfgName,
       @mfgModel,
       @serial,
       @mfgSerialNumber,
       @calibration_organization,
       @features,
       @pressure_sensor,
       @depth_rating,
       @firmware_eprom,
       @memory,
       @receive_frequency,
       @transmit_frequency,
       @enable_code,
       @release_code,
       @tilt_option,
       @purchased_for,
       @owner,
       @custodian,
       @date_new,
       @po,
       @transaction_col,
       @permanent_comment,
       @infoUrlList,
       @document_dir,
       @person_id,
       @deviceType_id
      )
  END
END
GO{noformat}
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    UPDATE ssdsdba.Device 
      SET ssdsdba.Device.mfgName = @mfgName,
          ssdsdba.Device.mfgModel = @mfgModel,
          ssdsdba.Device.Serial = @serial,
          ssdsdba.Device.mfgSerialNumber = @mfgSerialNumber,
          ssdsdba.Device.Calibration_organization = @calibration_organization,
          ssdsdba.Device.Features = @features,
          ssdsdba.Device.Pressure_Sensor = @pressure_sensor,
          ssdsdba.Device.Depth_Rating = @depth_rating,
          ssdsdba.Device.Firmware_EPROM = @firmware_eprom,
          ssdsdba.Device.Memory = @memory,
          ssdsdba.Device.Receive_frequency = @receive_frequency,
          ssdsdba.Device.Transmit_frequency = @transmit_frequency,
          ssdsdba.Device.Enable_code = @enable_code,
          ssdsdba.Device.Release_code = @release_code,
          ssdsdba.Device.Tilt_option = @tilt_option,
          ssdsdba.Device.Purchased_for = @purchased_for,
          ssdsdba.Device.Owner = @owner,
          ssdsdba.Device.Custodian = @custodian,
          ssdsdba.Device.Date_new = @date_new,
          ssdsdba.Device.PO = @po,
          ssdsdba.Device.Transaction_col = @transaction_col,
          ssdsdba.Device.Permanent_comment = @permanent_comment,
          ssdsdba.Device.infoUrlList = @infoUrlList,
          ssdsdba.Device.document_dir = @document_dir,
          ssdsdba.Device.PersonID_FK = @person_id,
          ssdsdba.Device.DeviceTypeID_FK = @deviceType_id
      WHERE ssdsdba.Device.id = (Select [SSDS ID] from Inserted)
  END
END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1008</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1006</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device LEFT OUTER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id LEFT OUTER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# The history tables store the updated values for entries as the thought is that each entry would have to be inserted before any updates so you would always have the initial state of the row.  In this case we are starting with existing data, so it is critical that we get a baseline of all the current rows.  This can be done simply by running these in SQL Query Analyzer:
{noformat}
UPDATE ssdsdba.Device SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.Person SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.DeviceType SET version = version
GO
{noformat}
This will create entries for all the rows so that we will have the current data in the history table to compare future updates/deletions against.
# Create an INSTEAD OF INSERT trigger on the view
{noformat}
CREATE TRIGGER trInstruInsert ON instru
INSTEAD OF INSERT
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Now let's make sure the MBARI_ID and SSDS_ID are null
    IF @mbari_id IS NOT NULL
      RAISERROR('The insert specified the MBARI_ID. This field is auto-generated, do not specify on insert',9,1)
    IF @ssds_id IS NOT NULL
      RAISERROR('The insert specified the SSDS_ID. This field is auto-generated, do not specify on insert',9,1)

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    INSERT INTO ssdsdba.Device 
      (
       mfgName,
       mfgModel,
       Serial,
       mfgSerialNumber,
       Calibration_organization,
       Features,
       Pressure_Sensor,
       Depth_Rating,
       Firmware_EPROM,
       Memory,
       Receive_frequency,
       Transmit_frequency,
       Enable_code,
       Release_code,
       Tilt_option,
       Purchased_for,
       Owner,
       Custodian,
       Date_new,
       PO,
       Transaction_col,
       Permanent_comment,
       infoUrlList,
       document_dir,
       PersonID_FK,
       DeviceTypeID_FK
      )
    VALUES
      (
       @mfgName,
       @mfgModel,
       @serial,
       @mfgSerialNumber,
       @calibration_organization,
       @features,
       @pressure_sensor,
       @depth_rating,
       @firmware_eprom,
       @memory,
       @receive_frequency,
       @transmit_frequency,
       @enable_code,
       @release_code,
       @tilt_option,
       @purchased_for,
       @owner,
       @custodian,
       @date_new,
       @po,
       @transaction_col,
       @permanent_comment,
       @infoUrlList,
       @document_dir,
       @person_id,
       @deviceType_id
      )
  END
END
GO{noformat}
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    UPDATE ssdsdba.Device 
      SET ssdsdba.Device.mfgName = @mfgName,
          ssdsdba.Device.mfgModel = @mfgModel,
          ssdsdba.Device.Serial = @serial,
          ssdsdba.Device.mfgSerialNumber = @mfgSerialNumber,
          ssdsdba.Device.Calibration_organization = @calibration_organization,
          ssdsdba.Device.Features = @features,
          ssdsdba.Device.Pressure_Sensor = @pressure_sensor,
          ssdsdba.Device.Depth_Rating = @depth_rating,
          ssdsdba.Device.Firmware_EPROM = @firmware_eprom,
          ssdsdba.Device.Memory = @memory,
          ssdsdba.Device.Receive_frequency = @receive_frequency,
          ssdsdba.Device.Transmit_frequency = @transmit_frequency,
          ssdsdba.Device.Enable_code = @enable_code,
          ssdsdba.Device.Release_code = @release_code,
          ssdsdba.Device.Tilt_option = @tilt_option,
          ssdsdba.Device.Purchased_for = @purchased_for,
          ssdsdba.Device.Owner = @owner,
          ssdsdba.Device.Custodian = @custodian,
          ssdsdba.Device.Date_new = @date_new,
          ssdsdba.Device.PO = @po,
          ssdsdba.Device.Transaction_col = @transaction_col,
          ssdsdba.Device.Permanent_comment = @permanent_comment,
          ssdsdba.Device.infoUrlList = @infoUrlList,
          ssdsdba.Device.document_dir = @document_dir,
          ssdsdba.Device.PersonID_FK = @person_id,
          ssdsdba.Device.DeviceTypeID_FK = @deviceType_id
      WHERE ssdsdba.Device.id = (Select [SSDS ID] from Inserted)
  END
END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1009</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1004</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device LEFT OUTER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id LEFT OUTER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# Create an INSTEAD OF INSERT trigger on the view
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    UPDATE ssdsdba.Device 
      SET ssdsdba.Device.mfgName = @mfgName,
          ssdsdba.Device.mfgModel = @mfgModel,
          ssdsdba.Device.Serial = @serial,
          ssdsdba.Device.mfgSerialNumber = @mfgSerialNumber,
          ssdsdba.Device.Calibration_organization = @calibration_organization,
          ssdsdba.Device.Features = @features,
          ssdsdba.Device.Pressure_Sensor = @pressure_sensor,
          ssdsdba.Device.Depth_Rating = @depth_rating,
          ssdsdba.Device.Firmware_EPROM = @firmware_eprom,
          ssdsdba.Device.Memory = @memory,
          ssdsdba.Device.Receive_frequency = @receive_frequency,
          ssdsdba.Device.Transmit_frequency = @transmit_frequency,
          ssdsdba.Device.Enable_code = @enable_code,
          ssdsdba.Device.Release_code = @release_code,
          ssdsdba.Device.Tilt_option = @tilt_option,
          ssdsdba.Device.Purchased_for = @purchased_for,
          ssdsdba.Device.Owner = @owner,
          ssdsdba.Device.Custodian = @custodian,
          ssdsdba.Device.Date_new = @date_new,
          ssdsdba.Device.PO = @po,
          ssdsdba.Device.Transaction_col = @transaction_col,
          ssdsdba.Device.Permanent_comment = @permanent_comment,
          ssdsdba.Device.infoUrlList = @infoUrlList,
          ssdsdba.Device.document_dir = @document_dir,
          ssdsdba.Device.PersonID_FK = @person_id,
          ssdsdba.Device.DeviceTypeID_FK = @deviceType_id
      WHERE ssdsdba.Device.id = (Select [SSDS ID] from Inserted)
  END
END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1007</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">999</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id INNER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# Create an INSTEAD OF INSERT trigger on the view
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN

  -- Check to see if there are updated rows
  IF (SELECT COUNT(*) FROM Inserted) > 0
  BEGIN
    UPDATE Device
      SET mfgName = i.Manufacturer,
          mfgModel = i.Model,
          Serial = i.Serial,
          mfgSerialNumber = i.FullSerial,
          Calibration_organization = i.[Calibration organization],
          Features = i.Features,
          Pressure_sensor = i.[Pressure sensor]
      WHERE
	id = i.[SSDS ID]
  END

END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1002</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1000</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device LEFT OUTER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id LEFT OUTER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# Create an INSTEAD OF INSERT trigger on the view
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN

  -- Check to see if there are updated rows
  IF (SELECT COUNT(*) FROM Inserted) > 0
  BEGIN
    UPDATE Device
      SET mfgName = i.Manufacturer,
          mfgModel = i.Model,
          Serial = i.Serial,
          mfgSerialNumber = i.FullSerial,
          Calibration_organization = i.[Calibration organization],
          Features = i.Features,
          Pressure_sensor = i.[Pressure sensor]
      WHERE
	id = i.[SSDS ID]
  END

END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1003</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">997</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

{anchor:Model}
{anchor:Serial}
{anchor:Name}
h3. BOG fields for Model and Serial Numbers

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* Serial number should be the most complete as presented and formatted by the manufacturer. There's sure to be a lot of hand-alignment.
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Mannufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so. |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

{anchor:Manufacturer}
h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded. (Go to website, how does company refer to itself?)  Abbreviations should be expanded except in extreme, well-known cases (e.g., MBARI, WHOI, HOBI Labs). 

Until we have a proper company table, we propose to update the company name to the current name whenever it's known to change.  (Better answer long term is to create Company Names and Company tables, so multiple names can reference the same company.  This can also support lookups of older names and other historical referencing.)

The following table was an initial cut at final names, and is now deprecated. (Kept only for reference.)  For the ultimate answers see the [final names list|MakingData#Manufacturer].

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

{anchor:Type}
h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Meteorology Package | Although "Metsys" is used as the common parlance for this package, it is not self-explanatory and is not trivial to derive from a Google search. |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  "Inductive Modem" isn't a used category (yet).|
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

{anchor:Technician}
h3. BOG field Technician

This field is entirely filled with 'pc' in BOG, and appears to have the same function as the PersonID_FK field in SSDS.  (This is not the 'owner' or 'custodian' functions of BOG, but is just the person who knows about this instrument and its properties.)  Suggest replacing Paul Coenen as the PersonID_FK for any device in Instru.

----
h3. Deferred to phase 2:

| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1000</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">998</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* ADCP                            
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter *(new*)
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not biologically active? Can we call them all bioshutters? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: acoustic system which produces (usually) short acoustic pulses, transmits them into the water column and then detects echoes from impedance discontinuities (e.g., fish, the bottom, or plankton) 
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Shutter: movable cover or screen that alternately prevents and permits the passage of desirable and undesirable elements; typically opens for measurements, and closes to prevent biofouling
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assume Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'


[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1001</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">995</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* ADCP                            
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new*)
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter *(new*)
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish                         
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer
* Battery
* Echo Sounder
* Inductive Modem Cable Coupler
* Power Supply-Electric
* Pump
* Release
* Shutter

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assume Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'

[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">998</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">996</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* ADCP                            
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter *(new*)
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: acoustic system which produces (usually) short acoustic pulses, transmits them into the water column and then detects echoes from impedance discontinuities (e.g., fish, the bottom, or plankton) 
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Shutter: movable cover or screen that alternately prevents and permits the passage of desirable and undesirable elements; typically opens for measurements, and closes to prevent biofouling
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assume Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'


[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">999</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">992</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* ADCP                            
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new*)
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter *(new*)
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish                         
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Nitrate analyzer' to 'Nitrogen Sensor-ISUS' (this is Satlantic unit)
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer
* Battery
* Echo Sounder
* Power Supply-Electric
* Pump
* Release
* Shutter

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assume Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor-ISUS' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'

[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">995</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">991</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* ADCP                            
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer               
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new*)
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter *(new*)
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish                         
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Nitrate analyzer' to 'Nitrogen Sensor-ISUS' (this is Satlantic unit)
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category

Add the types marked *(new)* above to the DeviceType table.
* Battery
* Echo Sounder
* Power Supply-Electric
* Pump
* Release
* Shutter

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assume Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor-ISUS' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'

[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">994</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">994</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* ADCP                            
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* CommDevice                      
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder *(new*)
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer-Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter *(new*)
* Shutter-Antifouling             
* Sound Speed Sensor 
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish                         
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer
* Battery
* Echo Sounder
* Power Supply-Electric
* Pump
* Release
* Shutter

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assume Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# 'ADCP' to 'Current Sensors-ADCP'
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'

[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">997</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">993</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

{anchor:Model}
{anchor:Serial}
{anchor:Name}
h3. BOG fields for Model and Serial Numbers

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* Serial number should be the most complete as presented and formatted by the manufacturer. There's sure to be a lot of hand-alignment.
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Mannufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so. |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

{anchor:Manufacturer}
h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded. (Go to website, how does company refer to itself?)  Abbreviations should be expanded except in extreme, well-known cases (e.g., MBARI, WHOI, HOBI Labs). 

Until we have a proper company table, we propose to update the company name to the current name whenever it's known to change.  (Better answer long term is to create Company Names and Company tables, so multiple names can reference the same company.  This can also support lookups of older names and other historical referencing.)

The following table was an initial cut at final names, and is now deprecated. (Kept only for reference.)  For the ultimate answers see the [final names list|MakingData#Manufacturer].

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

{anchor:Type}
h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

{anchor:Technici
h3. BOG field Technician

This field is entirely filled with 'pc' in BOG, and appears to have the same function as the PersonID_FK field in SSDS.  (This is not the 'owner' or 'custodian' functions of BOG, but is just the person who knows about this instrument and its properties.)  Suggest replacing Paul Coenen as the PersonID_FK for any device in Instru.

----
h3. Deferred to phase 2:

| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">996</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">987</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id INNER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# Create an INSTEAD OF INSERT trigger on the view
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN

  -- Check to see if there are updated rows
  IF (SELECT COUNT(*) FROM Updated) > 0
  BEGIN
    UPDATE Device
      SET mfgName = i.Manufacturer,
          mfgModel = i.Model,
          Serial = i.Serial,
          mfgSerialNumber = i.FullSerial,
          Calibration_organization = i.[Calibration organization],
          Features = i.Features,
          Pressure_sensor = i.[Pressure sensor]
      WHERE
	id = i.[SSDS ID]
  END

END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">990</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">990</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">993</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">983</id>
<property name="body"><![CDATA[I'll use the term "OSG-owned" to indicate the device Paul cares about.  We haven't exactly figured out how this will be delimited in the database, but I assume we'll be able to SELECT those lines as part of the SQL query.

----
h2. Summary

* Remove all references to MBARI_ID (auto-increment key used in instru table) and replace with SSDS_ID (?) (some sort of key from the merged table).  Note: Access assumes a relatively short MBARI_ID (4 digits), not the full SSDS UUID.
{note:title=Are we sure about this?}
I am not sure we need to necessarily get rid of the MBARI_ID.  Yes, we would have two auto-incrementing fields, but that may not be all that big of a deal and the Access application expects an MBARI_ID and that would minimize our code changes to the Access app.
{note}
{warning:Title=SSDS ID Editable}
We need to make it so that the SSDS_ID is not editable in the Access application
{warning}
* Several panes in the Access app use a series of drop-downs (Manufacturer, Model, Serial Number, Type, etc) to select one-or-more devices.  Whenever possible, an "OSG-owned" checkbox could be added to limit/unlimit the search.
{info:title=Done through view}
In theory, this should be accomplished by presenting a DB view that is keyed on the OSG view flag in the database.
{info}
* There are a few panels which display all of the fields of the instru database, and a few which also allow editing of those fields.  These need a clear and concise way of indicating and editing the "OSG-ownership"
{info:title=Also done through view}
In theory, this should be accomplished by presenting a DB view that is keyed on the OSG view flag in the database.
{info}
Overall impact to the Access app would be surprisingly light. The only truly obstrusive change would be to the "Instrumentation Data Entry" pane which is primarily for new instrument entry.  At present it's just a flat pane with fields for data entry (some drop-downs to normalize answers), but we're proposing changing it to a two-step process where some key information is entered, then checked for an existing records, before proceeding.

There will also be the introduction of a number of checkboxes which select if a particular search should be limited OSG-owned devices (the default) or expanded to the full SSDS database.
{note:title=I think we can ignore this}
I think we can safely ignore this and just assume that OSG will only want to search/work on entries that have the OSG flag enabled and we will just use the view for that.  If they want to expose the device through to the OSG app, they will have to use another interface to flip the bit to make it visible.
{note}
There's likely to be more impacts in changes to the meaning and function of some of the database fields.

There are also some loose ends in data normalization and field mapping (i.e. ensuring the FullSerial is always filled out, even if the user has only entered a Serial).  That sort of data verification and manipulation could be encoded in Access or pushed off to the SQL server as a trigger/job.

----
h2. More detail

From the front index page, there are nine sub-pages:

h3. Transactions Data Entry

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* I'm a little confused by the usage of this pane -- it's a combination of some instrumentation entries and the transaction entries.

h3. Instruments Data Entry

* Replace MBARI_ID with SSDS_ID.
* Add a way to indicate "OSG-owned"
* Need to put in an explicit step where the first few key fields are filled out and the database is check for duplicates before filling out the remaining fields.  This function should probably ignore the "OSG-owned" field.   This window may expand to include both the add and edit functions.

h3. Current Info

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Transaction History

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Find Location of Calibration

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID (takes information from trans table?)

h3. Query by Location

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID on list.
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"  (may be same detail window used in "Find Model")

h3. Find Model

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections.
* Replace MBARI_ID with SSDS_ID on list
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"

h3. Deployment Update

(this feature may not be functional or as functional as Paul would like.)
* At checkbox to filter list on "OSG-owned" -- affects list of instruments
* Change MBARI_ID to SSDS_ID (?)

h3. Edit Instruments and Transactions Table

* Add checkbox in top pane to filter out OSG-owned devices -- affects drop-down selections.
* Add entry box in lower pane to toggle "OSG-owned"
* Remove references to MBARI_ID in text boxes and transaction table.  Replace with SSDS ID.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">986</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">986</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id INNER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# Create an INSTEAD OF UPDATE trigger on the view
# Create an INSTEAD OF INSERT trigger on the view
# Create an INSTEAD OF DELETE trigger on the view
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">989</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">985</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id INNER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  I am thinking we will have to relegate all those controls to drop-downs in the Access applications and have pages where DeviceTypes and Persons can be added/edited/deleted.
{warning}
# Persoin Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">988</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">980</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id INNER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">983</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">979</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer
Manufacturer

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">982</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">982</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id INNER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">985</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">981</id>
<property name="body"><![CDATA[I'll use the term "OSG-owned" to indicate the device Paul cares about.  We haven't exactly figured out how this will be delimited in the database, but I assume we'll be able to SELECT those lines as part of the SQL query.

----
h2. Summary

* Remove all references to MBARI_ID (auto-increment key used in instru table) and replace with SSDS_ID (?) (some sort of key from the merged table).  Note: Access assumes a relatively short MBARI_ID (4 digits), not the full SSDS UUID.
{note:title=Are we sure about this?}
I am not sure we need to necessarily get rid of the MBARI_ID.  Yes, we would have two auto-incrementing fields, but that may not be all that big of a deal and the Access application expects an MBARI_ID and that would minimize our code changes to the Access app.
{note}
* Several panes in the Access app use a series of drop-downs (Manufacturer, Model, Serial Number, Type, etc) to select one-or-more devices.  Whenever possible, an "OSG-owned" checkbox could be added to limit/unlimit the search.
{info:title=Done through view}
In theory, this should be accomplished by presenting a DB view that is keyed on the OSG view flag in the database.
{info}
* There are a few panels which display all of the fields of the instru database, and a few which also allow editing of those fields.  These need a clear and concise way of indicating and editing the "OSG-ownership"
{info:title=Also done through view}
In theory, this should be accomplished by presenting a DB view that is keyed on the OSG view flag in the database.
{info}
Overall impact to the Access app would be surprisingly light. The only truly obstrusive change would be to the "Instrumentation Data Entry" pane which is primarily for new instrument entry.  At present it's just a flat pane with fields for data entry (some drop-downs to normalize answers), but we're proposing changing it to a two-step process where some key information is entered, then checked for an existing records, before proceeding.

There will also be the introduction of a number of checkboxes which select if a particular search should be limited OSG-owned devices (the default) or expanded to the full SSDS database.
{note:title=I think we can ignore this}
I think we can safely ignore this and just assume that OSG will only want to search/work on entries that have the OSG flag enabled and we will just use the view for that.  If they want to expose the device through to the OSG app, they will have to use another interface to flip the bit to make it visible.
{note}
There's likely to be more impacts in changes to the meaning and function of some of the database fields.

There are also some loose ends in data normalization and field mapping (i.e. ensuring the FullSerial is always filled out, even if the user has only entered a Serial).  That sort of data verification and manipulation could be encoded in Access or pushed off to the SQL server as a trigger/job.

----
h2. More detail

From the front index page, there are nine sub-pages:

h3. Transactions Data Entry

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* I'm a little confused by the usage of this pane -- it's a combination of some instrumentation entries and the transaction entries.

h3. Instruments Data Entry

* Replace MBARI_ID with SSDS_ID.
* Add a way to indicate "OSG-owned"
* Need to put in an explicit step where the first few key fields are filled out and the database is check for duplicates before filling out the remaining fields.  This function should probably ignore the "OSG-owned" field.   This window may expand to include both the add and edit functions.

h3. Current Info

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Transaction History

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Find Location of Calibration

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID (takes information from trans table?)

h3. Query by Location

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID on list.
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"  (may be same detail window used in "Find Model")

h3. Find Model

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections.
* Replace MBARI_ID with SSDS_ID on list
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"

h3. Deployment Update

(this feature may not be functional or as functional as Paul would like.)
* At checkbox to filter list on "OSG-owned" -- affects list of instruments
* Change MBARI_ID to SSDS_ID (?)

h3. Edit Instruments and Transactions Table

* Add checkbox in top pane to filter out OSG-owned devices -- affects drop-down selections.
* Add entry box in lower pane to toggle "OSG-owned"
* Remove references to MBARI_ID in text boxes and transaction table.  Replace with SSDS ID.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">984</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">975</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer
Manufacturer

The list of permitted manufacturers is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be (still in progress):
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
# Perform manual corrections listed below.

The following entries require manual correction:
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# Triaxys -> AXYS Technologies, Inc.
# UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# Benthos -> Teledyne Benthos (buyout))
# Biospherical -> Biospherical Instruments (full name)
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# RD Instruments -> Teledyne RD Instruments (buyout)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">978</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">976</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

h3. BOG fields for Model and Serial Numbers

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* Serial number should be the most complete as presented and formatted by the manufacturer. There's sure to be a lot of hand-alignment.
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Mannufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so. |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded.  I.e. go to website, how does company refer to itself?  Abbreviations should be expanded.

Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field Technician

This field is entirely filled with 'pc' in BOG, and appears to have the same function as the PersonID_FK field in SSDS.  (This is not the 'owner' or 'custodian' functions of BOG, but is just the person who knows about this instrument and its properties.)  Suggest replacing Paul Coenen as the PersonID_FK for any device in Instru.

----
h3. Deferred to phase 2:

| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">979</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">977</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer
Manufacturer

The list of permitted manufacturers is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">980</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">978</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

h3. BOG fields for Model and Serial Numbers

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* Serial number should be the most complete as presented and formatted by the manufacturer. There's sure to be a lot of hand-alignment.
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Mannufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so. |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded. (Go to website, how does company refer to itself?)  Abbreviations should be expanded except in extreme, well-known cases (e.g., MBARI, WHOI, HOBI Labs). 

Until we have a proper company table, we propose to update the company name to the current name whenever it's known to change.  (Better answer long term is to create Company Names and Company tables, so multiple names can reference the same company.  This can also support lookups of older names and other historical referencing.)

The following table was an initial cut at final names, and is now deprecated. (Kept only for reference.)  For the ultimate answers see the [final names list|MakingData#Manufacturer].

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. BOG field Technician

This field is entirely filled with 'pc' in BOG, and appears to have the same function as the PersonID_FK field in SSDS.  (This is not the 'owner' or 'custodian' functions of BOG, but is just the person who knows about this instrument and its properties.)  Suggest replacing Paul Coenen as the PersonID_FK for any device in Instru.

----
h3. Deferred to phase 2:

| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">981</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">971</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (50)
## Create column \[Permanent_comment\] \[nvarchar\] (2048)
## Create column \[document_dir\] \[nvarchar\] (50)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id INNER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">974</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">972</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (50)
## Create column \[Permanent_comment\] \[nvarchar\] (2048)
## Create column \[document_dir\] \[nvarchar\] (50)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id INNER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">975</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">974</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer
Manufacturer

The list of permitted manufacturers is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech
* Simrad
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* Triaxys
* UC Santa Barbara
* WET Labs
* WHOI
* Xantrex

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be (still in progress):
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
# Perform manual corrections listed below.

The following entries require manual correction:
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# ASIMET -> WHOI (model not company)
# Asimet/WHOI -> WHOI (model not company)

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# Benthos -> Teledyne Benthos (buyout))
# Biospherical -> Biospherical Instruments (full name)
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# RD Instruments -> Teledyne RD Instruments (buyout)
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">977</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">967</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
{anchor:Manufacturer}
h3. Manufacturer
Manufacturer

The list of permitted manufacturers is:
* Aanderaa Data Instruments 
* Ashtech
* Axys Environmental Systems
* Benthos
* Biospherical
* Bluefin Robotics
* Brook Ocean Technology Ltd.
* Crossbow Technologies
* Garmin
* HOBI Labs
* MBARI
* McLane Research Laboratories
* Nobska
* OrbComm
* Paroscientific
* Quake
* RD Instruments
* Satlantic
* Sea-Bird Electronics
* SeaTech
* Simrad
* Star Engineering
* Triaxys
* UC Santa Barbara
* WET Labs
* WHOI
* Xantrex

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be (still in progress):
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the name in SSDS or Instru is contained in or largely matches one of the ones above, use the name is largely matches or is contained in.
# If the name is ASIMET or Asimet/WHOI, ...
# The following entries require manual correction:
## 1445, 1524 -- may not match, change to Aanderaa Instruments
 
 
[Back to table...|#table]
{anchor:Type}
h3. Type
 
[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">970</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">968</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (2048)
## Create column \[Permanent_comment\] \[nvarchar\] (2048)
## Create column \[document_dir\] \[nvarchar\] (2048)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">971</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">969</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (50)
## Create column \[Permanent_comment\] \[nvarchar\] (2048)
## Create column \[document_dir\] \[nvarchar\] (50)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">972</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">970</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer
Manufacturer

The list of permitted manufacturers is:
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI
* McLane Research Laboratories
* Nobska
* OrbComm
* Paroscientific
* Quake
* RD Instruments
* Satlantic
* Sea-Bird Electronics
* SeaTech
* Simrad
* Star Engineering
* Teledyne Benthos (was Benthos)
* Triaxys
* UC Santa Barbara
* WET Labs
* WHOI
* Xantrex

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be (still in progress):
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the name in SSDS or Instru is contained in or largely matches (beginning of first word is contained in) one of the ones above, use the name it largely matches or is contained in.
# If the name is ASIMET or Asimet/WHOI, ...
# The following entries require manual correction:
## Anderraa Instruments -> Aanderaa Instruments (typo fix)
## Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
## ASIMET -> WHOI (model not company)
## Asimet/WHOI -> WHOI (model not company)

These entries shld be addressed by the 'contained in' rule above.
## Axys Environmental Systems -> Axys Technologies (name change?)
## Benthos -> Teledyne Benthos (name change?)
## Biospherical -> Biospherical Instruments (full name)
## Brook Ocean Technology Ltd. -> Brooke Ocean Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
[Back to table...|#table]
{anchor:Model}
h3. Model
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial
 
[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization
 
[Back to table...|#table]
{anchor:Features}
h3. Features
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">973</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">963</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted:

||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]||
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:Technician}
h3. Technician
 
{anchor:Manufacturer}
h3. Manufacturer
 
{anchor:Type}
h3. Type
 
{anchor:Model}
h3. Model
 
{anchor:Serial}
h3. Serial
 
{anchor:FullSerial}
h3. FullSerial
 
{anchor:Calibration-organization}
h3. Calibration organization
 
{anchor:Features}
h3. Features
 
{anchor:Pressure-sensor}
h3. Pressure sensor
 
{anchor:Depth-Rating}
h3. Depth Rating
 
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
{anchor:Memory}
h3. Memory
 
{anchor:Receive-frequency}
h3. Receive frequency
 
{anchor:Transmit-frequency}
h3. Transmit frequency
 
{anchor:Enable-code}
h3. Enable code
 
{anchor:Release-code}
h3. Release code
 
{anchor:Tilt-option}
h3. Tilt option
 
{anchor:Purchased-for}
h3. Purchased for
 
{anchor:Owner}
h3. Owner
 
{anchor:Custodian}
h3. Custodian
 
{anchor:Date-new}
h3. Date new
 
{anchor:PO}
h3. PO
 
{anchor:Transaction}
h3. Transaction
 
{anchor:Permanent-comment}
h3. Permanent comment
 
{anchor:manufacture-web-page}
h3. manufacture web page
 
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">966</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">964</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted:

||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]||
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
{anchor:Manufacturer}
h3. Manufacturer
 
{anchor:Type}
h3. Type
 
{anchor:Model}
h3. Model
 
{anchor:Serial}
h3. Serial
 
{anchor:FullSerial}
h3. FullSerial
 
{anchor:Calibration-organization}
h3. Calibration organization
 
{anchor:Features}
h3. Features
 
{anchor:Pressure-sensor}
h3. Pressure sensor
 
{anchor:Depth-Rating}
h3. Depth Rating
 
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
{anchor:Memory}
h3. Memory
 
{anchor:Receive-frequency}
h3. Receive frequency
 
{anchor:Transmit-frequency}
h3. Transmit frequency
 
{anchor:Enable-code}
h3. Enable code
 
{anchor:Release-code}
h3. Release code
 
{anchor:Tilt-option}
h3. Tilt option
 
{anchor:Purchased-for}
h3. Purchased for
 
{anchor:Owner}
h3. Owner
 
{anchor:Custodian}
h3. Custodian
 
{anchor:Date-new}
h3. Date new
 
{anchor:PO}
h3. PO
 
{anchor:Transaction}
h3. Transaction
 
{anchor:Permanent-comment}
h3. Permanent comment
 
{anchor:manufacture-web-page}
h3. manufacture web page
 
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">967</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">965</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):

||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
{anchor:Manufacturer}
h3. Manufacturer
 
{anchor:Type}
h3. Type
 
{anchor:Model}
h3. Model
 
{anchor:Serial}
h3. Serial
 
{anchor:FullSerial}
h3. FullSerial
 
{anchor:Calibration-organization}
h3. Calibration organization
 
{anchor:Features}
h3. Features
 
{anchor:Pressure-sensor}
h3. Pressure sensor
 
{anchor:Depth-Rating}
h3. Depth Rating
 
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
{anchor:Memory}
h3. Memory
 
{anchor:Receive-frequency}
h3. Receive frequency
 
{anchor:Transmit-frequency}
h3. Transmit frequency
 
{anchor:Enable-code}
h3. Enable code
 
{anchor:Release-code}
h3. Release code
 
{anchor:Tilt-option}
h3. Tilt option
 
{anchor:Purchased-for}
h3. Purchased for
 
{anchor:Owner}
h3. Owner
 
{anchor:Custodian}
h3. Custodian
 
{anchor:Date-new}
h3. Date new
 
{anchor:PO}
h3. PO
 
{anchor:Transaction}
h3. Transaction
 
{anchor:Permanent-comment}
h3. Permanent comment
 
{anchor:manufacture-web-page}
h3. manufacture web page
 
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">968</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">966</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[ntext\]
## Create column \[Permanent_comment\] \[ntext\]
## Create column \[document_dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">969</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">958</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted:

||Instru View||SSDS Field if diff||
|[MBARI ID|MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]||
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
h3. MBARI_ID
 
{anchor:SSDS-ID}
h3. SSDS ID
 
{anchor:Technician}
h3. Technician
 
{anchor:Manufacturer}
h3. Manufacturer
 
{anchor:Type}
h3. Type
 
{anchor:Model}
h3. Model
 
{anchor:Serial}
h3. Serial
 
{anchor:FullSerial}
h3. FullSerial
 
{anchor:Calibration-organization}
h3. Calibration organization
 
{anchor:Features}
h3. Features
 
{anchor:Pressure-sensor}
h3. Pressure sensor
 
{anchor:Depth-Rating}
h3. Depth Rating
 
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
{anchor:Memory}
h3. Memory
 
{anchor:Receive-frequency}
h3. Receive frequency
 
{anchor:Transmit-frequency}
h3. Transmit frequency
 
{anchor:Enable-code}
h3. Enable code
 
{anchor:Release-code}
h3. Release code
 
{anchor:Tilt-option}
h3. Tilt option
 
{anchor:Purchased-for}
h3. Purchased for
 
{anchor:Owner}
h3. Owner
 
{anchor:Custodian}
h3. Custodian
 
{anchor:Date-new}
h3. Date new
 
{anchor:PO}
h3. PO
 
{anchor:Transaction}
h3. Transaction
 
{anchor:Permanent-comment}
h3. Permanent comment
 
{anchor:manufacture-web-page}
h3. manufacture web page
 
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">961</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">957</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted:

||Instru View||SSDS Field if diff||
|[#SSDS-ID]|id|
|[#Technician]||
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI_ID}
h3. MBARI_ID
 
{anchor:SSDS-ID}
h3. SSDS ID
 
{anchor:Technician}
h3. Technician
 
{anchor:Manufacturer}
h3. Manufacturer
 
{anchor:Type}
h3. Type
 
{anchor:Model}
h3. Model
 
{anchor:Serial}
h3. Serial
 
{anchor:FullSerial}
h3. FullSerial
 
{anchor:Calibration-organization}
h3. Calibration organization
 
{anchor:Features}
h3. Features
 
{anchor:Pressure-sensor}
h3. Pressure sensor
 
{anchor:Depth-Rating}
h3. Depth Rating
 
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
{anchor:Memory}
h3. Memory
 
{anchor:Receive-frequency}
h3. Receive frequency
 
{anchor:Transmit-frequency}
h3. Transmit frequency
 
{anchor:Enable-code}
h3. Enable code
 
{anchor:Release-code}
h3. Release code
 
{anchor:Tilt-option}
h3. Tilt option
 
{anchor:Purchased-for}
h3. Purchased for
 
{anchor:Owner}
h3. Owner
 
{anchor:Custodian}
h3. Custodian
 
{anchor:Date-new}
h3. Date new
 
{anchor:PO}
h3. PO
 
{anchor:Transaction}
h3. Transaction
 
{anchor:Permanent-comment}
h3. Permanent comment
 
{anchor:manufacture-web-page}
h3. manufacture web page
 
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">960</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">956</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted:

||Instru View||SSDS Field if diff||
|[#SSDS-ID]|id|
|[#Technician]||
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI_ID}
.h3 MBARI_ID
 
{anchor:SSDS-ID}
.h3 SSDS ID
 
{anchor:Technician}
.h3 Technician
 
{anchor:Manufacturer}
.h3 Manufacturer
 
{anchor:Type}
.h3 Type
 
{anchor:Model}
.h3 Model
 
{anchor:Serial}
.h3 Serial
 
{anchor:FullSerial}
.h3 FullSerial
 
{anchor:Calibration-organization}
.h3 Calibration organization
 
{anchor:Features}
.h3 Features
 
{anchor:Pressure-sensor}
.h3 Pressure sensor
 
{anchor:Depth-Rating}
.h3 Depth Rating
 
{anchor:Firmware/EPROM}
.h3 Firmware/EPROM
 
{anchor:Memory}
.h3 Memory
 
{anchor:Receive-frequency}
.h3 Receive frequency
 
{anchor:Transmit-frequency}
.h3 Transmit frequency
 
{anchor:Enable-code}
.h3 Enable code
 
{anchor:Release-code}
.h3 Release code
 
{anchor:Tilt-option}
.h3 Tilt option
 
{anchor:Purchased-for}
.h3 Purchased for
 
{anchor:Owner}
.h3 Owner
 
{anchor:Custodian}
.h3 Custodian
 
{anchor:Date-new}
.h3 Date new
 
{anchor:PO}
.h3 PO
 
{anchor:Transaction}
.h3 Transaction
 
{anchor:Permanent-comment}
.h3 Permanent comment
 
{anchor:manufacture-web-page}
.h3 manufacture web page
 
{anchor:document-dir}
.h3 document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">959</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">955</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted:

||Instru View||SSDS Field if diff||
|[#MBARI_ID]||
|SSDS ID|id|
|[#Technician]||
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|Calibration organization||
|[#Features]||
|Pressure sensor||
|Depth Rating||
|Firmware/EPROM||
|[#Memory]||
|Receive frequency||
|Transmit frequency||
|Enable code||
|Release code||
|Tilt option||
|Purchased for||
|[#Owner]||
|[#Custodian]||
|Date new||
|[#PO]||
|[#Transaction]||
|Permanent comment||
|manufacture web page|infoUrlList|
|document dir||

.h3 MBARI_ID
 
.h3 SSDS ID
 
.h3 Technician
 
.h3 Manufacturer
 
.h3 Type
 
.h3 Model
 
.h3 Serial
 
.h3 FullSerial
 
.h3 Calibration organization
 
.h3 Features
 
.h3 Pressure sensor
 
.h3 Depth Rating
 
.h3 Firmware/EPROM
 
.h3 Memory
 
.h3 Receive frequency
 
.h3 Transmit frequency
 
.h3 Enable code
 
.h3 Release code
 
.h3 Tilt option
 
.h3 Purchased for
 
.h3 Owner
 
.h3 Custodian
 
.h3 Date new
 
.h3 PO
 
.h3 Transaction
 
.h3 Permanent comment
 
.h3 manufacture web page
 
.h3 document dir
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">958</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">962</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

h3. BOG fields for Model and Serial Numbers

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* Serial number should be the most complete as presented and formatted by the manufacturer. There's sure to be a lot of hand-alignment.
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Mannufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so. |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded.  I.e. go to website, how does company refer to itself?  Abbreviations should be expanded.

Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

----
h3. Deferred to phase 2:

| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">965</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">959</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted:

||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]||
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
h3. MBARI_ID
 
{anchor:SSDS-ID}
h3. SSDS ID
 
{anchor:Technician}
h3. Technician
 
{anchor:Manufacturer}
h3. Manufacturer
 
{anchor:Type}
h3. Type
 
{anchor:Model}
h3. Model
 
{anchor:Serial}
h3. Serial
 
{anchor:FullSerial}
h3. FullSerial
 
{anchor:Calibration-organization}
h3. Calibration organization
 
{anchor:Features}
h3. Features
 
{anchor:Pressure-sensor}
h3. Pressure sensor
 
{anchor:Depth-Rating}
h3. Depth Rating
 
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
{anchor:Memory}
h3. Memory
 
{anchor:Receive-frequency}
h3. Receive frequency
 
{anchor:Transmit-frequency}
h3. Transmit frequency
 
{anchor:Enable-code}
h3. Enable code
 
{anchor:Release-code}
h3. Release code
 
{anchor:Tilt-option}
h3. Tilt option
 
{anchor:Purchased-for}
h3. Purchased for
 
{anchor:Owner}
h3. Owner
 
{anchor:Custodian}
h3. Custodian
 
{anchor:Date-new}
h3. Date new
 
{anchor:PO}
h3. PO
 
{anchor:Transaction}
h3. Transaction
 
{anchor:Permanent-comment}
h3. Permanent comment
 
{anchor:manufacture-web-page}
h3. manufacture web page
 
{anchor:document-dir}
h3. document dir]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">962</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">950</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent_comment\] \[ntext\]
## Create column \[document_dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], 
                      ssdsdba.Device.Permanent_comment AS [Permanent comment], ssdsdba.Device.infoUrlList AS [manufacture web page], 
                      ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[History_Device]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[History_Device]
GO

CREATE TABLE [dbo].[History_Device] (
	[modified] [datetime] NULL ,
	[resultof] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[id] [numeric](19, 0) NOT NULL ,
	[version] [numeric](19, 0) NOT NULL ,
	[uuid] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[description] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgModel] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgSerialNumber] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[infoUrlList] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PersonID_FK] [numeric](19, 0) NULL ,
	[DeviceTypeID_FK] [numeric](19, 0) NULL, 
	[MBARI_ID] [int] NULL ,
	[Technician] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Serial] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Calibration_organization] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Features] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Pressure_sensor] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Depth_Rating] [int] NULL ,
	[Firmware_EPROM] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Memory] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Receive_frequency] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Transmit_frequency] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Enable_code] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Release_code] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Tilt_option] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Purchased_for] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Owner] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Custodian] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Date_new] [datetime] NULL ,
	[PO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Transaction] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Permanent_comment] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[document_dir] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[osg_view] [bit] NULL 
) ON [PRIMARY]
GO
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">953</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">949</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], 
                      ssdsdba.Device.Permanent_comment AS [Permanent comment], ssdsdba.Device.infoUrlList AS [manufacture web page], 
                      ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[History_Device]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[History_Device]
GO

CREATE TABLE [dbo].[History_Device] (
	[modified] [datetime] NULL ,
	[resultof] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[id] [numeric](19, 0) NOT NULL ,
	[version] [numeric](19, 0) NOT NULL ,
	[uuid] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[description] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgModel] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgSerialNumber] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[infoUrlList] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PersonID_FK] [numeric](19, 0) NULL ,
	[DeviceTypeID_FK] [numeric](19, 0) NULL, 
	[MBARI_ID] [int] NULL ,
	[Technician] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Serial] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Calibration organization] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Features] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Pressure sensor] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Depth Rating] [int] NULL ,
	[Firmware/EPROM] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Memory] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Receive frequency] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Transmit frequency] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Enable code] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Release code] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Tilt option] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Purchased for] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Owner] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Custodian] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Date new] [datetime] NULL ,
	[PO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Transaction] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Permanent comment] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[document dir] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[osg_view] [bit] NULL 
) ON [PRIMARY]
GO
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">952</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">948</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[History_Device]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[History_Device]
GO

CREATE TABLE [dbo].[History_Device] (
	[modified] [datetime] NULL ,
	[resultof] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[id] [numeric](19, 0) NOT NULL ,
	[version] [numeric](19, 0) NOT NULL ,
	[uuid] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[description] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgModel] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgSerialNumber] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[infoUrlList] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PersonID_FK] [numeric](19, 0) NULL ,
	[DeviceTypeID_FK] [numeric](19, 0) NULL, 
	[MBARI_ID] [int] NULL ,
	[Technician] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Serial] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Calibration organization] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Features] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Pressure sensor] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Depth Rating] [int] NULL ,
	[Firmware/EPROM] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Memory] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Receive frequency] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Transmit frequency] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Enable code] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Release code] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Tilt option] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Purchased for] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Owner] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Custodian] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Date new] [datetime] NULL ,
	[PO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Transaction] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Permanent comment] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[document dir] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[osg_view] [bit] NULL 
) ON [PRIMARY]
GO
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">951</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">947</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

h3. BOG fields for Model and Serial Numbers

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* Serial number should be the most complete as presented and formatted by the manufacturer. There's sure to be a lot of hand-alignment.
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Manfufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so. |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded.  I.e. go to website, how does company refer to itself?  Abbreviations should be expanded.

Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

----
h3. Deferred to phase 2:

| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">950</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">954</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[ntext\]
## Create column \[Permanent_comment\] \[ntext\]
## Create column \[document_dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">957</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">953</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[ntext\]
## Create column \[Permanent_comment\] \[ntext\]
## Create column \[document_dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, ssdsdba.Device.Transaction_col AS [Transaction], 
                      ssdsdba.Device.Permanent_comment AS [Permanent comment], ssdsdba.Device.infoUrlList AS [manufacture web page], 
                      ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">956</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">952</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted:

||Instru View||SSDS Field if diff||
|MBARI_ID||
|SSDS ID|id|
|Technician||
|Manufacturer|mfgName|
|Type|name|
|Model|mfgModel|
|Serial||
|FullSerial|mfgSerialNumber|
|Calibration organization||
|Features||
|Pressure sensor||
|Depth Rating||
|Firmware/EPROM||
|Memory||
|Receive frequency||
|Transmit frequency||
|Enable code||
|Release code||
|Tilt option||
|Purchased for||
|Owner||
|Custodian||
|Date new||
|PO||
|Transaction||
|Permanent comment||
|manufacture web page|infoUrlList|
|document dir||

.h3 MBARI_ID
 
.h3 SSDS ID
 
.h3 Technician
 
.h3 Manufacturer
 
.h3 Type
 
.h3 Model
 
.h3 Serial
 
.h3 FullSerial
 
.h3 Calibration organization
 
.h3 Features
 
.h3 Pressure sensor
 
.h3 Depth Rating
 
.h3 Firmware/EPROM
 
.h3 Memory
 
.h3 Receive frequency
 
.h3 Transmit frequency
 
.h3 Enable code
 
.h3 Release code
 
.h3 Tilt option
 
.h3 Purchased for
 
.h3 Owner
 
.h3 Custodian
 
.h3 Date new
 
.h3 PO
 
.h3 Transaction
 
.h3 Permanent comment
 
.h3 manufacture web page
 
.h3 document dir
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">955</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">951</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[ntext\]
## Create column \[Permanent_comment\] \[ntext\]
## Create column \[document_dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, ssdsdba.Device.Transaction_col AS [Transaction], 
                      ssdsdba.Device.Permanent_comment AS [Permanent comment], ssdsdba.Device.infoUrlList AS [manufacture web page], 
                      ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[History_Device]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[History_Device]
GO

CREATE TABLE [dbo].[History_Device] (
	[modified] [datetime] NULL ,
	[resultof] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[id] [numeric](19, 0) NOT NULL ,
	[version] [numeric](19, 0) NOT NULL ,
	[uuid] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[description] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgModel] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgSerialNumber] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[infoUrlList] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PersonID_FK] [numeric](19, 0) NULL ,
	[DeviceTypeID_FK] [numeric](19, 0) NULL, 
	[MBARI_ID] [int] NULL ,
	[Technician] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Serial] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Calibration_organization] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Features] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Pressure_sensor] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Depth_Rating] [int] NULL ,
	[Firmware_EPROM] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Memory] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Receive_frequency] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Transmit_frequency] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Enable_code] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Release_code] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Tilt_option] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Purchased_for] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Owner] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Custodian] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Date_new] [datetime] NULL ,
	[PO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Transaction_col] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Permanent_comment] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[document_dir] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[osg_view] [bit] NULL 
) ON [PRIMARY]
GO
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">954</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">939</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">942</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">945</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[History_Device]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[History_Device]
GO

CREATE TABLE [dbo].[History_Device] (
	[modified] [datetime] NULL ,
	[resultof] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[id] [numeric](19, 0) NOT NULL ,
	[version] [numeric](19, 0) NOT NULL ,
	[uuid] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL ,
	[name] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[description] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgName] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgModel] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[mfgSerialNumber] [varchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[infoUrlList] [varchar] (2048) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[PersonID_FK] [numeric](19, 0) NULL ,
	[DeviceTypeID_FK] [numeric](19, 0) NULL 
	[MBARI_ID] [int] NULL ,
	[Technician] [nvarchar] (255) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Serial] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Calibration organization] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Features] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Pressure sensor] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Depth Rating] [int] NULL ,
	[Firmware/EPROM] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Memory] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Receive frequency] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Transmit frequency] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Enable code] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Release code] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Tilt option] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Purchased for] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Owner] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Custodian] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Date new] [datetime] NULL ,
	[PO] [nvarchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Transaction] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[Permanent comment] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[document dir] [ntext] COLLATE SQL_Latin1_General_CP1_CI_AS NULL ,
	[osg_view] [bit] NULL 
) ON [PRIMARY]
GO
{noformat}
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">948</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">946</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted:

||Instu View||SSDS Field if diff||
|MBARI_ID||
|SSDS ID|id|
|Technician||
|Manufacturer|mfgName|
|Type|name|
|Model|mfgModel|
|Serial||
|FullSerial|mfgSerialNumber|
|Calibration organization||
|Features||
|Pressure sensor||
|Depth Rating||
|Firmware/EPROM||
|Memory||
|Receive frequency||
|Transmit frequency||
|Enable code||
|Release code||
|Tilt option||
|Purchased for||
|Owner||
|Custodian||
|Date new||
|PO||
|Transaction||
|Permanent comment||
|manufacture web page|infoUrlList|
|document dir||]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">949</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">944</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">947</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">931</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# Make changes to the instrumentsDE application
# Device Creation Page and Device Edit Page (KG)
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">934</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">932</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# Make changes to the instrumentsDE application
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">935</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">923</id>
<property name="body"><![CDATA[|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so.  There's sure to be a lot of hand-alignment. |
| Model | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc.  It's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. |

h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded.  I.e. go to website, how does company refer to itself?  Abbreviations should be expanded.

Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. MFG Model, S/N, Name

Guidelines:

* Model should be as presented and formatted by the manufacturer
* Serial number should be the most complete as presented and formatted by the manufacturer
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer

|| Manfufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

ugh...

----
h3. Deferred to phase 2:

| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">926</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">926</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

h3. BOG fields for Model and Serial Numbers

h3. MFG Model, S/N, Name

Guidelines:

* Model: The available labels are not as well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc; it's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. 
* Serial number should be the most complete as presented and formatted by the manufacturer. There's sure to be a lot of hand-alignment.
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer. This information can be constructed from the other fields in any case, and so it is believed not critical to processing.

Some example formats for the different manufacturers are in this table.
|| Manfufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

To create the normalized SSDS serial number field, we plan the following.

|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so. |
| Model | A real mess | Should be as presented and formatted by the manufacturer if possible. |

h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded.  I.e. go to website, how does company refer to itself?  Abbreviations should be expanded.

Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

----
h3. Deferred to phase 2:

| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">929</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">925</id>
<property name="body"><![CDATA[h3. Introduction

This page describes normalization planned for various fields.  The actual steps required to perform this normalization are documented in [MakingData].

h3. BOG fields for Model and Serial Numbers

|| BOG Field || Current Values || Suggested Value ||
| Serial, FullSerial | A real mess | If BOG has FullSerial, line that up with SSDS.  If only a Serial is in BOG, use that instead.  If at all possible, the FullSerial should be the serial "as provided by the vendor" --- as written on the invoice, written on the label, etc.  This will often include some model information.  The Serial will often be the unique "serial number" or last four digits or so.  There's sure to be a lot of hand-alignment. |
| Model | A real mess | Probably whatever makes sense and is consistent.&nbsp; I don't think the available labels are quite a well codified as Type, Manufacturer. As long as the two tables agree (initially), it doesn't matter if it's "37IM" or "37 IM" or "37-IM" etc.  It's been suggested that tools for searching on model be case-insensitive, also ignoring spaces, hyphens.   There's sure to be a lot of hand-alignment. |

h3. BOG field "Manufacturer"

If at all possible, the Manufacturer should be the complete name of the company, though "Inc" or "Co" can be excluded.  I.e. go to website, how does company refer to itself?  Abbreviations should be expanded.

Open questions:
* "WHOI" v "Woods Hole Oceanographic Institute"
* "MBARI" v. "Monterey Bay Aquarium Research Institute"

|| BOG has... || SSDS Has... || Suggested compromise ||
| Aanderaa | Aanderaa; Aanderaa Instruments | Aanderaa Data Instruments \\ |
| Asimet | Asimet; ASIMET; Asimet/WHOI; WHOI | WHOI |
| Benthos | n/a | Benthos |
| Biospherical | Biospherical | Biospherical |
| Garmin | Garmin | Garmin |
| HOBI Labs | Hobi Labs; HOBI Labs, Inc | HOBI Labs |
| MBARI | MBARI | MBARI |
| RD Instruments | RDI; RD Instruments | RD Instruments |
| Satlantic | Satlantic | Satlantic |
| Sea-Bird | Seabird; Sea-bird; Seabird Electronics; Sea-Bird Electronics; Sea-Bird Electronics Inc | Sea-Bird Electronics |
| SeaTech | n/a | SeaTech |
| Simrad | n/a | Simrad |
| WET Labs | WETLabs; Wetlabs; WET Labs | WET Labs |
| Xantrex | Xantrex | Xantrex |

h3. BOG field "Type"

|| BOG has... || SSDS has... || Suggested compromise (types new to SSDS in _italics_) || Comments? ||
| ADCP | ADCP | ADCP | |
| backscatter | Scatterometer; Backscatterometer | HOBI HS2 is a Backscatterometer-Fluorometer; WET Labs BBSB is a Backscatterometer; WET Labs VSFS is a Backscatterometer | HOBI Labs HS2 units are marked as both in SSDS.  WETLabs BBSB units are only Scatterometers.  Are the two categories distinct or not?  In BOG they're both "backscatter" |
| backscatter/fluorometer | (need to add) | _Backscatterometer-Fluorometer_ | In BOG there as WET Labs ECO BB2F-067 and \-065 |
| battery | n/a | _Battery_ | RDI battery packs |
| controller; Controller | ? | Controller for HydroDAS units; Controller-Mooring Node for OASIS units | Includes MBARI OASIS-x and HOBI HydroDAS |
| CTD | CTD | CTD | |
| e-meter | Electrical Sensor | Electrical Sensor | |
| fluor/turbidity | Fluorometer; Fluorometer-Nephalometer (some ECO-FLNT units marked as Fluormeter) | Fluorometer-Nephelometer | WET Labs ECO-FLNTUS.  Some ECO-FLNTU units are incorrectly identified at Fluorometers?).  Also, apparently (at least according to [Google Fight|http://www.googlefight.com/index.php?lang=en_GB&word1=nephelometer&word2=nephalometer]), it's a nephelometer, not a nephalometer |
| fluorometer | Fluorometer | Fluorometer | WET Labs ECO FLS and WETStar |
| GPS | GPS | GPS | |
| ICC | n/a | _Inductive Modem-Cable Coupler_ | Not really a distinct component, more like a modem accessory.  However, Paul is tracking it in BOG (though he may not in the future). |
| Meteorological | Metsys | Metsys | Sounds like "Metsys" is used as the common parlance for this package |
| modem | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Inductive Modem; Inductive Modem-Surface; Inductive Modem-Underwater | Backport from SSDS to BOG.  It might be that "Inductive Modem" isn't a used category. |
| Nitrate; Nitrate analyzer | Nitrogen Sensor-ISUS | Nitrogen Sensor-ISUS for MBARI units, Nitrogen Sensor for Satlantic units | Apparently the ISUS and Satlantic units are sufficently distinct that they should be considered different things. |
| Oxygen optode; Oxygen Optode | Oxygen; Oxygen Sensor | Oxygen Sensor | |
| pCO2 | CO2 Monitor | CO2 Monitor | |
| Platform | Mooring | Mooring | |
| power source | ? | Power Supply | MBARI WH-CPS-I and WH-CPS-E.  This is a unit developed inhouse for powering the Workhorse ADCPs off mooring power |
| pump | n/a | _Pump_ | |
| radiometer | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Radiometer; Radiometer-Hyperspectral; Radiometer-Longwave; Radiometer-Multispectral; Radiometer-Shortwave | Backport info to BOG |
| release | n/a | _Release_ | |
| shutter | n/a | Shutter-Antifouling | |
| temperature/humidity | Meteorology Package | Meteorology Package | Asimet HRH packages |
| Transducer | n/a | _Transponder_ | One instance, Benthos UAT-376.  It's a pinger/transponder. |
| transmissometer | n/a | _Transmissometer_ | Can't find matching instruments in SSDS: SeaTech and WET Labs C-Star units) |

h3. MFG Model, S/N, Name

Guidelines:

* Model should be as presented and formatted by the manufacturer
* Serial number should be the most complete as presented and formatted by the manufacturer
* Name may be the Type or Model or a more descriptive name, potentially in alignment with that provided by the manufacturer

|| Manfufacturer || Model || Serial Number || Name ||
| Aanderaa Data Instruments | just number (3830, 3835) | just number (131, 121) | Name as provided by Aandreaa ("Oxygen Optode", "Oxygen Optode Shallow Water") |
| WHOI (was ASIMET) | three-letter abbrev from ASIMET (LWR, SWR) | three-digit number | "ASIMET " + model (e.g. "ASIMET SWR") |
| Benthos | as provided by company (865-A, UAT-376) | as provided by company | Description "release" or "transducer" |
| Biospherical | as provided by company (PRR-620, PRR-620-T2) | as provided by company | |

ugh...

----
h3. Deferred to phase 2:

| Technician | "pc" | a Person's name (Paul Coenen) |
| Calibration Organization | Aandreaa, Benthos, Biospherical, HOBI, HOBI Labs, MBARI, MBARI-Heller, MBARI-Kocher, RD Instruments, RDI, Satlantic, SBE, Sea-Bird, Sea-Bird Electronics, WET Labs, WETLabs, | (line up organization with Manufacturer fields, add person field) |
| Custodian | \_some multiples i.e. _ Coenen/Heller.  Also "??" | |
| Owner | Mix of people and projects, some with slashes | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">928</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">928</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted:
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">931</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">930</id>
<property name="body"><![CDATA[I'll use the term "OSG-owned" to indicate the device Paul cares about.  We haven't exactly figured out how this will be delimited in the database, but I assume we'll be able to SELECT those lines as part of the SQL query.

----
h2. Summary

* Remove all references to MBARI_ID (auto-increment key used in instru table) and replace with SSDS_ID (?) (some sort of key from the merged table).  Note: Access assumes a relatively short MBARI_ID (4 digits), not the full SSDS UUID.

* Several panes in the Access app use a series of drop-downs (Manufacturer, Model, Serial Number, Type, etc) to select one-or-more devices.  Whenever possible, an "OSG-owned" checkbox could be added to limit/unlimit the search.

* There are a few panels which display all of the fields of the instru database, and a few which also allow editing of those fields.  These need a clear and concise way of indicating and editing the "OSG-ownership"

Overall impact to the Access app would be surprisingly light. The only truly obstrusive change would be to the "Instrumentation Data Entry" pane which is primarily for new instrument entry.  At present it's just a flat pane with fields for data entry (some drop-downs to normalize answers), but we're proposing changing it to a two-step process where some key information is entered, then checked for an existing records, before proceeding.

There will also be the introduction of a number of checkboxes which select if a particular search should be limited OSG-owned devices (the default) or expanded to the full SSDS database.

There's likely to be more impacts in changes to the meaning and function of some of the database fields.

There are also some loose ends in data normalization and field mapping (i.e. ensuring the FullSerial is always filled out, even if the user has only entered a Serial).  That sort of data verification and manipulation could be encoded in Access or pushed off to the SQL server as a trigger/job.

----
h2. More detail

From the front index page, there are nine sub-pages:

h3. Transactions Data Entry

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* I'm a little confused by the usage of this pane -- it's a combination of some instrumentation entries and the transaction entries.

h3. Instruments Data Entry

* Replace MBARI_ID with SSDS_ID.
* Add a way to indicate "OSG-owned"
* Need to put in an explicit step where the first few key fields are filled out and the database is check for duplicates before filling out the remaining fields.  This function should probably ignore the "OSG-owned" field.   This window may expand to include both the add and edit functions.

h3. Current Info

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Transaction History

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID

h3. Find Location of Calibration

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID (takes information from trans table?)

h3. Query by Location

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections
* Replace MBARI_ID with SSDS_ID on list.
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"  (may be same detail window used in "Find Model")

h3. Find Model

* Add checkbox to filter list on "OSG-owned" -- affects drop-down selections.
* Replace MBARI_ID with SSDS_ID on list
* Selecting "details" brings up a tertiary window.  Remove MBARI_ID.  Add entry on window for "OSG-owned"

h3. Deployment Update

(this feature may not be functional or as functional as Paul would like.)
* At checkbox to filter list on "OSG-owned" -- affects list of instruments
* Change MBARI_ID to SSDS_ID (?)

h3. Edit Instruments and Transactions Table

* Add checkbox in top pane to filter out OSG-owned devices -- affects drop-down selections.
* Add entry box in lower pane to toggle "OSG-owned"
* Remove references to MBARI_ID in text boxes and transaction table.  Replace with SSDS ID.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">933</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">929</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# Device Creation Page and Device Edit Page (KG)
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">932</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">921</id>
<property name="body"><![CDATA[Here's a proposal for a single database which is a union of the existing SSDS and Instru databases.  It should be possible to use a simple d/b view to translate this table to either the existing SSDS or instru formats without too many machinations.  The goal is to minimize/eliminate redundancy by combining overlapping fields without drastically affecting the use of either of the existing apps (SSDS, Access app).

This should be considered a phase one proposal to cover most of the "low hanging fruit" and start the integration process.  Subsequent phases can further integrate the two databases while taking into consideration lessons learned from phase one.

A good example is the handling of people/roles.  The instru database has a number of separate fields for different roles: owner/purchaser, technician, calibrator, etc.  Each of these fields is just freetext, allowing for inclusion of multiple people for each role, also project names instead of peoples names.  The SSDS database recognizes a single person, which is a record of type Person.  Though it's not clear how this record was intended to be used, it does not map cleanly into the instru model.

Despite this data mismatch, it isn't strictly necessary to solve this conundrum for successful use of the integrated database.  Later phases may include revisions to either or both data models (for example use of an associative array between ISO roles and Person records in SSDS).

Given the ability to "alias" fields when creating a view, name changes or mismatches should not be considered particularly serious.

Pending:
* Calibration information?  This is a new addition and not really relevant to the "merge"
* should probably settle on a word formatting sheme (i.e. starts with lower case and capitalize to make subwords) -- given we can alias when making the view it matters quite a bit less

|| SSDS Field || SSDS Comment || instru Field || instru comment || Merged field || Merge comment ||
| SSDS ID | Auto-incrementing key field | SSDS ID | Used to link to entry in SSDS d/b | SSDS ID | |
| UUID | | | | UUID | |
| mfgName | | Manufacturer | | mfgName | Needs some normalization |
| mfgModel | | Model | | mfgModel | Needs some normalization |
| mfgSerialNumber | | Serial, FullSerial | One or both may be used.  Typically FullSerial is the complete manufacturer's serial number and Serial is a shorter representation - often the actual sequential portion w/o any sort of model identification which may be encoded. | mfgSerialNumber, ShortSerial \\ | Keep _mfgSerialNumber_ as the full-length serial number.&nbsp; Make it a mandatory field.&nbsp; Allow an optional _ShortSerial_ to hold a shortened serial number (how is this used in the Access app?) \\ |
| name | Typically something like manufacturer+model | | | name | \\ |
| deviceType | | Type | | deviceType | Needs some normalization |
| Description | A free text description, may&nbsp; contain some information redundant with _name_ \\ | | | Description | |
| infoUrlList | | manufacture web page | | infoUrlList | Neither database uses this field very heavily.  Best to merge into a single "place for a hyperlink" -- though should we be specific that this is to either the manufacturers' home page or to the product page.  Does it matter? |
| person | The contact person (link to the Person table) \\ | | | person | Need to figure out how (if) to map the multiple instru roles into SSDS |
| | | Purchased for | Sometimes a person, sometimes a project \\ | Purchased for|" |
| | | Owner | Typically some combination of person, group (OSG, etc) and project.&nbsp; Sometimes all three \\ | Owner | "|
| | | Custodian | One or more people \\ | Custodian | "|
| | | Technician | Currently always 'pc' (Paul Coenen) | Technician | "|
| resources | Not used currently (?).&nbsp; Could be used for storing calibration files? \\ | | | | |
| | | document dir | Not used currently \\ | | |
| version | | | | version | |
| | | Features | A free text description of features on the device \\ | Features | Simplest to just leave this in place for now? |
| | | Pressure sensor | Just freetext, left blank if irrelevant \\ | Pressure sensor \\ | " |
| | | Depth Rating | Just freetext, left blank if irrelevant | Depth Rating \\ | " |
| | | Firmware/EPROM | Just freetext, left blank if irrelevant | Firmware/EPROM | " |
| | | Memory | Just freetext, left blank if irrelevant | Memory | " |
| | | Receive Frequency | Just freetext, left blank if irrelevant | Receive Frequency \\ | " |
| | | Transmit Frequency | Just freetext, left blank if irrelevant | Transmit Frequency \\ | " |
| | | Enable Code | Just freetext, left blank if irrelevant | Enable Code \\ | " |
| | | Release Code | Just freetext, left blank if irrelevant | Release Code \\ | " |
| | | Tilt option | Just freetext, left blank if irrelevant, though heavier use of "N/A" than in other fields \\ | Tilt option \\ | " |
| | | Date new | Used infrequently \\ | Date new \\ | " \\ |
| | | Calibration organization | Typically a company, but sometimes a company and a person \\ | Calibration organization \\ | In the long run we might normalize this against the msgNames \\ |
| | | PO | | PO | " |
| | | Permanent comment | Not entirely sure what this field is used for.  I think it's meant to be some permanent and overarching state of the system, not just the latest "transaction" | ?? | Keep it?  Or discard? |
| | | MBARI_ID | Auto-incrementing key field | _(discard)_ | Redundant if the *trans* table in instru is rewritten using SSDS IDs instead |
| | | Transaction | I believe this field isn't used in instru | _(discard)_ \\ | |
| | | | | | |]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">924</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">907</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Device Creation Page and Device Edit Page (KG)
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">910</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">908</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)

# Device Creation Page and Device Edit Page (KG)
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">911</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">909</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# Device Creation Page and Device Edit Page (KG)
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">912</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">910</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
## Create column \[osg_view\] \[bit\]
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Device.Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.[Calibration organization], ssdsdba.Device.Features, ssdsdba.Device.[Pressure sensor], ssdsdba.Device.[Depth Rating], 
                      ssdsdba.Device.[Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.[Receive frequency], ssdsdba.Device.[Transmit frequency], 
                      ssdsdba.Device.[Enable code], ssdsdba.Device.[Release code], ssdsdba.Device.[Tilt option], ssdsdba.Device.[Purchased for], ssdsdba.Device.Owner, 
                      ssdsdba.Device.Custodian, ssdsdba.Device.[Date new], ssdsdba.Device.PO, ssdsdba.Device.[Transaction], ssdsdba.Device.[Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.[document dir]
FROM         ssdsdba.Device INNER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO


{noformat}
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [dbo].[instru] (
		[MBARI_ID]
	)
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# Device Creation Page and Device Edit Page (KG)
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">913</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">905</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.

{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists) 
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys) 
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Device Creation Page and Device Edit Page (KG)
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit 
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform initial database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:

# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="/display/AST/BogInstruNormalization"   linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization">{html}SQL to perform database normalization between BOG and SSDS{html}</A>{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)

{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">908</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">906</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Tehnician\] \[nvarchar\] (255)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure sensor\] \[nvarchar\] (50)
## Create column \[Depth Rating\] \[int\]
## Create column \[Firmware/EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive frequency\] \[nvarchar\] (50)
## Create column \[Transmit frequency\] \[nvarchar\] (50)
## Create column \[Enable code\] \[nvarchar\] (50)
## Create column \[Release code\] \[nvarchar\] (50)
## Create column \[Tilt option\] \[nvarchar\] (50)
## Create column \[Purchased for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction\] \[ntext\]
## Create column \[Permanent comment\] \[ntext\]
## Create column \[document dir\] \[ntext\]
# Device Creation Page and Device Edit Page (KG)
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----
{info:title=Details before combined table approach (deprecated)}
# [Create New Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Fire trigger on insert into instru table on BOG
## Search SSDS for matching device
## Insert of update device info in SSDS
## Update the BOG instru entry with SSDS ID
## Email SSDS admin of insert
# [Edit Device in Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Fire trigger on update of instru table on BOG
## Search SSDS for matching device (match by ID)
## If found, update device table in SSDS
## If not found, throw flag to SSDS admin
# [Create New Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
### JSF validation
### Calls DAO to create new device
## Insert in device table in SSDS fires trigger
## Email is sent to OSG Operator
### OSG rejects, send email to SSDS admin (mailto: link in HTML email)
### OGS approves, link calls servlet that passes SSDS device ID and param to specify it is a call to create
#### Servlet calls stored procedure that inserts new device in BOG
# [Edit Device in SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page
### JSF Validation
### Calls DAO to update device
## Update on Device table fires trigger
### Email is sent to SSDS Admin
### If SSDS Admin clicks on reject link, he will be taken back to the edit page
### If SSDS Admin approves, servlet will be called (pass device ID) NOTE: Will need a history table on device to show differences
#### If OSG approves, servlet is called, passing device ID and parameter to indicate update
#### if OSG rejects: mailto: opens email to SSDSAdmin

So based on these steps the following components need to be built:
# Device Creation Page (KG)
## Authenticates against LDAP group
## JSF Validation
# Device Edit Page (KG)
# 4 Triggers (JG/AM)
## Fires when insert done on BOG instru table
## Fires when update done on BOG instru table
## Fires when insert done on SSDS_Metadata Device table
## Fires when update done on SSDS_Metadata Device table
# 2 Stored procedures (JG/AM)
## synchBOGChangesToSSDS
### parameter: change or update
### searches SSDS for matching SSDS ID
### If nothing found and parameter was update, send error email to SSDS Admin (end)
### If nothing found and parameter was create, search for matching mfg name, model, serial number
### If no match, insert matching record into SSDS_Metadata device table and save SSDS ID
### If match, update entry in SSDS_Metadata Device table and save SSDS ID
### If BOG instru entry does not have SSDS ID, update entry to store saved SSDS ID
### Email results to SSDS Admin
## synchSSDSChangesToBOG
### parameters: SSDS ID and string create or update
### Query SSDS_Metadata Device table for device with SSDS ID
### If create, insert matching entry in BOG instru table
### If update, udpate matching entry in BOG instru table
### Send email to SSDS Admin
# 2 Servlets (KG)
## Notify OSG Of Device Edit Servlet
### Pass in SSDS Device ID
### Grab old device information from history table
### Grab current device information from device table
### Construct email with differences report and approval/reject options
### Send email to OSG Operator
## Forward Changes to BOG from SSDS Servlet
### Parameters: SSDS ID and create or update
### Call stored procedure to push changes to BOG from SSDS and use parameters
# History Trigger on Device Table (KG)
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Create reporting SQL and schedule to send out reports of differences (AM)
# Put links to CVS web xml in Device listing web page (KG)
{info}

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">909</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1094</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Detailed SQL to be provided.


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
'
Detailed SQL to be provided.


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our InterimTable (using the workingText column), from Instru or Device as appropriate, using the rules above. 

At this point, all the workingText rows should be filled in. 

Manual changes will be done to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1097</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1091</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Detailed SQL to be provided.


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
'
Detailed SQL to be provided.


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used by the systems. (Conceivably this should all be relational, but for now this is a quick and dirty.)





[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 



[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1094</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1095</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Device Merge (Merging Instru Table into Device Table)

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 
* manufacturer-web-page gets copied to infoUrl.

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Detailed SQL to be provided.


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
* manufacturer-web-page gets copied to infoUrl.
'
Detailed SQL to be provided.


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If MBARI ID doesn't exist, it is set to the SSDS ID as part of the [device merge|#DeviceMerge].
- If the MBARI ID already exists, it will need to be changed to match SSDS.
 - _*if we need to save the Instru MBARI ID for some reason, this can be moved later; else do it as part of [device merge|#DeviceMerge].*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID in Device to the SSDS ID.  

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

{anchor:InterimTable}
h3. Interim Table Creation

Next we will create a table to use for interim results.  (This table will be reused in subsequent steps.)  The table will have an entry for each of the devices in SSDS -- note that some of these will be in Device only, and the rest will be in both tables (some devices that were originally Instru-only, and others that were originally in both tables).  All subsequent queries have to allow for all 3 possibilities, until all the Instru information has been migrated.

SQL for this task will be in [SqlQueries#MakeInterimTable].


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used to fill out the mfgName field in Device. (Conceivably the manufacturers information in Device should all be relational, but for now this is a quick and dirty.)  

Then we will copy the appropriate information over to our InterimTable (using the workingText column), from Instru or Device as appropriate, using the rules above. 

At this point, all the workingText rows should be filled in. 

Manual changes will be done to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the workingText column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'

h4. Implementation

We will copy the appropriate information over to our InterimTable (using the fkid column), from Instru or Device as appropriate, using the rules above. 

At this point, all the fkid rows should be filled in. 

Manual changes will be made to the InterimTable.

Finally, the InterimTable will be used to overwrite the Device table, and the fkid column of Interim table will be cleared.


[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge: Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 


[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial (becomes mfgSerialNumber)

We will fill out mfgSerialNumber in every case, even if it is the same as the shorter Serial.  This means that the Access interface will now see an entry for every FullSerial field, although often it will be the same as the Serial field.

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it for mfgSerialNumber 
#* If not, then if Instru has Serial, use that for mfgSerialNumber.

This algorithm works because (a) there are no cases where SSDS has a full serial number in mfgSerialNumber, but Instru only has a short Serial; and (b) there are no conflicts between Device and Instru (other than the two specifically mentioned above).

This algorithm can be implemented by assigning Serial whenever it exists, then assigning FullSerial whenever it exists.

h2. Unchanged Fields

The following columns will not be changed in Phase 1, and so will be copied as is during the initial merging of the tables.

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1098</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1034</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1037</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1033</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> IMCTD (120) from CommDevice (119) (check this with Paul)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1036</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1032</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: 
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> IMCTD (120) from CommDevice (119)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1035</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1027</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication                   
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Multipurpose                    
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Echo Sounder: 
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)

* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> IMCTD (120) from CommDevice (119)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1030</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1040</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '1'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device LEFT OUTER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id LEFT OUTER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# The history tables store the updated values for entries as the thought is that each entry would have to be inserted before any updates so you would always have the initial state of the row.  In this case we are starting with existing data, so it is critical that we get a baseline of all the current rows.  This can be done simply by running these in SQL Query Analyzer:
{noformat}
UPDATE ssdsdba.Device SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.Person SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.DeviceType SET version = version
GO
{noformat}
This will create entries for all the rows so that we will have the current data in the history table to compare future updates/deletions against.
# Create an INSTEAD OF INSERT trigger on the view
{noformat}
CREATE TRIGGER trInstruInsert ON instru
INSTEAD OF INSERT
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Now let's make sure the MBARI_ID and SSDS_ID are null
    IF @mbari_id IS NOT NULL
      RAISERROR('The insert specified the MBARI_ID. This field is auto-generated, do not specify on insert',9,1)
    IF @ssds_id IS NOT NULL
      RAISERROR('The insert specified the SSDS_ID. This field is auto-generated, do not specify on insert',9,1)

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    INSERT INTO ssdsdba.Device 
      (
       mfgName,
       mfgModel,
       Serial,
       mfgSerialNumber,
       Calibration_organization,
       Features,
       Pressure_Sensor,
       Depth_Rating,
       Firmware_EPROM,
       Memory,
       Receive_frequency,
       Transmit_frequency,
       Enable_code,
       Release_code,
       Tilt_option,
       Purchased_for,
       Owner,
       Custodian,
       Date_new,
       PO,
       Transaction_col,
       Permanent_comment,
       infoUrlList,
       document_dir,
       PersonID_FK,
       DeviceTypeID_FK
      )
    VALUES
      (
       @mfgName,
       @mfgModel,
       @serial,
       @mfgSerialNumber,
       @calibration_organization,
       @features,
       @pressure_sensor,
       @depth_rating,
       @firmware_eprom,
       @memory,
       @receive_frequency,
       @transmit_frequency,
       @enable_code,
       @release_code,
       @tilt_option,
       @purchased_for,
       @owner,
       @custodian,
       @date_new,
       @po,
       @transaction_col,
       @permanent_comment,
       @infoUrlList,
       @document_dir,
       @person_id,
       @deviceType_id
      )
  END
END
GO{noformat}
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    UPDATE ssdsdba.Device 
      SET ssdsdba.Device.mfgName = @mfgName,
          ssdsdba.Device.mfgModel = @mfgModel,
          ssdsdba.Device.Serial = @serial,
          ssdsdba.Device.mfgSerialNumber = @mfgSerialNumber,
          ssdsdba.Device.Calibration_organization = @calibration_organization,
          ssdsdba.Device.Features = @features,
          ssdsdba.Device.Pressure_Sensor = @pressure_sensor,
          ssdsdba.Device.Depth_Rating = @depth_rating,
          ssdsdba.Device.Firmware_EPROM = @firmware_eprom,
          ssdsdba.Device.Memory = @memory,
          ssdsdba.Device.Receive_frequency = @receive_frequency,
          ssdsdba.Device.Transmit_frequency = @transmit_frequency,
          ssdsdba.Device.Enable_code = @enable_code,
          ssdsdba.Device.Release_code = @release_code,
          ssdsdba.Device.Tilt_option = @tilt_option,
          ssdsdba.Device.Purchased_for = @purchased_for,
          ssdsdba.Device.Owner = @owner,
          ssdsdba.Device.Custodian = @custodian,
          ssdsdba.Device.Date_new = @date_new,
          ssdsdba.Device.PO = @po,
          ssdsdba.Device.Transaction_col = @transaction_col,
          ssdsdba.Device.Permanent_comment = @permanent_comment,
          ssdsdba.Device.infoUrlList = @infoUrlList,
          ssdsdba.Device.document_dir = @document_dir,
          ssdsdba.Device.PersonID_FK = @person_id,
          ssdsdba.Device.DeviceTypeID_FK = @deviceType_id
      WHERE ssdsdba.Device.id = (Select [SSDS ID] from Inserted)
  END
END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
{noformat}
CREATE TRIGGER trInstruDelete ON instru
INSTEAD OF DELETE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Deleted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Deleted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Deleted

    -- Now let's make sure the SSDS_ID is not null
    IF @ssds_id IS NULL
      RAISERROR('The delete did not specify the SSDS_ID. No delete performed',9,1)

    -- Now delete the row specified
    DELETE FROM ssdsdba.Device 
      WHERE id = @ssds_id
  END
END
GO
{noformat}
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Custom field comparison utilities
## Serial number
### Ignore non-alphanumeric text (remove white space, punctuation)
### If existing serial number matches the end of the new serial number, consider it a (likely?) match
## Model number
### Ignore non-alphanumeric text (remove white space, punctuation)
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1043</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1057</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Approaches]
# [Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Design]

----
# [Design Review Notes]
# [BogInstruNormalzation]
# [DatabaseFields]
# [MakingData] -- detailed steps needed to transform the contents of the database

Tasks and bugs can be found in [JIRA|http://oceana.shore.mbari.org:8082/browse/AST]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1060</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1056</id>
<property name="body"><![CDATA[Welcome to the project page for the Asset Configuration and Tracking Consolidation project.

&nbsp;Here are some related pages:
# [Use Cases]
# [Requirements]
# [Approaches]
# [Modeling|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/]
# [Design]

----
# [Design Review Notes]

Tasks and bugs can be found in [JIRA|http://oceana.shore.mbari.org:8082/browse/AST]]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1059</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1064</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. Initial Normalization

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1067</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1065</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same.  This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.
||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

I'll implement this by doing updates on the SSDS ID values in the instru table.


h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1068</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1062</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}
h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1065</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1072</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindingMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

I'm implementing this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].




[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

h3. Merging of Tables

The next step is to migrate the Instru data as is into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs.  

h4. Devices without SSDS IDs

Create new devices in Device, copying all the fields from Instru into the corresponding columns of Device.

Details to be provided.

h4. Devices with SSDS IDs

First, confirm there is no conflict in the overlapping columns.
Then, update the Instru fields in Device with the data from Instru.

Details for both steps to be provided.

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database.
- If the MBARI ID exists,
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID to the SSDS ID.

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1075</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1074</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1077</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1073</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

I'm implementing this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: I believe we will set all the Technician values that are currently 'pc' to coenen, which matches the ID used for Paul in the SSDS database.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  Then we must ensure those values are replaced by the appropriate PersonID_FK on merge.  If Kevin doesn't know already how to do this we'll have to find out...

To change all the 'pc' values, we have {SqlQueries#ChangeTechnician}.



[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

h3. Merging of Tables

The next step is to migrate the Instru data as is into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs.  

h4. Devices without SSDS IDs

Create new devices in Device, copying all the fields from Instru into the corresponding columns of Device.

Details to be provided.

h4. Devices with SSDS IDs

First, confirm there is no conflict in the overlapping columns.
Then, update the Instru fields in Device with the data from Instru.

Details for both steps to be provided.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database.
- If the MBARI ID exists,
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID to the SSDS ID.

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1076</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1068</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindingMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

I'm implementing this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].


h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1071</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1067</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same.  This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.
||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

I'm implementing this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].


h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- If no MBARI ID exists, set it to the SSDS ID.
- If no SSDS ID exists, set it to the MBARI ID.
(The only changes that need to happen to SSDS_Metadata to enable this are the deletion of devices with SSDS ID 1 and 101. These are bogus devices anyway.)

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)
 
[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 
[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1070</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1069</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS

This finds full serial matches to SSDS mfgSerialNumber.

SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID

This finds short serial matches (lots of false positives).

SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1072</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1075</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1078</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1076</id>
<property name="body"><![CDATA[{anchor:FindMatchingDevices}
h2. Finding Matching Instru Devices in SSDS (Information Only)

This finds full serial matches to SSDS mfgSerialNumber.

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.FullSerial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.FullSerial) 
) r2
WHERE d.mfgSerialNumber = FullSerial
ORDER BY r2.MBARI_ID
{code}

This finds short serial matches (lots of false positives).

{code:sql}
SELECT r2.MBARI_ID, d.id, r2.Serial, r2.Model, d.mfgModel, r2.Manufacturer, d.mfgName  
FROM Device as d, 
(
SELECT * FROM
(
SELECT     *
FROM         instru
WHERE     not exists (select null
FROM Device
WHERE Device.id = instru.[SSDS ID] )
) r1
WHERE EXISTS (select null
FROM Device
WHERE Device.mfgSerialNumber = r1.Serial) 
) r2
WHERE d.mfgSerialNumber = r2.Serial
ORDER BY r2.MBARI_ID
{code}


{anchor:MatchDevices}
h2. Match Instru to SSDS Devices
{code:sql}
UPDATE Instru SET [SSDS ID] = 1359
WHERE MBARI_ID = 10

UPDATE Instru SET [SSDS ID] = 1567
WHERE MBARI_ID = 23

UPDATE Instru SET [SSDS ID] = 1568
WHERE MBARI_ID = 50

UPDATE Instru SET [SSDS ID] = 1222
WHERE MBARI_ID = 129

UPDATE Instru SET [SSDS ID] = 1273
WHERE MBARI_ID = 162

UPDATE Instru SET [SSDS ID] = 1337
WHERE MBARI_ID = 195

UPDATE Instru SET [SSDS ID] = 1279
WHERE MBARI_ID = 201

UPDATE Instru SET [SSDS ID] = 1356
WHERE MBARI_ID = 204

UPDATE Instru SET [SSDS ID] = 1470
WHERE MBARI_ID = 227

UPDATE Instru SET [SSDS ID] = 1562
WHERE MBARI_ID = 288

UPDATE Instru SET [SSDS ID] = 1382
WHERE MBARI_ID = 51

UPDATE Instru SET [SSDS ID] = 1406
WHERE MBARI_ID = 137

UPDATE Instru SET [SSDS ID] = 1267
WHERE MBARI_ID = 157

UPDATE Instru SET [SSDS ID] = 1456
WHERE MBARI_ID = 175

UPDATE Instru SET [SSDS ID] = 1457
WHERE MBARI_ID = 176

UPDATE Instru SET [SSDS ID] = 1314
WHERE MBARI_ID = 190

UPDATE Instru SET [SSDS ID] = 1459
WHERE MBARI_ID = 256
{code}

{anchor:ChangeTechnician}
h2. Change Technician in Instru to coenen

{code:sql}
UPDATE instru 
SET Technician = 'coenen'
WHERE Technician = 'pc'
{code}]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1079</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1088</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

I'm implementing this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: I believe we will set all the Technician values that are currently 'pc' to coenen, which matches the ID used for Paul in the SSDS database.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  Then we must ensure those values are replaced by the appropriate PersonID_FK on merge.  If Kevin doesn't know already how to do this we'll have to find out...

To change all the 'pc' values, we have [SqlQueries#ChangeTechnician].



[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used by the systems. (Conceivably this should all be relational, but for now this is a quick and dirty.)





[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

h3. Merging of Tables

The next step is to migrate the Instru data as is into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs.  

h4. Devices without SSDS IDs

Create new devices in Device, copying all the fields from Instru into the corresponding columns of Device.

Details to be provided.

h4. Devices with SSDS IDs

First, confirm there is no conflict in the overlapping columns.
Then, update the Instru fields in Device with the data from Instru.

Details for both steps to be provided.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database.
- If the MBARI ID exists,
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID to the SSDS ID.

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1091</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1089</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Merging of Tables

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID (and MBARI ID?) column of Instru, to make later SQL simpler.

Detailed SQL to be provided.


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
'
Detailed SQL to be provided.


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.



[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used by the systems. (Conceivably this should all be relational, but for now this is a quick and dirty.)





[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 


{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database.
- If the MBARI ID exists,
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID to the SSDS ID.

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1092</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1090</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

Implement this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].

{anchor:DeviceMerge}
h3. Merging of Tables

The next step is to migrate most of the Instru data 'as is' into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs. In each case, only the fields which did not already exist in SSDS will be migrated.  The remaining fields will be accomplished in separate steps below. (An exception is the PersonID_FK field, which is easiest to do as part of this step.)

This step is performed now so that we have a single table with SSDS IDs for every item, which will be useful for future queries.

For this step, we assume the Device table already exists with the new Instru fields required for the merge.  Those fields are:

MBARI_ID
Serial
FullSerialmfgSerialNumber
Calibration-organization
Features
Pressure-sensor
Depth-Rating
Firmware/EPROM
Memory
Receive-frequency
Transmit-frequency
Enable-code
Release-code
Tilt-option
Purchased-for
Owner
Custodian
Date-new
PO
Transaction
Permanent-comment
document-dir

h4. Devices without SSDS IDs

Create new devices in Device, copying all the new fields from Instru into the corresponding columns of Device. 

Also set the PersonID_FK = 126 (for Paul Coenen -- see [#Technician] below).

Then copy the SSDS ID for the new devices back into the SSDS ID column of Instru, to make later SQL simpler.

Detailed SQL to be provided.


h4. Devices with SSDS IDs

Update the new Instru fields in Device with the data from Instru.  
'
Detailed SQL to be provided.


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: This is most easily accomplished during the [device merge|#DeviceMerge] step.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  

Originally we planned to change all the 'pc' values in Instru, as shown in [SqlQueries#ChangeTechnician]. I don't believe this step will be necessary.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database. This happens as part of the [device merge|#DeviceMerge] above.
- If the MBARI ID exists, _*if we want to perform these now, or do we need to save the Instru MBARI ID for some reason?*_
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID to the SSDS ID.

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.


[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 
h4. The plan

To do this, as a first step create a table of allowable Manufacturers (see [SqlQueries#CreateMfgTable]). The label column is the name that will be used by the systems. (Conceivably this should all be relational, but for now this is a quick and dirty.)





[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device type
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 



[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1093</id>
</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">1083</id>
<property name="body"><![CDATA[This document contains the steps needed to generate the data in [BogInstruNormalization] and [DatabaseFields].  

In some cases the steps can be done as part of a DTS job.  In other cases it may be more efficient to assign the values directly for all the existing devices (i.e., to copy them from a table).

{anchor:table}
We start from the following list of columns in the dbo.Instru view, corresponding to SSDS columns as noted (proposed changes in _italics_):
||Instru View||SSDS Field if diff||
|[MBARI ID|#MBARI-ID]||
|[#SSDS-ID]|id|
|[#Technician]|_PersonID_FK_|
|[#Manufacturer]|mfgName|
|[#Type]|name|
|[#Model]|mfgModel|
|[#Serial]||
|[#FullSerial]|mfgSerialNumber|
|[#Calibration-organization]||
|[#Features]||
|[#Pressure-sensor]||
|[#Depth-Rating]||
|[Firmware/EPROM|#Firmware-EPROM]||
|[#Memory]||
|[#Receive-frequency]||
|[#Transmit-frequency]||
|[#Enable-code]||
|[#Release-code]||
|[#Tilt-option]||
|[#Purchased-for]||
|[#Owner]||
|[#Custodian]||
|[#Date-new]||
|[#PO]||
|[#Transaction]||
|[#Permanent-comment]||
|[#manufacture-web-page]|infoUrlList|
|[#document-dir]||

h3. Initial Normalization of Devices

The first step is to ensure we know which of the items in the BOG Instru database that don't have SSDS_IDs are also in the SSDS database. (It is important that we minimize the number of duplicate entries as of the end of the process, so we might as well do this step first.)  This query must first find BOG devices that could be already entered as SSDS devices. To do this, we look for possibly matching serial numbers where there is no meaningful SSDS_ID in the Instru database. We can then cross-check the models and instrument types manually to see if it is likely to be the same instrument.

When in doubt, we should assume the two instruments are different, until it is clear that they are the same.

The following instruments are believed the same. (Queries are at [SqlQueries#FindMatchingDevices].) This will be reflected by setting their SSDS ID in Instru to the corresponding SSDS ID.

||Instru|| SSDS||Comment||
|10|1359| Full serial numbers match|
|23|1567||
|50|1568||
|129|1222||
|162|1273||
|195|1337||
|201|1279||
|204|1356||
|227|1470||
|288|1562||
|51|1382|Short serial numbers match|
|137|1406||
|157|1267||
|175|1456||
|176|1457||
|190|1314||
|256|1459||

I'm implementing this by doing updates on the SSDS ID values of the appropriate entries in the instru table. See [SqlQueries#MatchDevices].


[Back to table...|#table]
{anchor:Technician}
h3. Technician

For any device in Instru, set PersonID_FK in SSDS to 126 (Paul Coenen).  (See explanation in [BogInstruNormalization].)

Strategy: I believe we will set all the Technician values that are currently 'pc' to coenen, which matches the ID used for Paul in the SSDS database.
(Note, by the way, there are 15 additional items in Device with PersonID_FK = coenen that aren't already in Instru.)  Then we must ensure those values are replaced by the appropriate PersonID_FK on merge.  If Kevin doesn't know already how to do this we'll have to find out...

To change all the 'pc' values, we have [SqlQueries#ChangeTechnician].



[Back to table...|#table]
{anchor:Manufacturer}
h3. Manufacturer

(See [normalization strategy|BogInstruNormalization#Manufacturer].)

The list of permitted manufacturers (so far, based on existing data as of 2/20) is as follows. The name in parentheses provides the complete company name, in case we ever make a database.
* Aanderaa Data Instruments 
* Axys Technologies (.. Inc.) (was Axys Environmental Systems)
* Biospherical Instruments (.. Inc.)
* Bluefin Robotics (.. Corporation)
* Brook Ocean Technology (.. Limited)
* Crossbow Technology (.. Inc.)
* Garmin
* HOBI Labs (Hydro-Optics, Biology, & Instrumentation Laboratories)
* Magellan Navigation (.., Inc.)
* MBARI (Monterey Bay Aquarium Research Institute)
* McLane Research Laboratories (.., Inc.)
* NOBSKA
* ORBCOMM (.., Inc.)
* Paroscientific (.., Inc.)
* QUAKE Global (.., Inc.)
* Satlantic (.. Inc.)
* Sea-Bird Electronics (.., Inc.)
* SeaTech (.., Inc.) (no longer exists)
* Simrad (.., Inc)
* Star Engineering
* Teledyne Benthos (was Benthos)
* Teledyne RD Instruments (was RD Instruments)
* UC Santa Barbara (University of California, Santa Barbara)
* WET Labs
* WHOI (Woods Hole Oceanographic Institution)
* Xantrex Technology (.. Inc.)

The following names are also supported
* unknown
* tbd
* testing

The algorithm to follow for the merge will be:
# If the name in SSDS or Instru matches one in the above lists, use it.
# If the first 3 letters of the name in SSDS or Instru is contained in (ignoring case)one of the names above, use the name it is contained in.
#* Note that SeaTech entries should have been an exact match in step 1; all others map to Sea-Bird Electronics.
# Perform manual corrections listed below.

The following entries require manual correction (starred entries should be OK'd with Paul C):
# Anderraa Instruments -> Aanderaa Instruments (typo fix)
# * Ashtech -> Magellan Navigation (Ashtech is model not company) (let Paul know)
# * ASIMET -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Asimet/WHOI -> Star Engineering (model not company; allegedly Star Eng is only seller)
# * Triaxys -> AXYS Technologies, Inc.
# * UCSB -> UC Santa Barbara 

These entries shld be addressed by the 'contained in' rule above.
# Axys Environmental Systems -> Axys Technologies (name change?)
# * Benthos -> Teledyne Benthos (bought))
# Biospherical -> Biospherical Instruments
# Brook Ocean Technology Ltd. -> Brooke Ocean Technology
# Nobska -> NOBSKA
# OrbComm -> ORBCOMM
# Quake -> QUAKE Global
# * RD Instruments -> Teledyne RD Instruments (bought)
# Xantrex -> Xantrex Technology
 

[Back to table...|#table]
{anchor:Type}
h3. Type
 
(See [normalization strategy|BogInstruNormalization#Type].)

The list of permitted types (so far, based on existing data as of 2/20) is as follows. 
* Air Pressure Sensor             
* Aircraft                        
* AUV                             
* Backscatterometer
* Backscatterometer/Fluorometer *(new)*              
* Balloon    
* Battery *(new)*
* BatteryLog                      
* Bioshutter                      
* Cable Monitor                   
* CO2 Monitor                     
* Combined                        
* Communication    
* Communication/GPS *(new)*               
* Compass                         
* Conductivity Sensor             
* Controller                      
* Controller-Mooring Node         
* Controller-Power                
* CTD                             
* CTD Service                     
* Currents Sensor                 
* Currents Sensor-ADCP            
* Data Acquisition Unit           
* Data Acquisition Unit-SmartStar 
* Drifter                         
* Drifter-Profiling               
* Drifter-Surface                 
* Echo Sounder-Singlebeam *(new)*
* Echo Sounder-Multibeam *(new)*
* Electrical Sensor               
* Electrical Sensor-Ground Fault  
* Environment Monitor-System      
* Flow Meter                      
* Flowthrough System              
* Fluorometer                     
* Fluorometer/Nephalometer        
* Glider                          
* GPS                             
* Humidity Sensor                 
* Hydrophone                      
* IMCTD                           
* Inductive Modem                 
* Inductive Modem-Surface         
* Inductive Modem-Underwater
* Inductive Modem Cable Coupler *(new)*      
* Kite                            
* Meteorology Package             
* Metsys                          
* Model Service                   
* Mooring                         
* Navigation Service              
* Navigation-AHRS                 
* Network Hub                     
* Network Hub-Power Controller    
* Nitrogen Sensor                 
* Nitrogen Sensor-ISUS            
* Optical                         
* Oxygen                          
* Oxygen Sensor                   
* Photometer-Bioluminescence      
* platform                        
* Power Supply                    
* Power Supply-Battery            
* Power Supply-Electric *(new)*            
* Power Switch                    
* PowerSwitch                     
* Pressure Sensor                 
* pressureSensor                  
* Profiler                        
* Profiler Package                
* Profiler-Moored                 
* Profiler-Ship                   
* Profiler-Suspended              
* Propulsion Unit  
* Pump *(new*)
* Radiometer                      
* Radiometer-Hyperspectral        
* Radiometer-Longwave             
* Radiometer-Multispectral        
* Radiometer-Shortwave            
* Release *(new*)
* ROV                             
* Satellite                       
* Scatterometer                   
* Scatterometer-LISST             
* Ship                            
* Shutter-Antifouling             
* Sound Speed Sensor 
* Sonar-Sidescan Swath Bathymetry *(new)*
* Sonar-Scanning *(new)*
* Sonar-Subbottom *(new)*
* Spectrometer                    
* Temperature Sensor              
* Test Device                     
* Test Entry-Instrument Type      
* Test Simulated Instrument       
* Toroid                          
* Towfish  
* Transmissometer *(new)*
* Transponder *(new)*                       
* Velocity Sensor-DVL             
* Wave Sensor                     
* Wave Sensor-Heave               
* Wind Sensor                     

The following names are also supported
* unknown
* tbd
* testing


Before beginning, confirm with Paul that the following changes are OK:
# capitalizing first letters of each word
# 'ADCP' to 'Current Sensors-ADCP'
# 'modem' to 'Inductive Modem-Surface' or 'Inductive Modem-Underwater' as appropriate
# OASIS 'Controller' (those with capital C) to 'Controller-Mooring Node'
# separating 'backscatter' into the components below
## Scatterometer: Measures scattered  emitted radiation (includes OBS, optical backscatterometer)
## Backscatterometer: measures reflected radiation from in-situ surfaces
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor' (this is Satlantic unit)
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: measures a configurable series of wavelengths of radiation
## Radiometer-Hyperspectral: measures multiple specific wavelengths of radiation
## Radiometer-Shortwave: measures short-wave radiation ranges
## Radiometer-Longwave: measures long-wave radiation ranges
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder-Singlebeam'
# 'shutter' to 'Shutter-Antifouling'

Questions for Paul:
# Are ECO BBSBs (161, 202) really Backscatterometers, or just Scatterometers?
#* If the former, change SSDS DeviceType for these to Backscatterometer
#* If the later, use existing SSDS DeviceType
# Assumption: all HS2, VSFS units (he calls 'backscatter') are Backscatterometers
# confirm HyperOCRs are Hyperspectral, i.e., controllable
#* If confirmed change 1346-1350 to be Hyperspectral
#* If not put these into appropriate category
# Are any of our shutters not antifouling? Can we call them all Shutter-Antifouling? 

Add the types marked *(new)* above to the DeviceType table.
* Backscatterometer/Fluorometer: backscatterometer that additionally provides fluorescence data
* Battery:  device that stores energy and makes it available in an electrical form; not mediated by electronics (see Power Supply-Battery)
* Communication/GPS: transmits signals from one place to another, and contains GPS locator
* Echo Sounder-Singlebeam: acoustic system which transmits short acoustic pulses from single transmitter into the water column, and then detects echoes from impedance discontinuities (typically fish or plankton)
* Echo Sounder-Multibeam: acoustic system which transmits short acoustic pulses from multiple transmitters into the water column, and then detects echoes from impedance discontinuities (typically from the benthic layer)
* Inductive Modem Cable Coupler: connector for indcutive modems (ICC)
* Power Supply-Electric: power supply (delivers power to other equipment) that does not store energy
* Pump: mechanical device used to move liquids or gases
* Release: mechanism to disconnect two components, typically allowing a buoyant component in water to detach from an anchor and float to the surface
* Sonar-Sidescan Swath Bathymetry: fixed-mounted acoustic bathymetric sounding systems that sweep a wide path; also known as SSBS
* Sonar-Scanning: acoustic system that can move (examples are Articulating, Profiling, and Pencil Beam)
* Sonar-Subbottom: acoustic system designed to penetrate layers beneath the benthic surface (e.g., CHIRP)
* Transmissometer: device to measure the optical transparency of water (also turbidity sensor)
* Transponder: electrical device designed to receive a specific signal and automatically transmit a specific reply 

Change the name for device type 158 from 'Fluorometer/Nephalometer' to 'Fluorometer/Nephelometer', and change description to reflect new spelling.

The algorithm to follow for the merge (order matters) will be:
# Change BOG name 'Controller' (match case)  to 'Controller-Mooring Node'
# SSDS names remain unchanged unless otherwise noted 
#+ If the Instru device has an SSDS entry, use the SSDS device name
#* If the Instru name matches (ignoring case) one in the above lists, use the list name.
# Perform explicit corrections listed below.

The following entries require 'manual' correction (assuming Paul has OK'd the above):
# SSDS ID 1381 -> Radiometer-Multispectral
# SSDS ID 1319 -> Inductive Modem-Surface? () from CommDevice (119) (check this with Paul -- compare to 1538)
# SSDS ID 1224 -> Controller-CTD (151) from Multipurpose (104)
# SSDS ID 1323 -> Communication/GPS (tbd -- need to add) from Combined (185)
# 'ADCP' to 'Current Sensors-ADCP'
#* Instru devices
#* existing SSDS devices
#* Device Table (show as deprecated)
#* Device Entry form
# separating 'backscatter' into the components below
#* need to find out which are which, see Questions
# 'fluor/turbidity' to 'Fluorometer/Nephalometer'
# 'backscatter/fluorometer' to 'Backscatterometer/Fluorometer'
# 'temperature/humidity' to 'Metereology Package'
# 'Nitrate' to 'Nitrogen Sensor/ISUS'
# 'Nitrate analyzer' to 'Nitrogen Sensor'
# 'Oxygen optode' (ignore case) to 'Oxygen Sensor'
# 'radiometer' to one of the following, as appropriate:
## Radiometer-Multispectral: model contains PRR, HR2, HR3
## Radiometer-Hyperspectral: model contains HyperOCRs (see Questions) 
## Radiometer-Shortwave: model contains SWR
## Radiometer-Longwave: model contains LWR
# 'Platform' to 'Toroid'
# 'power source' to 'Power Supply-Electric'
# 'pCO2' to 'CO2 Monitor'
# 'transducer' to 'Transponder'
# 'sounder' to 'Echo Sounder'
# 'shutter' to 'Shutter-Antifouling'



[Back to table...|#table]
{anchor:Model}
h3. Model (in progress)

(See [normalization strategy|BogInstruNormalization#Model].)


The following names are also supported
* unknown
* none
* tbd
* testing

At some point (phase II?), figure out issues with:
# SSDS id 1009, 1218 (2 'MTM' with serial=1)
# SSDS id 1216 (GPS, no model)
# Are Metsys 1321, 1396, 1397 really MBARI mfg?
# What to do with virtual hardware (1309-1311)?
# delete test entries? (1509 etc.)
# SideARM (1278, 1295, 1300, 1411, 1413) vs MSP
# SSDS id 1275 (MBARI Gashound)
# Are all Aquadopp entries the same units (mfgModel is long and identical but descriptions differ)
# SSDS id 1323 (is it a SOON, is it a pco2, is it a platform?)

Before beginning, confirm with Paul that the following changes are OK:
# all Sea-Bird CTDs have model numbers of the form SBE nn[-IM[P]] 
#* SBE prefix
#* '-' after number, except for 'plus' versions
# changes listed under manual correction below

The algorithm to follow for the merge (order matters) will be:
# If BOG Instru Model exists use that; else use SSDS mfgModel.
# Do manual corrections as listed below

The following entries require 'manual' correction (assume Paul has OK'd the above):
# Make the models for the following SSDS ids as listed:
#* 1313: GPS16-HVS
#* 1395: ECO FLNTUSB

#* all '(null)' to null
#* all 'ECO-FLNT*' to 'ECO FLNT*'
#* all 'triplet' to 'ECO Triplet'
#* all 'MMC v*' to 'MMCv4'
#* all 'Medusa R*' to 'Medusa Rev 2'
#* all 'Medusa v*' to 'Medusa Rev 2'
#* all 'Fiberglass tor*' to 'OASIS Buoy'
#* all 'Emeter' to 'E-meter'
 

h3. Merging of Tables

The next step is to migrate the Instru data as is into the Device Table. This will have two aspects: the devices without SSDS IDs, and the devices with SSDS IDs.  

h4. Devices without SSDS IDs

Create new devices in Device, copying all the fields from Instru into the corresponding columns of Device.

Details to be provided.

h4. Devices with SSDS IDs

First, confirm there is no conflict in the overlapping columns.
Then, update the Instru fields in Device with the data from Instru.

Details for both steps to be provided.

{anchor:MBARI-ID}
{anchor:SSDS-ID}

h3. MBARI_ID and SSDS ID

For reasons explained in the [Design] page, we must support MBARI ID field in the BOG database.  To ensure proper operations of both systems, we want to guarantee that all devices have both an MBARI ID and an SSDS ID.  To do this, as we merge the two systems we will generate any missing IDs, according to the following rules:
- SSDS ID is set for new Instru devices as they are added to the database.
- If the MBARI ID exists,
 - prepare any associated changes to the FK in Trans.
 - Set the MBARI ID to the SSDS ID.

In the future, any new device receives the next available SSDS ID, and the MBARI ID is set to the same number.

[Back to table...|#table]
{anchor:Serial}
h3. Serial
 
For the merge:
# Present this field to Access as Serial.  
# Copy the contents of this field without changes.  

In Phase II, If Paul C approves, change the name presented to Access to ShortSerial, and change that application and presentation to match. 
[Back to table...|#table]
{anchor:FullSerial}
h3. FullSerial

Confer with Paul explicitly about SSDS IDs 1429 and 1437, for which the serial numbers are in conflict. For example, 1429 numbers, SSDS first, are 37IM20000-1244 vs. 37IM21734-1244.  If the latter is correct, no changes to the algorithm below are necessary.

The algorithm to follow for the merge (order matters) will be:
# Present the mfgSerialNumber to Access as FullSerial.
# If Instru has a full serial number, use it. 
#* If not, then if SSDS has FullSerial, use that. 
#** Lacking that, if only a (short) Serial is in Instru, use that for the full serial.

For phase II, rename FullSerial in BOG to the SSDS term, and change the application and presentation to match.  (The reason I originally called it mfgSerialNumber was to emphasize it was the number specified by the manufacturer.)

[Back to table...|#table]
{anchor:Calibration-organization}
h3. Calibration organization

For phase I, maintain this material as it is now.

For phase II, consider making it compatible with manufacturer table. But realize that more information may need to be tracked for the calibration organization, and it may be a separate part of the same compnay as the manufacturer.
 
[Back to table...|#table]
{anchor:Features}
h3. Features

Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Pressure-sensor}
h3. Pressure sensor
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Depth-Rating}
h3. Depth Rating
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Firmware-EPROM}
h3. Firmware/EPROM
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Memory}
h3. Memory
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Receive-frequency}
h3. Receive frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transmit-frequency}
h3. Transmit frequency
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Enable-code}
h3. Enable code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Release-code}
h3. Release code
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Tilt-option}
h3. Tilt option
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Purchased-for}
h3. Purchased for
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Owner}
h3. Owner
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Custodian}
h3. Custodian
 
Maintain this material without changes.

In the future, this field should become another Person field.
 
[Back to table...|#table]
{anchor:Date-new}
h3. Date new
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:PO}
h3. PO
 
Maintain this material without changes.
 
[Back to table...|#table]
{anchor:Transaction}
h3. Transaction
 
Maintain this material without changes (or delete this field).
 
[Back to table...|#table]
{anchor:Permanent-comment}
h3. Permanent comment
 
Maintain this material without changes (or delete this field).

[Back to table...|#table]
{anchor:manufacture-web-page}
h3. manufacture web page
 
Maintain this material without changes.

In future, clarify its role and recode appropriately.  (Is this the instrument web pages at the manufacturer's site?)
 
[Back to table...|#table]
{anchor:document-dir}
h3. document dir

Maintain this material without changes.]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">1086</id>
</property>
</object>
<object class="Label" package="com.atlassian.confluence.labels">
<id name="id">3</id>
<property name="name"><![CDATA[favourite]]></property>
<property name="owner"><![CDATA[amarburg]]></property>
<property name="namespace"><![CDATA[my]]></property>
<property name="creationDate">2006-10-27 11:40:54.303</property>
<property name="lastModificationDate">2006-10-27 11:42:01.643</property>
</object>
<object class="BodyContent" package="com.atlassian.confluence.core">
<id name="id">622673</id>
<property name="body"><![CDATA[After the use cases were defined, several [activity diagrams|http://oceana.shore.mbari.org/ProjectLibrary/900626.AssetTracking/together/] were created to help detail out the steps that would need to be taken to implement components to satisify the requirements of the system.  Some of the pieces existed already between SSDS and BOG, but the new steps for the different use cases are as follows.  Each of the DB changes listed below will cause a write to the database's history table, as indicated in the final scenario.
{tip:title=Current Design Details}
# [Create New Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20Instru]
## Changes are verified (must ensure unique alternate key triple exists)
## New entry is inserted into the Device table (set 'show in Instru view' flag to true)
# [Edit Device Through Instru|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20Instru]
## Changes are verified (must preserve uniqueness of alternate keys)
## Changes are made to Device table
# [Create New Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Create%20New%20Device%20in%20SSDS]
## Need a new Create Device page in SSDS web application
## Insert in device table
# [Edit Device Through SSDS|http://oceana.shore.mbari.org:8081/display/AST/Use+Cases#Edit%20Device%20in%20SSDS]
## Need to create new Device Edit page (with JSF validation, DAO submission)
## Update on Device table

So based on these steps the following components need to be built:
# Augment Device table per the following:
## Create column \[MBARI_ID\] \[int\] (but did not set NOT NULL or identity yet)
## Create column \[Serial\] \[nvarchar\] (50)
## Create column \[Calibration_organization\] \[nvarchar\] (50)
## Create column \[Features\] \[nvarchar\] (50)
## Create column \[Pressure_sensor\] \[nvarchar\] (50)
## Create column \[Depth_Rating\] \[int\]
## Create column \[Firmware_EPROM\] \[nvarchar\] (50)
## Create column \[Memory\] \[nvarchar\] (50)
## Create column \[Receive_frequency\] \[nvarchar\] (50)
## Create column \[Transmit_frequency\] \[nvarchar\] (50)
## Create column \[Enable_code\] \[nvarchar\] (50)
## Create column \[Release_code\] \[nvarchar\] (50)
## Create column \[Tilt_option\] \[nvarchar\] (50)
## Create column \[Purchased_for\] \[nvarchar\] (50)
## Create column \[Owner\] \[nvarchar\] (50)
## Create column \[Custodian\] \[nvarchar\] (50)
## Create column \[Date_new\] \[datetime\]
## Create column \[PO\] \[nvarchar\] (50)
## Create column \[Transaction_col\] \[nvarchar\] (10)
## Create column \[Permanent_comment\] \[nvarchar\] (400)
## Create column \[document_dir\] \[nvarchar\] (10)
## Create column \[osg_view\] \[bit\]
## Set default on osg_view to '0'
{note:Title=Column data type changes}
I changed the column type from ntext to nvarchar for 'Transaction_col', 'Permanent_comment', and 'document_dir' as ntext prevent triggers from being created.  Also I shrunk them all down as I did not want to hit the 8060 size limit per row in SQL server.  I made 'Transaction_col' and 'document_dir' really small (10) as they have only NULLs in the production database currently.  I sent an email to Paul asking about those columns.  He stated that the Transaction column was not really used and could be removed.
{note}
# Create a view that matches the instru table structure using the following SQL
{noformat}
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[instru]') and OBJECTPROPERTY(id, N'IsView') = 1)
drop view [dbo].[instru]
GO

SET QUOTED_IDENTIFIER ON 
GO
SET ANSI_NULLS ON 
GO

CREATE VIEW dbo.instru
AS
SELECT     ssdsdba.Device.MBARI_ID, ssdsdba.Device.id AS [SSDS ID], ssdsdba.Person.username AS Technician, ssdsdba.Device.mfgName AS Manufacturer, 
                      ssdsdba.DeviceType.name AS Type, ssdsdba.Device.mfgModel AS Model, ssdsdba.Device.Serial, ssdsdba.Device.mfgSerialNumber AS FullSerial, 
                      ssdsdba.Device.Calibration_organization AS [Calibration organization], ssdsdba.Device.Features, 
                      ssdsdba.Device.Pressure_sensor AS [Pressure sensor], ssdsdba.Device.Depth_Rating AS [Depth Rating], 
                      ssdsdba.Device.Firmware_EPROM AS [Firmware/EPROM], ssdsdba.Device.Memory, ssdsdba.Device.Receive_frequency AS [Receive frequency], 
                      ssdsdba.Device.Transmit_frequency AS [Transmit frequency], ssdsdba.Device.Enable_code AS [Enable code], 
                      ssdsdba.Device.Release_code AS [Release code], ssdsdba.Device.Tilt_option AS [Tilt option], ssdsdba.Device.Purchased_for AS [Purchased for], 
                      ssdsdba.Device.Owner, ssdsdba.Device.Custodian, ssdsdba.Device.Date_new AS [Date new], ssdsdba.Device.PO, 
                      ssdsdba.Device.Transaction_col AS [Transaction], ssdsdba.Device.Permanent_comment AS [Permanent comment], 
                      ssdsdba.Device.infoUrlList AS [manufacture web page], ssdsdba.Device.document_dir AS [document dir]
FROM         ssdsdba.Device LEFT OUTER JOIN
                      ssdsdba.DeviceType ON ssdsdba.Device.DeviceTypeID_FK = ssdsdba.DeviceType.id LEFT OUTER JOIN
                      ssdsdba.Person ON ssdsdba.Device.PersonID_FK = ssdsdba.Person.id
WHERE     (ssdsdba.Device.osg_view = 1)

GO
SET QUOTED_IDENTIFIER OFF 
GO
SET ANSI_NULLS ON 
GO
{noformat}
# Use Enterprise Manager to run a DTS job to copy the trans table from Solstice->BOG to SSDS_Metadata (with data)
# Perform a data normalization step.  This will be a bit tricky.
# Using SQL Query Analyzer, create a foreign key between trans and instru using:
{noformat}
ALTER TABLE [dbo].[trans] ADD 
	CONSTRAINT [FK_trans_instru] FOREIGN KEY 
	(
		[MBARI ID]
	) REFERENCES [ssdsdba].[Device] (
		[MBARI_ID]
	)
GO
{noformat}
{warning:title=NEED MBARI_IDs first}
This is a bit nasty as we would like to create a foreign key to the view, but we cannot so we should link to MBARI_ID in Device table, but since not all instruments are ones that OSG cares about, we don't have MBARI_IDs for all of them.  So in the data normalization step, we need to make sure all entries have MBARI_IDs and the ones from the current instru table match those in the trans table.  If we get rid of MBARI_IDs and change them to SSDS_IDs, we will have a different issue.
{warning}
# Create a System DSN on the machine where instrumentsDE will run and point to the SSDS_Metadata database but call it "BOG".  Use the ssdsdba login and password.
# When you open up the instrumentsDE, you will need to create new linked tables for instru and trans that point to the new DSN and the view and table in SSDS_Metadata.
# [Make changes to the instrumentsDE application|AccessAppChanges]
# Create a history table for the Device table using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTable 'Device'
go
{noformat}
{warning:title=Make sure not History_Device table exists}
In order for the stored procedure to work correct drop any History_Device table that may exist
{warning}
# Create the triggers using the stored procedure:
{noformat}
EXEC AdminGenerateHistoryTriggers 'Device'
go
{noformat}
{note:Title=Removed any old triggers before}
I found that I had to remove the old triggers before running this.
{note}
# Drop both history tables for DeviceType and Person
# Remove all triggers on DeviceType and Person tables
# Generate History tables for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTable 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTable 'Person'
go
{noformat}
# Generate Triggers for DeviceType and Person
{noformat}
EXEC AdminGenerateHistoryTriggers 'DeviceType'
go
{noformat}
{noformat}
EXEC AdminGenerateHistoryTriggers 'Person'
go
{noformat}
{warning:Title=Technician and Type Fields}
OK, so now that all that is in place, we have a bit of a problem with updates of the columns 'Technician' and 'Type' in the access application.  When 'Technician' is edited the Person.username will be changed.  When the 'Type' is edited the DeviceType.name will be changed.  This is where INSTEAD OF triggers should save our behind.
{warning}
# The history tables store the updated values for entries as the thought is that each entry would have to be inserted before any updates so you would always have the initial state of the row.  In this case we are starting with existing data, so it is critical that we get a baseline of all the current rows.  This can be done simply by running these in SQL Query Analyzer:
{noformat}
UPDATE ssdsdba.Device SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.Person SET version = version
GO
{noformat}
{noformat}
UPDATE ssdsdba.DeviceType SET version = version
GO
{noformat}
This will create entries for all the rows so that we will have the current data in the history table to compare future updates/deletions against.
# Create an INSTEAD OF INSERT trigger on the view
{noformat}
CREATE TRIGGER trInstruInsert ON instru
INSTEAD OF INSERT
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Now let's make sure the MBARI_ID and SSDS_ID are null
    IF @mbari_id IS NOT NULL
      RAISERROR('The insert specified the MBARI_ID. This field is auto-generated, do not specify on insert',9,1)
    IF @ssds_id IS NOT NULL
      RAISERROR('The insert specified the SSDS_ID. This field is auto-generated, do not specify on insert',9,1)

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    INSERT INTO ssdsdba.Device 
      (
       mfgName,
       mfgModel,
       Serial,
       mfgSerialNumber,
       Calibration_organization,
       Features,
       Pressure_Sensor,
       Depth_Rating,
       Firmware_EPROM,
       Memory,
       Receive_frequency,
       Transmit_frequency,
       Enable_code,
       Release_code,
       Tilt_option,
       Purchased_for,
       Owner,
       Custodian,
       Date_new,
       PO,
       Transaction_col,
       Permanent_comment,
       infoUrlList,
       document_dir,
       PersonID_FK,
       DeviceTypeID_FK
      )
    VALUES
      (
       @mfgName,
       @mfgModel,
       @serial,
       @mfgSerialNumber,
       @calibration_organization,
       @features,
       @pressure_sensor,
       @depth_rating,
       @firmware_eprom,
       @memory,
       @receive_frequency,
       @transmit_frequency,
       @enable_code,
       @release_code,
       @tilt_option,
       @purchased_for,
       @owner,
       @custodian,
       @date_new,
       @po,
       @transaction_col,
       @permanent_comment,
       @infoUrlList,
       @document_dir,
       @person_id,
       @deviceType_id
      )
  END
END
GO{noformat}
# Create an INSTEAD OF UPDATE trigger on the view
{noformat}
CREATE TRIGGER trInstruUpdate ON instru
INSTEAD OF UPDATE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Inserted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Inserted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Inserted
    -- Now grab the technician name
    SELECT @username = Technician FROM Inserted
    -- Now grab the device type name
    SELECT @deviceTypeName = Type FROM Inserted

    -- Next, let's check to see if the technician's name is not null
    IF @username IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @username != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.Person WHERE username = @username)
          INSERT INTO ssdsdba.Person (version, username, email) VALUES (0, @username, @username)
        SELECT @person_id = id FROM ssdsdba.Person WHERE username = @username
      END
      ELSE
        SET @person_id = NULL
    END
    ELSE
      SET @person_id = NULL

    -- Let's now do the same thing for the device type
    IF @deviceTypeName IS NOT NULL
    BEGIN
      -- Now check to make sure it is just not empty
      IF @deviceTypeName != ''
      BEGIN
        -- Check to see if it exists
        IF NOT EXISTS (SELECT id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName)
          INSERT INTO ssdsdba.DeviceType (version, name) VALUES (0, @deviceTypeName)
        SELECT @deviceType_id = id FROM ssdsdba.DeviceType WHERE name = @deviceTypeName
      END
      ELSE
        SET @deviceType_id = NULL
    END
    ELSE
      SET @deviceType_id = NULL

    -- First update the columns that map directly
    UPDATE ssdsdba.Device 
      SET ssdsdba.Device.mfgName = @mfgName,
          ssdsdba.Device.mfgModel = @mfgModel,
          ssdsdba.Device.Serial = @serial,
          ssdsdba.Device.mfgSerialNumber = @mfgSerialNumber,
          ssdsdba.Device.Calibration_organization = @calibration_organization,
          ssdsdba.Device.Features = @features,
          ssdsdba.Device.Pressure_Sensor = @pressure_sensor,
          ssdsdba.Device.Depth_Rating = @depth_rating,
          ssdsdba.Device.Firmware_EPROM = @firmware_eprom,
          ssdsdba.Device.Memory = @memory,
          ssdsdba.Device.Receive_frequency = @receive_frequency,
          ssdsdba.Device.Transmit_frequency = @transmit_frequency,
          ssdsdba.Device.Enable_code = @enable_code,
          ssdsdba.Device.Release_code = @release_code,
          ssdsdba.Device.Tilt_option = @tilt_option,
          ssdsdba.Device.Purchased_for = @purchased_for,
          ssdsdba.Device.Owner = @owner,
          ssdsdba.Device.Custodian = @custodian,
          ssdsdba.Device.Date_new = @date_new,
          ssdsdba.Device.PO = @po,
          ssdsdba.Device.Transaction_col = @transaction_col,
          ssdsdba.Device.Permanent_comment = @permanent_comment,
          ssdsdba.Device.infoUrlList = @infoUrlList,
          ssdsdba.Device.document_dir = @document_dir,
          ssdsdba.Device.PersonID_FK = @person_id,
          ssdsdba.Device.DeviceTypeID_FK = @deviceType_id
      WHERE ssdsdba.Device.id = (Select [SSDS ID] from Inserted)
  END
END
GO
{noformat}
# Create an INSTEAD OF DELETE trigger on the view
{noformat}
CREATE TRIGGER trInstruDelete ON instru
INSTEAD OF DELETE
AS
BEGIN
  -- Check to see if there are updated rows
  IF EXISTS (Select * from Deleted)
  BEGIN
    -- Declare any needed variables
    DECLARE @mbari_id int,
            @ssds_id numeric(9),
            @username varchar(50),
            @mfgName varchar(255),
            @deviceTypeName varchar(255),
            @mfgModel varchar(255),
            @serial varchar(50),
            @mfgSerialNumber varchar(255),
            @calibration_organization nvarchar(50),
            @features nvarchar(50),
            @pressure_sensor nvarchar(50),
            @depth_rating int,
            @firmware_eprom nvarchar(50),
            @memory nvarchar(50),
            @receive_frequency nvarchar(50),
            @transmit_frequency nvarchar(50),
            @enable_code nvarchar(50),
            @release_code nvarchar(50),
            @tilt_option nvarchar(50),
            @purchased_for nvarchar(50),
            @owner nvarchar(50),
            @custodian nvarchar(50),
            @date_new datetime,
            @po nvarchar(50),
            @transaction_col nvarchar(50),
            @permanent_comment nvarchar(50),
            @infoUrlList varchar(2048),
            @document_dir nvarchar(50),
            @person_id numeric(9),
            @deviceType_id numeric(9)

    -- Now grab all the values from the Deleted table
    SELECT 
            @mbari_id = MBARI_ID,
            @ssds_id = [SSDS ID],
            @username = Technician,
            @mfgName = Manufacturer,
            @deviceTypeName = Type,
            @mfgModel = Model,
            @serial = Serial,
            @mfgSerialNumber = FullSerial,
            @calibration_organization = [Calibration organization],
            @features = Features,
            @pressure_sensor = [Pressure sensor],
            @depth_rating = [Depth Rating],
            @firmware_eprom = [Firmware/EPROM],
            @memory = Memory,
            @receive_frequency = [Receive Frequency],
            @transmit_frequency = [Transmit Frequency],
            @enable_code = [Enable code],
            @release_code = [Release code],
            @tilt_option = [Tilt option],
            @purchased_for = [Purchased for],
            @owner = Owner,
            @custodian = Custodian,
            @date_new = [Date new],
            @po = PO,
            @transaction_col = [Transaction],
            @permanent_comment = [Permanent comment],
            @infoUrlList = [manufacture web page],
            @document_dir = [document dir]
            FROM Deleted

    -- Now let's make sure the SSDS_ID is not null
    IF @ssds_id IS NULL
      RAISERROR('The delete did not specify the SSDS_ID. No delete performed',9,1)

    -- Now delete the row specified
    DELETE FROM ssdsdba.Device 
      WHERE id = @ssds_id
  END
END
GO
{noformat}
# Person Creation/Edit/Delete page (KG)
# DeviceType Creation/Edit page (KG)
# Device Creation Page and Device Edit Page (KG)
## We will need a unique device edit page that can edit non-SSDS fields (like OSG view flag).
## Authenticate against LDAP group
## JSF Validation (unique alternate keys; what else?)
## Calls DAO to create new device/submit changes to existing device
# External application (JG/AM)
## Runs on interval (5(?) minutes) against history table
## Checks for new devices
### mail to SSDS admin with key and alternate key fields (all fields?), and whether device is exposed through Instru view
### send mail to OSG admin (with link to kick of the servlet to make it visible)...
#### only if not visible in Instru? (Does OSG want notification on _all_ additions?)
#### only if not OSG-created? (If OSG creates thru SSDS, send mail? set Instru-visible flag?)
### If OSG operator clicks link, servlet is called that sets Instru view flag on that device
## Checks for edited devices
### mail to SSDS admin with changed fields (old and new), who and when changed, whether device is exposed through Instru view
### if exposed through Instru view, send same mail to OSG admin with link to edit
#### just point back to edit the device for now; later can make this a link to revert the change
#### does OSG admin want to be notified of changes by OSG admin personnel?
## Marks each checked item as done
# 1 Servlet (KG)
## Change Instru view flag
### Pass in SSDS Device ID
### Set the flag on that device to allow it to show through the Instru view
### Send email to SSDS Admin confirming change
# 2 History Triggers on Device Table (KG)
## Every time a device is added, a trigger writes to a history table
##* Information includes key, the alternate key fields, who added the device, and when
## Every time a device is edited, a trigger writes to a history table
##* Information includes key, old record, new record (or old field, new field if atomic), who, when
# {html}<A href="http://oceana.shore.mbari.org:8081/display/AST/BogInstruNormalization" linktext="SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization" linktype="raw" title="BogInstruNormalization"></A>{html}[SQL to perform initial database normalization between BOG and SSDS|BogInstruNormalization]
{html}{html} (JG/AM)
## All XML in puckxml will have to have matching changes made
# Custom field comparison utilities
## Serial number
### Ignore non-alphanumeric text (remove white space, punctuation)
### If existing serial number matches the end of the new serial number, consider it a (likely?) match
## Model number
### Ignore non-alphanumeric text (remove white space, punctuation)
# Put links to CVS web xml in Device listing web page (KG)
{tip}

----

h2. Notes:

A proposal for an integrated set of database fields: [DatabaseFields]

[AccessAppChanges]

----
During our design, questions were raised:
# Does the Microsoft Access application have any validation (check for duplicate serial numbers, etc.)?

_Generally speaking, no.  Some fields (Mfg, Model, Device, ...)are regularized by using drop-downs on the new/edit dialog boxes._

----]]></property>
<property name="content" class="Page" package="com.atlassian.confluence.pages"><id name="id">589906</id>
</property>
</object>
<object class="Label" package="com.atlassian.confluence.labels">
<id name="id">2</id>
<property name="name"><![CDATA[favourite]]></property>
<property name="owner"><![CDATA[kgomes]]></property>
<property name="namespace"><![CDATA[my]]></property>
<property name="creationDate">2006-10-17 21:48:40.373</property>
<property name="lastModificationDate">2016-11-14 13:10:05.330</property>
</object>
</hibernate-generic>