Omaha #3702 register database plugin to fxa database.

Former-commit-id: 7fa6925c27330262dd0a70afcb77c589718cf1f7
This commit is contained in:
Ben Steffensmeier 2014-10-06 18:32:54 -05:00
parent 2616fe04b6
commit 997bfd689d
2 changed files with 43 additions and 1 deletions

View file

@ -0,0 +1,30 @@
#!/bin/bash
# DR #3702 Copy text plugin_info to the fxatext database.
PSQL="/awips2/psql/bin/psql"
echo "INFO: Copying text plugin_info to fxatext database."
initialized=`$PSQL -t -U awips -d metadata -c "SELECT initialized FROM plugin_info WHERE name = 'text';"`
if [ -n "$initialized" ]; then
$PSQL -U awips -d fxatext -c "CREATE TABLE IF NOT EXISTS plugin_info(name character varying(255) NOT NULL, initialized boolean,tablename character varying(255),CONSTRAINT plugin_info_pkey PRIMARY KEY (name)); ALTER TABLE plugin_info OWNER TO awips;"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to create plugin_info table in fxatext database"
echo "FATAL: The update has failed."
exit 1
fi
$PSQL -U awips -d fxatext -c "INSERT INTO plugin_info (name,initialized) VALUES ('text','$initialized');"
if [ $? -ne 0 ]; then
echo "ERROR: Failed to register text plugin in fxatext database."
echo "FATAL: The update has failed."
exit 1
fi
$PSQL -t -U awips -d metadata -c "DELETE FROM plugin_info WHERE name = 'text';"
else
echo "INFO: Nothing to do."
fi
${PSQL} -U awips -d metadata -c "ALTER TABLE plugin_info DROP COLUMN IF EXISTS database;"
echo "INFO: Done copying text plugin_info to fxatext database."

View file

@ -3,6 +3,17 @@
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd"> http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<bean id="fxaCommonDbPluginProperties" class="com.raytheon.uf.edex.database.DatabasePluginProperties">
<property name="pluginFQN" value="com.raytheon.uf.edex.database" />
<property name="database" value="fxa" />
<property name="forceCheck" value="true" />
</bean>
<bean id="fxaCommonDbRegistered" factory-bean="dbPluginRegistry" factory-method="register">
<constructor-arg value="com.raytheon.uf.edex.database.fxa" />
<constructor-arg ref="fxaCommonDbPluginProperties" />
</bean>
<bean id="textProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties"> <bean id="textProperties" class="com.raytheon.uf.common.dataplugin.PluginProperties">
<property name="pluginName" value="text" /> <property name="pluginName" value="text" />
<property name="pluginFQN" value="com.raytheon.uf.common.dataplugin.text" /> <property name="pluginFQN" value="com.raytheon.uf.common.dataplugin.text" />
@ -12,7 +23,7 @@
</bean> </bean>
<bean id="textRegistered" factory-bean="pluginRegistry" factory-method="register" <bean id="textRegistered" factory-bean="pluginRegistry" factory-method="register"
depends-on="fxaTxManager"> depends-on="fxaTxManager,fxaCommonDbRegistered">
<constructor-arg value="text"/> <constructor-arg value="text"/>
<constructor-arg ref="textProperties"/> <constructor-arg ref="textProperties"/>
</bean> </bean>
@ -22,6 +33,7 @@
<property name="includes"> <property name="includes">
<list> <list>
<value>com.raytheon.uf.common.dataplugin.text</value> <value>com.raytheon.uf.common.dataplugin.text</value>
<value>com.raytheon.uf.edex.database</value>
</list> </list>
</property> </property>
</bean> </bean>