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.krad.uif.view;
017
018import org.kuali.rice.krad.uif.UifConstants.ViewType;
019
020/**
021 * Type of <code>View</code> that provides a read-only display of a record of
022 * data (object instance)
023 * 
024 * <p>
025 * The <code>InquiryView</code> provides the interface for the Inquiry
026 * framework. It works with the <code>Inquirable</code> service and inquiry
027 * controller. The view does render a form to support the configuration of
028 * actions to perform operations on the data.
029 * </p>
030 * 
031 * <p>
032 * Inquiry views are primarily configured by the object class they are
033 * associated with. This provides the default dictionary information for the
034 * fields. If more than one inquiry view is needed for the same object class,
035 * the view name can be used to further identify an unique view
036 * </p>
037 * 
038 * @author Kuali Rice Team (rice.collab@kuali.org)
039 */
040public class InquiryView extends FormView {
041    private static final long serialVersionUID = 716926008488403616L;
042
043    private Class<?> dataObjectClassName;
044
045    public InquiryView() {
046        super();
047
048        setViewTypeName(ViewType.INQUIRY);
049        setValidateDirty(false);
050        setTranslateCodes(true);
051    }
052
053    /**
054     * The following initialization is performed:
055     *
056     * <ul>
057     * <li>Set the abstractTypeClasses map for the inquiry object path</li>
058     * </ul>
059     *
060     * @see org.kuali.rice.krad.uif.container.ContainerBase#performInitialization(org.kuali.rice.krad.uif.view.View, java.lang.Object)
061     */
062    @Override
063    public void performInitialization(View view, Object model) {
064        super.performInitialization(view, model);
065
066        getAbstractTypeClasses().put(getDefaultBindingObjectPath(), getDataObjectClassName());
067    }
068
069    /**
070     * Class name for the object the inquiry applies to
071     * 
072     * <p>
073     * The object class name is used to pick up a dictionary entry which will
074     * feed the attribute field definitions and other configuration. In addition
075     * it is used to configure the <code>Inquirable</code> which will carry out
076     * the inquiry action
077     * </p>
078     * 
079     * @return Class<?> inquiry object class
080     */
081    public Class<?> getDataObjectClassName() {
082        return this.dataObjectClassName;
083    }
084
085    /**
086     * Setter for the object class name
087     * 
088     * @param dataObjectClassName
089     */
090    public void setDataObjectClassName(Class<?> dataObjectClassName) {
091        this.dataObjectClassName = dataObjectClassName;
092    }
093
094}