00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 package org.objectweb.jonas.webapp.jonasadmin.service.container;
00027
00028 import java.util.List;
00029
00030 import javax.servlet.http.HttpServletRequest;
00031
00032 import org.apache.struts.action.ActionError;
00033 import org.apache.struts.action.ActionErrors;
00034 import org.apache.struts.action.ActionForm;
00035 import org.apache.struts.action.ActionMapping;
00036 import org.objectweb.jonas.webapp.jonasadmin.Jlists;
00037
00038
00042 public class WebAppForm extends ActionForm {
00043
00044
00045
00046 private String action = "edit";
00047 private boolean save = false;
00048 private String pathContext = null;
00049 private String labelPathContext = null;
00050 private List booleanValues = Jlists.getBooleanValues();
00051 private String objectName = null;
00052 private String j2eeApplication = null;
00053 private String j2eeServer = null;
00054 private String name = null;
00055
00056
00057
00065 public void reset(ActionMapping mapping, HttpServletRequest request) {
00066 action = "edit";
00067 save = false;
00068 }
00069
00081 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00082 ActionErrors oErrors = new ActionErrors();
00083
00084 if (getPathContext().length() == 0) {
00085 oErrors.add("context", new ActionError("error.webapp.context.required"));
00086 }
00087 return oErrors;
00088 }
00089
00090
00091
00092 public String getPathContext() {
00093 return pathContext;
00094 }
00095
00096 public void setPathContext(String pathContext) {
00097 this.pathContext = pathContext;
00098 if (pathContext.length() > 0) {
00099 if (pathContext.charAt(0) != '/') {
00100 this.pathContext = "/" + pathContext;
00101 }
00102 }
00103 setLabelPathContext(WebAppItem.extractLabelPathContext(this.pathContext));
00104 }
00105
00106 public String getAction() {
00107 return action;
00108 }
00109
00110 public void setAction(String action) {
00111 this.action = action;
00112 }
00113
00114 public List getBooleanValues() {
00115 return booleanValues;
00116 }
00117
00118 public String getLabelPathContext() {
00119 return labelPathContext;
00120 }
00121
00122 public void setLabelPathContext(String labelPathContext) {
00123 this.labelPathContext = labelPathContext;
00124 }
00125
00126 public boolean isSave() {
00127 return save;
00128 }
00129
00130 public void setSave(boolean save) {
00131 this.save = save;
00132 }
00133
00134 public String getObjectName() {
00135 return objectName;
00136 }
00137
00138 public void setObjectName(String objectName) {
00139 this.objectName = objectName;
00140 }
00141
00142 public String getJ2eeApplication() {
00143 return j2eeApplication;
00144 }
00145
00146 public void setJ2eeApplication(String j2eeApplication) {
00147 this.j2eeApplication = j2eeApplication;
00148 }
00149
00150 public String getJ2eeServer() {
00151 return j2eeServer;
00152 }
00153
00154 public void setJ2eeServer(String j2eeServer) {
00155 this.j2eeServer = j2eeServer;
00156 }
00157
00158 public String getName() {
00159 return name;
00160 }
00161
00162 public void setName(String name) {
00163 this.name = name;
00164 }
00165
00166 }