KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > acl > eventhandler > ACRoleListEventHandler


1 package de.webman.acl.eventhandler;
2
3 import java.util.*;
4
5 import com.teamkonzept.web.*;
6 import com.teamkonzept.lib.*;
7 import com.teamkonzept.webman.*;
8 import com.teamkonzept.webman.mainint.*;
9 import com.teamkonzept.webman.mainint.events.*;
10 import de.webman.acl.*;
11
12 /**
13 Displays a list of roles on the left side of a frameset
14  * @author $Author: alex $
15  * @version $Revision: 1.3 $
16  */

17 public class ACRoleListEventHandler extends DefaultEventHandler implements ParameterTypes, DatabaseDefaults, FrameConstants
18 {
19     private ACRoleListEventHandler() {}
20
21     private static ACRoleListEventHandler instance = new ACRoleListEventHandler();
22
23     public static ACRoleListEventHandler getInstance()
24     {
25         return instance;
26     }
27
28     public void handleEvent(TKEvent evt) throws TKException
29     {
30         try {
31             WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(), ContextConstants.ACCESS_CONTROL);
32
33             TKHTMLTemplate t = evt.getPrepHTMLTemplate( "ac_rolelist.tmpl" );
34             TKVector userVector = ACConvenience.makeRoleList( RoleFactory.getInstance().getRoles() );
35
36             t.setListIterator(new TKStandardPluginIterator("AC_ROLE_LIST", null, userVector, true, t.getListIterator()));
37             t.set("RTARGET", RIGHT_TARGET);
38             WebManEvent.fillEventsIntoTemplate(evt.getRemoteUser(), t, ACCESS_CONTROL);
39             evt.finishTemplate( t );
40         } catch (Throwable JavaDoc e) {
41             throw WebmanExceptionHandler.getException(e);
42         }
43     }
44
45     public boolean isHandler(TKEvent evt)
46     {
47         return evt.getName().equalsIgnoreCase( "AC_ROLE_LIST" );
48     }
49
50
51     //{{DECLARE_CONTROLS
52
//}}
53
}
54
Popular Tags