001/**
002 * Copyright 2005-2016 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016package org.kuali.rice.kew.quicklinks;
017
018import org.kuali.rice.kew.doctype.bo.DocumentType;
019
020/**
021 * Stores statistics about the number of times a particular {@link DocumentType}
022 * appears in a particular user's Action List.
023 * 
024 * @author Kuali Rice Team (rice.collab@kuali.org)
025 */
026public class ActionListStats implements Comparable {
027
028    private String documentTypeName;
029    private String documentTypeLabelText;
030    private int count;
031
032    public ActionListStats(String documentTypeName, String documentTypeLabelText, int count) {
033        this.documentTypeName = documentTypeName;
034        this.documentTypeLabelText = documentTypeLabelText;
035        this.count = count;
036    }
037    
038    public String getDocumentTypeLabelText() {
039        return documentTypeLabelText;
040    }
041    public void setDocumentTypeLabelText(String documentTypeLabelText) {
042        this.documentTypeLabelText = documentTypeLabelText;
043    }
044    public String getDocumentTypeName() {
045        return documentTypeName;
046    }
047    public void setDocumentTypeName(String documentTypeName) {
048        this.documentTypeName = documentTypeName;
049    }
050    public int getCount() {
051        return count;
052    }
053    public void setCount(int count) {
054        this.count = count;
055    }
056    public String getActionListFilterUrl() {
057        return "ActionList.do?method=showRequestFilteredView&docType=" + documentTypeName;
058    }
059    
060    public int compareTo(Object obj) {
061        if (obj != null && obj instanceof ActionListStats) {
062            return this.documentTypeLabelText.compareTo(((ActionListStats)obj).documentTypeLabelText);
063        }
064        return 0;
065    }
066}