View Javadoc
1   /**
2    * Copyright 2004-2014 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.kpme.tklm.time.rules.overtime.weekly.web;
17  
18  import java.util.List;
19  import java.util.Properties;
20  
21  import org.kuali.kpme.core.lookup.KPMELookupableHelperServiceImpl;
22  import org.kuali.kpme.tklm.time.rules.overtime.weekly.WeeklyOvertimeRule;
23  import org.kuali.rice.kns.lookup.HtmlData;
24  import org.kuali.rice.kns.lookup.HtmlData.AnchorHtmlData;
25  import org.kuali.rice.krad.bo.BusinessObject;
26  import org.kuali.rice.krad.util.KRADConstants;
27  import org.kuali.rice.krad.util.UrlFactory;
28  
29  @SuppressWarnings("deprecation")
30  public class WeeklyOvertimeRuleLookupableHelperServiceImpl extends KPMELookupableHelperServiceImpl {
31  
32  	private static final long serialVersionUID = 7408152182449747106L;
33  	
34  	@Override
35  	@SuppressWarnings("rawtypes")
36  	public List<HtmlData> getCustomActionUrls(BusinessObject businessObject, List pkNames) {
37  		List<HtmlData> customActionUrls = super.getCustomActionUrls(businessObject, pkNames);
38  
39  		WeeklyOvertimeRule weeklyOvertimeRule = (WeeklyOvertimeRule) businessObject;
40  		String tkWeeklyOvertimeRuleId = weeklyOvertimeRule.getTkWeeklyOvertimeRuleId();
41  		
42  		Properties params = new Properties();
43  		params.put(KRADConstants.BUSINESS_OBJECT_CLASS_ATTRIBUTE, getBusinessObjectClass().getName());
44  		params.put(KRADConstants.DISPATCH_REQUEST_PARAMETER, KRADConstants.MAINTENANCE_NEW_METHOD_TO_CALL);
45  		params.put("tkWeeklyOvertimeRuleId", tkWeeklyOvertimeRuleId);
46  		AnchorHtmlData viewUrl = new AnchorHtmlData(UrlFactory.parameterizeUrl(KRADConstants.INQUIRY_ACTION, params), "view");
47  		viewUrl.setDisplayText("view");
48  		viewUrl.setTarget(AnchorHtmlData.TARGET_BLANK);
49  		customActionUrls.add(viewUrl);
50  		
51  		return customActionUrls;
52  	}
53  
54  }