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