01: package de.webman.acl.eventhandler;
02:
03: import java.util.*;
04:
05: import com.teamkonzept.web.*;
06: import com.teamkonzept.lib.*;
07: import com.teamkonzept.webman.*;
08: import com.teamkonzept.webman.mainint.*;
09: import com.teamkonzept.webman.mainint.events.*;
10: import de.webman.acl.*;
11:
12: /**
13: Displays a list of Users on the left side of a frameset
14: * @author $Author: alex $
15: * @version $Revision: 1.3 $
16: */
17: public class ACUserListEventHandler extends DefaultEventHandler
18: implements ParameterTypes, DatabaseDefaults, FrameConstants {
19: private ACUserListEventHandler() {
20: }
21:
22: private static ACUserListEventHandler instance = new ACUserListEventHandler();
23:
24: /**
25: Returns the instance of this Singleton
26: */
27: public static ACUserListEventHandler getInstance() {
28: return instance;
29: }
30:
31: /**
32: This is where it all happens.
33: */
34: public void handleEvent(TKEvent evt) throws TKException {
35: try {
36: WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(),
37: ContextConstants.ACCESS_CONTROL);
38: TKHTMLTemplate t = evt
39: .getPrepHTMLTemplate("ac_userlist.tmpl");
40: TKVector userVector = ACConvenience
41: .makeUserList(UserFactory.getInstance().getUsers());
42:
43: t.setListIterator(new TKStandardPluginIterator(
44: "AC_USER_LIST", null, userVector, true, t
45: .getListIterator()));
46:
47: t.set("RTARGET", RIGHT_TARGET);
48: WebManEvent.fillEventsIntoTemplate(evt.getRemoteUser(), t,
49: ACCESS_CONTROL);
50: evt.finishTemplate(t);
51: } catch (Throwable e) {
52: throw WebmanExceptionHandler.getException(e);
53: }
54: }
55:
56: /**
57: Am I the one?
58: */
59: public boolean isHandler(TKEvent evt) {
60: return evt.getName().equalsIgnoreCase("AC_USER_LIST");
61: }
62:
63: }
|