WebAppForm.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Lesser General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2.1 of the License, or any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Lesser General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Lesser General Public
00017  * License along with this library; if not, write to the Free Software
00018  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
00019  * USA
00020  *
00021  * --------------------------------------------------------------------------
00022  * $Id: WebAppForm.java,v 1.4 2004/03/19 14:31:49 sauthieg Exp $
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 // --------------------------------------------------------- Properties variables
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 // --------------------------------------------------------- Public Methods
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         // Path context
00084         if (getPathContext().length() == 0) {
00085             oErrors.add("context", new ActionError("error.webapp.context.required"));
00086         }
00087         return oErrors;
00088     }
00089 
00090 // --------------------------------------------------------- Properties Methods
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 }

Generated on Tue Feb 15 15:05:31 2005 for JOnAS by  doxygen 1.3.9.1