1 package de.webman.content.eventhandler; 2 3 import com.teamkonzept.web.*; 4 import com.teamkonzept.webman.*; 5 import com.teamkonzept.webman.mainint.*; 6 import com.teamkonzept.webman.mainint.db.queries.*; 7 import com.teamkonzept.webman.mainint.events.*; 8 import com.teamkonzept.lib.*; 9 import com.teamkonzept.field.*; 10 import com.teamkonzept.field.db.*; 11 import com.teamkonzept.db.*; 12 13 import java.sql.*; 14 15 22 public class CEIntershopHandler extends DefaultEventHandler implements DatabaseDefaults, ParameterTypes, FrameConstants 23 { 24 private CEIntershopHandler() 25 {} 26 27 private static CEIntershopHandler instance = new CEIntershopHandler(); 28 29 public static CEIntershopHandler getInstance() 30 { 31 return instance; 32 } 33 34 36 public void handleEvent(TKEvent evt) throws TKException 37 { 38 try 39 { 40 CEUtils.checkEvent(evt); 41 TKQuery q = TKDBManager.newQuery(TKIntershopContentInstanceGet.class); 42 q.setQueryParams( "CONTENT_NODE_SHORTNAME", evt.getNotNullParameter(PARAMETER, "NEW_GROUP_CONTENT_SHORTNAME") ); 43 q.execute(); 44 ResultSet rs = q.fetchResultSet(); 45 if (rs.next()) 46 { 47 String instanceID = rs.getString("INSTANCE_ID"); 50 String nodeID = rs.getString("CONTENT_NODE_ID"); 51 evt.getParams().put(PARAMETER, "INSTANCE_ID", instanceID); 52 evt.getParams().put(PARAMETER, "CONTENT_NODE_ID", nodeID); 53 CEEditHandler.getInstance().handleEvent(evt); 54 } 55 else 56 { 57 CEEditHandler.getInstance().handleEvent(evt); 59 } 60 } 61 catch (Throwable e) 62 { 63 throw WebmanExceptionHandler.getException(e); 65 } 66 } 67 68 public boolean isHandler(TKEvent evt) 69 { 70 return (evt.getName().equals("CE_CATFORM") || evt.getName().equals("CE_PRODFORM")); 71 72 } 73 } 74 | Popular Tags |