1 23 24 package org.dbforms.event; 25 26 27 import org.dbforms.config.DbFormsConfig; 28 import org.dbforms.config.Table; 29 30 import java.util.Properties ; 31 32 import javax.servlet.http.HttpServletRequest ; 33 34 35 36 48 public abstract class WebEvent { 49 50 51 private DbFormsConfig config; 52 53 54 private HttpServletRequest request; 55 56 57 private Properties properties = null; 58 59 60 private String followUp; 61 62 63 private String followUpOnError; 64 65 66 private String type = "UNDEFINED"; 67 68 69 private Table table; 70 71 78 public WebEvent(int tableId, 79 HttpServletRequest request, 80 DbFormsConfig config) { 81 setTable(config.getTable(tableId)); 82 setRequest(request); 83 this.config = config; 84 } 85 86 91 public DbFormsConfig getConfig() { 92 return config; 93 } 94 95 96 101 public void setFollowUp(String followUp) { 102 this.followUp = followUp; 103 } 104 105 106 111 public String getFollowUp() { 112 return followUp; 113 } 114 115 116 121 public void setFollowUpOnError(String followUpOnError) { 122 this.followUpOnError = followUpOnError; 123 } 124 125 126 131 public String getFollowUpOnError() { 132 return followUpOnError; 133 } 134 135 136 141 public void setProperties(Properties properties) { 142 this.properties = properties; 143 } 144 145 146 151 public Properties getProperties() { 152 return properties; 153 } 154 155 156 161 public void setRequest(HttpServletRequest request) { 162 this.request = request; 163 } 164 165 166 171 public HttpServletRequest getRequest() { 172 return request; 173 } 174 175 176 181 public void setTable(Table table) { 182 this.table = table; 183 } 184 185 186 191 public Table getTable() { 192 return table; 193 } 194 195 196 201 public void setType(String type) { 202 this.type = type; 203 } 204 205 206 211 public String getType() { 212 return type; 213 } 214 215 216 224 protected boolean hasUserPrivileg(int privileg) { 225 return config.getTable(getTable().getId()) 226 .hasUserPrivileg(getRequest(), privileg); 227 } 228 } 229 | Popular Tags |