01: package de.webman.documenttype.eventhandler;
02:
03: import com.teamkonzept.web.*;
04: import com.teamkonzept.webman.*;
05: import com.teamkonzept.webman.db.TKWebmanDBManager;
06: import com.teamkonzept.webman.mainint.*;
07: import com.teamkonzept.webman.mainint.db.*;
08:
09: import com.teamkonzept.webman.mainint.db.queries.*;
10: import com.teamkonzept.webman.mainint.events.*;
11: import com.teamkonzept.lib.*;
12: import com.teamkonzept.field.*;
13: import com.teamkonzept.field.db.*;
14: import com.teamkonzept.db.*;
15: import com.teamkonzept.publishing.markups.*;
16:
17: import java.util.*;
18: import java.sql.*;
19:
20: /**
21: *
22: * Loeschen einer Componente einer Presentation
23: * @author $Author: alex $
24: * @version $Revision: 1.3 $
25: */
26: public class DTDeletePresCompHandler extends DefaultEventHandler
27: implements ParameterTypes, FrameConstants, DatabaseDefaults {
28: private DTDeletePresCompHandler() {
29: }
30:
31: private static DTDeletePresCompHandler instance = new DTDeletePresCompHandler();
32:
33: public static DTDeletePresCompHandler getInstance() {
34: return instance;
35: }
36:
37: public void handleEvent(TKEvent evt) throws TKException {
38: try {
39: WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(),
40: ContextConstants.PRESENTATIONS);
41: TKQuery q = TKDBManager.newQuery(TKDBPresCompDelete.class);
42: q.setQueryParams("PRESENTATION_ID", new Integer(evt
43: .getParameter(PARAMETER, "PRESENTATION_ID")));
44: q.setQueryParams("PRESENTATION_COMPONENT_IDX", new Integer(
45: evt.getParameter(PARAMETER,
46: "PRESENTATION_COMPONENT_IDX")));
47: q.execute();
48: q.fetchResultSet();
49: DTEditHandler.getInstance().handleEvent(evt);
50: } catch (Throwable e) {
51: // TO DO : Analyze Exception !
52: throw WebmanExceptionHandler.getException(e);
53: }
54: }
55:
56: public boolean isHandler(TKEvent evt) {
57: return evt.getName().equalsIgnoreCase("PR_DELETE_PRES_COMP");
58: }
59: }
|