summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java14
-rw-r--r--modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java28
2 files changed, 19 insertions, 23 deletions
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
index 037bc10..eaa4371 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/BundleSelector.java
@@ -23,6 +23,7 @@ import java.util.LinkedHashMap;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.smartgwt.client.data.Criteria;
+import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.widgets.form.DynamicForm;
import com.smartgwt.client.widgets.form.fields.SelectItem;
import com.smartgwt.client.widgets.form.fields.TextItem;
@@ -76,7 +77,7 @@ public class BundleSelector extends AbstractSelector<Bundle, BundleCriteria> {
}
protected RPCDataSource<Bundle, BundleCriteria> getDataSource() {
- return new BundlesDataSource();
+ return new SelectedBundlesDataSource();
}
protected Criteria getLatestCriteria(DynamicForm availableFilterForm) {
@@ -94,4 +95,15 @@ public class BundleSelector extends AbstractSelector<Bundle, BundleCriteria> {
protected String getItemTitle() {
return MSG.common_title_bundles();
}
+
+ public class SelectedBundlesDataSource extends BundlesDataSource {
+ @Override
+ protected BundleCriteria getFetchCriteria(final DSRequest request) {
+ BundleCriteria result = super.getFetchCriteria(request);
+ if (null != result) {
+ result.setStrict(false);
+ }
+ return result;
+ }
+ }
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java
index f8389b4..42a3e0d 100644
--- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java
+++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundlesDataSource.java
@@ -90,28 +90,12 @@ public class BundlesDataSource extends RPCDataSource<Bundle, BundleCriteria> {
@Override
protected BundleCriteria getFetchCriteria(final DSRequest request) {
BundleCriteria criteria = new BundleCriteria();
-
- if (request.getCriteria().getValues().get("tagNamespace") != null) {
- criteria.addFilterTagNamespace((String) request.getCriteria().getValues().get("tagNamespace"));
- }
-
- if (request.getCriteria().getValues().get("tagSemantic") != null) {
- criteria.addFilterTagSemantic((String) request.getCriteria().getValues().get("tagSemantic"));
- }
-
- if (request.getCriteria().getValues().get("tagName") != null) {
- criteria.addFilterTagName((String) request.getCriteria().getValues().get("tagName"));
- }
-
- if (request.getCriteria().getValues().get("bundleType") != null) {
- criteria.addFilterBundleTypeId(Integer.valueOf(request.getCriteria().getValues().get("bundleType")
- .toString()));
- }
-
- // TODO: this doesn't work like I think it should, figure out how to search on the name column
- // if (request.getCriteria().getValues().get("search") != null) {
- // criteria.setSearchExpression(request.getCriteria().getValues().get("search").toString());
- // }
+ criteria.addFilterTagNamespace(getFilter(request, "tagNamespace", String.class));
+ criteria.addFilterTagSemantic(getFilter(request, "tagSemantic", String.class));
+ criteria.addFilterTagName(getFilter(request, "tagName", String.class));
+ criteria.addFilterBundleTypeId(getFilter(request, "bundleType", Integer.class));
+ criteria.addFilterTagSemantic(getFilter(request, "tagSemantic", String.class));
+ criteria.addFilterName(getFilter(request, "search", String.class));
return criteria;
}