01: package de.webman.config.eventhandler;
02:
03: import java.util.*;
04:
05: import com.teamkonzept.web.*;
06: import com.teamkonzept.db.*;
07: import com.teamkonzept.lib.*;
08: import java.sql.*;
09: import com.teamkonzept.webman.*;
10: import com.teamkonzept.webman.mainint.*;
11: import com.teamkonzept.webman.mainint.db.queries.TKDBPropGroupGetAll;
12: import com.teamkonzept.webman.mainint.events.*;
13:
14: /**
15: Displays a frameset with a list of users on the left and an empty page to the right
16: * @author $Author: alex $
17: * @version $Revision: 1.2 $
18: */
19: public class COPropGroupListHandler extends DefaultEventHandler
20: implements ParameterTypes, DatabaseDefaults, FrameConstants {
21: private COPropGroupListHandler() {
22: }
23:
24: private static COPropGroupListHandler instance = new COPropGroupListHandler();
25:
26: public static COPropGroupListHandler getInstance() {
27: return instance;
28: }
29:
30: public void handleEvent(TKEvent evt) throws TKException {
31: try {
32: WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(),
33: ContextConstants.CUSTOMIZE_PROPERTIES); // check if event is allowed
34: TKQuery q = TKDBManager.newQuery(TKDBPropGroupGetAll.class);
35: q.execute();
36: ResultSet rs = q.fetchResultSet();
37:
38: TKHTMLTemplate t = evt
39: .getPrepHTMLTemplate("co_propgrouplist.tmpl");
40: TKDBTemplate
41: .prepareListTemplate(rs, t, "CO_PROPGROUP_LIST");
42: t.set("RTARGET", RIGHT_TARGET);
43: WebManEvent.fillEventsIntoTemplate(evt.getRemoteUser(), t,
44: CUSTOMIZE_PROPERTIES);
45: evt.finishTemplate(t);
46: } catch (Throwable e) {
47: throw WebmanExceptionHandler.getException(e);
48: }
49: }
50:
51: public boolean isHandler(TKEvent evt) {
52: return evt.getName().equalsIgnoreCase("CO_PROPGROUP_LIST");
53: }
54:
55: }
|