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 headerNames.add("scope");
040 }
041
042 public static final String EMPTY_RESULTS_MESSAGE = "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 = (AssetDisplayTerms)getDisplayTerms();
053
054 iteratorURL.setParameter(
055 AssetDisplayTerms.DESCRIPTION, displayTerms.getDescription());
056 iteratorURL.setParameter(
057 AssetDisplayTerms.GROUP_ID,
058 String.valueOf(displayTerms.getGroupId()));
059 iteratorURL.setParameter(
060 AssetDisplayTerms.TITLE, displayTerms.getTitle());
061 iteratorURL.setParameter(
062 AssetDisplayTerms.USER_NAME, displayTerms.getUserName());
063 }
064
065 public AssetSearch(PortletRequest portletRequest, PortletURL iteratorURL) {
066 this(portletRequest, DEFAULT_DELTA, iteratorURL);
067 }
068
069 }