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 renderRequest) {
58          super(renderRequest);
59  
60          definitionId = ParamUtil.getLong(renderRequest, DEFINITION_ID);
61          instanceId = ParamUtil.getLong(renderRequest, INSTANCE_ID);
62          definitionName = ParamUtil.getString(renderRequest, DEFINITION_NAME);
63          definitionVersion = ParamUtil.getString(
64              renderRequest, DEFINITION_VERSION);
65          hideEndedTasks = ParamUtil.getBoolean(renderRequest, HIDE_ENDED_TASKS);
66      }
67  
68      public long getDefinitionId() {
69          return definitionId;
70      }
71  
72      public String getDefinitionIdString() {
73          if (definitionId != 0) {
74              return String.valueOf(definitionId);
75          }
76          else {
77              return StringPool.BLANK;
78          }
79      }
80  
81      public long getInstanceId() {
82          return instanceId;
83      }
84  
85      public String getInstanceIdString() {
86          if (instanceId != 0) {
87              return String.valueOf(instanceId);
88          }
89          else {
90              return StringPool.BLANK;
91          }
92      }
93  
94      public String getDefinitionName() {
95          return definitionName;
96      }
97  
98      public String getDefinitionVersion() {
99          return definitionVersion;
100     }
101 
102     public String getStartDateGT() {
103         return startDateGT;
104     }
105 
106     public String getStartDateLT() {
107         return startDateLT;
108     }
109 
110     public String getEndDateGT() {
111         return endDateGT;
112     }
113 
114     public String getEndDateLT() {
115         return endDateLT;
116     }
117 
118     public boolean isHideEndedTasks() {
119         return hideEndedTasks;
120     }
121 
122     protected long definitionId;
123     protected long instanceId;
124     protected String definitionName;
125     protected String definitionVersion;
126     protected String startDateGT;
127     protected String startDateLT;
128     protected String endDateGT;
129     protected String endDateLT;
130     protected boolean hideEndedTasks;
131 
132 }