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.maintenance;
17
18 import org.kuali.rice.krad.document.Document;
19 import org.kuali.rice.krad.maintenance.Maintainable;
20
21 /**
22 * Common interface for all maintenance documents.
23 */
24 public interface MaintenanceDocument extends Document {
25
26 /**
27 * @return String containing the xml representation of the maintenance document
28 */
29 public String getXmlDocumentContents();
30
31 /**
32 * @return Maintainable which holds the new maintenance record
33 */
34 public Maintainable getNewMaintainableObject();
35
36 /**
37 * @return Maintainable which holds the old maintenance record
38 */
39 public Maintainable getOldMaintainableObject();
40
41 /**
42 * Sets the xml contents of the maintenance document
43 *
44 * @param documentContents - String xml
45 */
46 public void setXmlDocumentContents(String documentContents);
47
48 /**
49 * @param newMaintainableObject - Initializes the new maintainable
50 */
51 public void setNewMaintainableObject(Maintainable newMaintainableObject);
52
53 /**
54 * @param newMaintainableObject - Initializes the old maintainable
55 */
56 public void setOldMaintainableObject(Maintainable oldMaintainableObject);
57
58 /**
59 * Returns a reference to the data object that this MaintenanceDocument is maintaining
60 */
61 public Object getDocumentDataObject();
62
63 /**
64 * Builds the xml document string from the contents of the old and new maintainbles.
65 */
66 public void populateXmlDocumentContentsFromMaintainables();
67
68 /**
69 * Populates the old and new maintainables from the xml document contents string.
70 */
71 public void populateMaintainablesFromXmlDocumentContents();
72
73 /**
74 * @return boolean - indicates whether this is an edit or new maintenace document by the existence of an old maintainable
75 */
76 public boolean isOldDataObjectInDocument();
77
78 /**
79 *
80 * Returns true if this maintenance document is creating a new Business Object, false if its an edit.
81 *
82 */
83 public boolean isNew();
84
85 /**
86 *
87 * Returns true if this maintenance document is editing an existing Business Object, false if its creating a new one.
88 *
89 */
90 public boolean isEdit();
91
92 /**
93 *
94 * Returns true if this maintenance document is creating a new Business Object out of an existing Business Object,
95 * for example, a new division vendor out of an existing parent vendor.
96 *
97 */
98 public boolean isNewWithExisting();
99
100 /**
101 *
102 * A flag which indicates whether the primary keys have been cleared on a Copy-type of document. This will be true if the 'clear
103 * keys on a copy' has been done, and it will be false if not.
104 *
105 * @return true if the primary keys have been cleared already, false if not.
106 *
107 */
108 public boolean isFieldsClearedOnCopy();
109
110 /**
111 *
112 * This method sets the value of the fieldsClearedOnCopy.
113 *
114 * @param fieldsClearedOnCopy - true or false
115 *
116 */
117 public void setFieldsClearedOnCopy(boolean keysClearedOnCopy);
118
119 /**
120 *
121 * This method...
122 * @return
123 */
124 public boolean getDisplayTopicFieldInNotes();
125
126 /**
127 *
128 * This method...
129 */
130 public void setDisplayTopicFieldInNotes(boolean displayTopicFieldInNotes);
131
132 }