1 6 7 package com.raptus.owxv3.modules.usermgr; 8 9 10 import javax.servlet.http.HttpServletRequest ; 11 12 import org.apache.struts.action.*; 13 14 import com.raptus.owxv3.api.OmniaWebBean; 15 16 17 21 public class EAUserMgrEditRoleBean extends OmniaWebBean 22 { 23 26 protected String name = null; 27 28 31 protected String description = null; 32 33 36 protected boolean newrole = false; 37 38 41 public EAUserMgrEditRoleBean() 42 { 43 this.newrole = false; 44 } 45 46 47 52 public boolean isNewRole() 53 { 54 return newrole; 55 } 56 57 public String getNewRole() 58 { 59 return ""+newrole; 60 } 61 62 public void setNewRole(boolean newrole) 63 { 64 this.newrole = newrole; 65 } 66 67 public void setNewRole(String newrole) 68 { 69 this.newrole = Boolean.valueOf(newrole).booleanValue(); 70 } 71 72 77 public void setDescription(String description) 78 { 79 this.description = description; 80 } 81 82 87 public String getDescription() { return description; } 88 89 94 public String getName() { return name; } 95 96 101 public void setName(String name) { this.name = name; } 102 103 110 public ActionErrors validate(HttpServletRequest request) 111 { 112 ActionErrors ret=new ActionErrors(); 113 114 if(name==null||name.length()<1) 116 { 117 ret.add(ActionErrors.GLOBAL_ERROR,new ActionError("module.usermgr.error.NoRoleName")); 118 } 119 120 if(description==null||description.length()<1) 122 { 123 ret.add(ActionErrors.GLOBAL_ERROR,new ActionError("module.usermgr.error.NoDescriptionName")); 124 } 125 126 return ret; 127 } 128 129 132 public void reset() 133 { 134 this.name = null; 135 this.description = null; 136 } 137 } 138 | Popular Tags |