KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > de > webman > sitetree > eventhandler > STFrameHandler


1 package de.webman.sitetree.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
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 /**
23 * Baut das Frameset auf (vertikal, Tmpl: f_st.tmpl)
24 *
25 *
26 */

27 public class STFrameHandler extends DefaultEventHandler implements ParameterTypes, FrameConstants, DatabaseDefaults
28 {
29     private STFrameHandler()
30     {}
31     
32     private static STFrameHandler instance = new STFrameHandler();
33     
34     public static STFrameHandler getInstance()
35     {
36         return instance;
37     }
38     
39     public void handleEvent(TKEvent evt) throws TKException
40     {
41         try
42         {
43             WebManEvent.checkEvent(evt.getRemoteUser(), evt.getName(), ContextConstants.SITE_TREE);
44             TKHTMLTemplate frame = evt.getPrepHTMLTemplate( "f_st.tmpl" );
45             HTMLUtils.fillFrameSet( frame, LEFT_FRAME_WIDTH, "ST_SHOWLIST", "ST_EMPTY" );
46
47             TKVector openNodes = new TKVector(); // initial bei Root den Baum oeffnen
48
if( evt.getParams().hasMultiple( PARAMETER, "OPEN_NODES" ) ) {
49                 openNodes = evt.getParams().getVector( PARAMETER, "OPEN_NODES" );
50             }
51             else {
52                 openNodes.put( 0, evt.getParameter( PARAMETER, "OPEN_NODES" )==null?"-1":evt.getParameter( PARAMETER, "OPEN_NODES" ) );
53             }
54
55     // openNodes.put( 0, "-1" );
56
TKStandardIterator iterator1 = new TKStandardIterator( openNodes, frame.getListIterator(), "OPEN_NODES", "OPEN_NODES" );
57             frame.setListIterator( iterator1 );
58
59             evt.finishTemplate(frame);
60         }
61         catch (Throwable JavaDoc e)
62         {
63             // TO DO : Analyze Exception !
64
throw WebmanExceptionHandler.getException(e);
65         }
66     }
67     
68     public boolean isHandler(TKEvent evt)
69     {
70         return evt.getName().equalsIgnoreCase("ST_START");
71     }
72         
73 }
74
Popular Tags