Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
MaintenanceView |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright 2011 The Kuali Foundation Licensed under the Educational Community | |
3 | * License, Version 1.0 (the "License"); you may not use this file except in | |
4 | * compliance with the License. You may obtain a copy of the License at | |
5 | * http://www.opensource.org/licenses/ecl1.php Unless required by applicable law | |
6 | * or agreed to in writing, software distributed under the License is | |
7 | * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | |
8 | * KIND, either express or implied. See the License for the specific language | |
9 | * governing permissions and limitations under the License. | |
10 | */ | |
11 | package org.kuali.rice.kns.uif.container; | |
12 | ||
13 | import org.kuali.rice.kns.uif.UifConstants.ViewType; | |
14 | ||
15 | /** | |
16 | * View type for Maintenance documents | |
17 | * | |
18 | * <p> | |
19 | * Supports primary display for a new maintenance record, in which case the | |
20 | * fields are display for populating the new record, and an edit maintenance | |
21 | * record, which is a comparison view with the old record read-only on the left | |
22 | * side and the new record (changed record) on the right side | |
23 | * </p> | |
24 | * | |
25 | * <p> | |
26 | * The <code>MaintenanceView</code> provides the interface for the maintenance | |
27 | * framework. It works with the <code>Maintainable</code> service and | |
28 | * maintenance controller. | |
29 | * </p> | |
30 | * | |
31 | * <p> | |
32 | * Maintenance 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 maintenance view is needed for the same object | |
35 | * class, 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 MaintenanceView extends DocumentView { | |
41 | private static final long serialVersionUID = -3382802967703882341L; | |
42 | ||
43 | private Class<?> dataObjectClassName; | |
44 | ||
45 | private String oldObjectBindingPath; | |
46 | ||
47 | // TODO: figure out what this is used for | |
48 | 0 | private boolean allowsRecordDeletion = false; |
49 | ||
50 | public MaintenanceView() { | |
51 | 0 | super(); |
52 | ||
53 | 0 | setViewTypeName(ViewType.MAINTENANCE); |
54 | 0 | } |
55 | ||
56 | /** | |
57 | * The following initialization is performed: | |
58 | * | |
59 | * <ul> | |
60 | * <li>Set the abstractTypeClasses map for the maintenance object path</li> | |
61 | * </ul> | |
62 | * </p> | |
63 | * | |
64 | * @see org.kuali.rice.kns.uif.container.ContainerBase#performInitialization(org.kuali.rice.kns.uif.container.View) | |
65 | */ | |
66 | @Override | |
67 | public void performInitialization(View view) { | |
68 | 0 | super.performInitialization(view); |
69 | ||
70 | 0 | getAbstractTypeClasses().put(getDefaultBindingObjectPath(), dataObjectClassName); |
71 | 0 | getAbstractTypeClasses().put(getOldObjectBindingPath(), dataObjectClassName); |
72 | 0 | } |
73 | ||
74 | /** | |
75 | * Class name for the object the maintenance document applies to | |
76 | * | |
77 | * <p> | |
78 | * The object class name is used to pick up a dictionary entry which will | |
79 | * feed the attribute field definitions and other configuration. In addition | |
80 | * it is used to configure the <code>Maintainable</code> which will carry | |
81 | * out the maintenance action | |
82 | * </p> | |
83 | * | |
84 | * @return Class<?> maintenance object class | |
85 | */ | |
86 | public Class<?> getDataObjectClassName() { | |
87 | 0 | 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 | 0 | this.dataObjectClassName = dataObjectClassName; |
97 | 0 | } |
98 | ||
99 | public String getOldObjectBindingPath() { | |
100 | 0 | return this.oldObjectBindingPath; |
101 | } | |
102 | ||
103 | public void setOldObjectBindingPath(String oldObjectBindingPath) { | |
104 | 0 | this.oldObjectBindingPath = oldObjectBindingPath; |
105 | 0 | } |
106 | ||
107 | public boolean isAllowsRecordDeletion() { | |
108 | 0 | return this.allowsRecordDeletion; |
109 | } | |
110 | ||
111 | public void setAllowsRecordDeletion(boolean allowsRecordDeletion) { | |
112 | 0 | this.allowsRecordDeletion = allowsRecordDeletion; |
113 | 0 | } |
114 | ||
115 | } |