1
22
23 package com.liferay.portlet.journal.search;
24
25 import com.liferay.portal.kernel.dao.DAOParamUtil;
26 import com.liferay.portal.kernel.util.ParamUtil;
27 import com.liferay.portal.util.PortalUtil;
28
29 import java.util.Date;
30
31 import javax.portlet.RenderRequest;
32
33
39 public class ArticleSearchTerms extends ArticleDisplayTerms {
40
41 public ArticleSearchTerms(RenderRequest req) {
42 super(req);
43
44 groupId = ParamUtil.getLong(
45 req, GROUP_ID, PortalUtil.getPortletGroupId(req));
46 articleId = DAOParamUtil.getLike(req, ARTICLE_ID);
47 version = ParamUtil.getDouble(req, VERSION);
48 title = DAOParamUtil.getLike(req, TITLE);
49 description = DAOParamUtil.getLike(req, DESCRIPTION);
50 content = DAOParamUtil.getLike(req, CONTENT);
51 type = DAOParamUtil.getString(req, TYPE);
52 structureId = DAOParamUtil.getString(req, STRUCTURE_ID);
53 templateId = DAOParamUtil.getString(req, TEMPLATE_ID);
54 status = ParamUtil.getString(req, STATUS);
55 }
56
57 public void setGroupId(long groupId) {
58 this.groupId = groupId;
59 }
60
61 public Double getVersionObj() {
62 if (version == 0) {
63 return null;
64 }
65 else {
66 return new Double(version);
67 }
68 }
69
70 public void setType(String type) {
71 this.type = type;
72 }
73
74 public void setStatus(String status) {
75 this.status = status;
76 }
77
78 public Boolean getApprovedObj() {
79 if (status.equals("approved")) {
80 return Boolean.TRUE;
81 }
82 else if (status.equals("not-approved")) {
83 return Boolean.FALSE;
84 }
85 else if (status.equals("expired")) {
86 return Boolean.FALSE;
87 }
88 else if (status.equals("review")) {
89 return null;
90 }
91 else {
92 return null;
93 }
94 }
95
96 public Boolean getExpiredObj() {
97 if (status.equals("approved")) {
98 return Boolean.FALSE;
99 }
100 else if (status.equals("not-approved")) {
101 return Boolean.FALSE;
102 }
103 else if (status.equals("expired")) {
104 return Boolean.TRUE;
105 }
106 else if (status.equals("review")) {
107 return Boolean.FALSE;
108 }
109 else {
110 return null;
111 }
112 }
113
114 public Date getReviewDate() {
115 if (status.equals("review")) {
116 return new Date();
117 }
118 else {
119 return null;
120 }
121 }
122
123 }