01: /*
02:
03: This software is OSI Certified Open Source Software.
04: OSI Certified is a certification mark of the Open Source Initiative.
05:
06: The license (Mozilla version 1.0) can be read at the MMBase site.
07: See http://www.MMBase.org/license
08:
09: */
10: package org.mmbase.framework;
11:
12: import java.util.*;
13: import javax.servlet.http.*;
14: import java.io.*;
15: import org.mmbase.util.functions.*;
16: import org.mmbase.util.logging.Logger;
17: import org.mmbase.util.logging.Logging;
18:
19: /**
20: * Currently this generates a link to an editwizard list page.
21: *
22: * @todo Needs to produce a div, not an url.
23: *
24: * @author Michiel Meeuwissen
25: * @version $Id: EditwizardRenderer.java,v 1.13 2007/08/06 16:56:44 michiel Exp $
26: * @since MMBase-1.9
27: */
28: public class EditwizardRenderer extends AbstractRenderer {
29: private static final Logger log = Logging
30: .getLoggerInstance(EditwizardRenderer.class);
31:
32: protected String list;
33: protected String path;
34:
35: public EditwizardRenderer(String t, Block parent) {
36: super (t, parent);
37: }
38:
39: public void setList(String l) {
40: list = l;
41: }
42:
43: public void setNodepath(String p) {
44: path = p;
45: }
46:
47: public Parameter[] getParameters() {
48: return new Parameter[] { Parameter.RESPONSE, Parameter.REQUEST,
49: Parameter.LOCALE };
50: }
51:
52: /**
53: */
54: public void render(Parameters blockParameters,
55: Parameters frameworkParameters, Writer w,
56: Renderer.WindowState state) throws FrameworkException {
57: try {
58: HttpServletRequest request = blockParameters
59: .get(Parameter.REQUEST);
60: HttpServletResponse response = blockParameters
61: .get(Parameter.RESPONSE);
62: Locale locale = blockParameters.get(Parameter.LOCALE);
63: w.write(response.encodeUrl(request.getContextPath()
64: + "/mmbase/edit/wizard/jsp/list.jsp?wizard=" + list
65: + "&nodepath=" + path + "&language="
66: + locale.getLanguage()));
67: } catch (IOException eio) {
68: throw new FrameworkException(eio.getMessage(), eio);
69: }
70: }
71:
72: public String toString() {
73: return "EW " + list + " &nodepath= " + path;
74: }
75:
76: }
|