01: // @@
02: // @@
03: /*
04: * Wi.Ser Framework
05: *
06: * LGPL Version: 1.8.1, 20-September-2007
07: * Copyright (C) 2005-2006 Dirk von der Weiden <dvdw@imail.de>
08: *
09: * This library is free software; you can redistribute it and/or
10: * modify it under the terms of the GNU Lesser General Public
11: * License as published by the Free Software Foundation; either
12: * version 2 of the License, or (at your option) any later version.
13: *
14: * This library is distributed in the hope that it will be useful,
15: * but WITHOUT ANY WARRANTY; without even the implied warranty of
16: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17: * Lesser General Public License for more details.
18: *
19: * You should have received a copy of the GNU Lesser General Public
20: * License along with this library located in LGPL.txt in the
21: * license directory; if not, write to the
22: * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23: * Boston, MA 02111-1307, USA.
24: *
25: * If this agreement does not cover your requirements, please contact us
26: * via email to get detailed information about the commercial license
27: * or our service offerings!
28: *
29: */
30: // @@
31: package de.ug2t.channel.markup.generic;
32:
33: import de.ug2t.kernel.*;
34:
35: /**
36: * @author dirk
37: *
38: * date: 10.05.2005
39: *
40: * This abstract class is used to as base class to implement new renderer from
41: * html/web widgets. The abstract method <b>String
42: * pcmf_render(MuGenericComponent xWidget)</b> is responsible for generating a
43: * valid html string which represents the widget in a browser.
44: *
45: */
46: public abstract class AMuGenericComponentRenderer implements IKeView {
47: private MuGenericCache pem_cache = new MuGenericCache();
48:
49: public boolean pcmf_supportsCaching() {
50: return (true);
51: }
52:
53: public void pcmf_clearCache() {
54: this .pem_cache.pcmf_clearCache();
55: }
56:
57: public final void pcmf_activateCache(boolean xAc) {
58: this .pem_cache.pcmf_activateThisCache(xAc);
59: return;
60: }
61:
62: public final Object pcmf_output(KeTreeElement xTreeEl) {
63: // @@
64:
65: String l_string = null;
66: try {
67: l_string = this .pcmf_render((MuGenericComponent) xTreeEl);
68: } catch (Exception e) {
69: KeLog.pcmf_logException("ug2t", this , e);
70: KeLog.pcmf_log("ug2t", "error during rendering", this ,
71: KeLog.ERROR);
72: l_string = "ERROR";
73: }
74:
75: // @@
76:
77: return (l_string);
78: }
79:
80: public final Object pcmf_execView(KeTreeElement xTreeEl) {
81: return (xTreeEl.pcmf_execView());
82: };
83:
84: /**
85: * The function is responsible for widget rendering
86: *
87: * @param xWidget
88: * the widget to render
89: * @return a valid html string
90: */
91: public abstract String pcmf_render(MuGenericComponent xWidget);
92: }
|