001: /**
002: * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
003: *
004: * Permission is hereby granted, free of charge, to any person obtaining a copy
005: * of this software and associated documentation files (the "Software"), to deal
006: * in the Software without restriction, including without limitation the rights
007: * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
008: * copies of the Software, and to permit persons to whom the Software is
009: * furnished to do so, subject to the following conditions:
010: *
011: * The above copyright notice and this permission notice shall be included in
012: * all copies or substantial portions of the Software.
013: *
014: * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
015: * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
016: * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
017: * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
018: * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
019: * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
020: * SOFTWARE.
021: */package com.liferay.portlet.journal.search;
022:
023: import com.liferay.portal.kernel.dao.search.DisplayTerms;
024: import com.liferay.portal.kernel.util.ParamUtil;
025: import com.liferay.portal.kernel.util.StringPool;
026: import com.liferay.portal.util.PortalUtil;
027:
028: import java.util.Date;
029:
030: import javax.portlet.RenderRequest;
031:
032: /**
033: * <a href="ArticleDisplayTerms.java.html"><b><i>View Source</i></b></a>
034: *
035: * @author Brian Wing Shun Chan
036: *
037: */
038: public class ArticleDisplayTerms extends DisplayTerms {
039:
040: public static final String GROUP_ID = "groupId";
041:
042: public static final String ARTICLE_ID = "searchArticleId";
043:
044: public static final String VERSION = "version";
045:
046: public static final String TITLE = "name";
047:
048: public static final String DESCRIPTION = "description";
049:
050: public static final String CONTENT = "content";
051:
052: public static final String TYPE = "type";
053:
054: public static final String STRUCTURE_ID = "structureId";
055:
056: public static final String TEMPLATE_ID = "templateId";
057:
058: public static final String DISPLAY_DATE_GT = "displayDateGT";
059:
060: public static final String DISPLAY_DATE_LT = "displayDateLT";
061:
062: public static final String STATUS = "status";
063:
064: public ArticleDisplayTerms(RenderRequest req) {
065: super (req);
066:
067: groupId = ParamUtil.getLong(req, GROUP_ID, PortalUtil
068: .getPortletGroupId(req));
069: articleId = ParamUtil.getString(req, ARTICLE_ID);
070: version = ParamUtil.getDouble(req, VERSION);
071: title = ParamUtil.getString(req, TITLE);
072: description = ParamUtil.getString(req, DESCRIPTION);
073: content = ParamUtil.getString(req, CONTENT);
074: type = ParamUtil.getString(req, TYPE);
075: structureId = ParamUtil.getString(req, STRUCTURE_ID);
076: templateId = ParamUtil.getString(req, TEMPLATE_ID);
077: status = ParamUtil.getString(req, STATUS);
078: }
079:
080: public long getGroupId() {
081: return groupId;
082: }
083:
084: public String getArticleId() {
085: return articleId;
086: }
087:
088: public double getVersion() {
089: return version;
090: }
091:
092: public String getVersionString() {
093: if (version != 0) {
094: return String.valueOf(version);
095: } else {
096: return StringPool.BLANK;
097: }
098: }
099:
100: public String getTitle() {
101: return title;
102: }
103:
104: public String getDescription() {
105: return description;
106: }
107:
108: public String getContent() {
109: return content;
110: }
111:
112: public String getType() {
113: return type;
114: }
115:
116: public String getStructureId() {
117: return structureId;
118: }
119:
120: public String getTemplateId() {
121: return templateId;
122: }
123:
124: public Date getDisplayDateGT() {
125: return displayDateGT;
126: }
127:
128: public Date getDisplayDateLT() {
129: return displayDateLT;
130: }
131:
132: public String getStatus() {
133: return status;
134: }
135:
136: public void setStatus(String status) {
137: this .status = status;
138: }
139:
140: protected long groupId;
141: protected String articleId;
142: protected double version;
143: protected String title;
144: protected String description;
145: protected String content;
146: protected String type;
147: protected String structureId;
148: protected String templateId;
149: protected Date displayDateGT;
150: protected Date displayDateLT;
151: protected String status;
152:
153: }
|