1 23 24 package org.dbforms.event; 25 26 import org.dbforms.config.DbFormsConfig; 27 import org.dbforms.config.FieldValue; 28 import org.dbforms.config.ResultSetVector; 29 import org.dbforms.config.Table; 30 import org.dbforms.config.DbEventInterceptorData; 31 32 import org.dbforms.util.StringUtil; 33 34 import java.sql.SQLException ; 35 36 import javax.servlet.http.HttpServletRequest ; 37 38 39 40 45 public abstract class NavigationEvent extends WebEvent { 46 53 public NavigationEvent(String action, 54 HttpServletRequest request, 55 DbFormsConfig config) { 56 super(getTableId(action), request, config); 57 } 58 59 60 67 public NavigationEvent(Table table, 68 HttpServletRequest request, 69 DbFormsConfig config) { 70 super(table.getId(), request, config); 71 } 72 73 94 public abstract ResultSetVector processEvent(FieldValue[] filterFieldValues, 95 FieldValue[] orderConstraint, 96 String sqlFilter, 97 FieldValue[] sqlFilterParams, 98 int count, 99 String firstPosition, 100 String lastPosition, 101 DbEventInterceptorData interceptorData) 102 throws SQLException ; 103 104 105 private static int getTableId(String action) { 106 int tableId; 107 108 try { 109 tableId = StringUtil.getEmbeddedStringAsInteger(action, 2, '_'); 110 } catch (Exception e) { 111 tableId = -1; 112 } 113 114 return tableId; 115 } 116 } 117 | Popular Tags |