ScriptContainerController.jpf Sample

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

Sample Location

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

BEA_HOME/weblogic81/samples/workshop/SamplesApp/WebApp/tagSamples/netui/scriptContainer/

Sample Source Code


001 package tagSamples.netui.scriptContainer;
002 import com.bea.wlw.netui.pageflow.FormData;
003 import com.bea.wlw.netui.pageflow.Forward;
004 import com.bea.wlw.netui.pageflow.PageFlowController;
005 
006 /**
007  * @jpf:controller
008  * @jpf:view-properties view-properties::
009  <!-- This data is auto-generated. Hand-editing this section is not recommended. -->
010  <view-properties>
011  <pageflow-object id="pageflow:/scriptContainer/ScriptContainerController.jpf"/>
012  <pageflow-object id="action:begin.do">
013  *   <property value="60" name="x"/>
014  *   <property value="60" name="y"/>
015  </pageflow-object>
016  <pageflow-object id="action:done.do">
017  *   <property value="320" name="x"/>
018  *   <property value="200" name="y"/>
019  </pageflow-object>
020  <pageflow-object id="action:submit.do#scriptContainer.ScriptContainerController.NameBean">
021  *   <property value="200" name="x"/>
022  *   <property value="120" name="y"/>
023  </pageflow-object>
024  <pageflow-object id="page:index.jsp">
025  *   <property value="320" name="x"/>
026  *   <property value="60" name="y"/>
027  </pageflow-object>
028  <pageflow-object id="external-jpf:/Controller.jpf">
029  *   <property value="440" name="x"/>
030  *   <property value="200" name="y"/>
031  </pageflow-object>
032  <pageflow-object id="page:results.jsp">
033  *   <property value="60" name="x"/>
034  *   <property value="200" name="y"/>
035  </pageflow-object>
036  <pageflow-object id="forward:path#success#index.jsp#@action:begin.do@">
037  *   <property value="96,190,190,284" name="elbowsX"/>
038  *   <property value="52,52,52,52" name="elbowsY"/>
039  *   <property value="East_1" name="fromPort"/>
040  *   <property value="West_1" name="toPort"/>
041  *   <property value="success" name="label"/>
042  </pageflow-object>
043  <pageflow-object id="forward:path#done#/Controller.jpf#@action:done.do@">
044  *   <property value="356,380,380,404" name="elbowsX"/>
045  *   <property value="192,192,192,192" name="elbowsY"/>
046  *   <property value="East_1" name="fromPort"/>
047  *   <property value="West_1" name="toPort"/>
048  *   <property value="done" name="label"/>
049  </pageflow-object>
050  <pageflow-object id="forward:path#success#results.jsp#@action:submit.do#scriptContainer.ScriptContainerController.NameBean@">
051  *   <property value="164,130,130,96" name="elbowsX"/>
052  *   <property value="112,112,181,181" name="elbowsY"/>
053  *   <property value="West_1" name="fromPort"/>
054  *   <property value="East_0" name="toPort"/>
055  *   <property value="success" name="label"/>
056  </pageflow-object>
057  <pageflow-object id="formbeanprop:scriptContainer.ScriptContainerController.NameBean#lastName#java.lang.String"/>
058  <pageflow-object id="formbeanprop:scriptContainer.ScriptContainerController.NameBean#firstName#java.lang.String"/>
059  <pageflow-object id="formbean:scriptContainer.ScriptContainerController.NameBean"/>
060  <pageflow-object id="action-call:@page:index.jsp@#@action:submit.do#scriptContainer.ScriptContainerController.NameBean@">
061  *   <property value="284,260,260,236" name="elbowsX"/>
062  *   <property value="63,63,112,112" name="elbowsY"/>
063  *   <property value="West_2" name="fromPort"/>
064  *   <property value="East_1" name="toPort"/>
065  </pageflow-object>
066  <pageflow-object id="action-call:@page:results.jsp@#@action:done.do@">
067  *   <property value="96,190,190,284" name="elbowsX"/>
068  *   <property value="192,192,192,192" name="elbowsY"/>
069  *   <property value="East_1" name="fromPort"/>
070  *   <property value="West_1" name="toPort"/>
071  </pageflow-object>
072  <pageflow-object id="action-call:@page:results.jsp@#@action:begin.do@">
073  *   <property value="60,60,60,60" name="elbowsX"/>
074  *   <property value="156,130,130,104" name="elbowsY"/>
075  *   <property value="North_1" name="fromPort"/>
076  *   <property value="South_1" name="toPort"/>
077  </pageflow-object>
078  <pageflow-object id="action-call:@page:index.jsp@#@action:done.do@">
079  *   <property value="320,320,320,320" name="elbowsX"/>
080  *   <property value="104,130,130,156" name="elbowsY"/>
081  *   <property value="South_1" name="fromPort"/>
082  *   <property value="North_1" name="toPort"/>
083  </pageflow-object>
084  </view-properties>
085  * ::
086  */
087 public class ScriptContainerController extends PageFlowController
088 {
089 
090     public String action = "foobar";
091     
092     protected global.Global globalApp;
093  
094     /**
095      * This method represents the point of entry into the pageflow
096      * @jpf:action
097      * @jpf:forward name="success" path="index.jsp"
098      */
099     protected Forward begin()
100     {
101         return new Forward("success");
102     }
103     
104     /**
105      * This method represents the exit out of this pageflow
106      * @jpf:action
107      * @jpf:forward name="done" path="/Controller.jpf"
108      */
109     protected Forward done()
110     {
111         return new Forward("done");
112     }    
113     
114     /**
115      * @jpf:action
116      * @jpf:forward name="success" path="results.jsp"
117      */
118     protected Forward submit(NameBean form)
119     {
120         Forward f = new Forward("success");
121         f.addPageInput("names",form);
122         return f;
123     }
124     
125     /**
126      * FormData get and set methods may be overwritten by the Form Bean editor.
127      */
128     public static class NameBean extends FormData
129     {
130         private String firstName;
131 
132         private String lastName;
133 
134 
135         public void setLastName(String lastName)
136         {
137             this.lastName = lastName;
138         }
139 
140         public String getLastName()
141         {
142             return this.lastName;
143         }
144 
145         public void setFirstName(String firstName)
146         {
147             this.firstName = firstName;
148         }
149 
150         public String getFirstName()
151         {
152             return this.firstName;
153         }
154     }
155 }