package de.webman.config.eventhandler;
import java.util.*;
import com.teamkonzept.web.*;
import com.teamkonzept.webman.mainint.*;
import com.teamkonzept.webman.*;
import com.teamkonzept.lib.*;
import com.teamkonzept.webman.mainint.events.*;
/**
Displays a frameset with a list of properties on the left and an empty page to the right
* @author $Author: alex $
* @version $Revision: 1.3 $
*/
public class COPropFrameHandler extends DefaultEventHandler implements ParameterTypes, DatabaseDefaults, FrameConstants
{
private COPropFrameHandler() {}
private static COPropFrameHandler instance = new COPropFrameHandler();
public static COPropFrameHandler getInstance()
{
return instance;
}
public void handleEvent(TKEvent evt) throws TKException
{
try {
WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(), ContextConstants.CUSTOMIZE_PROPERTIES); // check if event is allowed
String propGroupId = evt.getParameter(PARAMETER, "PROPGROUP_ID");
propGroupId = (propGroupId != null ? propGroupId : "-1");
/* alte version
String pId = evt.getParameter(PARAMETER, "PROP_ID");
TKHTMLTemplate t = evt.getPrepHTMLTemplate( "f_co_prop.tmpl" );
if (pId == null) {
HTMLUtils.fillFrameSet( t, LEFT_FRAME_WIDTH, "CO_PROP_LIST", "EMPTY" );
}
else {
HTMLUtils.fillFrameSet( t, LEFT_FRAME_WIDTH, "CO_PROP_LIST", "CO_PROP_EDIT" );
t.set("PROP_ID", pId);
}
t.set("RTARGET", RIGHT_TARGET);
WebManEvent.fillEventsIntoTemplate(evt, t, CUSTOMIZE_PROPERTIES);
evt.finishTemplate( t );
*/
evt.getParams().put(PARAMETER, "PROPGROUP_ID", propGroupId);
evt.getParams().put(PARAMETER, "LIST_PROPS", "1");
COPropGroupEditHandler.getInstance().handleEvent(evt);
} catch (Throwable e) {
throw WebmanExceptionHandler.getException(e);
}
}
public boolean isHandler(TKEvent evt)
{
return evt.getName().equalsIgnoreCase( "CO_PROP_FRAME" );
}
}
|