001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.journal.search;
016    
017    import com.liferay.portal.kernel.dao.search.DisplayTerms;
018    import com.liferay.portal.kernel.util.ParamUtil;
019    import com.liferay.portal.theme.ThemeDisplay;
020    import com.liferay.portal.util.WebKeys;
021    
022    import javax.portlet.PortletRequest;
023    
024    /**
025     * @author Brian Wing Shun Chan
026     */
027    public class TemplateDisplayTerms extends DisplayTerms {
028    
029            public static final String DESCRIPTION = "description";
030    
031            public static final String GROUP_ID = "groupId";
032    
033            public static final String NAME = "name";
034    
035            public static final String STRUCTURE_ID = "structureId";
036    
037            public static final String TEMPLATE_ID = "searchTemplateId";
038    
039            public TemplateDisplayTerms(PortletRequest portletRequest) {
040                    super(portletRequest);
041    
042                    ThemeDisplay themeDisplay = (ThemeDisplay)portletRequest.getAttribute(
043                            WebKeys.THEME_DISPLAY);
044    
045                    description = ParamUtil.getString(portletRequest, DESCRIPTION);
046                    groupId = ParamUtil.getLong(
047                            portletRequest, GROUP_ID, themeDisplay.getScopeGroupId());
048                    name = ParamUtil.getString(portletRequest, NAME);
049                    structureId = ParamUtil.getString(portletRequest, STRUCTURE_ID);
050                    templateId = ParamUtil.getString(portletRequest, TEMPLATE_ID);
051            }
052    
053            public String getDescription() {
054                    return description;
055            }
056    
057            public long getGroupId() {
058                    return groupId;
059            }
060    
061            public String getName() {
062                    return name;
063            }
064    
065            public String getStructureId() {
066                    return structureId;
067            }
068    
069            public String getTemplateId() {
070                    return templateId;
071            }
072    
073            protected String description;
074            protected long groupId;
075            protected String name;
076            protected String structureId;
077            protected String templateId;
078    
079    }