From c0d8dad8ae4590b5bc2a4f104382fbff035068b7 Mon Sep 17 00:00:00 2001 From: Ben Steffensmeier Date: Thu, 16 May 2013 17:30:05 -0500 Subject: [PATCH] Issue #1869 Remove DataURI column from qc. Former-commit-id: e54b02e75b3534f829f0cc4be2639ae5ed26663e --- .../viz/pointdata/rsc/PlotResourceData.java | 4 +-- .../retrieve/PointDataPlotInfoRetriever.java | 2 +- deltaScripts/13.5.1/dropDataURI.sh | 1 + .../uf/common/dataplugin/qc/QCRecord.java | 31 ++++--------------- .../res/pointdata/qcdb.xml | 2 +- .../raytheon/uf/edex/plugin/qc/QCScanner.java | 8 ++--- 6 files changed, 15 insertions(+), 33 deletions(-) diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotResourceData.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotResourceData.java index 968eb85e77..fb6b132e6b 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotResourceData.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/PlotResourceData.java @@ -56,7 +56,6 @@ import com.raytheon.viz.pointdata.rsc.retrieve.PointDataPlotInfoRetriever; * Feb 17, 2009 njensen Initial creation * Jun 29, 2009 2538 jsanchez Implemented Metars. * May 14, 2013 1869 bsteffen Get plots working without dataURI - * May 15, 2013 1869 bsteffen Remove DataURI column from ldadmesonet. * * * @@ -168,7 +167,6 @@ public class PlotResourceData extends AbstractRequestableResourceData { pluginProps.put("tcg", new PluginPlotProperties(true, false)); pluginProps.put("svrwx", new PluginPlotProperties(true, false)); pluginProps.put("ldadhydro", new PluginPlotProperties(true, false)); - pluginProps.put("qc", new PluginPlotProperties(true, false)); pluginProps.put("textPoints", new PluginPlotProperties(true, false)); /* * The good ones, these don't even need to be here because this is the @@ -191,6 +189,8 @@ public class PlotResourceData extends AbstractRequestableResourceData { pluginProps.put("bufrmosMRF", new PluginPlotProperties()); pluginProps.put("bufrmosNGM", new PluginPlotProperties()); pluginProps.put("ldadmesonet", new PluginPlotProperties()); + pluginProps.put("qc", new PluginPlotProperties()); + ParsedURL.registerHandler(new LocalizationParsedURLHandler()); } diff --git a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java index 050f6a51c6..f54224d14d 100644 --- a/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java +++ b/cave/com.raytheon.viz.pointdata/src/com/raytheon/viz/pointdata/rsc/retrieve/PointDataPlotInfoRetriever.java @@ -109,7 +109,7 @@ public class PointDataPlotInfoRetriever extends AbstractDbPlotInfoRetriever { statusHandler.handle(Priority.CRITICAL, message, new Exception( message)); } - if (data.length == 5) { + if (data.length > 4) { stationInfo.dataURI = (String) data[4]; } return stationInfo; diff --git a/deltaScripts/13.5.1/dropDataURI.sh b/deltaScripts/13.5.1/dropDataURI.sh index 8dfcff093e..1fcc289f0c 100644 --- a/deltaScripts/13.5.1/dropDataURI.sh +++ b/deltaScripts/13.5.1/dropDataURI.sh @@ -42,5 +42,6 @@ dropDatauriAndAddConstraint bufrmoshpc bufrmoshpc_location_id_reftime_forecastti dropDatauriAndAddConstraint goessounding goessounding_stationid_reftime_latitude_longitude_key "(stationid, reftime, latitude, longitude)" dropDatauriAndAddConstraint poessounding poessounding_stationid_reftime_latitude_longitude_key "(stationid, reftime, latitude, longitude)" dropDatauriAndAddConstraint ldadmesonet ldadmesonet_stationid_reftime_reportType_dataProvider_latitude_longitude_key "(stationid, reftime, reportType, dataProvider, latitude, longitude)" +dropDatauriAndAddConstraint qc qc_stationid_reftime_qctype_latitude_longitude_key "(stationid, reftime, qcType, latitude, longitude)" echo "INFO: dataURI columns dropped successfully" diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java b/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java index ad0175d16b..42fcfbec87 100644 --- a/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java +++ b/edexOsgi/com.raytheon.uf.common.dataplugin.qc/src/com/raytheon/uf/common/dataplugin/qc/QCRecord.java @@ -22,8 +22,6 @@ package com.raytheon.uf.common.dataplugin.qc; import java.util.Date; -import javax.persistence.Access; -import javax.persistence.AccessType; import javax.persistence.Column; import javax.persistence.Embeddable; import javax.persistence.Embedded; @@ -32,14 +30,9 @@ import javax.persistence.SequenceGenerator; import javax.persistence.Table; import javax.persistence.Transient; import javax.persistence.UniqueConstraint; -import javax.xml.bind.annotation.XmlAccessType; -import javax.xml.bind.annotation.XmlAccessorType; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; import org.hibernate.annotations.Index; -import com.raytheon.uf.common.dataplugin.IDecoderGettable; import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.annotations.DataURI; import com.raytheon.uf.common.geospatial.ISpatialEnabled; @@ -56,11 +49,13 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; * SOFTWARE HISTORY * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 12/07/2009 3408 bphillip Initial creation - * Apr 4, 2013 1846 bkowal Added an index on refTime and forecastTime + * Dec 07, 2009 3408 bphillip Initial creation + * Apr 04, 2013 1846 bkowal Added an index on refTime and + * forecastTime * Apr 12, 2013 1857 bgonzale Added SequenceGenerator annotation. * May 07, 2013 1869 bsteffen Remove dataURI column from * PluginDataObject. + * May 16, 2013 1869 bsteffen Remove DataURI column from qc. * * * @@ -69,7 +64,8 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; */ @Entity @SequenceGenerator(initialValue = 1, name = PluginDataObject.ID_GEN, sequenceName = "qcseq") -@Table(name = "qc", uniqueConstraints = { @UniqueConstraint(columnNames = { "dataURI" }) }) +@Table(name = "qc", uniqueConstraints = { @UniqueConstraint(columnNames = { + "stationid", "reftime", "qcType", "latitude", "longitude" }) }) /* * Both refTime and forecastTime are included in the refTimeIndex since * forecastTime is unlikely to be used. @@ -80,8 +76,6 @@ import com.raytheon.uf.common.serialization.annotations.DynamicSerializeElement; @Index(name = "qc_refTimeIndex", columnNames = { "refTime", "forecastTime" } ) } ) -@XmlRootElement -@XmlAccessorType(XmlAccessType.NONE) @DynamicSerialize public class QCRecord extends PluginDataObject implements ISpatialEnabled { @@ -131,13 +125,11 @@ public class QCRecord extends PluginDataObject implements ISpatialEnabled { @Embedded @DataURI(position = 2, embedded = true) - @XmlElement @DynamicSerializeElement private SurfaceObsLocation location; // latitude, longitude, elevation, @Column(nullable = false, length = 20) @DataURI(position = 1) - @XmlElement @DynamicSerializeElement private String qcType; @@ -704,11 +696,6 @@ public class QCRecord extends PluginDataObject implements ISpatialEnabled { super(uri); } - @Override - public IDecoderGettable getDecoderGettable() { - return null; - } - public Date getInvTime() { return invTime; } @@ -1971,10 +1958,4 @@ public class QCRecord extends PluginDataObject implements ISpatialEnabled { public void setPointDataView(FakePointDataView pointDataView) { this.pointDataView = pointDataView; } - @Override - @Column - @Access(AccessType.PROPERTY) - public String getDataURI() { - return super.getDataURI(); - } } diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.qc/res/pointdata/qcdb.xml b/edexOsgi/com.raytheon.uf.edex.plugin.qc/res/pointdata/qcdb.xml index 8d29123e1d..905fe8f1a4 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.qc/res/pointdata/qcdb.xml +++ b/edexOsgi/com.raytheon.uf.edex.plugin.qc/res/pointdata/qcdb.xml @@ -23,6 +23,6 @@ + - \ No newline at end of file diff --git a/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java b/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java index c71b17ac57..b8c39b423c 100644 --- a/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java +++ b/edexOsgi/com.raytheon.uf.edex.plugin.qc/src/com/raytheon/uf/edex/plugin/qc/QCScanner.java @@ -54,9 +54,10 @@ import com.raytheon.uf.edex.plugin.qc.dao.QCDao; * * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- - * 2010-12-03 #4775 D. Friedman Initial version - * ... - * 2013-03-07 DR 15842 D. Friedman Use Java NetCDF library instead of pupynere + * Dec 03, 2010 4775 D. Friedman Initial version + * Mar 07, 2013 15842 D. Friedman Use Java NetCDF library instead of + * pupynere + * May 16, 2013 1869 bsteffen Remove DataURI column from qc. * * * @@ -212,7 +213,6 @@ public class QCScanner { r.setNcSet(fn); r.setNcIndex(index); r.setQcType(qcType); - r.constructDataURI(); records[oi++] = r; } ++index;