| 1 | |
package org.kuali.student.enrollment.class2.acal.service.impl; |
| 2 | |
|
| 3 | |
import org.kuali.rice.core.api.resourceloader.GlobalResourceLoader; |
| 4 | |
import org.kuali.rice.krad.lookup.LookupableImpl; |
| 5 | |
import org.kuali.rice.krad.web.form.LookupForm; |
| 6 | |
import org.kuali.student.enrollment.acal.constants.AcademicCalendarServiceConstants; |
| 7 | |
import org.kuali.student.enrollment.acal.dto.HolidayCalendarInfo; |
| 8 | |
import org.kuali.student.enrollment.acal.service.AcademicCalendarService; |
| 9 | |
import org.kuali.student.r2.common.dto.ContextInfo; |
| 10 | |
import org.kuali.student.r2.common.exceptions.InvalidParameterException; |
| 11 | |
import org.kuali.student.r2.common.exceptions.MissingParameterException; |
| 12 | |
import org.kuali.student.r2.common.exceptions.OperationFailedException; |
| 13 | |
import org.kuali.student.r2.common.exceptions.PermissionDeniedException; |
| 14 | |
|
| 15 | |
import javax.xml.namespace.QName; |
| 16 | |
import java.util.ArrayList; |
| 17 | |
import java.util.List; |
| 18 | |
import java.util.Map; |
| 19 | |
|
| 20 | |
|
| 21 | |
@Deprecated |
| 22 | 0 | public class HolidayCalendarLookupableImpl extends LookupableImpl { |
| 23 | |
|
| 24 | |
public final static String ACADEMIC_CALENDAR_YEAR_KEY = "year"; |
| 25 | |
private transient AcademicCalendarService academicCalendarService; |
| 26 | |
|
| 27 | |
|
| 28 | |
@Override |
| 29 | |
protected List<?> getSearchResults(LookupForm lookupForm, Map<String, String> fieldValues, boolean unbounded) { |
| 30 | |
|
| 31 | 0 | List<HolidayCalendarInfo> holidayCalendarInfoList = new ArrayList<HolidayCalendarInfo>(); |
| 32 | |
|
| 33 | 0 | Integer academicCalendarYear = new Integer("2011"); |
| 34 | 0 | ContextInfo context = new ContextInfo(); |
| 35 | |
try{ |
| 36 | 0 | holidayCalendarInfoList = getAcademicCalendarService().getHolidayCalendarsByStartYear(academicCalendarYear, context); |
| 37 | 0 | return holidayCalendarInfoList; |
| 38 | 0 | }catch (InvalidParameterException ipe){ |
| 39 | 0 | System.out.println("call getAcademicCalendarService().getHolidayCalendarsByStartYear(startYear, context), and get InvalidParameterException: "+ipe.toString()); |
| 40 | 0 | }catch (MissingParameterException mpe){ |
| 41 | 0 | System.out.println("call getAcademicCalendarService().getHolidayCalendarsByStartYear(startYear, context), and get MissingParameterException: "+mpe.toString()); |
| 42 | 0 | }catch (OperationFailedException ofe){ |
| 43 | 0 | System.out.println("call getAcademicCalendarService().getHolidayCalendarsByStartYear(startYear, context), and get OperationFailedException: "+ofe.toString()); |
| 44 | 0 | }catch (PermissionDeniedException pde){ |
| 45 | 0 | System.out.println("call getAcademicCalendarService().getHolidayCalendarsByStartYear(startYear, context), and get PermissionDeniedException: "+pde.toString()); |
| 46 | 0 | } |
| 47 | 0 | return null; |
| 48 | |
|
| 49 | |
} |
| 50 | |
|
| 51 | |
protected AcademicCalendarService getAcademicCalendarService() { |
| 52 | 0 | if(academicCalendarService == null) { |
| 53 | 0 | academicCalendarService = (AcademicCalendarService) GlobalResourceLoader.getService(new QName(AcademicCalendarServiceConstants.NAMESPACE, AcademicCalendarServiceConstants.SERVICE_NAME_LOCAL_PART)); |
| 54 | |
} |
| 55 | |
|
| 56 | 0 | return academicCalendarService; |
| 57 | |
} |
| 58 | |
} |
| 59 | |
|
| 60 | |
|