KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > content > eventhandler > CECheckHandler


1 package de.webman.content.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 import com.teamkonzept.webman.mainint.db.queries.*;
9 import com.teamkonzept.webman.mainint.events.*;
10 import com.teamkonzept.lib.*;
11 import com.teamkonzept.field.*;
12 import com.teamkonzept.field.db.*;
13 import com.teamkonzept.db.*;
14 import de.webman.content.workflow.*;
15
16 import java.sql.*;
17
18 /**
19 * Validieren von eingegebenem Content
20 *
21  * @author $Author: alex $
22  * @version $Revision: 1.5 $
23 */

24 public class CECheckHandler extends DefaultEventHandler implements ParameterTypes, FrameConstants, DatabaseDefaults
25 {
26     private CECheckHandler()
27     {}
28     
29     private static CECheckHandler instance = new CECheckHandler();
30     
31     public static CECheckHandler getInstance()
32     {
33         return instance;
34     }
35     
36     public void handleEvent(TKEvent evt) throws TKException
37     {
38         try
39         {
40             CEUtils.checkEvent(evt);
41
42             TKHTMLTemplate t = evt.getPrepHTMLTemplate( "ce_fields.tmpl" );
43             ContentContext ceContext = CEUtils.keepCEContext(evt, t );
44             // statische Daten der Versionsverwaltuung abrufen
45
VersionStatics statics = VersionStatics.setup();
46
47             // Versionsinfos erzeugen
48
CEUtils.getVersionInfo (ceContext,t,statics);
49             TKFormDBData data = new TKFormDBData( ceContext.formId.intValue() );
50             TKFormDBInterface.Get( data );
51             TKBaseField field = TKFieldRegistry.getFieldFromDB( data );
52             TKHashtable fieldContext = new TKHashtable();
53             Object JavaDoc realData = field.compileData( "", evt.getParams().getClass( PARAMETER ), fieldContext );
54             field.fillIntoTemplate( t, realData, "" );
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("CE_CHECK");
67     }
68 }
69
Popular Tags