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