diff --git a/cave/com.raytheon.uf.viz.d2d.gfe/src/com/raytheon/uf/viz/d2d/gfe/browser/GFEDataDefinition.java b/cave/com.raytheon.uf.viz.d2d.gfe/src/com/raytheon/uf/viz/d2d/gfe/browser/GFEDataDefinition.java index c811026afd..6e8bf5972f 100644 --- a/cave/com.raytheon.uf.viz.d2d.gfe/src/com/raytheon/uf/viz/d2d/gfe/browser/GFEDataDefinition.java +++ b/cave/com.raytheon.uf.viz.d2d.gfe/src/com/raytheon/uf/viz/d2d/gfe/browser/GFEDataDefinition.java @@ -50,6 +50,8 @@ import com.raytheon.viz.grid.rsc.GridLoadProperties; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Mar 9, 2011 bsteffen Initial creation + * May 02, 2013 1949 bsteffen Switch Product Browser from uengine to + * DbQueryRequest. * * * @@ -136,7 +138,7 @@ public class GFEDataDefinition extends @Override protected String[] queryData(String param, - HashMap queryList) { + Map queryList) { return super.queryData(GFEDataAccessUtil.PARM_ID, queryList); } diff --git a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssDataDefinition.java b/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssDataDefinition.java index 4ff2dfb379..b2552c9f0e 100644 --- a/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssDataDefinition.java +++ b/cave/com.raytheon.uf.viz.npp.crimss/src/com/raytheon/uf/viz/npp/crimss/CrimssDataDefinition.java @@ -61,6 +61,8 @@ import com.vividsolutions.jts.geom.Coordinate; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * Dec 6, 2011 bsteffen Initial creation + * May 02, 2013 1949 bsteffen Switch Product Browser from uengine to + * DbQueryRequest. * * * @@ -91,7 +93,7 @@ public class CrimssDataDefinition @Override protected String[] queryData(String param, - HashMap queryList) { + Map queryList) { if (param.equals(POINT)) { // TODO depending on how much data we have this might be way too // data to request. diff --git a/cave/com.raytheon.uf.viz.productbrowser/META-INF/MANIFEST.MF b/cave/com.raytheon.uf.viz.productbrowser/META-INF/MANIFEST.MF index 73fe762c86..3778a53e41 100644 --- a/cave/com.raytheon.uf.viz.productbrowser/META-INF/MANIFEST.MF +++ b/cave/com.raytheon.uf.viz.productbrowser/META-INF/MANIFEST.MF @@ -25,7 +25,6 @@ Export-Package: com.raytheon.uf.viz.productbrowser; com.raytheon.uf.viz.productbrowser.actions;uses:="org.eclipse.core.commands", com.raytheon.uf.viz.productbrowser.bookmarks, com.raytheon.uf.viz.productbrowser.xml -Import-Package: com.raytheon.edex.scriptfactory, +Import-Package: com.raytheon.uf.common.dataplugin, com.raytheon.uf.common.message.response, - com.raytheon.uf.common.serialization, - com.raytheon.uf.viz.core.catalog + com.raytheon.uf.common.serialization diff --git a/cave/com.raytheon.uf.viz.productbrowser/src/com/raytheon/uf/viz/productbrowser/AbstractRequestableProductBrowserDataDefinition.java b/cave/com.raytheon.uf.viz.productbrowser/src/com/raytheon/uf/viz/productbrowser/AbstractRequestableProductBrowserDataDefinition.java index 074c8de473..147892842a 100644 --- a/cave/com.raytheon.uf.viz.productbrowser/src/com/raytheon/uf/viz/productbrowser/AbstractRequestableProductBrowserDataDefinition.java +++ b/cave/com.raytheon.uf.viz.productbrowser/src/com/raytheon/uf/viz/productbrowser/AbstractRequestableProductBrowserDataDefinition.java @@ -31,27 +31,29 @@ import javax.xml.bind.annotation.XmlAccessorType; import org.eclipse.ui.IEditorPart; import org.eclipse.ui.IWorkbenchWindow; +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.serialization.ISerializableObject; 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.DescriptorMap; import com.raytheon.uf.viz.core.IDisplayPaneContainer; -import com.raytheon.uf.viz.core.catalog.CatalogQuery; -import com.raytheon.uf.viz.core.catalog.DbQuery; +import com.raytheon.uf.viz.core.RecordFactory; import com.raytheon.uf.viz.core.drawables.AbstractRenderableDisplay; import com.raytheon.uf.viz.core.drawables.IDescriptor; import com.raytheon.uf.viz.core.drawables.ResourcePair; import com.raytheon.uf.viz.core.exception.VizException; import com.raytheon.uf.viz.core.map.MapDescriptor; import com.raytheon.uf.viz.core.procedures.Bundle; +import com.raytheon.uf.viz.core.requests.ThriftClient; import com.raytheon.uf.viz.core.rsc.AbstractRequestableResourceData; import com.raytheon.uf.viz.core.rsc.ResourceProperties; import com.raytheon.uf.viz.core.rsc.ResourceType; import com.raytheon.uf.viz.productbrowser.ProductBrowserPreference.PreferenceType; -import com.raytheon.viz.ui.EditorUtil; import com.raytheon.viz.ui.BundleProductLoader; +import com.raytheon.viz.ui.EditorUtil; import com.raytheon.viz.ui.VizWorkbenchManager; import com.raytheon.viz.ui.editor.AbstractEditor; import com.raytheon.viz.ui.perspectives.AbstractVizPerspectiveManager; @@ -66,6 +68,8 @@ import com.raytheon.viz.ui.perspectives.VizPerspectiveListener; * Date Ticket# Engineer Description * ------------ ---------- ----------- -------------------------- * May 3, 2010 mnash Initial creation + * May 02, 2013 1949 bsteffen Switch Product Browser from uengine to + * DbQueryRequest. * * * @@ -103,23 +107,23 @@ public abstract class AbstractRequestableProductBrowserDataDefinition parameters = null; + Object[] parameters = null; if (order.length >= 1) { try { - DbQuery query = new DbQuery(productName); - query.setMaxResults(1); - parameters = query.performQuery(); + DbQueryRequest request = new DbQueryRequest(); + request.setEntityClass(RecordFactory.getInstance() + .getPluginClass(productName)); + request.setLimit(1); + DbQueryResponse response = (DbQueryResponse) ThriftClient + .sendRequest(request); + parameters = response.getEntityObjects(Object.class); } catch (VizException e) { statusHandler.handle(Priority.ERROR, "Unable to populate initial product tree", e); } - if (parameters != null && !parameters.isEmpty()) { - if (parameters.get(0).length > 0) { - return displayName; - } else { - return null; - } + if (parameters != null && parameters.length != 0) { + return displayName; } else { return null; } @@ -172,9 +176,26 @@ public abstract class AbstractRequestableProductBrowserDataDefinition queryList) { + Map queryList) { try { - return CatalogQuery.performQuery(param, queryList); + DbQueryRequest request = new DbQueryRequest(); + request.setEntityClass(RecordFactory.getInstance().getPluginClass( + productName)); + request.setConstraints(queryList); + request.addRequestField(param); + request.setDistinct(true); + DbQueryResponse response = (DbQueryResponse) ThriftClient + .sendRequest(request); + Object[] paramObjs = response.getFieldObjects(param, Object.class); + if (paramObjs != null) { + String[] params = new String[paramObjs.length]; + for (int i = 0; i < params.length; i += 1) { + if (paramObjs[i] != null) { + params[i] = paramObjs[i].toString(); + } + } + return params; + } } catch (VizException e) { statusHandler .handle(Priority.PROBLEM, "Unable to perform query", e); @@ -238,16 +259,14 @@ public abstract class AbstractRequestableProductBrowserDataDefinition labels = formatData(order[i], items); if (labels != null) { for (int j = 0; j < labels.size(); j++) { historyList.add(labels.get(j).getName()); } } - } catch (VizException e) { - e.printStackTrace(); } } return historyList; diff --git a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java index 668f13dfb7..3eac892d91 100644 --- a/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java +++ b/cave/com.raytheon.viz.grid/src/com/raytheon/viz/grid/GridProductBrowserDataDefinition.java @@ -73,6 +73,8 @@ import com.raytheon.viz.grid.rsc.GridResourceData; * ------------ ---------- ----------- -------------------------- * May 21, 2010 bsteffens Initial creation * May 26, 2010 mnash Used ProductBrowserLabel implementation instead of requery + * May 02, 2013 1949 bsteffen Switch Product Browser from uengine to + * DbQueryRequest. * * * @@ -175,7 +177,7 @@ public class GridProductBrowserDataDefinition extends @Override protected String[] queryData(String param, - HashMap queryList) { + Map queryList) { try { if (getInventory() == null) { return super.queryData(param, queryList);