001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: *
017: * $Header:$
018: */
019: package org.apache.beehive.netui.pageflow.config;
020:
021: import org.apache.struts.action.ActionForward;
022:
023: import java.util.ArrayList;
024: import java.io.Serializable;
025:
026: /**
027: * Bean class to handle our extensions to the Struts <forward> element.
028: */
029: public class PageFlowActionForward extends ActionForward {
030: private boolean _isNestedReturn = false;
031: private boolean _isReturnToPage = false;
032: private boolean _isReturnToAction = false;
033: private String _returnFormType;
034: private String _returnFormMember;
035: private boolean _hasExplicitRedirectValue = false;
036: private ArrayList _actionOutputs;
037: private boolean _restoreQueryString;
038: private boolean _externalRedirect = false;
039: private String _relativeTo;
040:
041: public boolean isNestedReturn() {
042: return _isNestedReturn;
043: }
044:
045: public void setNestedReturn(boolean nestedReturn) {
046: _isNestedReturn = nestedReturn;
047: }
048:
049: public boolean isReturnToPage() {
050: return _isReturnToPage;
051: }
052:
053: public void setReturnToPage(boolean returnToPage) {
054: _isReturnToPage = returnToPage;
055: }
056:
057: public boolean isReturnToAction() {
058: return _isReturnToAction;
059: }
060:
061: public void setReturnToAction(boolean returnToAction) {
062: _isReturnToAction = returnToAction;
063: }
064:
065: public String getReturnFormType() {
066: return _returnFormType;
067: }
068:
069: public void setReturnFormType(String returnFormType) {
070: _returnFormType = returnFormType;
071: }
072:
073: public String getReturnFormMember() {
074: return _returnFormMember;
075: }
076:
077: public void setReturnFormMember(String returnFormMember) {
078: _returnFormMember = returnFormMember;
079: }
080:
081: public boolean hasExplicitRedirectValue() {
082: return _hasExplicitRedirectValue;
083: }
084:
085: public void setHasExplicitRedirectValue(
086: boolean hasExplicitRedirectValue) {
087: _hasExplicitRedirectValue = hasExplicitRedirectValue;
088: }
089:
090: public boolean isRestoreQueryString() {
091: return _restoreQueryString;
092: }
093:
094: public void setRestoreQueryString(boolean restoreQueryString) {
095: _restoreQueryString = restoreQueryString;
096: }
097:
098: public boolean isExternalRedirect() {
099: return _externalRedirect;
100: }
101:
102: public void setExternalRedirect(boolean externalRedirect) {
103: _externalRedirect = externalRedirect;
104: }
105:
106: public String getRelativeTo() {
107: return _relativeTo;
108: }
109:
110: public void setRelativeTo(String relativeTo) {
111: _relativeTo = relativeTo;
112: }
113:
114: public static class ActionOutput implements Serializable {
115: private String _name;
116: private String _type;
117: private boolean _isNullable;
118:
119: public ActionOutput(String name, String type, boolean isNullable) {
120: _name = name;
121: _type = type;
122: _isNullable = isNullable;
123: }
124:
125: public String getName() {
126: return _name;
127: }
128:
129: public String getType() {
130: return _type;
131: }
132:
133: public boolean getNullable() {
134: return _isNullable;
135: }
136: }
137:
138: public void setActionOutputCount(String count) {
139: setActionOutputCount(Integer.parseInt(count));
140: }
141:
142: public String getActionOutputCount() {
143: return new Integer(_actionOutputs != null ? _actionOutputs
144: .size() : 0).toString();
145: }
146:
147: public void setActionOutputCount(int count) {
148: if (_actionOutputs == null) {
149: _actionOutputs = new ArrayList(count);
150: } else {
151: _actionOutputs.ensureCapacity(count);
152: }
153:
154: while (_actionOutputs.size() < count) {
155: _actionOutputs.add(null);
156: }
157: }
158:
159: protected void setActionOutput(int n, String concatenatedVals) {
160: setActionOutputCount(n + 1);
161: String[] vals = concatenatedVals.split("\\|");
162: assert vals.length == 3 : vals.length;
163: _actionOutputs.set(n, new ActionOutput(vals[2], vals[0],
164: Boolean.valueOf(vals[1]).booleanValue()));
165: }
166:
167: public ActionOutput[] getActionOutputs() {
168: if (_actionOutputs == null)
169: return new ActionOutput[0];
170: return (ActionOutput[]) _actionOutputs
171: .toArray(new ActionOutput[_actionOutputs.size()]);
172: }
173:
174: public void setActionOutput0(String str) {
175: setActionOutput(0, str);
176: }
177:
178: public void setActionOutput1(String str) {
179: setActionOutput(1, str);
180: }
181:
182: public void setActionOutput2(String str) {
183: setActionOutput(2, str);
184: }
185:
186: public void setActionOutput3(String str) {
187: setActionOutput(3, str);
188: }
189:
190: public void setActionOutput4(String str) {
191: setActionOutput(4, str);
192: }
193:
194: public void setActionOutput5(String str) {
195: setActionOutput(5, str);
196: }
197:
198: public void setActionOutput6(String str) {
199: setActionOutput(6, str);
200: }
201:
202: public void setActionOutput7(String str) {
203: setActionOutput(7, str);
204: }
205:
206: public void setActionOutput8(String str) {
207: setActionOutput(8, str);
208: }
209:
210: public void setActionOutput9(String str) {
211: setActionOutput(9, str);
212: }
213:
214: public void setActionOutput10(String str) {
215: setActionOutput(10, str);
216: }
217:
218: public void setActionOutput11(String str) {
219: setActionOutput(11, str);
220: }
221:
222: public void setActionOutput12(String str) {
223: setActionOutput(12, str);
224: }
225:
226: public void setActionOutput13(String str) {
227: setActionOutput(13, str);
228: }
229:
230: public void setActionOutput14(String str) {
231: setActionOutput(14, str);
232: }
233:
234: public void setActionOutput15(String str) {
235: setActionOutput(15, str);
236: }
237:
238: public void setActionOutput16(String str) {
239: setActionOutput(16, str);
240: }
241:
242: public void setActionOutput17(String str) {
243: setActionOutput(17, str);
244: }
245:
246: public void setActionOutput18(String str) {
247: setActionOutput(18, str);
248: }
249:
250: public void setActionOutput19(String str) {
251: setActionOutput(19, str);
252: }
253: }
|