01: package de.webman.acl.eventhandler;
02:
03: import java.util.*;
04:
05: import com.teamkonzept.web.*;
06: import com.teamkonzept.webman.*;
07: import com.teamkonzept.webman.mainint.*;
08: import com.teamkonzept.webman.mainint.events.*;
09: import com.teamkonzept.lib.*;
10:
11: /**
12: Displays a frameset with a list of roles on the left and an empty page to the right
13: * @author $Author: alex $
14: * @version $Revision: 1.2 $
15: */
16: public class ACRoleFrameEventHandler extends DefaultEventHandler
17: implements ParameterTypes, DatabaseDefaults, FrameConstants {
18: private ACRoleFrameEventHandler() {
19: }
20:
21: private static ACRoleFrameEventHandler instance = new ACRoleFrameEventHandler();
22:
23: public static ACRoleFrameEventHandler getInstance() {
24: return instance;
25: }
26:
27: public void handleEvent(TKEvent evt) throws TKException {
28: try {
29: WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(),
30: ContextConstants.ACCESS_CONTROL);
31:
32: String uId = evt.getParameter(PARAMETER, "ROLE_ID");
33: String editPage = evt.getParameter(PARAMETER, "ROLE_ID");
34: TKHTMLTemplate t = evt
35: .getPrepHTMLTemplate("f_ac_role.tmpl");
36: if (uId != null) {
37: HTMLUtils.fillFrameSet(t, LEFT_FRAME_WIDTH,
38: "AC_ROLE_LIST", "AC_ROLE_EDIT");
39: t.set("ROLE_ID", uId);
40: t.set("EDIT_PAGE", (editPage == null ? "1" : editPage));
41: } else {
42: HTMLUtils.fillFrameSet(t, LEFT_FRAME_WIDTH,
43: "AC_ROLE_LIST", "EMPTY");
44: }
45:
46: WebManEvent.fillEventsIntoTemplate(evt.getRemoteUser(), t,
47: ACCESS_CONTROL);
48: evt.finishTemplate(t);
49: } catch (Throwable e) {
50: throw WebmanExceptionHandler.getException(e);
51: }
52: }
53:
54: public boolean isHandler(TKEvent evt) {
55: return evt.getName().equalsIgnoreCase("AC_ROLE_FRAME");
56: }
57:
58: }
|