Merge "Omaha #3702 register database plugin to fxa database." into omaha_14.4.1

Former-commit-id: 82280a1f38 [formerly 1038af1901] [formerly ee86734625] [formerly ee86734625 [formerly 1adac05f5a]] [formerly 82280a1f38 [formerly 1038af1901] [formerly ee86734625] [formerly ee86734625 [formerly 1adac05f5a]] [formerly 1bc24c3be2 [formerly ee86734625 [formerly 1adac05f5a] [formerly 1bc24c3be2 [formerly 0ceea4d3d7e36160a70ea9f7f5256d94cd2778b5]]]]]
Former-commit-id: 1bc24c3be2
Former-commit-id: 3781c4b08c [formerly e660a61fa9] [formerly 4f056d76c8] [formerly 2bbcaa94dc86cdcd5d39a57ffd8ea8fd079e8e6e [formerly dcfabbc95e67fec2343f8bc01a273a0ef2f97589] [formerly 4f056d76c8 [formerly c6cb389a3d]]]
Former-commit-id: 831d2e5edba4dc20d1806bd8ce522a78003283b7 [formerly fee614f33d7cd6e30009bae10026ea09adbfa457] [formerly 7bb803b504 [formerly 327d82ed02]]
Former-commit-id: 7bb803b504
Former-commit-id: 9f372715f5
This commit is contained in:
Richard Peter 2014-10-07 15:13:11 -05:00 committed by Gerrit Code Review
commit 3b1ca283a3
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
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">
<property name="pluginName" value="text" />
<property name="pluginFQN" value="com.raytheon.uf.common.dataplugin.text" />
@ -12,7 +23,7 @@
</bean>
<bean id="textRegistered" factory-bean="pluginRegistry" factory-method="register"
depends-on="fxaTxManager">
depends-on="fxaTxManager,fxaCommonDbRegistered">
<constructor-arg value="text"/>
<constructor-arg ref="textProperties"/>
</bean>
@ -22,6 +33,7 @@
<property name="includes">
<list>
<value>com.raytheon.uf.common.dataplugin.text</value>
<value>com.raytheon.uf.edex.database</value>
</list>
</property>
</bean>