View Javadoc

1   /**
2    * Copyright 2005-2012 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.kew.quicklinks;
17  
18  import org.kuali.rice.kew.doctype.bo.DocumentType;
19  
20  /**
21   * Stores statistics about the number of times a particular {@link DocumentType}
22   * appears in a particular user's Action List.
23   * 
24   * @author Kuali Rice Team (rice.collab@kuali.org)
25   */
26  public class ActionListStats implements Comparable {
27  
28      private String documentTypeName;
29      private String documentTypeLabelText;
30      private int count;
31  
32      public ActionListStats(String documentTypeName, String documentTypeLabelText, int count) {
33          this.documentTypeName = documentTypeName;
34          this.documentTypeLabelText = documentTypeLabelText;
35          this.count = count;
36      }
37      
38      public String getDocumentTypeLabelText() {
39          return documentTypeLabelText;
40      }
41      public void setDocumentTypeLabelText(String documentTypeLabelText) {
42          this.documentTypeLabelText = documentTypeLabelText;
43      }
44      public String getDocumentTypeName() {
45          return documentTypeName;
46      }
47      public void setDocumentTypeName(String documentTypeName) {
48          this.documentTypeName = documentTypeName;
49      }
50      public int getCount() {
51          return count;
52      }
53      public void setCount(int count) {
54          this.count = count;
55      }
56      public String getActionListFilterUrl() {
57          return "ActionList.do?method=showRequestFilteredView&docType=" + documentTypeName;
58      }
59      
60      public int compareTo(Object obj) {
61          if (obj != null && obj instanceof ActionListStats) {
62              return this.documentTypeLabelText.compareTo(((ActionListStats)obj).documentTypeLabelText);
63          }
64          return 0;
65      }
66  }