01: package de.webman.config.eventhandler;
02:
03: import java.util.*;
04:
05: import com.teamkonzept.web.*;
06: import com.teamkonzept.webman.mainint.*;
07: import com.teamkonzept.webman.*;
08: import com.teamkonzept.lib.*;
09: 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
17: ParameterTypes, DatabaseDefaults, FrameConstants {
18: private COPropFrameHandler() {
19: }
20:
21: private static COPropFrameHandler instance = new COPropFrameHandler();
22:
23: public static COPropFrameHandler getInstance() {
24: return instance;
25: }
26:
27: public void handleEvent(TKEvent evt) throws TKException {
28: try {
29: WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(),
30: ContextConstants.CUSTOMIZE_PROPERTIES); // check if event is allowed
31:
32: String propGroupId = evt.getParameter(PARAMETER,
33: "PROPGROUP_ID");
34: propGroupId = (propGroupId != null ? propGroupId : "-1");
35:
36: /* alte version
37:
38: String pId = evt.getParameter(PARAMETER, "PROP_ID");
39:
40: TKHTMLTemplate t = evt.getPrepHTMLTemplate( "f_co_prop.tmpl" );
41:
42: if (pId == null) {
43: HTMLUtils.fillFrameSet( t, LEFT_FRAME_WIDTH, "CO_PROP_LIST", "EMPTY" );
44: }
45: else {
46: HTMLUtils.fillFrameSet( t, LEFT_FRAME_WIDTH, "CO_PROP_LIST", "CO_PROP_EDIT" );
47: t.set("PROP_ID", pId);
48: }
49: t.set("RTARGET", RIGHT_TARGET);
50: WebManEvent.fillEventsIntoTemplate(evt, t, CUSTOMIZE_PROPERTIES);
51: evt.finishTemplate( t );
52: */
53:
54: evt.getParams().put(PARAMETER, "PROPGROUP_ID", propGroupId);
55: evt.getParams().put(PARAMETER, "LIST_PROPS", "1");
56: COPropGroupEditHandler.getInstance().handleEvent(evt);
57:
58: } catch (Throwable e) {
59: throw WebmanExceptionHandler.getException(e);
60: }
61: }
62:
63: public boolean isHandler(TKEvent evt) {
64: return evt.getName().equalsIgnoreCase("CO_PROP_FRAME");
65: }
66:
67: }
|