KickJava   Java API By Example, From Geeks To Geeks.

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


1 package de.webman.config.eventhandler;
2
3 import com.teamkonzept.web.*;
4 import com.teamkonzept.webman.*;
5 import com.teamkonzept.webman.db.TKWebmanDBManager;
6 import com.teamkonzept.webman.mainint.*;
7 import com.teamkonzept.webman.mainint.db.*;
8
9 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 ParameterTypes, FrameConstants, DatabaseDefaults
29 {
30     private COEditStatusHandler()
31     {}
32     
33     private static COEditStatusHandler instance = new COEditStatusHandler();
34     
35     public static COEditStatusHandler getInstance()
36     {
37         return instance;
38     }
39     
40     public void handleEvent(TKEvent evt) throws TKException
41     {
42         try
43         {
44             WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(), ContextConstants.CUSTOMIZE_PROPERTIES);
45             TKHTMLTemplate t = evt.getPrepHTMLTemplate( "co_statusedit.tmpl" );
46             String JavaDoc statusID = evt.getParameter(PARAMETER, "STATUS_ID");
47             // statische Daten der Versionsverwaltung abrufen
48
if (statusID != null)
49             {
50                 VersionStatics statics = VersionStatics.setup();
51                 VersionStatus status = (VersionStatus)statics.getStatusPool().get(new Integer JavaDoc(statusID));
52                 TKHashtable attr = status.toHashtable();
53                 t.set(attr);
54             }
55             evt.finishTemplate(t);
56         }
57         catch (Throwable JavaDoc e)
58         {
59             // TO DO : Analyze Exception !
60
throw WebmanExceptionHandler.getException(e);
61         }
62     }
63     
64     public boolean isHandler(TKEvent evt)
65     {
66         return evt.getName().equalsIgnoreCase("CO_EDIT_STATUS");
67     }
68 }
69
Popular Tags