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