01: package de.webman.template.eventhandler;
02:
03: import com.teamkonzept.db.*;
04: import com.teamkonzept.webman.mainint.db.queries.*;
05:
06: import com.teamkonzept.webman.mainint.events.*;
07: import com.teamkonzept.webman.mainint.*;
08: import com.teamkonzept.webman.*;
09: import com.teamkonzept.web.*;
10: import com.teamkonzept.lib.*;
11: import com.teamkonzept.international.LanguageManager;
12: import java.io.*;
13: import java.sql.*;
14:
15: /**
16: * Abhaengigkeiten eines Templates
17: *
18: * @author $Author: alex $
19: * @version $Revision: 1.1 $
20: */
21: public class TEInfoHandler extends DefaultEventHandler implements
22: ParameterTypes, FrameConstants {
23: private TEInfoHandler() {
24: }
25:
26: private static TEInfoHandler instance = new TEInfoHandler();
27:
28: public static TEInfoHandler getInstance() {
29: return instance;
30: }
31:
32: public void handleEvent(TKEvent evt) throws TKException {
33: try {
34: String tmplId = evt.getParameter(PARAMETER, "TEMPLATE_ID");
35: String tmplName = evt.getParameter(PARAMETER,
36: "TEMPLATE_NAME");
37:
38: // Checken, ob das Template noch in Documenttypen benutzt wird
39: TKHTMLTemplate t = evt
40: .getPrepHTMLTemplate("dependency.tmpl");
41: Object[] tmp = new Object[1];
42: tmp[0] = tmplName;
43: String text = LanguageManager.getText("templates",
44: "DEPENDENCY", tmp);
45: TKVector references = TEUtils.getDependencies(new Integer(
46: tmplId));
47: t.set("TITLE", text);
48: t.setListIterator(new TKStandardPluginIterator(
49: "REFERENCES", null, references, false, t
50: .getListIterator()));
51: evt.finishTemplate(t);
52: return;
53: } catch (Throwable t) {
54: throw WebmanExceptionHandler.getException(t);
55: }
56: }
57:
58: public boolean isHandler(TKEvent evt) {
59: return evt.getName().equalsIgnoreCase("TE_INFO");
60: }
61: }
|