01: package de.webman.template.eventhandler;
02:
03: import java.sql.*;
04:
05: import com.teamkonzept.db.*;
06: import com.teamkonzept.webman.mainint.db.queries.TKDBTmplGetAll;
07: import com.teamkonzept.webman.mainint.events.*;
08: import com.teamkonzept.webman.mainint.*;
09: import com.teamkonzept.webman.*;
10: import com.teamkonzept.web.*;
11: import com.teamkonzept.lib.*;
12:
13: /**
14: * Aufbauen der Liste der Templates im linken frame
15: *
16: * @author $Author: alex $
17: * @version $Revision: 1.2 $
18: */
19: public class TEShowlistHandler extends DefaultEventHandler implements
20: FrameConstants {
21: private TEShowlistHandler() {
22: }
23:
24: private static TEShowlistHandler instance = new TEShowlistHandler();
25:
26: public static TEShowlistHandler getInstance() {
27: return instance;
28: }
29:
30: public void handleEvent(TKEvent evt) throws TKException {
31: try {
32: TKQuery q = TKDBManager.newQuery(TKDBTmplGetAll.class);
33: q.execute();
34: ResultSet rs = q.fetchResultSet();
35: TKHTMLTemplate t = evt
36: .getPrepHTMLTemplate("te_tmplList.tmpl");
37: TKDBTemplate.prepareListTemplate(rs, t, "TE_TEMPLATE_LIST");
38: t.set("RTARGET", RIGHT_TARGET);
39: WebManEvent.fillEventsIntoTemplate(evt.getRemoteUser(), t,
40: TEMPLATES);
41: evt.finishTemplate(t);
42: } catch (Throwable t) {
43: throw WebmanExceptionHandler.getException(t);
44: }
45: }
46:
47: public boolean isHandler(TKEvent evt) {
48: return evt.getName().equalsIgnoreCase("TE_SHOWLIST");
49: }
50: }
|