001
014
015 package com.liferay.portlet.shopping.search;
016
017 import com.liferay.portal.kernel.dao.search.SearchContainer;
018 import com.liferay.portlet.shopping.model.ShoppingOrder;
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 OrderSearch extends SearchContainer<ShoppingOrder> {
030
031 static List<String> headerNames = new ArrayList<String>();
032
033 static {
034 headerNames.add("number");
035 headerNames.add("date");
036 headerNames.add("status");
037 headerNames.add("customer");
038 }
039
040 public static final String EMPTY_RESULTS_MESSAGE =
041 "no-orders-were-found";
042
043 public OrderSearch(PortletRequest portletRequest, PortletURL iteratorURL) {
044 super(
045 portletRequest, new OrderDisplayTerms(portletRequest),
046 new OrderSearchTerms(portletRequest), DEFAULT_CUR_PARAM,
047 DEFAULT_DELTA, iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);
048
049 OrderDisplayTerms displayTerms =
050 (OrderDisplayTerms)getDisplayTerms();
051
052 iteratorURL.setParameter(
053 OrderDisplayTerms.EMAIL_ADDRESS, displayTerms.getEmailAddress());
054 iteratorURL.setParameter(
055 OrderDisplayTerms.FIRST_NAME, displayTerms.getFirstName());
056 iteratorURL.setParameter(
057 OrderDisplayTerms.LAST_NAME, displayTerms.getLastName());
058 iteratorURL.setParameter(
059 OrderDisplayTerms.NUMBER, displayTerms.getNumber());
060 iteratorURL.setParameter(
061 OrderDisplayTerms.STATUS, displayTerms.getStatus());
062 }
063
064 }