KickJava   Java API By Example, From Geeks To Geeks.

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


1 package de.webman.acl.eventhandler;
2
3 import java.util.*;
4
5 import com.teamkonzept.web.*;
6 import com.teamkonzept.webman.*;
7 import com.teamkonzept.webman.mainint.*;
8 import com.teamkonzept.webman.mainint.events.*;
9 import com.teamkonzept.lib.*;
10
11 /**
12 Displays a frameset with a list of groups on the left and an empty page to the right
13  * @author $Author: alex $
14  * @version $Revision: 1.2 $
15  */

16 public class ACGroupFrameEventHandler extends DefaultEventHandler implements ParameterTypes, DatabaseDefaults, FrameConstants
17 {
18 private ACGroupFrameEventHandler() {}
19
20     private static ACGroupFrameEventHandler instance = new ACGroupFrameEventHandler();
21
22     public static ACGroupFrameEventHandler getInstance()
23     {
24         return instance;
25     }
26
27     public void handleEvent(TKEvent evt) throws TKException
28     {
29         try {
30             WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(), ContextConstants.ACCESS_CONTROL);
31
32             String JavaDoc groupID = evt.getParameter( PARAMETER, "GROUP_ID");
33             TKHTMLTemplate t = evt.getPrepHTMLTemplate( "f_ac_group.tmpl" );
34             String JavaDoc detail = "EMPTY";
35             if (groupID != null && groupID.length() > 0)
36             {
37                 detail="AC_GROUP_EDIT";
38                 t.set("GROUP_ID", groupID);
39             }
40             HTMLUtils.fillFrameSet( t, HTMLUtils.LEFT_FRAME_WIDTH, "AC_GROUP_LIST", detail );
41             String JavaDoc editPage = evt.getParameter(PARAMETER, "EDIT_PAGE");
42             
43             t.set("EDIT_PAGE", (editPage == null ? "1" : editPage));
44             WebManEvent.fillEventsIntoTemplate(evt.getRemoteUser(), t, ACCESS_CONTROL);
45             evt.finishTemplate( t );
46         } catch (Throwable JavaDoc e) {
47             throw WebmanExceptionHandler.getException(e);
48         }
49     }
50
51     public boolean isHandler(TKEvent evt)
52     {
53         return evt.getName().equalsIgnoreCase( "AC_GROUP_FRAME" );
54     }
55
56 }
57
Popular Tags