1 26 27 package org.objectweb.jonas.webapp.jonasadmin.security; 28 29 import java.util.ArrayList ; 30 31 import javax.servlet.http.HttpServletRequest ; 32 33 import org.apache.struts.action.ActionMessage; 34 import org.apache.struts.action.ActionErrors; 35 import org.apache.struts.action.ActionForm; 36 import org.apache.struts.action.ActionMapping; 37 import org.objectweb.jonas.webapp.jonasadmin.Jlists; 38 39 public class GroupMemoryRealmForm extends ActionForm { 40 41 43 45 private String action = null; 46 private String group = null; 47 private String description = null; 48 private java.util.ArrayList listRolesGroup = new ArrayList (); 49 private java.util.ArrayList listRolesRealm = new ArrayList (); 50 private java.util.ArrayList listRolesUsed = new ArrayList (); 51 private java.util.ArrayList listRolesNotused = new ArrayList (); 52 private String rolesUsed = null; 53 private String rolesNotused = null; 54 private String [] rolesNotusedSelected = new String [0]; 55 private String [] rolesUsedSelected = new String [0]; 56 57 59 65 public void reset(ActionMapping mapping, HttpServletRequest request) { 66 rolesUsed = null; 67 rolesNotused = null; 68 rolesNotusedSelected = new String [0]; 70 rolesUsedSelected = new String [0]; 71 } 72 73 83 public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { 84 ActionErrors oErrors = new ActionErrors(); 85 if (action.equals("create") == true) { 87 group = group.trim(); 88 if (group.length() == 0) { 89 oErrors.add("group" 90 , new ActionMessage("error.security.factory.memory.realm.group.name.required")); 91 } 92 } 93 if (oErrors.size() > 0) { 95 listRolesUsed = Jlists.getArrayList(rolesUsed, Jlists.SEPARATOR); 96 listRolesNotused = Jlists.getArrayList(rolesNotused, Jlists.SEPARATOR); 97 } 98 return oErrors; 99 } 100 101 103 public String getGroup() { 104 return group; 105 } 106 107 public void setGroup(String group) { 108 this.group = group; 109 } 110 111 public String getDescription() { 112 return description; 113 } 114 115 public void setDescription(String description) { 116 this.description = description; 117 } 118 119 public java.util.ArrayList getListRolesGroup() { 120 return listRolesGroup; 121 } 122 123 public void setListRolesGroup(java.util.ArrayList listRolesGroup) { 124 this.listRolesGroup = listRolesGroup; 125 } 126 127 public java.util.ArrayList getListRolesRealm() { 128 return listRolesRealm; 129 } 130 131 public void setListRolesRealm(java.util.ArrayList listRolesRealm) { 132 this.listRolesRealm = listRolesRealm; 133 } 134 135 public java.util.ArrayList getListRolesUsed() { 136 return listRolesUsed; 137 } 138 139 public void setListRolesUsed(java.util.ArrayList listRolesUsed) { 140 this.listRolesUsed = listRolesUsed; 141 } 142 143 public java.util.ArrayList getListRolesNotused() { 144 return listRolesNotused; 145 } 146 147 public void setListRolesNotused(java.util.ArrayList listRolesNotused) { 148 this.listRolesNotused = listRolesNotused; 149 } 150 151 public String getRolesUsed() { 152 return rolesUsed; 153 } 154 155 public void setRolesUsed(String rolesUsed) { 156 this.rolesUsed = rolesUsed; 157 } 158 159 public String getRolesNotused() { 160 return rolesNotused; 161 } 162 163 public void setRolesNotused(String rolesNotused) { 164 this.rolesNotused = rolesNotused; 165 } 166 167 public String [] getRolesNotusedSelected() { 168 return rolesNotusedSelected; 169 } 170 171 public void setRolesNotusedSelected(String [] rolesNotusedSelected) { 172 this.rolesNotusedSelected = rolesNotusedSelected; 173 } 174 175 public String [] getRolesUsedSelected() { 176 return rolesUsedSelected; 177 } 178 179 public void setRolesUsedSelected(String [] rolesUsedSelected) { 180 this.rolesUsedSelected = rolesUsedSelected; 181 } 182 183 public String getAction() { 184 return action; 185 } 186 187 public void setAction(String action) { 188 this.action = action; 189 } 190 191 } | Popular Tags |