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.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
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
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
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
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 }