001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portlet.dynamicdatamapping.search;
016    
017    import com.liferay.portal.kernel.dao.search.SearchContainer;
018    import com.liferay.portlet.dynamicdatamapping.model.DDMStructure;
019    
020    import javax.portlet.PortletRequest;
021    import javax.portlet.PortletURL;
022    
023    /**
024     * @author Eduardo Lundgren
025     */
026    public class StructureSearch extends SearchContainer<DDMStructure> {
027    
028            public static final String EMPTY_RESULTS_MESSAGE = "there-are-no-results";
029    
030            public StructureSearch(
031                    PortletRequest portletRequest, PortletURL iteratorURL) {
032    
033                    super(
034                            portletRequest, new StructureDisplayTerms(portletRequest),
035                            new StructureSearchTerms(portletRequest), DEFAULT_CUR_PARAM,
036                            DEFAULT_DELTA, iteratorURL, null, EMPTY_RESULTS_MESSAGE);
037    
038                    StructureDisplayTerms displayTerms =
039                            (StructureDisplayTerms)getDisplayTerms();
040    
041                    iteratorURL.setParameter(
042                            StructureDisplayTerms.CLASS_NAME_ID,
043                            String.valueOf(displayTerms.getClassNameId()));
044                    iteratorURL.setParameter(
045                            StructureDisplayTerms.DESCRIPTION, displayTerms.getDescription());
046                    iteratorURL.setParameter(
047                            StructureDisplayTerms.NAME, displayTerms.getName());
048                    iteratorURL.setParameter(
049                            StructureDisplayTerms.STORAGE_TYPE, displayTerms.getStorageType());
050            }
051    
052    }