You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beehive.apache.org by ri...@apache.org on 2005/05/24 04:57:34 UTC
svn commit: r178068 - in /incubator/beehive/trunk:
docs/forrest/src/documentation/content/xdocs/pageflow/
netui/src/webapp-template/default/WEB-INF/src/shared/
samples/netui-jsf/jsf/physiciansFlow/ samples/netui-samples/
samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/
samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/login/
samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/loginexample/
samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/popup/
samples/netui-samples/loginexample/loginflow/
samples/netui-samples/loginexample/start/ samples/netui-samples/ui/popup/
samples/netui-samples/ui/popup/getColorPopup/
samples/netui-samples/ui/popup/getcolor/
Author: rich
Date: Mon May 23 19:57:33 2005
New Revision: 178068
URL: http://svn.apache.org/viewcvs?rev=178068&view=rev
Log:
Samples work:
- Fix for http://issues.apache.org/jira/browse/BEEHIVE-759 : JSF Sample throws exception when do an detailed physician info search with RI1_1_01. This appears to be a bug in the JSF RI -- I've worked around it.
- Reworked the Popup Windows sample.
- Changed the Login sample to use Page Flow inheritance instead of shared flows -- this is a perfect case for it.
- Other minor fixup in the netui-samples app.
Docs:
- Changed the MyFaces links to point to myfaces.apache.org, and to list the MyFaces version (1.0.9).
- Changed the JSF RI links to list the RI version (1.1_01).
Other:
- In the webapp template, renamed SharedFlow.jpfs to SharedFlow.java, to line up with the rename of all .jpf files to .java.
tests: validate in docs/forrest, build.dist.full (WinXP)
BB: self (linux) (including run.tests against the distributions)
Added:
incubator/beehive/trunk/netui/src/webapp-template/default/WEB-INF/src/shared/SharedFlow.java
- copied unchanged from r171359, incubator/beehive/trunk/netui/src/webapp-template/default/WEB-INF/src/shared/SharedFlow.jpfs
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/BaseFlow.java
- copied, changed from r177943, incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/SharedFlow.java
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/loginexample/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/loginexample/messages.properties
- copied unchanged from r177943, incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/login/messages.properties
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/popup/
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/popup/messages.properties (with props)
incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/
- copied from r177935, incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/
incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/confirm.jsp (with props)
Removed:
incubator/beehive/trunk/netui/src/webapp-template/default/WEB-INF/src/shared/SharedFlow.jpfs
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/SharedFlow.java
incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/login/messages.properties
incubator/beehive/trunk/samples/netui-samples/ui/popup/error.jsp
incubator/beehive/trunk/samples/netui-samples/ui/popup/getColorPopup/
incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/error.jsp
Modified:
incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/pageflow/jsf.xml
incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/pageflow/sample_jpf_jsf_integration.xml
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianDetail.jsp
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianResultsWithDetail.jsp
incubator/beehive/trunk/samples/netui-samples/index.jsp
incubator/beehive/trunk/samples/netui-samples/loginexample/loginflow/Controller.java
incubator/beehive/trunk/samples/netui-samples/loginexample/start/Controller.java
incubator/beehive/trunk/samples/netui-samples/loginexample/start/index.jsp
incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.java
incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/GetColorController.java
incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/index.jsp
incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp
incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp
Modified: incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/pageflow/jsf.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/pageflow/jsf.xml?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/pageflow/jsf.xml (original)
+++ incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/pageflow/jsf.xml Mon May 23 19:57:33 2005
@@ -50,8 +50,11 @@
<section><title>Enabling Java Server Faces</title>
<p>To enable Java Server Faces in a Beehive web application, complete the following steps:</p>
<section><title>Integrate JSF Tags in Your Web App</title>
- <p>Integrate JSF into your webapp. You can use either <a href="http://www.marinschek.com/myfaces/tiki/tiki-index.php?page=GettingStarted"><code>MyFaces</code></a> or
-the <a href="http://java.sun.com/j2ee/javaserverfaces/download.html">JSF Reference Implementation</a>.</p>
+ <p>Integrate JSF into your webapp. You can use either
+ <a href="http://myfaces.apache.org"><code>MyFaces v1.0.9 or later</code></a>, or
+ the <a href="http://java.sun.com/j2ee/javaserverfaces/download.html">
+ JSF Reference Implementation v1.1_01</a>.
+ </p>
</section>
<section><title>Configure Your Web Application</title>
<p>Add the following snippet to your <code>WEB-INF/faces-config.xml</code> file:</p>
Modified: incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/pageflow/sample_jpf_jsf_integration.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/pageflow/sample_jpf_jsf_integration.xml?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/pageflow/sample_jpf_jsf_integration.xml (original)
+++ incubator/beehive/trunk/docs/forrest/src/documentation/content/xdocs/pageflow/sample_jpf_jsf_integration.xml Mon May 23 19:57:33 2005
@@ -54,8 +54,8 @@
<section><title>To Download a JSF Implementation</title>
<p>Download and install one of the following JSF implementations:</p>
<ul>
- <li><a href="http://www.marinschek.com/myfaces/tiki/tiki-index.php?page=GettingStarted">MyFaces</a></li>
- <li><a href="http://java.sun.com/j2ee/javaserverfaces/download.html">JSF Reference Implementation</a></li>
+ <li><a href="http://myfaces.apache.org">MyFaces v1.0.9 or later</a></li>
+ <li><a href="http://java.sun.com/j2ee/javaserverfaces/download.html">JSF Reference Implementation v1.1_01</a></li>
</ul>
</section>
<section id="edit_properties_file"><title>To Edit the <code>build.properties</code> File</title>
@@ -144,4 +144,4 @@
Sun Microsystems, Inc. in the United States and other
countries.<br/> © 2004, Apache Software Foundation </legal>
</footer>
-</document>
\ No newline at end of file
+</document>
Modified: incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianDetail.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianDetail.jsp?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianDetail.jsp (original)
+++ incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianDetail.jsp Mon May 23 19:57:33 2005
@@ -94,12 +94,12 @@
</h:panelGrid>
</h:panelGrid>
- </h:form>
+ <h:panelGrid>
+ <f:attribute name="align" value="center"/>
+ <h:commandLink action="physicianSearch" value="Return to Search" />
+ </h:panelGrid>
- <h:panelGrid>
- <f:attribute name="align" value="center"/>
- <h:commandLink action="physicianSearch" value="Return to Search" />
- </h:panelGrid>
+ </h:form>
<!-- explanatory notes block -->
<h:panelGrid width="90%" cellpadding="5" style="background-color: #EEF3FB; margin-bottom: 30; border:1px solid blue;" rendered="#{sharedFlow.shared.notesPreference}">
Modified: incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianResultsWithDetail.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianResultsWithDetail.jsp?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianResultsWithDetail.jsp (original)
+++ incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianResultsWithDetail.jsp Mon May 23 19:57:33 2005
@@ -43,49 +43,50 @@
<f:attribute name="align" value="center"/>
<h:outputText value="#{msgs.detailedResults}" styleClass="infoMessage" />
</h:panelGrid>
- </h:form>
- <!-- detailed search results -->
- <h:dataTable value="#{pageFlow.results}" var="physician" rendered="#{pageFlow.results != null}" styleClass="resultsTable" rowClasses="oddRow, evenRow" id="searchResults" cellpadding="7px" style="margin-bottom: 30">
- <h:column>
- <h:panelGrid columns="2" cellpadding="7">
- <f:facet name="header">
- <h:outputText value="Dr. #{physician.firstName} #{physician.lastName}" />
- </f:facet>
- <h:outputText value="#{msgs.specialtyColumnLabel}: " />
- <h:outputText value="#{physician.specialty}" />
- <h:outputText value="#{msgs.genderColumnLabel}: " />
- <h:outputText value="#{physician.gender}" />
- <h:outputText value="#{msgs.cityColumnLabel}: " />
- <h:outputText value="#{physician.city}" />
- <h:outputText value="#{msgs.schoolColumnLabel}: " />
- <h:outputText value="#{physician.school}" />
- <h:outputText value="#{msgs.hospitalsColumnLabel}: " />
- <h:panelGroup>
- <c:forEach items="${physician.hospitalAffiliations}" var="hospital">
- <f:verbatim>
- <c:out value="${hospital}" />
- <br>
- </f:verbatim>
- </c:forEach>
- </h:panelGroup>
- </h:panelGrid>
- </h:column>
- <h:column>
- <h:panelGrid columns="1" cellpadding="7">
- <f:facet name="header">
- <h:outputText value="#{msgs.bioHeading}" />
- </f:facet>
- <!-- disabled because this is for output text only -->
- <h:inputTextarea value="#{physician.bio}" cols="40" rows="10" disabled="false"/>
- </h:panelGrid>
- </h:column>
- </h:dataTable>
+ <!-- detailed search results -->
+ <h:dataTable value="#{pageFlow.results}" var="physician" rendered="#{pageFlow.results != null}" styleClass="resultsTable" rowClasses="oddRow, evenRow" id="searchResults" cellpadding="7px" style="margin-bottom: 30">
+ <h:column>
+ <h:panelGrid columns="2" cellpadding="7">
+ <f:facet name="header">
+ <h:outputText value="Dr. #{physician.firstName} #{physician.lastName}" />
+ </f:facet>
+ <h:outputText value="#{msgs.specialtyColumnLabel}: " />
+ <h:outputText value="#{physician.specialty}" />
+ <h:outputText value="#{msgs.genderColumnLabel}: " />
+ <h:outputText value="#{physician.gender}" />
+ <h:outputText value="#{msgs.cityColumnLabel}: " />
+ <h:outputText value="#{physician.city}" />
+ <h:outputText value="#{msgs.schoolColumnLabel}: " />
+ <h:outputText value="#{physician.school}" />
+ <h:outputText value="#{msgs.hospitalsColumnLabel}: " />
+ <h:panelGroup>
+ <c:forEach items="${physician.hospitalAffiliations}" var="hospital">
+ <f:verbatim>
+ <c:out value="${hospital}" />
+ <br>
+ </f:verbatim>
+ </c:forEach>
+ </h:panelGroup>
+ </h:panelGrid>
+ </h:column>
+ <h:column>
+ <h:panelGrid columns="1" cellpadding="7">
+ <f:facet name="header">
+ <h:outputText value="#{msgs.bioHeading}" />
+ </f:facet>
+ <!-- disabled because this is for output text only -->
+ <h:inputTextarea value="#{physician.bio}" cols="40" rows="10" disabled="false"/>
+ </h:panelGrid>
+ </h:column>
+ </h:dataTable>
- <h:panelGrid>
- <f:attribute name="align" value="center"/>
- <h:commandLink action="physicianSearch" value="Return to Search" />
- </h:panelGrid>
+ <h:panelGrid>
+ <f:attribute name="align" value="center"/>
+ <h:commandLink action="physicianSearch" value="Return to Search" />
+ </h:panelGrid>
+
+ </h:form>
<!-- explanatory notes block -->
<h:panelGrid width="90%" cellpadding="5" style="background-color: #EEF3FB; margin-bottom: 30; border:1px solid blue;" rendered="#{sharedFlow.shared.notesPreference}">
Copied: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/BaseFlow.java (from r177943, incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/SharedFlow.java)
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/BaseFlow.java?p2=incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/BaseFlow.java&p1=incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/SharedFlow.java&r1=177943&r2=178068&rev=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/SharedFlow.java (original)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/loginexample/BaseFlow.java Mon May 23 19:57:33 2005
@@ -17,7 +17,7 @@
*/
package org.apache.beehive.samples.netui.loginexample;
-import org.apache.beehive.netui.pageflow.SharedFlowController;
+import org.apache.beehive.netui.pageflow.PageFlowController;
import org.apache.beehive.netui.pageflow.Forward;
import org.apache.beehive.netui.pageflow.NotLoggedInException;
import org.apache.beehive.netui.pageflow.annotations.Jpf;
@@ -32,8 +32,8 @@
@Jpf.Catch(type=NotLoggedInException.class, path="/loginexample/loginflow/Controller.jpf")
}
)
-public class SharedFlow
- extends SharedFlowController
+public abstract class BaseFlow
+ extends PageFlowController
{
@Jpf.Action(
forwards={
@@ -42,7 +42,7 @@
)
public Forward logout()
{
- logout( false );
- return new Forward( "success" );
+ logout(false);
+ return new Forward("success");
}
}
Added: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/popup/messages.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/popup/messages.properties?rev=178068&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/popup/messages.properties (added)
+++ incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/popup/messages.properties Mon May 23 19:57:33 2005
@@ -0,0 +1,7 @@
+# Messages for page flow /ui/popup/Controller.jpf
+
+errors.nameRequired=You must enter your name.
+errors.colorRequired=The Color is required. Click the button to choose a color.
+
+error.prefix=<span style="color:red">
+error.suffix=</span>
Propchange: incubator/beehive/trunk/samples/netui-samples/WEB-INF/src/org/apache/beehive/samples/netui/resources/popup/messages.properties
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/samples/netui-samples/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/index.jsp?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/index.jsp (original)
+++ incubator/beehive/trunk/samples/netui-samples/index.jsp Mon May 23 19:57:33 2005
@@ -33,12 +33,13 @@
</dl>
<dl>
<dt><netui:anchor href="loginexample/start/Controller.jpf" value="Login"/></dt>
- <dd>Demonstrates defining your own LoginHandler, as well as nested page flows and shared
- flows.</dd>
+ <dd>Demonstrates defining your own LoginHandler, as well as nested page flows and Page Flow
+ inheritance.</dd>
</dl>
<dl>
<dt><netui:anchor href="ui/popup/Controller.jpf" value="Popup Window"/></dt>
- <dd>Demonstrates popup window implemented by a nested page flow.</dd>
+ <dd>Demonstrates nested page flow shown in a popup window, with values passed back to the
+ original page flow.</dd>
</dl>
<dl>
<dt><netui:anchor href="ui/tree/Controller.jpf" value="Tree"/></dt>
Modified: incubator/beehive/trunk/samples/netui-samples/loginexample/loginflow/Controller.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/loginexample/loginflow/Controller.java?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/loginexample/loginflow/Controller.java (original)
+++ incubator/beehive/trunk/samples/netui-samples/loginexample/loginflow/Controller.java Mon May 23 19:57:33 2005
@@ -26,20 +26,20 @@
nested=true,
simpleActions={
@Jpf.SimpleAction(name="begin", path="index.jsp"),
- @Jpf.SimpleAction(name="cancel", returnAction="shared.loginCancel")
+ @Jpf.SimpleAction(name="cancel", returnAction="loginCancel")
},
catches={
@Jpf.Catch(type=LoginException.class, path="index.jsp")
},
messageBundles={
- @Jpf.MessageBundle(bundlePath="org.apache.beehive.samples.netui.loginexample.login.messages")
+ @Jpf.MessageBundle(bundlePath="org.apache.beehive.samples.netui.resources.loginexample.messages")
}
)
public class Controller extends PageFlowController
{
@Jpf.Action(
forwards={
- @Jpf.Forward(name="success", returnAction="shared.loginSuccess")
+ @Jpf.Forward(name="success", returnAction="loginSuccess")
},
validationErrorForward=@Jpf.Forward(name="failure", path="index.jsp")
)
Modified: incubator/beehive/trunk/samples/netui-samples/loginexample/start/Controller.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/loginexample/start/Controller.java?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/loginexample/start/Controller.java (original)
+++ incubator/beehive/trunk/samples/netui-samples/loginexample/start/Controller.java Mon May 23 19:57:33 2005
@@ -17,22 +17,16 @@
*/
package loginexample.start;
-import org.apache.beehive.netui.pageflow.*;
-import org.apache.beehive.netui.pageflow.annotations.*;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.samples.netui.loginexample.BaseFlow;
@Jpf.Controller(
simpleActions={
@Jpf.SimpleAction(name="begin", path="index.jsp"),
@Jpf.SimpleAction(name="goProtectedFlow", path="/loginexample/protectedflow/Controller.jpf", loginRequired=true),
@Jpf.SimpleAction(name="protectedFlowDone", navigateTo=Jpf.NavigateTo.currentPage)
- },
- sharedFlowRefs={
- // This declares a shared flow that will be used by this page flow. Note that you can also
- // declare shared flows to be used by *all* page flows, using the
- // <default-shared-flow-refs> element in WEB-INF/beehive-netui-config.xml.
- @Jpf.SharedFlowRef(name="shared", type=org.apache.beehive.samples.netui.loginexample.SharedFlow.class)
}
)
-public class Controller extends PageFlowController
+public class Controller extends BaseFlow
{
}
Modified: incubator/beehive/trunk/samples/netui-samples/loginexample/start/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/loginexample/start/index.jsp?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/loginexample/start/index.jsp (original)
+++ incubator/beehive/trunk/samples/netui-samples/loginexample/start/index.jsp Mon May 23 19:57:33 2005
@@ -29,7 +29,7 @@
This example demonstrates the following features:
<ul>
<li>Plugging in your own LoginHandler</li>
- <li>Using shared flows for common actions and exception handlers</li>
+ <li>Using Page Flow inheritance for common actions and exception handlers</li>
<li>Using nested page flows</li>
</ul>
@@ -47,15 +47,14 @@
and you are not currently logged in.
</li>
<li>
- The current page flow does not handle <code>NotLoggedInException</code>, but its referenced
- shared flow (<code>org.apache.beehive.samples.netui.loginexample.SharedFlow</code>) does.
- The shared flow forwards to the Login nested page flow
- (/loginexample/loginflow/Controller.jpf).
+ The current page flow does not handle <code>NotLoggedInException</code>, but its base class
+ (<code>org.apache.beehive.samples.netui.loginexample.BaseFlow</code>). The base class
+ forwards to the Login nested page flow when this exception occurs.
</li>
<li>
There are two possible <strong>return actions</strong> from the Login nested page flow:
- 'shared.loginSuccess' or 'shared.loginCancel'. Take a look at each action, defined in
- <code>org.apache.beehive.samples.netui.loginexample.SharedFlow</code>. The 'loginSuccess'
+ 'loginSuccess' or 'loginCancel'. Take a look at each action, defined in
+ <code>org.apache.beehive.samples.netui.loginexample.BaseFlow</code>. The 'loginSuccess'
action <strong>re-runs the original target action</strong>, which was 'goProtectedFlow'. Now
that you're logged in, the action will succeed. The 'loginCancel' action just takes you back
to the original page you were on.
@@ -67,14 +66,14 @@
<li>
Note that the current page flow (or any other page flow) knows <i>nothing</i> about the Login
page flow. It only has to mark its protected actions with <code>loginRequired=true</code>.
- The shared flow and the Login flow take care of the rest.
+ The base class page flow and the Login flow take care of the rest.
</li>
</ul>
<br/>
<netui:anchor action="goProtectedFlow">go to a protected page flow</netui:anchor>
<br/>
- <netui:anchor action="shared.logout">log out</netui:anchor>
+ <netui:anchor action="logout">log out</netui:anchor>
</netui-template:section>
</netui-template:template>
Modified: incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.java?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.java (original)
+++ incubator/beehive/trunk/samples/netui-samples/ui/popup/Controller.java Mon May 23 19:57:33 2005
@@ -23,33 +23,38 @@
import org.apache.beehive.netui.pageflow.PageFlowController;
import org.apache.beehive.netui.pageflow.annotations.Jpf;
-import ui.popup.getColorPopup.GetColorController;
+import ui.popup.getcolor.GetColorController;
@Jpf.Controller(
simpleActions={
@Jpf.SimpleAction(name="begin", path="index.jsp"),
- @Jpf.SimpleAction(name="getColor", path="getColorPopup/index.jsp")
+ @Jpf.SimpleAction(name="getColor", path="getcolor/GetColorController.jpf"),
+ @Jpf.SimpleAction(name="getColorCancel", forwardRef="_auto")
},
- sharedFlowRefs={
- @Jpf.SharedFlowRef(name="shared", type=shared.SharedFlow.class)
+ messageBundles={
+ @Jpf.MessageBundle(bundlePath="org.apache.beehive.samples.netui.resources.popup.messages")
}
)
public class Controller
extends PageFlowController
{
- @Jpf.SharedFlowField(name="shared")
- private shared.SharedFlow sharedFlow;
-
+ /**
+ * Returning the special "_auto" Forward causes the popup window to close, and automatically
+ * runs the JavaScript to map return values from the nested page flow into fields on the
+ * original page. The simple action "getColorCancel" shows another way to return the "_auto"
+ * forward.
+ */
@Jpf.Action()
- public Forward gotColor(GetColorController.ColorForm colorForm)
+ public Forward getColorSuccess(GetColorController.ColorForm colorForm)
{
return new Forward("_auto");
}
- @Jpf.Action(
- forwards={
- @Jpf.Forward( name="success", path="show.jsp" )
- }
+ @Jpf.Action(
+ forwards={
+ @Jpf.Forward(name="success", path="show.jsp")
+ },
+ validationErrorForward=@Jpf.Forward(name="failure", navigateTo=Jpf.NavigateTo.currentPage)
)
public Forward submit(SubmitForm form)
{
@@ -66,6 +71,9 @@
private String _city;
private String _color;
+ @Jpf.ValidatableProperty(
+ validateRequired=@Jpf.ValidateRequired(messageKey="errors.nameRequired")
+ )
public String getName()
{
return _name;
@@ -96,6 +104,9 @@
_city = city;
}
+ @Jpf.ValidatableProperty(
+ validateRequired=@Jpf.ValidateRequired(messageKey="errors.colorRequired")
+ )
public String getColor()
{
return _color;
Modified: incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/GetColorController.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/GetColorController.java?rev=178068&r1=177935&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/GetColorController.java (original)
+++ incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/GetColorController.java Mon May 23 19:57:33 2005
@@ -15,9 +15,10 @@
*
* $Header:$
*/
-package ui.popup.getColorPopup;
+package ui.popup.getcolor;
import javax.servlet.http.HttpSession;
+import java.io.Serializable;
import org.apache.beehive.netui.pageflow.Forward;
import org.apache.beehive.netui.pageflow.PageFlowController;
@@ -26,31 +27,45 @@
@Jpf.Controller(
nested=true,
simpleActions={
- @Jpf.SimpleAction(name="begin", path="index.jsp")
- },
- sharedFlowRefs={
- @Jpf.SharedFlowRef(name="shared", type=shared.SharedFlow.class)
+ @Jpf.SimpleAction(name="begin", path="index.jsp"),
+ @Jpf.SimpleAction(name="cancel", returnAction="getColorCancel")
}
)
public class GetColorController extends PageFlowController
{
- @Jpf.SharedFlowField(name="shared")
- private shared.SharedFlow sharedFlow;
+ private ColorForm _returnFormBean;
@Jpf.Action(
+ useFormBean="_returnFormBean",
forwards={
- @Jpf.Forward(name="success",
- returnAction="gotColor",
- outputFormBeanType=ColorForm.class
+ @Jpf.Forward(
+ name="confirm",
+ path="confirm.jsp",
+ actionOutputs={
+ @Jpf.ActionOutput(name="chosenColor", type=String.class, required=true)
+ }
)
}
)
- public Forward done( ColorForm returnForm )
+ public Forward submitColor(ColorForm form)
{
- return new Forward("success", returnForm);
+ Forward fwd = new Forward("confirm");
+ fwd.addActionOutput("chosenColor", form.getColor());
+ return fwd;
+ }
+
+ @Jpf.Action(
+ forwards={
+ @Jpf.Forward(name="success", returnAction="getColorSuccess", outputFormBeanType=ColorForm.class)
+ }
+ )
+ public Forward done(ColorForm form)
+ {
+ return new Forward("success", _returnFormBean);
}
public static class ColorForm
+ implements Serializable
{
private String _color;
Added: incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/confirm.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/confirm.jsp?rev=178068&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/confirm.jsp (added)
+++ incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/confirm.jsp Mon May 23 19:57:33 2005
@@ -0,0 +1,38 @@
+<%--
+ Copyright 2004-2005 The Apache Software Foundation.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+
+ $Header:$
+--%>
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
+
+<netui-data:declarePageInput name="chosenColor" type="java.lang.String" required="true"/>
+
+<netui-template:template templatePage="/resources/template/template.jsp">
+
+ <netui-template:setAttribute name="samTitle" value="Popup Windows"/>
+
+ <netui-template:section name="main">
+ <netui:form action="done">
+ You chose <span style="color:${pageInput.chosenColor}">${pageInput.chosenColor}</span>.
+ <br/>
+ <netui:button value="OK"/>
+ <netui:button value="try again" action="begin"/>
+ </netui:form>
+ </netui-template:section>
+
+</netui-template:template>
Propchange: incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/confirm.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/index.jsp?rev=178068&r1=177935&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/index.jsp (original)
+++ incubator/beehive/trunk/samples/netui-samples/ui/popup/getcolor/index.jsp Mon May 23 19:57:33 2005
@@ -19,23 +19,25 @@
<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0" prefix="netui-data"%>
<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
-<netui:html>
- <head>
- <title>Web Application Page</title>
- <netui:base/>
- </head>
- <netui:body>
- <netui:form action="done">
- Color:<br/>
- <netui:select dataSource="actionForm.color" size="5">
- <netui:selectOption value="red" />
- <netui:selectOption value="blue" />
- <netui:selectOption value="green" />
- <netui:selectOption value="yellow" />
- <netui:selectOption value="orange" />
- </netui:select>
- <br/>
- <netui:button type="submit" value="submit"/>
- </netui:form>
- </netui:body>
-</netui:html>
+
+<netui-template:template templatePage="/resources/template/template.jsp">
+
+ <netui-template:setAttribute name="samTitle" value="Popup Windows"/>
+
+ <netui-template:section name="main">
+ <netui:form action="submitColor">
+ Color:<br/>
+ <netui:select dataSource="actionForm.color" size="5" defaultValue="red">
+ <netui:selectOption value="red" />
+ <netui:selectOption value="blue" />
+ <netui:selectOption value="green" />
+ <netui:selectOption value="yellow" />
+ <netui:selectOption value="orange" />
+ </netui:select>
+ <br/>
+ <netui:button value="submit"/>
+ <netui:button value="cancel" action="cancel"/>
+ </netui:form>
+ </netui-template:section>
+
+</netui-template:template>
Modified: incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp (original)
+++ incubator/beehive/trunk/samples/netui-samples/ui/popup/index.jsp Mon May 23 19:57:33 2005
@@ -25,17 +25,52 @@
<netui-template:section name="main">
<netui:form action="submit">
<table>
- <tr><td>Name:</td><td><netui:textBox dataSource="actionForm.name"/></td></tr>
+ <tr>
+ <td>Name:</td>
+ <td>
+ <netui:textBox dataSource="actionForm.name"/>
+ <netui:error key="name"/>
+ </td>
+ </tr>
<tr><td>Address:</td><td><netui:textBox dataSource="actionForm.address"/></td></tr>
<tr><td>City:</td><td><netui:textBox dataSource="actionForm.city"/></td></tr>
- <tr><td>Favorite Color:</td><td><netui:textBox dataSource="actionForm.color" tagId="colorField"/>
- <netui:button type="submit" value="Go to the Color Picker" action="getColor" popup="true">
- <netui:configurePopup location="false" width="550" height="150">
- <netui:retrievePopupOutput dataSource="outputFormBean.color" tagIdRef="colorField"/>
- </netui:configurePopup>
- </netui:button></td></tr>
+ <tr>
+ <td>Favorite Color:</td>
+ <td>
+ <netui:textBox dataSource="actionForm.color" tagId="colorField" readonly="true"/>
+
+ <%-- The netui:button uses the 'popup' attribute to trigger the popup window. --%>
+ <netui:button type="submit" value="Go to the Color Picker" action="getColor" popup="true">
+ <%--
+ The netui:configurePopup tag sets popup window parameters, and also contains
+ netui:retrievePopupOutput tags to map return values from the nested page flow
+ into fields on this page.
+
+ You can *override* the default field-mapping behavior by setting the 'onPopupDone'
+ attribute on netui:configurePopup. For instance, if you set that value to
+ "myPopupMapper" and include the function below, then an alert dialog will appear
+ for each field when the popup window closes.
+
+ function myPopupMapper(map)
+ {
+ for (var i in map)
+ {
+ alert("field-ID=" + i + ", value=" + map[i]);
+ }
+ }
+ --%>
+ <netui:configurePopup location="false" width="585" height="243">
+ <netui:retrievePopupOutput dataSource="outputFormBean.color" tagIdRef="colorField"/>
+ </netui:configurePopup>
+ </netui:button>
+ <netui:error key="color"/>
+ </td>
+ </tr>
</table>
<netui:button type="submit" value="Submit" action="submit"/>
</netui:form>
+
</netui-template:section>
</netui-template:template>
+
+
Modified: incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp?rev=178068&r1=178067&r2=178068&view=diff
==============================================================================
--- incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp (original)
+++ incubator/beehive/trunk/samples/netui-samples/ui/popup/show.jsp Mon May 23 19:57:33 2005
@@ -21,12 +21,28 @@
<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0" prefix="netui-template"%>
<netui-template:template templatePage="/resources/template/template.jsp">
- <netui-template:setAttribute name="samTitle" value="Popup Windows"/>
- <netui-template:section name="main">
- <h3>You submitted the following information:</h3>
- Name: <netui:span value="${pageInput.form.name}"/><br/>
- Address: <netui:span value="${pageInput.form.address}"/><br/>
- City: <netui:span value="${pageInput.form.city}"/><br/>
- Favorite Color: <netui:span value="${pageInput.form.color}"/>
- </netui-template:section>
+ <netui-template:setAttribute name="samTitle" value="Popup Windows"/>
+ <netui-template:section name="main">
+ <h3>You submitted the following information:</h3>
+ <table>
+ <tr>
+ <td>Name:</td>
+ <td><b>${pageInput.form.name}</b></td>
+ </tr>
+ <tr>
+ <td>Address:</td>
+ <td><b>${pageInput.form.address}</b></td>
+ </tr>
+ <tr>
+ <td>City:</td>
+ <td><b>${pageInput.form.city}</b></td>
+ </tr>
+ <tr>
+ <td>Favorite Color:</td>
+ <td><b>${pageInput.form.color}</b></td>
+ </tr>
+ </table>
+ <br/>
+ <netui:anchor action="begin">try again</netui:anchor>
+ </netui-template:section>
</netui-template:template>