SelectTagNavigationController.jpf Sample

This topic inludes the source code for the SelectTagNavigationController.jpf Sample.

Sample Location

This sample is located in the following directory in your WebLogic Workshop installation:

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/navigation/selectTagNavigation/

Sample Source Code


001 package navigation.selectTagNavigation;
002 
003 import com.bea.wlw.netui.pageflow.Forward;
004 import com.bea.wlw.netui.pageflow.PageFlowController;
005 import com.bea.wlw.netui.pageflow.FormData;
006 import com.bea.wlw.netui.tags.html.Form;
007 import java.util.*;
008 
009 /**
010  * @jpf:view-properties view-properties::
011  <!-- This data is auto-generated. Hand-editing this section is not recommended. -->
012  <view-properties>
013  <pageflow-object id="pageflow:/navigation/selectTagNavigation/SelectTagNavigationController.jpf"/>
014  <pageflow-object id="action:begin.do">
015  *   <property value="80" name="x"/>
016  *   <property value="60" name="y"/>
017  </pageflow-object>
018  <pageflow-object id="action:done.do">
019  *   <property value="80" name="x"/>
020  *   <property value="280" name="y"/>
021  </pageflow-object>
022  <pageflow-object id="action:goAgain.do">
023  *   <property value="260" name="x"/>
024  *   <property value="440" name="y"/>
025  </pageflow-object>
026  <pageflow-object id="action:selectedCar.do#navigation.selectTagNavigation.SelectTagNavigationController.CarForm">
027  *   <property value="260" name="x"/>
028  *   <property value="120" name="y"/>
029  </pageflow-object>
030  <pageflow-object id="action-call:@page:index.jsp@#@action:done.do@">
031  *   <property value="204,220,220,236" name="elbowsY"/>
032  *   <property value="80,80,80,80" name="elbowsX"/>
033  *   <property value="North_1" name="toPort"/>
034  *   <property value="South_1" name="fromPort"/>
035  </pageflow-object>
036  <pageflow-object id="page:index.jsp">
037  *   <property value="80" name="x"/>
038  *   <property value="160" name="y"/>
039  </pageflow-object>
040  <pageflow-object id="external-jpf:/navigation/navigationController.jpf">
041  *   <property value="80" name="x"/>
042  *   <property value="380" name="y"/>
043  </pageflow-object>
044  <pageflow-object id="action-call:@page:convertibles.jsp@#@action:done.do@">
045  *   <property value="272,272,272,272" name="elbowsY"/>
046  *   <property value="224,170,170,116" name="elbowsX"/>
047  *   <property value="East_1" name="toPort"/>
048  *   <property value="West_1" name="fromPort"/>
049  </pageflow-object>
050  <pageflow-object id="action-call:@page:convertibles.jsp@#@action:goAgain.do@">
051  *   <property value="324,360,360,396" name="elbowsY"/>
052  *   <property value="260,260,260,260" name="elbowsX"/>
053  *   <property value="North_1" name="toPort"/>
054  *   <property value="South_1" name="fromPort"/>
055  </pageflow-object>
056  <pageflow-object id="page:convertibles.jsp">
057  *   <property value="260" name="x"/>
058  *   <property value="280" name="y"/>
059  </pageflow-object>
060  <pageflow-object id="action-call:@page:specialty.jsp@#@action:goAgain.do@">
061  *   <property value="283,283,432,432" name="elbowsY"/>
062  *   <property value="196,210,210,224" name="elbowsX"/>
063  *   <property value="West_1" name="toPort"/>
064  *   <property value="East_2" name="fromPort"/>
065  </pageflow-object>
066  <pageflow-object id="action-call:@page:specialty.jsp@#@action:done.do@">
067  *   <property value="272,272,272,272" name="elbowsY"/>
068  *   <property value="124,120,120,116" name="elbowsX"/>
069  *   <property value="East_1" name="toPort"/>
070  *   <property value="West_1" name="fromPort"/>
071  </pageflow-object>
072  <pageflow-object id="page:specialty.jsp">
073  *   <property value="160" name="x"/>
074  *   <property value="280" name="y"/>
075  </pageflow-object>
076  <pageflow-object id="action-call:@page:vintage.jsp@#@action:done.do@">
077  *   <property value="272,272,272,272" name="elbowsY"/>
078  *   <property value="304,210,210,116" name="elbowsX"/>
079  *   <property value="East_1" name="toPort"/>
080  *   <property value="West_1" name="fromPort"/>
081  </pageflow-object>
082  <pageflow-object id="action-call:@page:vintage.jsp@#@action:goAgain.do@">
083  *   <property value="283,283,432,432" name="elbowsY"/>
084  *   <property value="304,300,300,296" name="elbowsX"/>
085  *   <property value="East_1" name="toPort"/>
086  *   <property value="West_2" name="fromPort"/>
087  </pageflow-object>
088  <pageflow-object id="page:vintage.jsp">
089  *   <property value="340" name="x"/>
090  *   <property value="280" name="y"/>
091  </pageflow-object>
092  <pageflow-object id="action-call:@page:error.jsp@#@action:begin.do@">
093  *   <property value="144,130,130,116" name="elbowsX"/>
094  *   <property value="52,52,52,52" name="elbowsY"/>
095  *   <property value="West_1" name="fromPort"/>
096  *   <property value="East_1" name="toPort"/>
097  </pageflow-object>
098  <pageflow-object id="page:error.jsp">
099  *   <property value="180" name="x"/>
100  *   <property value="60" name="y"/>
101  </pageflow-object>
102  <pageflow-object id="forward:path#success#index.jsp#@action:begin.do@">
103  *   <property value="104,110,110,116" name="elbowsY"/>
104  *   <property value="North_1" name="toPort"/>
105  *   <property value="80,80,80,80" name="elbowsX"/>
106  *   <property value="success" name="label"/>
107  *   <property value="South_1" name="fromPort"/>
108  </pageflow-object>
109  <pageflow-object id="forward:path#done#/navigation/navigationController.jpf#@action:done.do@">
110  *   <property value="80,80,80,80" name="elbowsX"/>
111  *   <property value="324,330,330,336" name="elbowsY"/>
112  *   <property value="South_1" name="fromPort"/>
113  *   <property value="North_1" name="toPort"/>
114  *   <property value="done" name="label"/>
115  </pageflow-object>
116  <pageflow-object id="return-to:@forward:return-to#again#previousPage#@action:goAgain.do@@">
117  *   <property value="260" name="x"/>
118  *   <property value="540" name="y"/>
119  </pageflow-object>
120  <pageflow-object id="forward:return-to#again#previousPage#@action:goAgain.do@">
121  *   <property value="484,490,490,496" name="elbowsY"/>
122  *   <property value="260,260,260,260" name="elbowsX"/>
123  *   <property value="North_1" name="toPort"/>
124  *   <property value="South_1" name="fromPort"/>
125  *   <property value="again" name="label"/>
126  </pageflow-object>
127  <pageflow-object id="forward:path#convertibles#convertibles.jsp#@action:selectedCar.do#navigation.selectTagNavigation.SelectTagNavigationController.CarForm@">
128  *   <property value="260,260,260,260" name="elbowsX"/>
129  *   <property value="164,200,200,236" name="elbowsY"/>
130  *   <property value="South_1" name="fromPort"/>
131  *   <property value="North_1" name="toPort"/>
132  *   <property value="convertibles" name="label"/>
133  </pageflow-object>
134  <pageflow-object id="forward:path#specialty#specialty.jsp#@action:selectedCar.do#navigation.selectTagNavigation.SelectTagNavigationController.CarForm@">
135  *   <property value="224,210,210,196" name="elbowsX"/>
136  *   <property value="112,112,272,272" name="elbowsY"/>
137  *   <property value="West_1" name="fromPort"/>
138  *   <property value="East_1" name="toPort"/>
139  *   <property value="specialty" name="label"/>
140  </pageflow-object>
141  <pageflow-object id="forward:path#vintage#vintage.jsp#@action:selectedCar.do#navigation.selectTagNavigation.SelectTagNavigationController.CarForm@">
142  *   <property value="296,300,300,304" name="elbowsX"/>
143  *   <property value="112,112,272,272" name="elbowsY"/>
144  *   <property value="East_1" name="fromPort"/>
145  *   <property value="West_1" name="toPort"/>
146  *   <property value="vintage" name="label"/>
147  </pageflow-object>
148  <pageflow-object id="formbeanprop:navigation.selectTagNavigation.SelectTagNavigationController.CarForm#selection#java.lang.String"/>
149  <pageflow-object id="formbean:navigation.selectTagNavigation.SelectTagNavigationController.CarForm"/>
150  </view-properties>
151  * ::
152  *  */
153 public class SelectTagNavigationController extends PageFlowController
154 {
155 
156      protected global.Global globalApp;
157     
158     /**
159      * @jpf:action
160      * @jpf:forward name="success" path="index.jsp"
161      */
162     protected Forward begin()
163     {
164         return new Forward"success" );
165     }
166 
167     /**
168      * @jpf:action
169      * @jpf:forward name="done" path="/navigation/navigationController.jpf"
170      */
171     public Forward done()
172         throws Exception
173     {
174         return new Forward"done" );
175     }
176     
177     
178     /**
179      * @jpf:action
180      * @jpf:forward name="again" return-to="previousPage"
181      */
182     public Forward goAgain()
183     {
184         return new Forward"again" );
185     }
186 
187     /**
188      * @jpf:action
189      * @jpf:forward name="convertibles" path="convertibles.jsp"
190      * @jpf:forward name="specialty" path="specialty.jsp"       
191      * @jpf:forward name="vintage" path="vintage.jsp"
192      */
193     public Forward selectedCar(CarForm form)
194     {
195         String selection = form.getSelection();
196          if (selection.equals("Convertibles"))
197          
198              return new Forward("convertibles");            
199          }
200          else if (selection.equals("Specialty"))
201          
202              return new Forward("specialty");
203          }
204          else
205          
206              return new Forward"vintage" );
207          }         
208     }
209 
210     public static class CarForm extends FormData
211     {
212         private String selection;
213 
214         public String getSelection()
215         {
216             return selection;
217         }
218 
219         public void setSelectionString selection )
220         {
221             this.selection = selection;
222         }
223     }    
224     
225 }