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.kns.lookup; 017 018import java.util.Collection; 019import java.util.Set; 020 021import org.kuali.rice.krad.bo.BusinessObject; 022 023/** 024 * Contract for strategies which can help LokoupResultsService with aspects (mainly id generation and result lookup) of multi value lookup support 025 * 026 * @author Kuali Rice Team (rice.collab@kuali.org) 027 * 028 */ 029public interface LookupResultsSupportStrategyService { 030 031 /** 032 * Returns a list of BOs that were selected. 033 * 034 * This implementation makes an attempt to retrieve all BOs with the given object IDs, unless they have been deleted or the object ID changed. 035 * Since data may have changed since the search, the returned BOs may not match the criteria used to search. 036 * 037 * @param lookupResultsSequenceNumber the sequence number identifying the lookup results in the database 038 * @param boClass the class of the business object to retrieve 039 * @param personId the id of the principal performing this search 040 * @param lookupResultsService an implementation of the lookupResultsService to do some of the dirty work... 041 * @return a Collection of retrieved BusinessObjects 042 * @throws Exception if anything goes wrong...well, just blow up, okay? 043 */ 044 public abstract <T extends BusinessObject> Collection<T> retrieveSelectedResultBOs(Class<T> boClass, Set<String> lookupIds) throws Exception; 045 046 /** 047 * Generates a String id which is used as an id on a checkbox for result rows returning the business object in a multiple value lookup 048 * 049 * @param businessObject the lookup to generate an id for 050 * @return the String id 051 */ 052 public abstract String getLookupIdForBusinessObject(BusinessObject businessObject); 053 054 /** 055 * Determines if the given class is supported by this strategy 056 * 057 * @param boClass the class to test the determination on 058 * @return true if this strategy supports it, false otherwise 059 */ 060 public abstract boolean qualifiesForStrategy(Class<? extends BusinessObject> boClass); 061}