1 package de.webman.config.eventhandler; 2 3 import java.util.*; 4 import java.sql.*; 5 6 import com.teamkonzept.web.*; 7 import com.teamkonzept.lib.*; 8 import com.teamkonzept.db.*; 9 import com.teamkonzept.webman.mainint.*; 10 import com.teamkonzept.webman.*; 11 import com.teamkonzept.webman.mainint.events.*; 12 13 18 public class COErrorHandler extends DefaultEventHandler implements ParameterTypes, DatabaseDefaults, FrameConstants 19 { 20 21 private COErrorHandler() { } 22 23 private static COErrorHandler instance = new COErrorHandler(); 24 25 public static COErrorHandler getInstance() 26 { 27 return instance; 28 } 29 30 public void handleEvent(TKEvent evt) throws TKException 31 { 32 try { 33 WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(), ContextConstants.CUSTOMIZE_PROPERTIES); String edit = evt.getParameter(PARAMETER, "EDIT"); 35 String noName = evt.getParameter(PARAMETER, "NONAME"); 36 37 TKHTMLTemplate t = evt.getPrepHTMLTemplate( "co_error.tmpl" ); 38 39 t.set("GROUP", "1"); 43 44 if ( edit != null && edit.equals("1") ) 46 { 47 t.set("EDIT", "1"); 48 } 49 if ( noName != null && noName.equals("1") ) 50 { 51 t.set("NONAME", "1"); 52 } 53 54 WebManEvent.fillEventsIntoTemplate(evt.getRemoteUser(), t, CUSTOMIZE_PROPERTIES); 55 evt.finishTemplate( t ); 56 57 } catch (Throwable e) { 58 throw WebmanExceptionHandler.getException(e); 59 } 60 } 61 62 public boolean isHandler(TKEvent evt) 63 { 64 return evt.getName().equalsIgnoreCase( "CO_ERROR" ); 65 } 66 67 } 68 | Popular Tags |