Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2005-2012 The Kuali Foundation Licensed under the Educational Community License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.opensource.org/licenses/ecl2.php Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
package org.kuali.rice.coreservice.web.component;
Since ParameterDetailType can be either DataDictionary or DB based, we need a custom org.kuali.rice.krad.inquiry.Inquirable to check both.

Author(s):
Kuali Rice Team (rice.collab@kuali.org)
	private static final String COMPONENT_CODE = "code";
	private static final String NAMESPACE_CODE = "namespaceCode";
	public Object retrieveDataObject(Map fieldValues){
		BusinessObject result = (BusinessObject)super.retrieveDataObject(fieldValues);
		if (result == null) {
            result = loadDerivedComponent(fieldValues);
        }
		return result
    }
	public BusinessObject getBusinessObject(Map fieldValues) {
		BusinessObject result = super.getBusinessObject(fieldValues);
		if (result == null) {
			result = loadDerivedComponent(fieldValues);
		}
		return result
	}
    protected ComponentBo loadDerivedComponent(Map fieldValues) {
        String componentCode = (String)fieldValues.get();
	    String namespaceCode = (String)fieldValues.get();
        if (componentCode == null) {
            throw new RuntimeException( + " is a required key for this inquiry");
        }
	    if (namespaceCode == null) {
            throw new RuntimeException( + " is a required key for this inquiry");
        }
        Map<StringObjectprimaryKeys = new HashMap<StringObject>();
        primaryKeys.put(componentCode);
        primaryKeys.put(namespaceCode);
        DerivedComponentBo derivedComponentBo = KRADServiceLocator.getBusinessObjectService().findByPrimaryKey(
                DerivedComponentBo.classprimaryKeys);
        if (derivedComponentBo != null) {
            return DerivedComponentBo.toComponentBo(derivedComponentBo);
        }
        return null;
    }
New to GrepCode? Check out our FAQ X