Coverage Report - org.kuali.rice.kns.lookup.LookupResultsSupportStrategyService
 
Classes in this File Line Coverage Branch Coverage Complexity
LookupResultsSupportStrategyService
N/A
N/A
1
 
 1  
 /*
 2  
  * Copyright 2007-2010 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.kns.lookup;
 17  
 
 18  
 import java.util.Collection;
 19  
 import java.util.Set;
 20  
 
 21  
 import org.kuali.rice.krad.bo.BusinessObject;
 22  
 
 23  
 /**
 24  
  * Contract for strategies which can help LokoupResultsService with aspects (mainly id generation and result lookup) of multi value lookup support 
 25  
  * 
 26  
  * @author Kuali Rice Team (rice.collab@kuali.org)
 27  
  *
 28  
  */
 29  
 public interface LookupResultsSupportStrategyService {
 30  
 
 31  
         /**
 32  
          * Returns a list of BOs that were selected.
 33  
          * 
 34  
          * This implementation makes an attempt to retrieve all BOs with the given object IDs, unless they have been deleted or the object ID changed.
 35  
          * Since data may have changed since the search, the returned BOs may not match the criteria used to search.
 36  
          * 
 37  
          * @param lookupResultsSequenceNumber the sequence number identifying the lookup results in the database
 38  
          * @param boClass the class of the business object to retrieve
 39  
          * @param personId the id of the principal performing this search
 40  
          * @param lookupResultsService an implementation of the lookupResultsService to do some of the dirty work...
 41  
          * @return a Collection of retrieved BusinessObjects
 42  
          * @throws Exception if anything goes wrong...well, just blow up, okay?
 43  
          */
 44  
     public abstract <T extends BusinessObject> Collection<T> retrieveSelectedResultBOs(Class<T> boClass, Set<String> lookupIds) throws Exception;
 45  
     
 46  
     /**
 47  
      * 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
 48  
      * 
 49  
      * @param businessObject the lookup to generate an id for
 50  
      * @return the String id
 51  
      */
 52  
     public abstract String getLookupIdForBusinessObject(BusinessObject businessObject);
 53  
     
 54  
     /**
 55  
      * Determines if the given class is supported by this strategy
 56  
      * 
 57  
      * @param boClass the class to test the determination on
 58  
      * @return true if this strategy supports it, false otherwise
 59  
      */
 60  
     public abstract boolean qualifiesForStrategy(Class<? extends BusinessObject> boClass);
 61  
 }