01: /*
02: * Copyright 2001-2006 C:1 Financial Services GmbH
03: *
04: * This software is free software; you can redistribute it and/or
05: * modify it under the terms of the GNU Lesser General Public
06: * License Version 2.1, as published by the Free Software Foundation.
07: *
08: * This software is distributed in the hope that it will be useful,
09: * but WITHOUT ANY WARRANTY; without even the implied warranty of
10: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11: * Lesser General Public License for more details.
12: *
13: * You should have received a copy of the GNU Lesser General Public
14: * License along with this library; if not, write to the Free Software
15: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
16: */
17:
18: package de.finix.contelligent.components.query;
19:
20: import java.io.IOException;
21: import java.io.Writer;
22: import java.util.Collection;
23: import java.util.Collections;
24: import java.util.Map;
25:
26: import de.finix.contelligent.AbstractComponent;
27: import de.finix.contelligent.CallData;
28: import de.finix.contelligent.exception.ContelligentException;
29: import de.finix.contelligent.logging.LoggingService;
30: import de.finix.contelligent.render.ParameterDescription;
31: import de.finix.contelligent.render.Renderable;
32: import de.finix.contelligent.render.Renderer;
33:
34: public class StaticQueryResultEntry extends AbstractComponent implements
35: Renderable, Renderer {
36: final static private org.apache.log4j.Logger log = LoggingService
37: .getLogger(StaticQueryResultEntry.class);
38:
39: private String value;
40:
41: /**
42: * @return Returns the value.
43: */
44: public String getValue() {
45: return value;
46: }
47:
48: /**
49: * @param value
50: * The value to set.
51: */
52: public void setValue(String value) {
53: this .value = value;
54: }
55:
56: public ParameterDescription[] getParameterDescription() {
57: return null;
58: }
59:
60: public Collection getSensitiveCategories() {
61: return Collections.EMPTY_SET;
62: }
63:
64: public Renderer getRenderer() {
65: return this ;
66: }
67:
68: public void render(Writer writer, Map parameterMap,
69: CallData callData) throws ContelligentException,
70: IOException {
71: String key = getComponentContext().getPath().getName();
72: if (callData.getRequestAttribute(key) != null) {
73: writer.write(callData.getRequestAttribute(key).toString());
74: } else {
75: log.warn("Key '" + key + "' not defined!");
76: }
77: }
78: }
|