001
014
015 package com.liferay.portlet.mobiledevicerules.search;
016
017 import com.liferay.portal.kernel.dao.search.SearchContainer;
018 import com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup;
019
020 import java.util.ArrayList;
021 import java.util.List;
022
023 import javax.portlet.PortletRequest;
024 import javax.portlet.PortletURL;
025
026
029 public class RuleGroupSearch extends SearchContainer<MDRRuleGroup> {
030
031 static List<String> headerNames = new ArrayList<String>();
032
033 static {
034 headerNames.add("name");
035 headerNames.add("description");
036 }
037
038 public static final String EMPTY_RESULTS_MESSAGE =
039 "no-rule-groups-are-configured";
040
041 public RuleGroupSearch(
042 PortletRequest portletRequest, PortletURL iteratorURL) {
043
044 super(
045 portletRequest, new RuleGroupDisplayTerms(portletRequest),
046 new RuleGroupSearchTerms(portletRequest), DEFAULT_CUR_PARAM,
047 DEFAULT_DELTA, iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);
048
049 RuleGroupDisplayTerms displayTerms =
050 (RuleGroupDisplayTerms)getDisplayTerms();
051
052 iteratorURL.setParameter(
053 RuleGroupDisplayTerms.GROUP_ID,
054 String.valueOf(displayTerms.getGroupId()));
055 iteratorURL.setParameter(
056 RuleGroupDisplayTerms.NAME, displayTerms.getName());
057 }
058
059 }