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.rule.bo; 017 018import java.util.List; 019import java.util.Map; 020 021import org.kuali.rice.kew.rule.RuleDelegationBo; 022import org.kuali.rice.kew.rule.web.WebRuleUtils; 023import org.kuali.rice.kns.inquiry.KualiInquirableImpl; 024import org.kuali.rice.kns.web.ui.Section; 025import org.kuali.rice.krad.bo.BusinessObject; 026 027/** 028 * Inquirable implementation for KEW rule delegations. 029 * 030 * @author Kuali Rice Team (rice.collab@kuali.org) 031 * 032 */ 033public class RuleDelegationInquirableImpl extends KualiInquirableImpl { 034 035 @Override 036 public Object retrieveDataObject(Map fieldValues){ 037 RuleDelegationBo rule = (RuleDelegationBo)super.retrieveDataObject(fieldValues); 038 WebRuleUtils.populateRuleMaintenanceFields(rule.getDelegationRule()); 039 return rule; 040 } 041 042 /** 043 * This overridden method ... 044 * 045 * @see org.kuali.rice.krad.inquiry.Inquirable#getBusinessObject(java.util.Map) 046 */ 047 public BusinessObject getBusinessObject(Map fieldValues) { 048 RuleDelegationBo rule = (RuleDelegationBo)super.getBusinessObject(fieldValues); 049 WebRuleUtils.populateRuleMaintenanceFields(rule.getDelegationRule()); 050 return rule; 051 } 052 053 /** 054 * This overridden method ... 055 * 056 * @see org.kuali.rice.krad.inquiry.Inquirable#getSections(org.kuali.rice.krad.bo.BusinessObject) 057 */ 058 public List getSections(BusinessObject bo) { 059 List<Section> sections = super.getSections(bo); 060 061 return WebRuleUtils.customizeSections(((RuleDelegationBo)bo).getDelegationRule(), sections, true); 062 063 } 064 065}