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.workflow.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  
29  import javax.portlet.RenderRequest;
30  
31  /**
32   * <a href="TaskDisplayTerms.java.html"><b><i>View Source</i></b></a>
33   *
34   * @author Brian Wing Shun Chan
35   *
36   */
37  public class TaskDisplayTerms extends DisplayTerms {
38  
39      public static final String INSTANCE_ID = "instanceId";
40  
41      public static final String TASK_NAME = "taskName";
42  
43      public static final String DEFINITION_NAME = "definitionName";
44  
45      public static final String ASSIGNED_TO = "assignedTo";
46  
47      public static final String CREATE_DATE_GT = "createDateGT";
48  
49      public static final String CREATE_DATE_LT = "createDateLT";
50  
51      public static final String START_DATE_GT = "startDateGT";
52  
53      public static final String START_DATE_LT = "startDateLT";
54  
55      public static final String END_DATE_GT = "endDateGT";
56  
57      public static final String END_DATE_LT = "endDateLT";
58  
59      public static final String HIDE_ENDED_TASKS = "hideEndedTasks";
60  
61      public TaskDisplayTerms(RenderRequest req) {
62          super(req);
63  
64          instanceId = ParamUtil.getLong(req, INSTANCE_ID);
65          taskName = ParamUtil.getString(req, TASK_NAME);
66          definitionName = ParamUtil.getString(req, DEFINITION_NAME);
67          assignedTo = ParamUtil.getString(req, ASSIGNED_TO);
68          hideEndedTasks = ParamUtil.getBoolean(req, HIDE_ENDED_TASKS);
69      }
70  
71      public long getInstanceId() {
72          return instanceId;
73      }
74  
75      public String getInstanceIdString() {
76          if (instanceId != 0) {
77              return String.valueOf(instanceId);
78          }
79          else {
80              return StringPool.BLANK;
81          }
82      }
83  
84      public String getTaskName() {
85          return taskName;
86      }
87  
88      public String getDefinitionName() {
89          return definitionName;
90      }
91  
92      public String getAssignedTo() {
93          return assignedTo;
94      }
95  
96      public String getCreateDateGT() {
97          return createDateGT;
98      }
99  
100     public String getCreateDateLT() {
101         return createDateLT;
102     }
103 
104     public String getStartDateGT() {
105         return startDateGT;
106     }
107 
108     public String getStartDateLT() {
109         return startDateLT;
110     }
111 
112     public String getEndDateGT() {
113         return endDateGT;
114     }
115 
116     public String getEndDateLT() {
117         return endDateLT;
118     }
119 
120     public boolean isHideEndedTasks() {
121         return hideEndedTasks;
122     }
123 
124     protected long instanceId;
125     protected String taskName;
126     protected String definitionName;
127     protected String assignedTo;
128     protected String createDateGT;
129     protected String createDateLT;
130     protected String startDateGT;
131     protected String startDateLT;
132     protected String endDateGT;
133     protected String endDateLT;
134     protected boolean hideEndedTasks;
135 
136 }