01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: AutolinkSource.java 3819 2007-06-28 13:13:23Z gbevin $
07: */
08: package com.uwyn.rife.engine.testelements.exits;
09:
10: import com.uwyn.rife.config.RifeConfig;
11: import com.uwyn.rife.engine.Element;
12: import java.util.Calendar;
13:
14: public class AutolinkSource extends Element {
15: public void processElement() {
16: Calendar cal = Calendar.getInstance(RifeConfig.Tools
17: .getDefaultTimeZone());
18: cal.clear();
19:
20: setOutput("value1", "output1 value");
21: setOutput("value2", "output2 value");
22: setOutput("value3", "output3 value");
23:
24: cal.set(2007, 3, 21, 8, 12, 28);
25: BeanImpl2 bean2 = new BeanImpl2();
26: bean2.setEnum4(BeanImpl1.Day.FRIDAY);
27: bean2.setDate5(cal.getTime());
28: bean2.setString6("stringvalue6");
29: bean2.setString7("stringvalue7");
30: bean2.setString8("stringvalue8");
31: setOutputBean(bean2);
32:
33: cal.set(2007, 2, 13, 8, 12, 28);
34: BeanImpl1 bean1 = new BeanImpl1();
35: bean1.setString1("stringvalue1");
36: bean1.setString2("stringvalue2");
37: bean1.setString3("stringvalue3");
38: bean1.setEnum4(BeanImpl1.Day.MONDAY);
39: bean1.setDate5(cal.getTime());
40: setOutputBean(bean1);
41:
42: if (getInput("type", "").equals("directlink")) {
43: print("<html><body>");
44: print("<a href=\""
45: + getExitQueryUrl("AUTOLINK_DESTINATION")
46: + "\">link</a>");
47: print("</body></html>");
48: } else {
49: exit("AUTOLINK_DESTINATION");
50: }
51: }
52: }
|