Issue #2038 Delta script should also update providers in the database
Change-Id: I07f058af1702d43f3aa60f0a8646b016f6866b3b Former-commit-id:f361c49484
[formerly de9efbe2f2a74f5c2b2d730153f4831f0c17336e] Former-commit-id:14c7d2d81e
This commit is contained in:
parent
af9cdf8042
commit
582c618ace
2 changed files with 35 additions and 1 deletions
|
@ -26,6 +26,38 @@ do
|
|||
rm $FILE.md5
|
||||
done
|
||||
|
||||
# Dump the provider rows from the database for modification
|
||||
PROVIDER_ROWS=/tmp/provider_rows.tmp
|
||||
psql -U awips -d metadata -c "\copy (select key, stringvalue from ebxml.value where stringvalue like '%<provider %') To '${PROVIDER_ROWS}'";
|
||||
|
||||
# Get old separator
|
||||
OIFS=$IFS
|
||||
|
||||
IFS=$'\n'
|
||||
for f in `cat ${PROVIDER_ROWS}`
|
||||
do
|
||||
IFS=$'\t'
|
||||
arr2=( $f )
|
||||
|
||||
KEY=${arr2[0]}
|
||||
XML_FILE=/tmp/${KEY}.xml
|
||||
|
||||
# Write out database contents
|
||||
echo "${arr2[1]}" > ${XML_FILE}
|
||||
# Remove carriage returns
|
||||
sed -i 's/\\n//g' ${XML_FILE}
|
||||
|
||||
# Run the xslt transform on the tmp file
|
||||
xsltproc ${XSLT_SCRIPT} ${XML_FILE} > ${XML_FILE}.new
|
||||
|
||||
# Insert the new xml into the database
|
||||
NEW_XML=`cat ${XML_FILE}.new`
|
||||
psql -U awips -d metadata -c "UPDATE ebxml.value SET stringvalue = '${NEW_XML}' WHERE key = '${KEY}'"
|
||||
done
|
||||
|
||||
# Restore old separator
|
||||
IFS=$OIFS
|
||||
|
||||
echo "INFO: the update has completed successfully!"
|
||||
|
||||
exit 0
|
||||
|
|
|
@ -220,7 +220,9 @@ public class SubscriptionIntegrityVerifier {
|
|||
try {
|
||||
DataSet dataSet = DataDeliveryHandlers.getDataSetHandler()
|
||||
.getById(event.getId());
|
||||
dataSetUpdated(dataSet);
|
||||
if (dataSet != null) {
|
||||
dataSetUpdated(dataSet);
|
||||
}
|
||||
} catch (RegistryHandlerException e) {
|
||||
statusHandler
|
||||
.handle(Priority.ERROR,
|
||||
|
|
Loading…
Add table
Reference in a new issue