1 package de.webman.documenttype.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 28 public class DTShowListHandler extends DefaultEventHandler implements ParameterTypes, FrameConstants, DatabaseDefaults 29 { 30 private DTShowListHandler() 31 {} 32 33 private static DTShowListHandler instance = new DTShowListHandler(); 34 35 public static DTShowListHandler getInstance() 36 { 37 return instance; 38 } 39 40 public void handleEvent(TKEvent evt) throws TKException 41 { 42 try 43 { 44 TKHTMLTemplate t = evt.getPrepHTMLTemplate( "pr_presList.tmpl" ); 46 String dest = evt.getNotNullParameter( PARAMETER, "DESTINATION" ); 47 48 TKQuery q = TKDBManager.newQuery(TKDBPresentationGet.class); 49 q.execute(); 50 ResultSet rs = q.fetchResultSet(); 51 52 TKDestinationIterator iterator; 53 if( !dest.equals( "" ) ) { 54 iterator = new TKDestinationIterator( rs, t.getListIterator(), "PR_PRES_LIST", Integer.parseInt( dest ), "PRESENTATION_ID" ); 55 } 56 else { 57 t.set( "IS_TOP", "1" ); 58 iterator = new TKDestinationIterator( rs, t.getListIterator(), "PR_PRES_LIST" ); 59 } 60 t.setListIterator( iterator ); 61 62 t.set( "RTARGET", RIGHT_TARGET ); 63 WebManEvent.fillEventsIntoTemplate(evt.getRemoteUser(), t, PRESENTATIONS ); 64 evt.finishTemplate(t); 65 } 66 catch (Throwable e) 67 { 68 throw WebmanExceptionHandler.getException(e); 70 } 71 } 72 73 public boolean isHandler(TKEvent evt) 74 { 75 return evt.getName().equalsIgnoreCase("PR_SHOWLIST") ; 76 } 77 } 78 | Popular Tags |