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
00027 package org.objectweb.jonas.webapp.jonasadmin.security;
00028
00029 import java.util.ArrayList;
00030
00031 import javax.servlet.http.HttpServletRequest;
00032
00033 import org.apache.struts.action.ActionError;
00034 import org.apache.struts.action.ActionErrors;
00035 import org.apache.struts.action.ActionForm;
00036 import org.apache.struts.action.ActionMapping;
00037 import org.objectweb.jonas.webapp.jonasadmin.Jlists;
00038
00039 public class GroupMemoryRealmForm extends ActionForm {
00040
00041
00042
00043
00044
00045 private String action = null;
00046 private String group = null;
00047 private String description = null;
00048 private java.util.ArrayList listRolesGroup = new ArrayList();
00049 private java.util.ArrayList listRolesRealm = new ArrayList();
00050 private java.util.ArrayList listRolesUsed = new ArrayList();
00051 private java.util.ArrayList listRolesNotused = new ArrayList();
00052 private String rolesUsed = null;
00053 private String rolesNotused = null;
00054 private String[] rolesNotusedSelected = new String[0];
00055 private String[] rolesUsedSelected = new String[0];
00056
00057
00058
00065 public void reset(ActionMapping mapping, HttpServletRequest request) {
00066 rolesUsed = null;
00067 rolesNotused = null;
00068
00069 rolesNotusedSelected = new String[0];
00070 rolesUsedSelected = new String[0];
00071 }
00072
00083 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {
00084 ActionErrors oErrors = new ActionErrors();
00085
00086 if (action.equals("create") == true) {
00087 group = group.trim();
00088 if (group.length() == 0) {
00089 oErrors.add("group"
00090 , new ActionError("error.security.factory.memory.realm.group.name.required"));
00091 }
00092 }
00093
00094 if (oErrors.size() > 0) {
00095 listRolesUsed = Jlists.getArrayList(rolesUsed, Jlists.SEPARATOR);
00096 listRolesNotused = Jlists.getArrayList(rolesNotused, Jlists.SEPARATOR);
00097 }
00098 return oErrors;
00099 }
00100
00101
00102
00103 public String getGroup() {
00104 return group;
00105 }
00106
00107 public void setGroup(String group) {
00108 this.group = group;
00109 }
00110
00111 public String getDescription() {
00112 return description;
00113 }
00114
00115 public void setDescription(String description) {
00116 this.description = description;
00117 }
00118
00119 public java.util.ArrayList getListRolesGroup() {
00120 return listRolesGroup;
00121 }
00122
00123 public void setListRolesGroup(java.util.ArrayList listRolesGroup) {
00124 this.listRolesGroup = listRolesGroup;
00125 }
00126
00127 public java.util.ArrayList getListRolesRealm() {
00128 return listRolesRealm;
00129 }
00130
00131 public void setListRolesRealm(java.util.ArrayList listRolesRealm) {
00132 this.listRolesRealm = listRolesRealm;
00133 }
00134
00135 public java.util.ArrayList getListRolesUsed() {
00136 return listRolesUsed;
00137 }
00138
00139 public void setListRolesUsed(java.util.ArrayList listRolesUsed) {
00140 this.listRolesUsed = listRolesUsed;
00141 }
00142
00143 public java.util.ArrayList getListRolesNotused() {
00144 return listRolesNotused;
00145 }
00146
00147 public void setListRolesNotused(java.util.ArrayList listRolesNotused) {
00148 this.listRolesNotused = listRolesNotused;
00149 }
00150
00151 public String getRolesUsed() {
00152 return rolesUsed;
00153 }
00154
00155 public void setRolesUsed(String rolesUsed) {
00156 this.rolesUsed = rolesUsed;
00157 }
00158
00159 public String getRolesNotused() {
00160 return rolesNotused;
00161 }
00162
00163 public void setRolesNotused(String rolesNotused) {
00164 this.rolesNotused = rolesNotused;
00165 }
00166
00167 public String[] getRolesNotusedSelected() {
00168 return rolesNotusedSelected;
00169 }
00170
00171 public void setRolesNotusedSelected(String[] rolesNotusedSelected) {
00172 this.rolesNotusedSelected = rolesNotusedSelected;
00173 }
00174
00175 public String[] getRolesUsedSelected() {
00176 return rolesUsedSelected;
00177 }
00178
00179 public void setRolesUsedSelected(String[] rolesUsedSelected) {
00180 this.rolesUsedSelected = rolesUsedSelected;
00181 }
00182
00183 public String getAction() {
00184 return action;
00185 }
00186
00187 public void setAction(String action) {
00188 this.action = action;
00189 }
00190
00191 }