1 /**
2 * Copyright 2005-2016 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.util;
17
18 import java.io.Serializable;
19
20 /**
21 * Contains configuration for displaying a growl message
22 *
23 * @author Kuali Rice Team (rice.collab@kuali.org)
24 */
25 public class GrowlMessage implements Serializable {
26 private static final long serialVersionUID = 6588969539633862559L;
27
28 private String namespaceCode;
29 private String componentCode;
30
31 private String title;
32 private String titleKey;
33
34 private String messageKey;
35 private String[] messageParameters;
36
37 private String theme;
38
39 public GrowlMessage() {
40
41 }
42
43 /**
44 * Namespace code (often an application or module code) the growl message is associated with
45 *
46 * <p>
47 * Used with the component code and message key for retrieving the message text (and title text). If null,
48 * the default namespace code will be used
49 * </p>
50 *
51 * @return String error namespace code
52 */
53 public String getNamespaceCode() {
54 return namespaceCode;
55 }
56
57 /**
58 * Setter for the growl's associated namespace code
59 *
60 * @param namespaceCode
61 */
62 public void setNamespaceCode(String namespaceCode) {
63 this.namespaceCode = namespaceCode;
64 }
65
66 /**
67 * A code within the namespace that identifies a component or group the growl message is associated with
68 *
69 * <p>
70 * Used with the namespace and message key for retrieving the message text (and title text). If null,
71 * the default component code will be used
72 * </p>
73 *
74 * @return String component code
75 */
76 public String getComponentCode() {
77 return componentCode;
78 }
79
80 /**
81 * Setter for the growl's associated component code
82 *
83 * @param componentCode
84 */
85 public void setComponentCode(String componentCode) {
86 this.componentCode = componentCode;
87 }
88
89 /**
90 * Title for growl message (displays on top bar of growl)
91 *
92 * @return String title text
93 */
94 public String getTitle() {
95 return title;
96 }
97
98 /**
99 * Setter for the growl title
100 *
101 * @param title
102 */
103 public void setTitle(String title) {
104 this.title = title;
105 }
106
107 /**
108 * Key for the title message within the message repository
109 *
110 * <p>
111 * Growl title text can be externalized into a message repository (see {@link
112 * org.kuali.rice.krad.messages.MessageService}.
113 * This gives the key for which the message which is used with the namespace and component to retrieve
114 * the message text
115 * </p>
116 *
117 * @return String message key
118 */
119 public String getTitleKey() {
120 return titleKey;
121 }
122
123 /**
124 * Setter for the growl title message key
125 *
126 * @param titleKey
127 */
128 public void setTitleKey(String titleKey) {
129 this.titleKey = titleKey;
130 }
131
132 /**
133 * Key for the growl message within the message repository
134 *
135 * <p>
136 * Growl message text must be externalized into a message repository (see {@link
137 * org.kuali.rice.krad.messages.MessageService}.
138 * This gives the key for which the message which is used with the namespace and component to retrieve
139 * the message text
140 * </p>
141 *
142 * @return String message key
143 */
144 public String getMessageKey() {
145 return messageKey;
146 }
147
148 /**
149 * Setter for the growl message key
150 *
151 * @param messageKey
152 */
153 public void setMessageKey(String messageKey) {
154 this.messageKey = messageKey;
155 }
156
157 /**
158 * One or more parameters for complete the growl message
159 *
160 * <p>
161 * An externally defined message can contain one or more placeholders which will get completed from runtime
162 * variables. This array of strings is used for completing the message. The message parameters are filled based
163 * on the order or parameters within the array
164 * </p>
165 *
166 * @return String[] array of string values to fill message parameters
167 */
168 public String[] getMessageParameters() {
169 return messageParameters;
170 }
171
172 /**
173 * Setter for the message parameters array
174 *
175 * @param messageParameters
176 */
177 public void setMessageParameters(String[] messageParameters) {
178 this.messageParameters = messageParameters;
179 }
180
181 /**
182 * Name of the growl theme to use (must be setup through the view growl property
183 *
184 * @return String name of growl theme
185 * @{link org.kuali.rice.krad.uif.view.View#getGrowls()} )
186 */
187 public String getTheme() {
188 return theme;
189 }
190
191 /**
192 * Setter for the growl theme to use
193 *
194 * @param theme
195 */
196 public void setTheme(String theme) {
197 this.theme = theme;
198 }
199 }