001
014
015 package com.liferay.portlet.assetpublisher.search;
016
017 import com.liferay.portal.kernel.dao.search.SearchContainer;
018 import com.liferay.portlet.asset.model.AssetEntry;
019
020 import java.util.ArrayList;
021 import java.util.List;
022
023 import javax.portlet.PortletRequest;
024 import javax.portlet.PortletURL;
025
026
030 public class AssetSearch extends SearchContainer<AssetEntry> {
031
032 static List<String> headerNames = new ArrayList<String>();
033
034 static {
035 headerNames.add("title");
036 headerNames.add("description");
037 headerNames.add("user-name");
038 headerNames.add("modified-date");
039 }
040
041 public static final String EMPTY_RESULTS_MESSAGE =
042 "there-are-no-results";
043
044 public AssetSearch(
045 PortletRequest portletRequest, int delta, PortletURL iteratorURL) {
046
047 super(
048 portletRequest, new AssetDisplayTerms(portletRequest),
049 new AssetSearchTerms(portletRequest), DEFAULT_CUR_PARAM, delta,
050 iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);
051
052 AssetDisplayTerms displayTerms =
053 (AssetDisplayTerms)getDisplayTerms();
054
055 iteratorURL.setParameter(
056 AssetDisplayTerms.DESCRIPTION, displayTerms.getDescription());
057 iteratorURL.setParameter(
058 AssetDisplayTerms.GROUP_ID,
059 String.valueOf(displayTerms.getGroupId()));
060 iteratorURL.setParameter(
061 AssetDisplayTerms.TITLE, displayTerms.getTitle());
062 iteratorURL.setParameter(
063 AssetDisplayTerms.USER_NAME, displayTerms.getUserName());
064 }
065
066 public AssetSearch(
067 PortletRequest portletRequest, PortletURL iteratorURL) {
068
069 this(portletRequest, DEFAULT_DELTA, iteratorURL);
070 }
071
072 }