KickJava   Java API By Example, From Geeks To Geeks.

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


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

16 public class COPropFrameHandler extends DefaultEventHandler implements ParameterTypes, DatabaseDefaults, FrameConstants
17 {
18     private COPropFrameHandler() {}
19     
20     private static COPropFrameHandler instance = new COPropFrameHandler();
21     
22     public static COPropFrameHandler 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.CUSTOMIZE_PROPERTIES); // check if event is allowed
31

32         String JavaDoc propGroupId = evt.getParameter(PARAMETER, "PROPGROUP_ID");
33         propGroupId = (propGroupId != null ? propGroupId : "-1");
34         
35         /* alte version
36         
37         String pId = evt.getParameter(PARAMETER, "PROP_ID");
38         
39         TKHTMLTemplate t = evt.getPrepHTMLTemplate( "f_co_prop.tmpl" );
40         
41         if (pId == null) {
42         HTMLUtils.fillFrameSet( t, LEFT_FRAME_WIDTH, "CO_PROP_LIST", "EMPTY" );
43         }
44         else {
45         HTMLUtils.fillFrameSet( t, LEFT_FRAME_WIDTH, "CO_PROP_LIST", "CO_PROP_EDIT" );
46         t.set("PROP_ID", pId);
47         }
48         t.set("RTARGET", RIGHT_TARGET);
49         WebManEvent.fillEventsIntoTemplate(evt, t, CUSTOMIZE_PROPERTIES);
50         evt.finishTemplate( t );
51         */

52         
53         evt.getParams().put(PARAMETER, "PROPGROUP_ID", propGroupId);
54         evt.getParams().put(PARAMETER, "LIST_PROPS", "1");
55         COPropGroupEditHandler.getInstance().handleEvent(evt);
56
57         
58     } catch (Throwable JavaDoc e) {
59         throw WebmanExceptionHandler.getException(e);
60     }
61     }
62     
63     public boolean isHandler(TKEvent evt)
64     {
65     return evt.getName().equalsIgnoreCase( "CO_PROP_FRAME" );
66     }
67
68 }
69
Popular Tags