1 25 26 package org.objectweb.jonas.webapp.jonasadmin.resource; 27 28 import javax.servlet.http.HttpServletRequest ; 29 30 import org.apache.struts.action.ActionMessage; 31 import org.apache.struts.action.ActionErrors; 32 import org.apache.struts.action.ActionForm; 33 import org.apache.struts.action.ActionMapping; 34 35 public class MailFactoryPropertiesForm extends ActionForm { 36 37 39 private String mailFactoryName = null; 41 private String jndiName = null; 42 private String type = null; 43 private String username = null; 45 private String password = null; 46 private String sessionProps = null; 48 private String to = null; 50 private String subject = null; 51 private String cc = null; 52 private String bcc = null; 53 54 56 62 63 public void reset(ActionMapping mapping, HttpServletRequest request) { 64 mailFactoryName = null; 65 jndiName = null; 66 type = null; 67 username = null; 69 password = null; 70 sessionProps = null; 72 to = null; 74 subject = null; 75 cc = null; 76 bcc = null; 77 } 78 79 89 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 90 ActionErrors oErrors = new ActionErrors(); 91 if ((jndiName == null) || (jndiName.length() == 0)) { 92 oErrors.add("jndiName", new ActionMessage("error.mailservice.mailfactory.emptyjndiname")); 93 } 94 if ((mailFactoryName == null) || (mailFactoryName.length() == 0)) { 95 oErrors.add("jndiName", new ActionMessage("error.mailservice.mailfactory.emptyname")); 96 } 97 if ((type == null) || (type.length() == 0)) { 98 oErrors.add("jndiName", new ActionMessage("error.mailservice.mailfactory.emptytype")); 99 } 100 return oErrors; 101 } 102 103 105 public String getMailFactoryName() { 106 return mailFactoryName; 107 } 108 109 public void setMailFactoryName(String mailFactoryName) { 110 this.mailFactoryName = mailFactoryName; 111 } 112 113 public String getJndiName() { 114 return jndiName; 115 } 116 117 public void setJndiName(String jndiName) { 118 this.jndiName = jndiName; 119 } 120 121 public String getType() { 122 return type; 123 } 124 125 public void setType(String type) { 126 this.type = type; 127 } 128 129 public String getUsername() { 130 return username; 131 } 132 133 public void setUsername(String username) { 134 this.username = username; 135 } 136 137 public String getPassword() { 138 return password; 139 } 140 141 public void setPassword(String password) { 142 this.password = password; 143 } 144 145 public String getSessionProps() { 146 return sessionProps; 147 } 148 149 public void setSessionProps(String sessionProps) { 150 this.sessionProps = sessionProps; 151 } 152 153 public String getTo() { 154 return to; 155 } 156 157 public void setTo(String to) { 158 this.to = to; 159 } 160 161 public String getSubject() { 162 return subject; 163 } 164 165 public void setSubject(String subject) { 166 this.subject = subject; 167 } 168 169 public String getCc() { 170 return cc; 171 } 172 173 public void setCc(String cc) { 174 this.cc = cc; 175 } 176 177 public String getBcc() { 178 return bcc; 179 } 180 181 public void setBcc(String bcc) { 182 this.bcc = bcc; 183 } 184 185 } 186 | Popular Tags |