001: /*
002: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
003: * Distributed under the terms of either:
004: * - the common development and distribution license (CDDL), v1.0; or
005: * - the GNU Lesser General Public License, v2.1 or later
006: * $Id: Simple.java 3687 2007-03-09 23:13:07Z gbevin $
007: */
008: package com.uwyn.rife.engine.testelements.annotations;
009:
010: import com.uwyn.rife.engine.UploadedFile;
011: import com.uwyn.rife.engine.annotations.*;
012: import com.uwyn.rife.engine.testelements.exits.BeanImpl1;
013: import com.uwyn.rife.engine.testelements.exits.BeanImpl2;
014: import com.uwyn.rife.engine.testelements.submission.BeanImpl;
015:
016: @Elem(id="ELEMENT1",url="test/element1",contentType="text/xhtml",inputs={@Input(name="input3")},inbeans={@InBean(beanclass=BeanImpl2.class),@InBean(beanclass=BeanImpl1.class,prefix="prefix_"),@InBean(beanclass=BeanImpl.class,group="somegroup")},incookies={@InCookie(name="incookie2")},outputs={@Output(name="output2"),@Output(name="output3")},outbeans={@OutBean(beanclass=BeanImpl1.class),@OutBean(beanclass=BeanImpl2.class),@OutBean(beanclass=BeanImpl.class,prefix="prefixgroup_",group="somegroup")},outcookies={@OutCookie(name="outcookie1"),@OutCookie(name="outcookie4")},childTriggers={@ChildTrigger(name="input1"),@ChildTrigger(name="input2")},exits={@Exit(name="exit1"),@Exit(name="exit2")},submissions={@Submission(name="submission1",params={@Param(name="param1"),@Param(name="param3")},paramRegexps={@ParamRegexp("paramA(\\d+)"),@ParamRegexp("paramB(\\d+)")},files={@File(name="file2")},beans={@SubmissionBean(beanclass=BeanImpl.class,prefix="subm_",group="somegroup"),@SubmissionBean(beanclass=BeanImpl1.class,prefix="subm_")})},pathinfo=@Pathinfo(mappings={@Mapping("$key1/name/stuff"),@Mapping("$key1/$key2")}))
017: public class Simple extends BaseSimple {
018: private int mOutput1;
019: private String mOutput4;
020: private BeanImpl2 mOutbean1;
021: private BeanImpl mOutbean2;
022: private int mOutcookie2;
023: private String mOutcookie3;
024:
025: @ExitField
026: public static final String EXIT_3 = "exit3";
027:
028: @InBeanProperty(name="inbean1")
029: public void setInbean1(BeanImpl1 inbean1) {
030: }
031:
032: @InBeanProperty(prefix="prefixgroup_",group="somegroup")
033: public void setInbean2(BeanImpl inbean2) {
034: }
035:
036: @InCookieProperty
037: public void setIncookie1(String incookie1) {
038: }
039:
040: @OutputProperty(name="output1")
041: public int getOutput1() {
042: return mOutput1;
043: }
044:
045: @OutputProperty
046: public String getOutput4() {
047: return mOutput4;
048: }
049:
050: @OutBeanProperty(prefix="prefix_")
051: public BeanImpl2 getOutbean1() {
052: return mOutbean1;
053: }
054:
055: @OutBeanProperty(name="outbean2",group="somegroup")
056: public BeanImpl getOutbean2() {
057: return mOutbean2;
058: }
059:
060: @OutCookieProperty
061: public int getOutcookie2() {
062: return mOutcookie2;
063: }
064:
065: @Priority({2,1})
066: @ParamProperty
067: public void setParam4(String param4) {
068: }
069:
070: @OutCookieProperty
071: public String getOutcookie3() {
072: return mOutcookie3;
073: }
074:
075: @FileProperty(name="file1")
076: public void setFile1(UploadedFile file1) {
077: }
078:
079: @Priority({1})
080: @SubmissionHandler(params={@Param(name="param1"),@Param(name="param2")},paramRegexps={@ParamRegexp("paramC(.*)")},files={@File(name="file1")})
081: public void doSubmission2() {
082: }
083:
084: @Priority({1,1})
085: @ParamProperty
086: public void setParam3(String param3) {
087: }
088:
089: @Priority({1,1})
090: @FileProperty
091: public void setFile2(UploadedFile file2) {
092: }
093:
094: @Priority({2})
095: @SubmissionHandler
096: public void doAnotherSubmission() {
097: }
098:
099: @ParamProperty
100: public void setParam2(String param2) {
101: }
102:
103: public void processElement() {
104: pause();
105: }
106: }
|