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