ResourceAdapterForm.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: ResourceAdapterForm.java,v 1.3 2004/03/19 14:31:49 sauthieg Exp $
00023  * --------------------------------------------------------------------------
00024  */
00025 
00026 package org.objectweb.jonas.webapp.jonasadmin.service.container;
00027 
00028 import java.net.URL;
00029 import java.util.ArrayList;
00030 import java.util.Collections;
00031 import java.util.Enumeration;
00032 import java.util.Properties;
00033 
00034 import javax.servlet.http.HttpServletRequest;
00035 
00036 import org.apache.struts.action.ActionErrors;
00037 import org.apache.struts.action.ActionForm;
00038 import org.apache.struts.action.ActionMapping;
00039 import org.objectweb.jonas.webapp.jonasadmin.JonasAdminJmx;
00040 import org.objectweb.jonas.webapp.jonasadmin.common.LabelValueByLabelComparator;
00041 import org.objectweb.jonas.webapp.taglib.LabelValueBean;
00042 
00043 
00047 public class ResourceAdapterForm extends ActionForm {
00048 
00049 // --------------------------------------------------------- Properties variables
00050 
00051     private String name = null;
00052     private String path = null;
00053     private String file = null;
00054     private boolean inEar = false;
00055     private String earFile = null;
00056     private String earPath = null;
00057     private ArrayList listProperties = new ArrayList();
00058 
00059 // --------------------------------------------------------- Public Methods
00060 
00061     public void reset(ActionMapping mapping, HttpServletRequest request) {
00062     }
00063 
00064     public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00065         ActionErrors oErrors = new ActionErrors();
00066         return oErrors;
00067     }
00068 
00069 // --------------------------------------------------------- Properties Methods
00070 
00071     public String getName() {
00072         return name;
00073     }
00074 
00075     public void setName(String name) {
00076         this.name = name;
00077     }
00078 
00079     public String getPath() {
00080         return path;
00081     }
00082 
00083     public void setPath(String path) {
00084         this.path = path;
00085     }
00086 
00087     public String getFile() {
00088         return file;
00089     }
00090 
00091     public void setFile(String file) {
00092         this.file = file;
00093     }
00094 
00095     public String getEarFile() {
00096         return earFile;
00097     }
00098 
00099     public String getEarPath() {
00100         return earPath;
00101     }
00102 
00103     public void setEarPath(URL p_Url) {
00104         this.earPath = null;
00105         if (p_Url != null) {
00106             this.earPath = p_Url.getPath();
00107             this.earFile = JonasAdminJmx.extractFilename(this.earPath);
00108         }
00109     }
00110 
00111     public boolean isInEar() {
00112         return inEar;
00113     }
00114 
00115     public void setInEar(boolean inEar) {
00116         this.inEar = inEar;
00117     }
00118 
00119     public ArrayList getListProperties() {
00120         return listProperties;
00121     }
00122 
00123     public void setListProperties(Properties properties) {
00124         this.listProperties.clear();
00125         // Fill list with properties (keys and values)
00126         String sKey;
00127         Enumeration oEnum = properties.keys();
00128         while (oEnum.hasMoreElements()) {
00129             sKey = oEnum.nextElement().toString();
00130             this.listProperties.add(new LabelValueBean(sKey, properties.getProperty(sKey, "")));
00131         }
00132         Collections.sort(this.listProperties, new LabelValueByLabelComparator());
00133     }
00134 
00135 }

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