001: /*
002: * JOnAS: Java(TM) Open Application Server
003: * Copyright (C) 1999 Bull S.A.
004: * Contact: jonas-team@objectweb.org
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2.1 of the License, or any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
019: * USA
020: *
021: * --------------------------------------------------------------------------
022: * $Id: WarForm.java 8144 2006-03-20 15:03:22Z danesa $
023: * --------------------------------------------------------------------------
024: */
025:
026: package org.objectweb.jonas.webapp.jonasadmin.service.container;
027:
028: import java.util.ArrayList;
029: import java.util.Collections;
030:
031: import javax.servlet.http.HttpServletRequest;
032:
033: import org.apache.struts.action.ActionErrors;
034: import org.apache.struts.action.ActionMapping;
035: import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx;
036: import org.objectweb.jonas.webapp.jonasadmin.service.ModuleForm;
037:
038: /**
039: * @author Michel-Ange ANTON
040: */
041: public class WarForm extends ModuleForm {
042:
043: // --------------------------------------------------------- Properties variables
044:
045: private String path = null;
046: private String filename = null;
047: private String contextRoot = null;
048: private String hostName = null;
049: private String warFile = null;
050: private String warPath = null;
051: private boolean java2DelegationModel = false;
052: private String xmlContent = null;
053: private String jonasXmlContent = null;
054: private String[] servletsName = null;
055: private ArrayList listServlets = new ArrayList();
056:
057: // --------------------------------------------------------- Public Methods
058:
059: /**
060: * Reset all properties to their default values.
061: *
062: * @param mapping The mapping used to select this instance
063: * @param request The servlet request we are processing
064: */
065:
066: public void reset(ActionMapping mapping, HttpServletRequest request) {
067: path = null;
068: filename = null;
069:
070: contextRoot = null;
071: hostName = null;
072: warPath = null;
073: java2DelegationModel = false;
074: xmlContent = null;
075: jonasXmlContent = null;
076: servletsName = null;
077: listServlets = new ArrayList();
078: }
079:
080: /**
081: * Validate the properties that have been set from this HTTP request,
082: * and return an <code>ActionErrors</code> object that encapsulates any
083: * validation errors that have been found. If no errors are found, return
084: * <code>null</code> or an <code>ActionErrors</code> object with no
085: * recorded error messages.
086: *
087: * @param mapping The mapping used to select this instance
088: * @param request The servlet request we are processing
089: * @return List of errors
090: */
091: public ActionErrors validate(ActionMapping mapping,
092: HttpServletRequest request) {
093: ActionErrors oErrors = new ActionErrors();
094: return oErrors;
095: }
096:
097: // --------------------------------------------------------- Properties Methods
098:
099: public String getPath() {
100: return path;
101: }
102:
103: public void setPath(String path) {
104: this .path = path;
105: }
106:
107: public String getFilename() {
108: return filename;
109: }
110:
111: public void setFilename(String filename) {
112: this .filename = filename;
113: }
114:
115: public String getHostName() {
116: return hostName;
117: }
118:
119: public void setHostName(String hostName) {
120: this .hostName = hostName;
121: }
122:
123: public String getWarPath() {
124: return warPath;
125: }
126:
127: public void setWarPath(java.net.URL p_WarUrl) {
128: this .warPath = null;
129: if (p_WarUrl != null) {
130: this .warPath = p_WarUrl.getPath();
131: }
132: }
133:
134: public String getContextRoot() {
135: return contextRoot;
136: }
137:
138: public void setContextRoot(String contextRoot) {
139: this .contextRoot = contextRoot;
140: }
141:
142: public boolean getJava2DelegationModel() {
143: return java2DelegationModel;
144: }
145:
146: public void setJava2DelegationModel(boolean java2DelegationModel) {
147: this .java2DelegationModel = java2DelegationModel;
148: }
149:
150: public String getXmlContent() {
151: return xmlContent;
152: }
153:
154: public void setXmlContent(String xmlContent) {
155: this .xmlContent = xmlContent;
156: }
157:
158: public String getJonasXmlContent() {
159: return jonasXmlContent;
160: }
161:
162: public void setJonasXmlContent(String jonasXmlContent) {
163: this .jonasXmlContent = jonasXmlContent;
164: }
165:
166: public String[] getServletsName() {
167: return servletsName;
168: }
169:
170: public void setServletsName(String[] servletsName) {
171: this .servletsName = servletsName;
172: // Fill list
173: listServlets = new ArrayList();
174: for (int i = 0; i < this .servletsName.length; i++) {
175: listServlets.add(this .servletsName[i]);
176: }
177: Collections.sort(listServlets);
178: }
179:
180: public ArrayList getListServlets() {
181: return listServlets;
182: }
183: }
|