1   /**
2    * Copyright (c) 2000-2007 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.journal.search;
24  
25  import com.liferay.portal.kernel.dao.search.DisplayTerms;
26  import com.liferay.portal.kernel.util.ParamUtil;
27  import com.liferay.portal.kernel.util.StringPool;
28  import com.liferay.portal.util.PortalUtil;
29  
30  import java.util.Date;
31  
32  import javax.portlet.RenderRequest;
33  
34  /**
35   * <a href="ArticleDisplayTerms.java.html"><b><i>View Source</i></b></a>
36   *
37   * @author Brian Wing Shun Chan
38   *
39   */
40  public class ArticleDisplayTerms extends DisplayTerms {
41  
42      public static final String GROUP_ID = "groupId";
43  
44      public static final String ARTICLE_ID = "searchArticleId";
45  
46      public static final String VERSION = "version";
47  
48      public static final String TITLE = "name";
49  
50      public static final String DESCRIPTION = "description";
51  
52      public static final String CONTENT = "content";
53  
54      public static final String TYPE = "type";
55  
56      public static final String STRUCTURE_ID = "structureId";
57  
58      public static final String TEMPLATE_ID = "templateId";
59  
60      public static final String DISPLAY_DATE_GT = "displayDateGT";
61  
62      public static final String DISPLAY_DATE_LT = "displayDateLT";
63  
64      public static final String STATUS = "status";
65  
66      public ArticleDisplayTerms(RenderRequest req) {
67          super(req);
68  
69          groupId = ParamUtil.getLong(
70              req, GROUP_ID, PortalUtil.getPortletGroupId(req));
71          articleId = ParamUtil.getString(req, ARTICLE_ID);
72          version = ParamUtil.getDouble(req, VERSION);
73          title = ParamUtil.getString(req, TITLE);
74          description = ParamUtil.getString(req, DESCRIPTION);
75          content = ParamUtil.getString(req, CONTENT);
76          type = ParamUtil.getString(req, TYPE);
77          structureId = ParamUtil.getString(req, STRUCTURE_ID);
78          templateId = ParamUtil.getString(req, TEMPLATE_ID);
79          status = ParamUtil.getString(req, STATUS);
80      }
81  
82      public long getGroupId() {
83          return groupId;
84      }
85  
86      public String getArticleId() {
87          return articleId;
88      }
89  
90      public double getVersion() {
91          return version;
92      }
93  
94      public String getVersionString() {
95          if (version != 0) {
96              return String.valueOf(version);
97          }
98          else {
99              return StringPool.BLANK;
100         }
101     }
102 
103     public String getTitle() {
104         return title;
105     }
106 
107     public String getDescription() {
108         return description;
109     }
110 
111     public String getContent() {
112         return content;
113     }
114 
115     public String getType() {
116         return type;
117     }
118 
119     public String getStructureId() {
120         return structureId;
121     }
122 
123     public String getTemplateId() {
124         return templateId;
125     }
126 
127     public Date getDisplayDateGT() {
128         return displayDateGT;
129     }
130 
131     public Date getDisplayDateLT() {
132         return displayDateLT;
133     }
134 
135     public String getStatus() {
136         return status;
137     }
138 
139     public void setStatus(String status) {
140         this.status = status;
141     }
142 
143     protected long groupId;
144     protected String articleId;
145     protected double version;
146     protected String title;
147     protected String description;
148     protected String content;
149     protected String type;
150     protected String structureId;
151     protected String templateId;
152     protected Date displayDateGT;
153     protected Date displayDateLT;
154     protected String status;
155 
156 }