1 /** 2 * Copyright 2005-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.rice.krad.uif.view; 17 18 import org.kuali.rice.krad.uif.UifConstants.ViewType; 19 20 /** 21 * Type of <code>View</code> that provides a read-only display of a record of 22 * data (object instance) 23 * 24 * <p> 25 * The <code>InquiryView</code> provides the interface for the Inquiry 26 * framework. It works with the <code>Inquirable</code> service and inquiry 27 * controller. The view does render a form to support the configuration of 28 * actions to perform operations on the data. 29 * </p> 30 * 31 * <p> 32 * Inquiry views are primarily configured by the object class they are 33 * associated with. This provides the default dictionary information for the 34 * fields. If more than one inquiry view is needed for the same object class, 35 * the view name can be used to further identify an unique view 36 * </p> 37 * 38 * @author Kuali Rice Team (rice.collab@kuali.org) 39 */ 40 public class InquiryView extends FormView { 41 private static final long serialVersionUID = 716926008488403616L; 42 43 private Class<?> dataObjectClassName; 44 45 public InquiryView() { 46 super(); 47 48 setViewTypeName(ViewType.INQUIRY); 49 setValidateDirty(false); 50 setTranslateCodes(true); 51 } 52 53 /** 54 * The following initialization is performed: 55 * 56 * <ul> 57 * <li>Set the abstractTypeClasses map for the inquiry object path</li> 58 * </ul> 59 * 60 * @see org.kuali.rice.krad.uif.container.ContainerBase#performInitialization(org.kuali.rice.krad.uif.view.View, java.lang.Object) 61 */ 62 @Override 63 public void performInitialization(View view, Object model) { 64 super.performInitialization(view, model); 65 66 getAbstractTypeClasses().put(getDefaultBindingObjectPath(), getDataObjectClassName()); 67 } 68 69 /** 70 * Class name for the object the inquiry applies to 71 * 72 * <p> 73 * The object class name is used to pick up a dictionary entry which will 74 * feed the attribute field definitions and other configuration. In addition 75 * it is used to configure the <code>Inquirable</code> which will carry out 76 * the inquiry action 77 * </p> 78 * 79 * @return Class<?> inquiry object class 80 */ 81 public Class<?> getDataObjectClassName() { 82 return this.dataObjectClassName; 83 } 84 85 /** 86 * Setter for the object class name 87 * 88 * @param dataObjectClassName 89 */ 90 public void setDataObjectClassName(Class<?> dataObjectClassName) { 91 this.dataObjectClassName = dataObjectClassName; 92 } 93 94 }