001
014
015 package com.liferay.portlet.journal.search;
016
017 import com.liferay.portal.kernel.dao.search.DAOParamUtil;
018 import com.liferay.portal.kernel.util.ParamUtil;
019 import com.liferay.portal.kernel.workflow.WorkflowConstants;
020
021 import java.util.Date;
022
023 import javax.portlet.PortletRequest;
024
025
028 public class ArticleSearchTerms extends ArticleDisplayTerms {
029
030 public ArticleSearchTerms(PortletRequest portletRequest) {
031 super(portletRequest);
032
033 articleId = DAOParamUtil.getString(portletRequest, ARTICLE_ID);
034 content = DAOParamUtil.getString(portletRequest, CONTENT);
035 ddmStructureKey = DAOParamUtil.getString(
036 portletRequest, DDM_STRUCTURE_KEY);
037 ddmTemplateKey = DAOParamUtil.getString(
038 portletRequest, DDM_TEMPLATE_KEY);
039 description = DAOParamUtil.getString(portletRequest, DESCRIPTION);
040 status = ParamUtil.getInteger(portletRequest, STATUS);
041 title = DAOParamUtil.getString(portletRequest, TITLE);
042 version = ParamUtil.getDouble(portletRequest, VERSION);
043
044 groupId = setGroupId(portletRequest);
045 }
046
047 public Date getReviewDate() {
048 if (status == WorkflowConstants.STATUS_PENDING) {
049 return new Date();
050 }
051 else {
052 return null;
053 }
054 }
055
056 public Double getVersionObj() {
057 if (version == 0) {
058 return null;
059 }
060 else {
061 return new Double(version);
062 }
063 }
064
065 public void setArticleId(String articleId) {
066 this.articleId = articleId;
067 }
068
069 public void setDDMStructureKey(String ddmStructureKey) {
070 this.ddmStructureKey = ddmStructureKey;
071 }
072
073 public void setGroupId(long groupId) {
074 this.groupId = groupId;
075 }
076
077 @Override
078 public void setStatus(int status) {
079 this.status = status;
080 }
081
082 public void setVersion(double version) {
083 this.version = version;
084 }
085
086 }