01: /*
02: * This file is part of PFIXCORE.
03: *
04: * PFIXCORE is free software; you can redistribute it and/or modify
05: * it under the terms of the GNU Lesser General Public License as published by
06: * the Free Software Foundation; either version 2 of the License, or
07: * (at your option) any later version.
08: *
09: * PFIXCORE is distributed in the hope that it will be useful,
10: * but WITHOUT ANY WARRANTY; without even the implied warranty of
11: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12: * GNU Lesser General Public License for more details.
13: *
14: * You should have received a copy of the GNU Lesser General Public License
15: * along with PFIXCORE; if not, write to the Free Software
16: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17: *
18: */
19:
20: package de.skelexamples;
21:
22: import org.w3c.dom.Element;
23:
24: import de.schlund.pfixcore.workflow.Context;
25: import de.schlund.pfixxml.ResultDocument;
26:
27: /**
28: * A class representing our ContextResource. It has been createdto store the
29: * text sent by the form in order to give it out on the second page.
30: *
31: * @author <a href="mailto:rapude@schlund.de">Ralf Rapude </a>
32: * @version $Id: ContextDemoTextImpl.java 3302 2007-11-30 16:56:16Z jenstl $
33: */
34: public class ContextDemoTextImpl implements ContextDemoText {
35:
36: /** A private String containing the content of the textfield */
37: private String demoText = null;
38:
39: /** Setting demoText with the String sent by the form */
40: public void setDemoText(String formText) {
41: System.out.println("ContextDemoTextImpl::setDemoText");
42: demoText = formText;
43: }
44:
45: /** Certainly we need a getter for the String */
46: public String getDemoText() {
47: System.out.println("ContextDemoTextImpl::getDemoText");
48: return demoText;
49: }
50:
51: /*
52: * (non-Javadoc)
53: *
54: * @see de.schlund.pfixcore.workflow.ContextResource#init(de.schlund.pfixcore.workflow.Context)
55: */
56: public void init(Context context) throws Exception {
57:
58: }
59:
60: /**
61: * Inserting the String into the Domtree given back to pustefix
62: *
63: * @see de.schlund.pfixcore.workflow.ContextResource#insertStatus(
64: * de.schlund.pfixxml.ResultDocument, org.w3c.dom.Element)
65: */
66: public void insertStatus(ResultDocument resdoc, final Element root)
67: throws Exception {
68: if (demoText != null) {
69: resdoc.createSubNode(root, "demotext").setAttribute(
70: "value", demoText);
71: }
72: }
73:
74: }
|