001    /**
002     * Copyright 2005-2011 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     */
016    package org.kuali.rice.kew.actionlist;
017    
018    import java.util.List;
019    
020    import org.displaytag.pagination.PaginatedList;
021    import org.displaytag.properties.SortOrderEnum;
022    
023    /**
024     * Implements the display tags paginated list to provide effecient paging for the action list.  
025     * This allows us not to have to fetch an entire action list each time a user pages their list.
026     *
027     * @author Kuali Rice Team (rice.collab@kuali.org)
028     */
029    public class PaginatedActionList implements PaginatedList {
030    
031            private final List list;
032            private final int fullListSize;
033            private final int pageNumber;
034            private final int objectsPerPage;
035            private final String searchId;
036            private final String sortCriterion;
037            private final SortOrderEnum sortDirection; 
038            
039            public PaginatedActionList(List list, int fullListSize, int pageNumber, int objectsPerPage, String searchId, String sortCriterion, SortOrderEnum sortDirection) {
040                    this.list = list;
041                    this.fullListSize = fullListSize;
042                    this.pageNumber = pageNumber;
043                    this.objectsPerPage = objectsPerPage;
044                    this.searchId = searchId;
045                    this.sortCriterion = sortCriterion;
046                    this.sortDirection = sortDirection;
047            }
048            
049            public int getFullListSize() {
050                    return fullListSize;
051            }
052    
053            public List getList() {
054                    return list;
055            }
056    
057            public int getObjectsPerPage() {
058                    return objectsPerPage;
059            }
060    
061            public int getPageNumber() {
062                    return pageNumber;
063            }
064    
065            public String getSearchId() {
066                    return searchId;
067            }
068    
069            public String getSortCriterion() {
070                    return sortCriterion;
071            }
072    
073            public SortOrderEnum getSortDirection() {
074                    return sortDirection;
075            }
076            
077    }