Merge "Issue #1638 Adding pointdata as common base plugin, adding edex pointdata to edex base plugin. Removed edex pointdata dependency on uengine. Removed unused class RequestJob. Cleaned up manifest dependencies in CAVE." into development

Former-commit-id: 820518ffb9 [formerly 0479eb0cc1] [formerly 820518ffb9 [formerly 0479eb0cc1] [formerly 3baebb684b [formerly 582f5f0fe2e348ea5ec3fe75a66b2ccbce431515]]]
Former-commit-id: 3baebb684b
Former-commit-id: 63f7abc798 [formerly 374bd51fb0]
Former-commit-id: 5eae24b949
This commit is contained in:
Bryan Kowal 2013-03-20 16:53:18 -05:00 committed by Gerrit Code Review
commit ddf4c04e59
19 changed files with 174 additions and 478 deletions

View file

@ -21,13 +21,6 @@
<import feature="com.raytheon.uf.viz.cots.feature" version="1.0.0.qualifier"/>
</requires>
<plugin
id="com.raytheon.uf.common.derivparam"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.dissemination"
download-size="0"
@ -42,13 +35,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.pointdata"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.cache"
download-size="0"

View file

@ -33,7 +33,15 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.viz.application;bundle-version="1.0.0",
com.raytheon.uf.common.geospatial;bundle-version="1.12.1174",
com.raytheon.uf.common.units;bundle-version="1.0.0",
com.raytheon.uf.common.colormap;bundle-version="1.12.1174"
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174",
com.raytheon.uf.common.time;bundle-version="1.12.1174",
com.raytheon.uf.common.comm;bundle-version="1.12.1174",
com.raytheon.uf.common.message;bundle-version="1.12.1174",
com.raytheon.uf.common.alertmonitor;bundle-version="1.12.1174",
com.raytheon.uf.common.python;bundle-version="1.12.1174",
com.raytheon.uf.common.velocity;bundle-version="1.0.0",
org.apache.log4j;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Eclipse-BuddyPolicy: ext, registered, global
Eclipse-RegisterBuddy: org.apache.velocity, org.apache.log4j, com.raytheon.edex.common, com.raytheon.uf.common.serialization, com.raytheon.uf.common.serialization.comm, com.raytheon.uf.common.status, com.raytheon.uf.common.dataplugin.level
@ -80,19 +88,4 @@ Export-Package: com.raytheon.uf.viz.core,
com.raytheon.viz.core.slice,
com.raytheon.viz.core.slice.request,
com.raytheon.viz.core.units
Import-Package: com.raytheon.uf.common.alertmonitor,
com.raytheon.uf.common.comm,
com.raytheon.uf.common.datastorage,
com.raytheon.uf.common.datastorage.records,
com.raytheon.uf.common.message,
com.raytheon.uf.common.message.response,
com.raytheon.uf.common.pointdata,
com.raytheon.uf.common.python,
com.raytheon.uf.common.time,
com.raytheon.uf.common.time.adapter,
com.raytheon.uf.common.time.util,
com.raytheon.uf.common.topo,
com.raytheon.uf.common.velocity,
org.apache.log4j,
org.apache.log4j.spi
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -137,12 +137,7 @@ public class PixelCoverage {
* @return
*/
public boolean intersects(IExtent extent) {
if (mesh == null || true) {
// TODO: Figure out mesh intersection algorithm
return this.extent.intersects(extent);
} else {
return mesh.intersects(extent);
}
return this.extent.intersects(extent);
}
/**

View file

@ -117,18 +117,6 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.mina"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.qpid"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="com.sun.jna"
download-size="0"

View file

@ -63,7 +63,6 @@ Import-Package: com.raytheon.uf.common.geospatial,
com.raytheon.viz.ui.editor,
com.raytheon.viz.ui.input,
com.raytheon.viz.ui.input.preferences,
com.raytheon.viz.ui.jobs,
com.raytheon.viz.ui.keys,
com.raytheon.viz.ui.panes,
com.raytheon.viz.ui.perspectives,

View file

@ -28,8 +28,7 @@ Require-Bundle: org.eclipse.ui,
com.raytheon.uf.common.colormap;bundle-version="1.0.0",
com.raytheon.uf.common.serialization.comm,
org.eclipse.core.expressions,
com.raytheon.uf.viz.application;bundle-version="1.0.0",
com.raytheon.uf.common.topo;bundle-version="1.12.1174"
com.raytheon.uf.viz.application;bundle-version="1.0.0"
Eclipse-BuddyPolicy: ext, registered, global
Eclipse-RegisterBuddy: org.apache.velocity, com.raytheon.edex.common, com.raytheon.uf.common.serialization, com.raytheon.uf.common.status
Export-Package:

View file

@ -14,7 +14,10 @@ Require-Bundle: com.raytheon.viz.core,
org.apache.commons.lang,
com.raytheon.uf.viz.core,
org.eclipse.core.expressions,
com.raytheon.uf.common.colormap;bundle-version="1.12.1174"
com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
com.raytheon.uf.common.message;bundle-version="1.12.1174",
com.raytheon.uf.common.time;bundle-version="1.12.1174",
com.raytheon.uf.common.util;bundle-version="1.12.1174"
Export-Package: com.raytheon.viz.ui,
com.raytheon.viz.ui.actions,
com.raytheon.viz.ui.cmenu,
@ -24,7 +27,6 @@ Export-Package: com.raytheon.viz.ui,
com.raytheon.viz.ui.editor,
com.raytheon.viz.ui.input,
com.raytheon.viz.ui.input.preferences,
com.raytheon.viz.ui.jobs,
com.raytheon.viz.ui.keys,
com.raytheon.viz.ui.panes,
com.raytheon.viz.ui.parameter.converters,
@ -37,5 +39,4 @@ Export-Package: com.raytheon.viz.ui,
com.raytheon.viz.ui.widgets,
com.raytheon.viz.ui.widgets.duallist
Bundle-Vendor: Raytheon
Import-Package: com.raytheon.uf.common.message.response
Bundle-RequiredExecutionEnvironment: JavaSE-1.6

View file

@ -1,272 +0,0 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.viz.ui.jobs;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus;
import com.raytheon.uf.common.status.UFStatus.Priority;
import com.raytheon.uf.viz.core.IDisplayPane;
import com.raytheon.uf.viz.core.drawables.IDescriptor;
import com.raytheon.uf.viz.core.exception.NoDataAvailableException;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData;
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
import com.raytheon.viz.core.ColorUtil;
import com.raytheon.viz.core.rsc.BlendedResource;
import com.raytheon.viz.core.rsc.BlendedResourceData;
import com.raytheon.viz.ui.HistoryList;
import com.raytheon.viz.ui.UiPlugin;
import com.raytheon.viz.ui.editor.AbstractEditor;
import com.raytheon.viz.ui.editor.IMultiPaneEditor;
/**
* Request products from EDEX via JMS (Receives file pointer, not base64
* encoding of product)
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* 7/1/06 chammack Initial Creation.
* 8/8/07 chammack Refactored: moved loading logic to core.comm.Loader
*
* </pre>
*
* @author chammack
* @version 1
*/
public class RequestJob extends Job {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(RequestJob.class);
/**
* Resource that is being added via a request job
*/
private class Resource {
public AbstractVizResource<?, ?> vizResource;
public IDescriptor descriptor;
}
public static class Request {
public AbstractRequestableResourceData resourceData;
public LoadProperties loadProperties;
}
private final List<Request> requests;
private boolean blendable;
private boolean difference;
private IDisplayPane[] displayPanes;
/**
* Constructor
*
* @param property
* the layer property to build data from
* @param timeOut
* time out in seconds
* @param requests2
* @param displayPanes
* @param loadProperties
* the load properties (null will construct a default load
* properties)
*/
public RequestJob(int timeOut, AbstractEditor editor, Request... requests) {
super("Requesting EDEX Product(s)");
this.requests = new ArrayList<Request>();
for (Request r : requests) {
this.requests.add(r);
}
this.displayPanes = editor.getDisplayPanes();
IDisplayPane selected = getSelectedDisplayPane(editor);
if (selected != null) {
this.displayPanes = new IDisplayPane[] { selected };
}
this.blendable = false;
this.setDifference(false);
}
/**
* @param editor
* @return the selectedDisplayPane, null if nothing is selected
*/
private IDisplayPane getSelectedDisplayPane(AbstractEditor editor) {
IDisplayPane selected = null;
if (editor instanceof IMultiPaneEditor) {
selected = ((IMultiPaneEditor) editor)
.getSelectedPane(IMultiPaneEditor.LOAD_ACTION);
}
return selected;
}
/**
*
* @param flag
* the requests to be loaded as blendable resources. by default
* resource blending is disabled.
*/
public void setBlendable(boolean flag) {
this.blendable = flag;
}
/**
*
* @return true if there are exactly two resources and the resources to be
* loaded by this RequestJob are set to be blendable.
*/
public boolean isBlendable() {
return (requests.size() == 2) && blendable;
}
/*
* (non-Javadoc)
*
* @seeorg.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.
* IProgressMonitor)
*/
@Override
protected IStatus run(IProgressMonitor monitor) {
List<Resource> resources = null;
try {
resources = new ArrayList<Resource>();
for (Request request : this.requests) {
for (IDisplayPane displayPane : displayPanes) {
Resource resource = new Resource();
try {
resource.vizResource = request.resourceData.construct(
request.loadProperties,
displayPane.getDescriptor());
if (resource.vizResource != null) {
resource.descriptor = displayPane.getDescriptor();
resources.add(resource);
}
} catch (NoDataAvailableException e) {
statusHandler
.handle(Priority.PROBLEM,
"No Data Available for "
+ getMetaDataValueString(request.resourceData
.getMetadataMap()), e);
}
}
}
requests.clear();
} catch (VizException e1) {
final Status s = new Status(IStatus.ERROR, UiPlugin.PLUGIN_ID,
IStatus.ERROR, "Error: " + e1.getMessage(), e1);
return s;
}
if (resources.size() == 2) {
if (isBlendable()) {
BlendedResourceData resourceData = new BlendedResourceData();
BlendedResource resource = new BlendedResource(resourceData,
new LoadProperties());
resource.addResource(resources.get(0).vizResource);
resource.addResource(resources.get(1).vizResource);
Resource blendedResource = new Resource();
blendedResource.vizResource = resource;
blendedResource.descriptor = resources.get(0).descriptor;
resources.clear();
resources.add(blendedResource);
}
}
try {
for (Resource resource : resources) {
if (resource.vizResource
.hasCapability(ColorableCapability.class) == false) {
resource.vizResource.getCapability(
ColorableCapability.class).setColor(
ColorUtil.getNewColor(displayPanes));
}
resource.descriptor.getResourceList().add(resource.vizResource);
}
HistoryList.getInstance().refreshLatestBundle();
} catch (VizException e) {
final Status s = new Status(IStatus.ERROR, UiPlugin.PLUGIN_ID,
IStatus.ERROR, "Error: " + e.getMessage(), e);
return s;
}
return Status.OK_STATUS;
}
/**
* @param metadataMap
* @return
*/
private String getMetaDataValueString(
HashMap<String, RequestConstraint> metadataMap) {
StringBuilder valueString = new StringBuilder();
for (RequestConstraint constraint : metadataMap.values()) {
if (valueString.length() != 0) {
valueString.append("::");
}
valueString.append(constraint.getConstraintValue());
}
return valueString.toString();
}
public void setDifference(boolean difference) {
this.difference = difference;
}
public boolean isDifference() {
return difference;
}
}

View file

@ -368,4 +368,30 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.pointdata"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.derivparam"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="org.apache.qpid"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.mina"
download-size="0"
install-size="0"
version="0.0.0"/>
</feature>

View file

@ -66,13 +66,17 @@ public class DbQueryResponse implements ISerializableObject {
return getResults().size();
}
@SuppressWarnings("unchecked")
public <T> T[] getEntityObjects(Class<T> entityType) {
return getFieldObjects(ENTITY_RESULT_KEY, entityType);
}
@SuppressWarnings("unchecked")
public <T> T[] getFieldObjects(String fieldKey, Class<T> fieldType) {
List<Map<String, Object>> results = getResults();
T[] entities = (T[]) Array.newInstance(entityType, results.size());
T[] entities = (T[]) Array.newInstance(fieldType, results.size());
int i = 0;
for (Map<String, Object> result : results) {
entities[i++] = entityType.cast(result.get(ENTITY_RESULT_KEY));
entities[i++] = fieldType.cast(result.get(fieldKey));
}
return entities;
}

View file

@ -3,6 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Name: PointData
Bundle-SymbolicName: com.raytheon.uf.common.pointdata
Bundle-Version: 1.12.1174.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-RegisterBuddy: com.raytheon.uf.common.serialization
Export-Package: com.raytheon.uf.common.pointdata,
com.raytheon.uf.common.pointdata.accumulate,

View file

@ -125,6 +125,13 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.pointdata"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.purgesrv"
download-size="0"
@ -164,18 +171,6 @@
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.mina"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.apache.qpid"
download-size="0"
install-size="0"
version="0.0.0"/>
<plugin
id="org.dom4j"
download-size="0"

View file

@ -49,13 +49,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.derivparam"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.dissemination"
download-size="0"
@ -77,13 +70,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.pointdata"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.common.site"
download-size="0"

View file

@ -70,13 +70,6 @@
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.pointdata"
download-size="0"
install-size="0"
version="0.0.0"
unpack="false"/>
<plugin
id="com.raytheon.uf.edex.python.decoder"
download-size="0"

View file

@ -56,122 +56,121 @@ import com.raytheon.uf.edex.pointdata.PointDataQuery;
*/
public class QCDataQuery extends PointDataQuery {
/** List of query parameters for "querying" the netCDF file */
private final List<String> queryParameters;
/** List of query parameters for "querying" the netCDF file */
private final List<String> queryParameters;
/**
* Constructs a new QCDataQuery
*
* @throws DataAccessLayerException
* If errors occur while retrieving the data access object
* @throws PluginException
* If the data access object is of the wrong type
*/
public QCDataQuery() throws DataAccessLayerException, PluginException {
super("qc");
queryParameters = new ArrayList<String>();
}
/**
* Constructs a new QCDataQuery
*
* @throws DataAccessLayerException
* If errors occur while retrieving the data access object
* @throws PluginException
* If the data access object is of the wrong type
*/
public QCDataQuery() throws DataAccessLayerException, PluginException {
super("qc");
queryParameters = new ArrayList<String>();
}
@Override
@Override
public void addParameter(String name, String value, String operand) {
queryParameters.add(name + " " + value + " " + operand);
}
queryParameters.add(name + " " + value + " " + operand);
}
/**
* Executes the query and returns the data in a PointDataContainer
*
* @return The data in a PointDataContainer
* @throws Exception
* if errors occur while retrieving the data
*/
@Override
/**
* Executes the query and returns the data in a PointDataContainer
*
* @return The data in a PointDataContainer
* @throws Exception
* if errors occur while retrieving the data
*/
@Override
public PointDataContainer execute() throws Exception {
List<PointDataContainer> containers = new ArrayList<PointDataContainer>();
List<PointDataContainer> containers = new ArrayList<PointDataContainer>();
// Gets the available files for querying
Map<String, File> pathMap = QCPaths.getPaths();
for (File dir : pathMap.values()) {
// Gets the available files for querying
Map<String, File> pathMap = QCPaths.getPaths();
for (File dir : pathMap.values()) {
List<File> files = FileUtil.listFiles(dir, null, false);
if (!files.isEmpty()) {
String[] fileParams = ((QCDao) dao).getParameters(files.get(0));
Set<String> attribSet = new HashSet<String>(
Arrays.asList(attribs));
attribSet.retainAll(Arrays.asList(fileParams));
List<String> attributes = new ArrayList<String>();
attributes.addAll(attribSet);
for (File file : files) {
PointDataContainer pdc = ((QCDao) dao).getPointData(file,
attributes, queryParameters);
if (pdc == null) {
return null;
}
if (pdc.getAllocatedSz() != 0) {
containers.add(pdc);
}
}
}
}
if (!files.isEmpty()) {
String[] fileParams = ((QCDao) dao).getParameters(files.get(0));
Set<String> attribSet = new HashSet<String>(
Arrays.asList(attribs));
attribSet.retainAll(Arrays.asList(fileParams));
List<String> attributes = new ArrayList<String>();
attributes.addAll(attribSet);
for (File file : files) {
PointDataContainer pdc = ((QCDao) dao).getPointData(file,
attributes, queryParameters);
if (pdc == null) {
return null;
}
if (pdc.getAllocatedSz() != 0) {
containers.add(pdc);
}
}
}
}
if (containers.size() == 0)
return null;
if (containers.size() == 0)
return null;
PointDataContainer c0 = containers.get(0);
PointDataContainer c0 = containers.get(0);
for (int i = 1; i < containers.size(); i++) {
c0.combine(containers.get(i));
}
return c0;
}
for (int i = 1; i < containers.size(); i++) {
c0.combine(containers.get(i));
}
return c0;
}
@Override
public ResponseMessageCatalog getAvailableParameters() throws Exception {
String[] p = new String[0];
Map<String, List<Integer[]>> fnameMap = getRetrievalMap(1);
@Override
public ResponseMessageCatalog getAvailableParameters() throws Exception {
String[] p = new String[0];
Map<String, List<Integer[]>> fnameMap = getRetrievalMap(1);
if (fnameMap.size() > 0) {
if (fnameMap.size() > 0) {
Iterator<String> str = fnameMap.keySet().iterator();
p = ((QCDao) dao).getParameters(new File(str.next()));
}
ResponseMessageCatalog cat = new ResponseMessageCatalog();
cat.setValues(p);
Iterator<String> str = fnameMap.keySet().iterator();
p = ((QCDao) dao).getParameters(new File(str.next()));
}
ResponseMessageCatalog cat = new ResponseMessageCatalog();
cat.setValues(p);
return cat;
}
return cat;
}
@SuppressWarnings("unchecked")
private Map<String, List<Integer[]>> getRetrievalMap(int limit)
throws Exception {
private Map<String, List<Integer[]>> getRetrievalMap(int limit)
throws Exception {
String[] fnameKeys = dao.getKeysRequiredForFileName();
tq.addReturnedField("pointDataView.curIdx", null);
tq.addReturnedField("id", null);
tq.setCount(limit);
for (String fnameKey : fnameKeys) {
tq.addReturnedField(fnameKey, null);
}
List<?> results = tq.execute();
String[] fnameKeys = dao.getKeysRequiredForFileName();
query.addReturnedField("pointDataView.curIdx");
query.addReturnedField("id");
query.setMaxResults(limit);
for (String fnameKey : fnameKeys) {
query.addReturnedField(fnameKey);
}
List<?> results = dao.queryByCriteria(query);
Map<String, List<Integer[]>> fnameMap = new HashMap<String, List<Integer[]>>();
Map<String, List<Integer[]>> fnameMap = new HashMap<String, List<Integer[]>>();
Map<String, Object> workingMap = new HashMap<String, Object>();
for (Object o : results) {
Object[] oArr = (Object[]) o;
workingMap.clear();
for (int i = 0; i < fnameKeys.length; i++) {
workingMap.put(fnameKeys[i], oArr[i + 2]);
}
Map<String, Object> workingMap = new HashMap<String, Object>();
for (Object o : results) {
Object[] oArr = (Object[]) o;
workingMap.clear();
for (int i = 0; i < fnameKeys.length; i++) {
workingMap.put(fnameKeys[i], oArr[i + 2]);
}
String fileName = dao.getPointDataFileName(workingMap);
List<Integer[]> ints = fnameMap.get(fileName);
if (ints == null) {
ints = new ArrayList<Integer[]>(500);
fnameMap.put(fileName, ints);
}
ints.add(new Integer[] { (Integer) oArr[0], (Integer) oArr[1] });
}
String fileName = dao.getPointDataFileName(workingMap);
List<Integer[]> ints = fnameMap.get(fileName);
if (ints == null) {
ints = new ArrayList<Integer[]>(500);
fnameMap.put(fileName, ints);
}
ints.add(new Integer[] { (Integer) oArr[0], (Integer) oArr[1] });
}
return fnameMap;
}
return fnameMap;
}
}

View file

@ -16,7 +16,6 @@ Require-Bundle: com.raytheon.uf.common.pointdata;bundle-version="1.12.1174";visi
com.raytheon.uf.common.derivparam;bundle-version="1.12.1174",
com.raytheon.uf.common.dataplugin.level;bundle-version="1.12.1174",
com.raytheon.edex.common;bundle-version="1.12.1174",
com.raytheon.edex.uengine;bundle-version="1.12.1174",
org.geotools;bundle-version="2.6.4",
javax.measure;bundle-version="1.0.0"
Export-Package: com.raytheon.uf.edex.pointdata,

View file

@ -24,12 +24,14 @@ import java.util.Collections;
import java.util.List;
import java.util.Map.Entry;
import com.raytheon.edex.uengine.tasks.query.CatalogQuery;
import com.raytheon.edex.uengine.tasks.query.MetadataCatalogQuery;
import com.raytheon.uf.common.dataplugin.level.LevelFactory;
import com.raytheon.uf.common.dataquery.requests.DbQueryRequest;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
import com.raytheon.uf.common.dataquery.responses.DbQueryResponse;
import com.raytheon.uf.common.derivparam.tree.DataTree;
import com.raytheon.uf.common.pointdata.GetPointDataTreeRequest;
import com.raytheon.uf.common.serialization.comm.IRequestHandler;
import com.raytheon.uf.common.serialization.comm.RequestRouter;
/**
*
@ -79,9 +81,15 @@ public class GetPointDataTreeHandler implements
private String[] getAvailableTypes(String pluginName, String typeKey) {
if (!typeKey.equals(PLUGIN_NAME)) {
try {
CatalogQuery query = new MetadataCatalogQuery(pluginName);
query.setDistinctField(typeKey);
String[] result = query.execute().getValues();
DbQueryRequest request = new DbQueryRequest();
request.addConstraint(PLUGIN_NAME, new RequestConstraint(
pluginName));
request.addRequestField(typeKey);
request.setDistinct(true);
DbQueryResponse response = (DbQueryResponse) RequestRouter
.route(request);
String[] result = response.getFieldObjects(typeKey,
String.class);
return result;
} catch (Exception e) {
e.printStackTrace();

View file

@ -28,7 +28,6 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import com.raytheon.edex.uengine.tasks.query.TableQuery;
import com.raytheon.uf.common.dataplugin.PluginException;
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
import com.raytheon.uf.common.datastorage.records.IDataRecord;
@ -43,6 +42,7 @@ import com.raytheon.uf.common.pointdata.PointDataView;
import com.raytheon.uf.edex.database.DataAccessLayerException;
import com.raytheon.uf.edex.database.plugin.PluginDao;
import com.raytheon.uf.edex.database.plugin.PluginFactory;
import com.raytheon.uf.edex.database.query.DatabaseQuery;
import com.raytheon.uf.edex.pointdata.PointDataPluginDao.LevelRequest;
/**
@ -63,9 +63,9 @@ import com.raytheon.uf.edex.pointdata.PointDataPluginDao.LevelRequest;
public class PointDataQuery {
protected PointDataPluginDao<?> dao;
protected DatabaseQuery query;
protected TableQuery tq;
protected PointDataPluginDao<?> dao;
protected String[] attribs;
@ -73,9 +73,6 @@ public class PointDataQuery {
public PointDataQuery(final String plugin) throws DataAccessLayerException,
PluginException {
this.tq = new TableQuery(PluginFactory.getInstance()
.getDatabase(plugin), PluginFactory.getInstance()
.getPluginRecordClass(plugin).getName());
try {
PluginDao pd = PluginFactory.getInstance().getPluginDao(plugin);
if (!(pd instanceof PointDataPluginDao)) {
@ -83,6 +80,7 @@ public class PointDataQuery {
+ " DAO is not a point data DAO");
}
this.dao = (PointDataPluginDao<?>) pd;
this.query = new DatabaseQuery(pd.getDaoClass());
} catch (Exception e) {
e.printStackTrace();
throw new DataAccessLayerException(
@ -105,8 +103,7 @@ public class PointDataQuery {
operand = "=";
}
tq.addParameter(name, value, operand);
query.addQueryParam(name, value, operand);
}
public void requestAllLevels() {
@ -171,10 +168,10 @@ public class PointDataQuery {
final int limit) throws Exception {
for (String field : fields) {
tq.addReturnedField(field, null);
query.addReturnedField(field);
}
tq.setCount(limit);
List<?> queryResults = tq.execute();
query.setMaxResults(limit);
List<?> queryResults = dao.queryByCriteria(query);
List<Map<String, Object>> results = new ArrayList<Map<String, Object>>();
@ -365,4 +362,3 @@ public class PointDataQuery {
return masterPDC;
}
}

View file

@ -27,7 +27,6 @@ Import-Package: com.raytheon.uf.common.dataplugin,
com.raytheon.uf.viz.core.map,
com.raytheon.uf.viz.core.rsc,
com.raytheon.viz.pointdata,
com.raytheon.viz.ui.jobs,
com.vividsolutions.jts.geom,
gov.noaa.nws.ncep.viz.common.ui,
gov.noaa.nws.ncep.viz.localization,