KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > config > eventhandler > COPropGroupListHandler


1 package de.webman.config.eventhandler;
2
3 import java.util.*;
4
5 import com.teamkonzept.web.*;
6 import com.teamkonzept.db.*;
7 import com.teamkonzept.lib.*;
8 import java.sql.*;
9 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 implements ParameterTypes, DatabaseDefaults, FrameConstants
20 {
21     private COPropGroupListHandler() {}
22     
23     private static COPropGroupListHandler instance = new COPropGroupListHandler();
24     
25     public static COPropGroupListHandler getInstance()
26     {
27         return instance;
28     }
29
30     public void handleEvent(TKEvent evt) throws TKException
31     {
32         try {
33             WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(), 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.getPrepHTMLTemplate( "co_propgrouplist.tmpl" );
39             TKDBTemplate.prepareListTemplate( rs, t, "CO_PROPGROUP_LIST" );
40             t.set("RTARGET", RIGHT_TARGET);
41             WebManEvent.fillEventsIntoTemplate(evt.getRemoteUser(), t, CUSTOMIZE_PROPERTIES);
42             evt.finishTemplate( t );
43         } catch (Throwable JavaDoc e) {
44             throw WebmanExceptionHandler.getException(e);
45         }
46     }
47     
48     public boolean isHandler(TKEvent evt)
49     {
50         return evt.getName().equalsIgnoreCase( "CO_PROPGROUP_LIST" );
51     }
52
53 }
54
Popular Tags