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.util; 017 018import java.io.Serializable; 019 020/** 021 * Contains configuration for displaying a growl message 022 * 023 * @author Kuali Rice Team (rice.collab@kuali.org) 024 */ 025public class GrowlMessage implements Serializable { 026 private static final long serialVersionUID = 6588969539633862559L; 027 028 private String namespaceCode; 029 private String componentCode; 030 031 private String title; 032 private String titleKey; 033 034 private String messageKey; 035 private String[] messageParameters; 036 037 private String theme; 038 039 public GrowlMessage() { 040 041 } 042 043 /** 044 * Namespace code (often an application or module code) the growl message is associated with 045 * 046 * <p> 047 * Used with the component code and message key for retrieving the message text (and title text). If null, 048 * the default namespace code will be used 049 * </p> 050 * 051 * @return String error namespace code 052 */ 053 public String getNamespaceCode() { 054 return namespaceCode; 055 } 056 057 /** 058 * Setter for the growl's associated namespace code 059 * 060 * @param namespaceCode 061 */ 062 public void setNamespaceCode(String namespaceCode) { 063 this.namespaceCode = namespaceCode; 064 } 065 066 /** 067 * A code within the namespace that identifies a component or group the growl message is associated with 068 * 069 * <p> 070 * Used with the namespace and message key for retrieving the message text (and title text). If null, 071 * the default component code will be used 072 * </p> 073 * 074 * @return String component code 075 */ 076 public String getComponentCode() { 077 return componentCode; 078 } 079 080 /** 081 * Setter for the growl's associated component code 082 * 083 * @param componentCode 084 */ 085 public void setComponentCode(String componentCode) { 086 this.componentCode = componentCode; 087 } 088 089 /** 090 * Title for growl message (displays on top bar of growl) 091 * 092 * @return String title text 093 */ 094 public String getTitle() { 095 return title; 096 } 097 098 /** 099 * 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}