001
014
015 package com.liferay.portlet.journal.search;
016
017 import com.liferay.portal.kernel.dao.search.SearchContainer;
018 import com.liferay.portal.kernel.util.StringUtil;
019 import com.liferay.portlet.journal.model.JournalStructure;
020
021 import java.util.ArrayList;
022 import java.util.List;
023
024 import javax.portlet.PortletRequest;
025 import javax.portlet.PortletURL;
026
027
030 public class StructureSearch extends SearchContainer<JournalStructure> {
031
032 static List<String> headerNames = new ArrayList<String>();
033
034 static {
035 headerNames.add("id");
036 headerNames.add("name");
037 headerNames.add("description");
038 }
039
040 public static final String EMPTY_RESULTS_MESSAGE =
041 "no-structures-were-found";
042
043 public StructureSearch(
044 PortletRequest portletRequest, int delta, PortletURL iteratorURL) {
045
046 super(
047 portletRequest, new StructureDisplayTerms(portletRequest),
048 new StructureSearchTerms(portletRequest), DEFAULT_CUR_PARAM, delta,
049 iteratorURL, headerNames, EMPTY_RESULTS_MESSAGE);
050
051 StructureDisplayTerms displayTerms =
052 (StructureDisplayTerms)getDisplayTerms();
053
054 iteratorURL.setParameter(
055 StructureDisplayTerms.DESCRIPTION, displayTerms.getDescription());
056 iteratorURL.setParameter(
057 StructureDisplayTerms.GROUP_IDS,
058 StringUtil.merge(displayTerms.getGroupIds()));
059 iteratorURL.setParameter(
060 StructureDisplayTerms.NAME, displayTerms.getName());
061 iteratorURL.setParameter(
062 StructureDisplayTerms.STRUCTURE_ID, displayTerms.getStructureId());
063 }
064
065 public StructureSearch(
066 PortletRequest portletRequest, PortletURL iteratorURL) {
067
068 this(portletRequest, DEFAULT_DELTA, iteratorURL);
069 }
070
071 }