1 16 17 18 package org.apache.webapp.admin.host; 19 20 import javax.servlet.http.HttpServletRequest ; 21 import org.apache.struts.action.ActionError; 22 import org.apache.struts.action.ActionErrors; 23 import org.apache.struts.action.ActionForm; 24 import org.apache.struts.action.ActionMapping; 25 import java.util.List ; 26 27 33 34 public final class HostForm extends ActionForm { 35 36 38 41 private String adminAction = "Edit"; 42 43 46 private String objectName = null; 47 48 52 private String nodeLabel = null; 53 54 57 private String hostName = null; 58 59 62 private String serviceName = null; 63 64 67 private String appBase = null; 68 69 72 private String autoDeploy = "true"; 73 74 77 private String deployXML = "true"; 78 79 82 private String deployOnStartup = "true"; 83 84 87 private String unpackWARs = "false"; 88 89 92 private String findAliases = null; 93 94 97 private List booleanVals = null; 98 99 102 private List aliasVals = null; 103 104 107 private String xmlNamespaceAware = "false"; 108 109 112 private String xmlValidation = "false"; 113 114 116 119 public String getAdminAction() { 120 121 return this.adminAction; 122 123 } 124 125 126 129 public void setAdminAction(String adminAction) { 130 131 this.adminAction = adminAction; 132 133 } 134 135 138 public String getObjectName() { 139 140 return this.objectName; 141 142 } 143 144 145 148 public void setObjectName(String objectName) { 149 150 this.objectName = objectName; 151 152 } 153 154 155 158 public String getServiceName() { 159 160 return this.serviceName; 161 162 } 163 164 165 168 public void setServiceName(String serviceName) { 169 170 this.serviceName = serviceName; 171 172 } 173 174 177 public String getNodeLabel() { 178 179 return this.nodeLabel; 180 181 } 182 183 186 public void setNodeLabel(String nodeLabel) { 187 188 this.nodeLabel = nodeLabel; 189 190 } 191 192 195 public String getHostName() { 196 197 return this.hostName; 198 199 } 200 201 204 public void setHostName(String hostName) { 205 206 this.hostName = hostName; 207 208 } 209 210 213 public String getAppBase() { 214 215 return this.appBase; 216 217 } 218 219 222 public String getAutoDeploy() { 223 224 return this.autoDeploy; 225 226 } 227 228 231 232 public void setAutoDeploy(String autoDeploy) { 233 234 this.autoDeploy = autoDeploy; 235 236 } 237 238 241 public String getDeployXML() { 242 243 return this.deployXML; 244 245 } 246 247 250 251 public void setDeployXML(String deployXML) { 252 253 this.deployXML = deployXML; 254 255 } 256 257 260 public String getDeployOnStartup() { 261 262 return this.deployOnStartup; 263 264 } 265 266 269 270 public void setDeployOnStartup(String deployOnStartup) { 271 272 this.deployOnStartup = deployOnStartup; 273 274 } 275 276 279 280 public void setAppBase(String appBase) { 281 282 this.appBase = appBase; 283 284 } 285 286 289 public String getUnpackWARs() { 290 291 return this.unpackWARs; 292 293 } 294 295 298 299 public void setUnpackWARs(String unpackWARs) { 300 301 this.unpackWARs = unpackWARs; 302 303 } 304 305 308 public List getBooleanVals() { 309 310 return this.booleanVals; 311 312 } 313 314 317 public void setBooleanVals(List booleanVals) { 318 319 this.booleanVals = booleanVals; 320 321 } 322 323 326 public List getAliasVals() { 327 328 return this.aliasVals; 329 330 } 331 332 335 public void setAliasVals(List aliasVals) { 336 337 this.aliasVals = aliasVals; 338 339 } 340 341 344 public String getXmlNamespaceAware() { 345 346 return this.xmlNamespaceAware; 347 348 } 349 350 353 354 public void setXmlNamespaceAware(String xmlNamespaceAware) { 355 356 this.xmlNamespaceAware = xmlNamespaceAware; 357 358 } 359 360 363 public String getXmlValidation() { 364 365 return this.xmlValidation; 366 367 } 368 369 372 373 public void setXmlValidation(String xmlValidation) { 374 375 this.xmlValidation = xmlValidation; 376 377 } 378 379 381 387 public void reset(ActionMapping mapping, HttpServletRequest request) { 388 389 this.objectName = null; 390 this.serviceName = null; 391 this.hostName = null; 392 this.appBase = null; 393 this.autoDeploy = "true"; 394 this.deployXML = "true"; 395 this.deployOnStartup = "true"; 396 this.unpackWARs = "true"; 397 398 } 399 400 403 public String toString() { 404 405 StringBuffer sb = new StringBuffer ("HostForm[adminAction="); 406 sb.append(adminAction); 407 sb.append(",appBase="); 408 sb.append(appBase); 409 sb.append(",autoDeploy="); 410 sb.append(autoDeploy); 411 sb.append(",deployXML="); 412 sb.append(deployXML); 413 sb.append(",deployOnStartup="); 414 sb.append(deployOnStartup); 415 sb.append(",unpackWARs="); 416 sb.append(unpackWARs); 417 sb.append("',objectName='"); 418 sb.append(objectName); 419 sb.append("',hostName="); 420 sb.append(hostName); 421 sb.append("',serviceName="); 422 sb.append(serviceName); 423 sb.append("]"); 424 return (sb.toString()); 425 426 } 427 428 438 439 public ActionErrors validate(ActionMapping mapping, 440 HttpServletRequest request) { 441 442 ActionErrors errors = new ActionErrors(); 443 444 String submit = request.getParameter("submit"); 445 446 449 if ((hostName== null) || (hostName.length() < 1)) { 451 errors.add("hostName", new ActionError("error.hostName.required")); 452 } 453 454 if ((appBase == null) || (appBase.length() < 1)) { 456 errors.add("appBase", new ActionError("error.appBase.required")); 457 } 458 459 return errors; 461 462 } 463 464 } 465 | Popular Tags |