01: package de.webman.config.eventhandler;
02:
03: import com.teamkonzept.web.*;
04: import com.teamkonzept.webman.*;
05: import com.teamkonzept.webman.db.TKWebmanDBManager;
06: import com.teamkonzept.webman.mainint.*;
07: import com.teamkonzept.webman.mainint.db.*;
08:
09: import de.webman.content.workflow.*;
10: import com.teamkonzept.webman.mainint.db.queries.*;
11: import com.teamkonzept.webman.mainint.events.*;
12: import com.teamkonzept.lib.*;
13: import com.teamkonzept.field.*;
14: import com.teamkonzept.field.db.*;
15: import com.teamkonzept.db.*;
16: import com.teamkonzept.publishing.markups.*;
17:
18: import java.sql.*;
19: import java.io.*;
20:
21: /**
22: * Editieren bzw. Anlegen eines Status
23: *
24: *
25: * @author $Author: alex $
26: * @version $Revision: 1.3 $
27: */
28: public class COEditStatusHandler extends DefaultEventHandler implements
29: ParameterTypes, FrameConstants, DatabaseDefaults {
30: private COEditStatusHandler() {
31: }
32:
33: private static COEditStatusHandler instance = new COEditStatusHandler();
34:
35: public static COEditStatusHandler getInstance() {
36: return instance;
37: }
38:
39: public void handleEvent(TKEvent evt) throws TKException {
40: try {
41: WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(),
42: ContextConstants.CUSTOMIZE_PROPERTIES);
43: TKHTMLTemplate t = evt
44: .getPrepHTMLTemplate("co_statusedit.tmpl");
45: String statusID = evt.getParameter(PARAMETER, "STATUS_ID");
46: // statische Daten der Versionsverwaltung abrufen
47: if (statusID != null) {
48: VersionStatics statics = VersionStatics.setup();
49: VersionStatus status = (VersionStatus) statics
50: .getStatusPool().get(new Integer(statusID));
51: TKHashtable attr = status.toHashtable();
52: t.set(attr);
53: }
54: evt.finishTemplate(t);
55: } catch (Throwable e) {
56: // TO DO : Analyze Exception !
57: throw WebmanExceptionHandler.getException(e);
58: }
59: }
60:
61: public boolean isHandler(TKEvent evt) {
62: return evt.getName().equalsIgnoreCase("CO_EDIT_STATUS");
63: }
64: }
|