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/16 23:09:26 UTC
svn commit: r170448 [1/2] - in /incubator/beehive/trunk/samples/netui-jsf:
./ WEB-INF/ WEB-INF/lib/ WEB-INF/src/ WEB-INF/src/bundles/ WEB-INF/src/jsf/
WEB-INF/src/jsf/data/ WEB-INF/src/jsf/physician/
WEB-INF/src/jsf/physiciansFlow/ WEB-INF/src/shared/ jsf/
jsf/physiciansFlow/ resources/ resources/template/
Author: rich
Date: Mon May 16 14:09:24 2005
New Revision: 170448
URL: http://svn.apache.org/viewcvs?rev=170448&view=rev
Log:
Checkpoint for a Page Flow / JSF sample contributed by John Rohrlich (see http://issues.apache.org/jira/browse/BEEHIVE-658 ). Fixed some bugs and integrated it into a "netui-jsf" samples app.
Added:
incubator/beehive/trunk/samples/netui-jsf/
incubator/beehive/trunk/samples/netui-jsf/Controller.java (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/beehive-netui-validator-rules.xml (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/faces-config.xml (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/lib/
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.properties (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.xml (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.properties (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/bundles/
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/bundles/site.properties (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/SharedFlow.java (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/AddressData.java (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/PhysicianData.java (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/messages.properties (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/Physician.java (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianDataAccess.java (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianSession.java (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physiciansFlow/
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physiciansFlow/messages.properties (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/log4j.xml (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/shared/
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/shared/SharedFlow.java (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/validator-rules.xml (with props)
incubator/beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.myfaces
incubator/beehive/trunk/samples/netui-jsf/index.jsp (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/
incubator/beehive/trunk/samples/netui-jsf/jsf/Controller.java (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/error.jsp (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/home.java (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/home.jsp (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/Controller.java (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/confirmMailSent.jsp (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianDetail.java (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianDetail.jsp (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianResultsWithDetail.java (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/physicianResultsWithDetail.jsp (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/search.java (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/physiciansFlow/search.jsp (with props)
incubator/beehive/trunk/samples/netui-jsf/jsf/style.css (with props)
incubator/beehive/trunk/samples/netui-jsf/resources/
incubator/beehive/trunk/samples/netui-jsf/resources/template/
incubator/beehive/trunk/samples/netui-jsf/resources/template/template.jsp (with props)
Added: incubator/beehive/trunk/samples/netui-jsf/Controller.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/Controller.java?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/Controller.java (added)
+++ incubator/beehive/trunk/samples/netui-jsf/Controller.java Mon May 16 14:09:24 2005
@@ -0,0 +1,37 @@
+/*
+ * 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:$
+ */
+import javax.servlet.http.HttpSession;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+@Jpf.Controller(
+ simpleActions={
+ @Jpf.SimpleAction(name="begin", path="index.jsp")
+ },
+ sharedFlowRefs={
+ @Jpf.SharedFlowRef(name="shared", type=shared.SharedFlow.class)
+ }
+)
+public class Controller
+ extends PageFlowController
+{
+ @Jpf.SharedFlowField(name="shared")
+ private shared.SharedFlow sharedFlow;
+}
Propchange: incubator/beehive/trunk/samples/netui-jsf/Controller.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/beehive-netui-validator-rules.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/beehive-netui-validator-rules.xml?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/beehive-netui-validator-rules.xml (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/beehive-netui-validator-rules.xml Mon May 16 14:09:24 2005
@@ -0,0 +1,38 @@
+<!DOCTYPE form-validation PUBLIC
+ "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.0//EN"
+ "http://jakarta.apache.org/commons/dtds/validator_1_0.dtd">
+<!--
+ This file contains the default NetUI validator definitions. It should be
+ placed in /WEB-INF, and is automatically referenced in Struts config files
+ generated by the Page Flow compiler.
+-->
+
+<form-validation>
+
+ <global>
+
+ <validator name="netui_validwhen"
+ classname="org.apache.beehive.netui.pageflow.validation.ValidatorRules"
+ method="validateValidWhen"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest,
+ javax.servlet.ServletContext"
+ msg="errors.netui_validwhen"/>
+
+ <validator name="netui_longRange"
+ classname="org.apache.beehive.netui.pageflow.validation.ValidatorRules"
+ method="validateLongRange"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends="long"
+ msg="errors.range"/>
+
+ </global>
+
+</form-validation>
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/beehive-netui-validator-rules.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/faces-config.xml?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/faces-config.xml (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/faces-config.xml Mon May 16 14:09:24 2005
@@ -0,0 +1,22 @@
+<?xml version='1.0' encoding='UTF-8'?>
+
+<!DOCTYPE faces-config PUBLIC
+ "-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN"
+ "http://java.sun.com/dtd/web-facesconfig_1_1.dtd">
+
+<faces-config>
+
+ <application>
+ <locale-config>
+ <default-locale>en</default-locale>
+ <supported-locale>de</supported-locale>
+ <supported-locale>fr</supported-locale>
+ <supported-locale>es</supported-locale>
+ </locale-config>
+ </application>
+
+ <factory>
+ <application-factory>org.apache.beehive.netui.pageflow.faces.PageFlowApplicationFactory</application-factory>
+ </factory>
+
+</faces-config>
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/faces-config.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.properties?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.properties (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.properties Mon May 16 14:09:24 2005
@@ -0,0 +1,9 @@
+#
+#
+#
+beehive.home=../../../..
+
+servlet-api.jar=${os.CATALINA_HOME}/common/lib/servlet-api.jar
+jsp-api.jar=${os.CATALINA_HOME}/common/lib/jsp-api.jar
+
+context.path=netui-jsf
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.xml?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.xml (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.xml Mon May 16 14:09:24 2005
@@ -0,0 +1,122 @@
+<?xml version="1.0"?>
+<!--
+ 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:$
+ -->
+
+<!--
+ An Ant build file for compiling the petstoreWeb Beehive sample web application.
+-->
+<project name="Beehive/Samples/NetUI-JSF-Samples" default="usage" basedir="../..">
+
+ <property environment="os"/>
+ <import file="../../../../beehive-imports.xml"/>
+ <import file="${beehive.home}/ant/beehive-tools.xml"/>
+
+ <property name="webapp.dir" location="${basedir}"/>
+
+ <property name="tmp.sourcegen.dir" value=".tmpbeansrc"/>
+ <property name="tmp.jpfgen.dir" value=".pageflow-struts-generated"/>
+
+ <!-- Define the classpath used to build the webapp -->
+ <path id="webapp.build.classpath">
+ <path refid="servlet.dependency.path"/>
+ <pathelement location="${webapp.dir}/WEB-INF/classes"/>
+ <fileset dir="${webapp.dir}/WEB-INF/lib">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <target name="deploy-beehive" description="Copy the Beehive webapp rutime into the petstoreWeb webapp">
+ <deploy-netui webappDir="${webapp.dir}"/>
+ <deploy-wsm webappDir="${webapp.dir}"/>
+ </target>
+
+ <target name="build" depends="deploy-beehive" description="Build the petstoreWeb webapp">
+ <available property="webapp.dir.available" file="${webapp.dir}" type="dir"/>
+ <fail unless="webapp.dir.available" message="Can't find the webapp directory ${webapp.dir}"/>
+
+ <!--
+ this directory needs to get whacked before every build so
+ that control interface repackagings don't cause stale
+ files to be compiled
+ -->
+ <delete dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}" includeEmptyDirs="true"/>
+
+ <mkdir dir="${webapp.dir}/WEB-INF/classes"/>
+
+ <!-- compile XSDs -->
+ <build-schemas srcdir="${webapp.dir}/WEB-INF/schemas" destdir="${webapp.dir}/WEB-INF/classes"/>
+
+ <!-- compile controls -->
+ <build-controls srcdir="${webapp.dir}/WEB-INF/src"
+ destdir="${webapp.dir}/WEB-INF/classes"
+ tempdir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
+ classpathref="webapp.build.classpath"/>
+
+ <!-- compile JPFs -->
+ <build-pageflows srcdir="${webapp.dir}"
+ weboutputdir="${webapp.dir}"
+ classoutputdir="${webapp.dir}/WEB-INF/classes"
+ tempdir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
+ classpathref="webapp.build.classpath"/>
+
+ <!-- copy resources -->
+ <echo>Copy all .properties and .xml files</echo>
+ <copy todir="${webapp.dir}/WEB-INF/classes">
+ <fileset dir="${webapp.dir}/WEB-INF/src" includes="**/*.properties"/>
+ <fileset dir="${webapp.dir}/WEB-INF/src" includes="**/*.xml"/>
+ </copy>
+ </target>
+
+ <target name="clean" description="Clean the netui-jsf webapp">
+ <clean-webapp webappDir="${webapp.dir}"/>
+ <delete>
+ <fileset dir="${webapp.dir}/WEB-INF/lib" includes="*.jar"/>
+ </delete>
+ </target>
+
+ <target name="war" description="Build a compressed WAR file that can be deployed to an application container">
+ <property name="archive.dir" value="${webapp.dir}/.."/>
+
+ <!-- this does *not* exclude source from the archive -->
+ <war destfile="${archive.dir}/${context.path}.war" webxml="${webapp.dir}/WEB-INF/web.xml">
+ <fileset dir="${webapp.dir}">
+ <exclude name="WEB-INF/web.xml"/>
+ <exclude name="WEB-INF/src/**"/>
+ </fileset>
+ </war>
+ </target>
+
+ <target name="usage" description="Print usage information for this build file">
+ <echo>
+Welcome to the Beehive netui-jsf webapp!
+
+To run the webapp, several steps need to occur:
+ (manual) Deploy either MyFaces or the JavaServer Faces Reference Implementation libraries to WEB-INF/lib.
+ (manual) Copy either WEB-INF/web.xml.myfaces or WEB-INF/web.xml.jsf-ri to WEB-INF/web.xml, depending on
+ which JSF implementation you are using.
+ ant deploy-beehive -- this deploys the Beehive webapp runtime
+ ant build -- this builds the netui-jsf webapp
+ ant war -- creates a .war archive to deploy
+ </echo>
+
+ <java fork="no" classname="org.apache.tools.ant.Main">
+ <arg line="-f ${ant.file} -projecthelp"/>
+ </java>
+ </target>
+
+</project>
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build-dist.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.properties?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.properties (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.properties Mon May 16 14:09:24 2005
@@ -0,0 +1,9 @@
+#
+#
+#
+beehive.home=../../../..
+
+servlet-api.jar=${os.CATALINA_HOME}/common/lib/servlet-api.jar
+jsp-api.jar=${os.CATALINA_HOME}/common/lib/jsp-api.jar
+
+context.path=netui-jsf
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml Mon May 16 14:09:24 2005
@@ -0,0 +1,122 @@
+<?xml version="1.0"?>
+<!--
+ 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:$
+ -->
+
+<!--
+ An Ant build file for compiling the petstoreWeb Beehive sample web application.
+-->
+<project name="Beehive/Samples/NetUI-JSF-Samples" default="usage" basedir=".">
+
+ <property environment="os"/>
+ <property file="build.properties"/>
+
+ <import file="${beehive.home}/beehive-imports.xml"/>
+ <import file="${beehive.home}/ant/beehive-tools.xml"/>
+
+ <property name="webapp.dir" location="${basedir}/../.."/>
+
+ <property name="tmp.sourcegen.dir" value=".tmpbeansrc"/>
+ <property name="tmp.jpfgen.dir" value=".pageflow-struts-generated"/>
+
+ <!-- Define the classpath used to build the webapp -->
+ <path id="webapp.build.classpath">
+ <pathelement location="${servlet-api.jar}"/>
+ <pathelement location="${jsp-api.jar}"/>
+ <pathelement location="${webapp.dir}/WEB-INF/classes"/>
+ <fileset dir="${webapp.dir}/WEB-INF/lib">
+ <include name="*.jar"/>
+ </fileset>
+ </path>
+
+ <target name="deploy-beehive" description="Copy the Beehive webapp rutime into the petstoreWeb webapp">
+ <deploy-netui webappDir="${webapp.dir}"/>
+ <deploy-wsm webappDir="${webapp.dir}"/>
+ </target>
+
+ <target name="build" depends="deploy-beehive" description="Build the petstoreWeb webapp">
+ <available property="webapp.dir.available" file="${webapp.dir}" type="dir"/>
+ <fail unless="webapp.dir.available" message="Can't find the webapp directory ${webapp.dir}"/>
+
+ <!--
+ this directory needs to get whacked before every build so
+ that control interface repackagings don't cause stale
+ files to be compiled
+ -->
+ <delete dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}" includeEmptyDirs="true"/>
+
+ <mkdir dir="${webapp.dir}/WEB-INF/classes"/>
+
+ <!-- compile XSDs -->
+ <build-schemas srcdir="${webapp.dir}/WEB-INF/schemas" destdir="${webapp.dir}/WEB-INF/classes"/>
+
+ <!-- compile controls -->
+ <build-controls srcdir="${webapp.dir}/WEB-INF/src"
+ destdir="${webapp.dir}/WEB-INF/classes"
+ tempdir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
+ classpathref="webapp.build.classpath"/>
+
+ <!-- compile JPFs -->
+ <build-pageflows srcdir="${webapp.dir}"
+ weboutputdir="${webapp.dir}"
+ classoutputdir="${webapp.dir}/WEB-INF/classes"
+ tempdir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"
+ classpathref="webapp.build.classpath"/>
+
+ <!-- copy resources -->
+ <echo>Copy all .properties and .xml files</echo>
+ <copy todir="${webapp.dir}/WEB-INF/classes">
+ <fileset dir="${webapp.dir}/WEB-INF/src" includes="**/*.properties"/>
+ <fileset dir="${webapp.dir}/WEB-INF/src" includes="**/*.xml"/>
+ </copy>
+ </target>
+
+ <target name="clean" description="Clean the netui-jsf webapp">
+ <delete dir="${webapp.dir}/WEB-INF/classes"/>
+ <delete dir="${webapp.dir}/WEB-INF/${tmp.sourcegen.dir}"/>
+ <delete dir="${webapp.dir}/WEB-INF/.pageflow-struts-generated"/>
+ </target>
+
+ <target name="war" description="Build a compressed WAR file that can be deployed to an application container">
+ <property name="archive.dir" value="${webapp.dir}/.."/>
+
+ <!-- this does *not* exclude source from the archive -->
+ <war destfile="${archive.dir}/${context.path}.war" webxml="${webapp.dir}/WEB-INF/web.xml">
+ <fileset dir="${webapp.dir}">
+ <exclude name="WEB-INF/web.xml"/>
+ <exclude name="WEB-INF/src/**"/>
+ </fileset>
+ </war>
+ </target>
+
+ <target name="usage" description="Print usage information for this build file">
+ <echo>
+To run the webapp, several steps need to occur:
+ (manual) Deploy either MyFaces or the JavaServer Faces Reference Implementation libraries to WEB-INF/lib.
+ (manual) Copy either WEB-INF/web.xml.myfaces or WEB-INF/web.xml.jsf-ri to WEB-INF/web.xml, depending on
+ which JSF implementation you are using.
+ ant deploy-beehive -- this deploys the Beehive webapp runtime
+ ant build -- this builds the netui-jsf webapp
+ ant war -- creates a .war archive to deploy
+ </echo>
+
+ <java fork="no" classname="org.apache.tools.ant.Main">
+ <arg line="-f ${ant.file} -projecthelp"/>
+ </java>
+ </target>
+
+</project>
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/bundles/site.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/bundles/site.properties?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/bundles/site.properties (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/bundles/site.properties Mon May 16 14:09:24 2005
@@ -0,0 +1,2 @@
+browserTitle=Beehive Page Flow / JSF Samples
+welcome=Welcome to the Page Flow / JSF Samples
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/bundles/site.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/SharedFlow.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/SharedFlow.java?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/SharedFlow.java (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/SharedFlow.java Mon May 16 14:09:24 2005
@@ -0,0 +1,30 @@
+package jsf;
+
+import java.io.IOException;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowException;
+import org.apache.beehive.netui.pageflow.SharedFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+@Jpf.Controller(
+ simpleActions={
+ @Jpf.SimpleAction(name="home", path="/jsf/Controller.jpf")
+ }
+)
+
+public class SharedFlow
+ extends SharedFlowController
+{
+ private boolean commentsPreference = true;
+
+ public void setCommentsPreference(boolean value)
+ {
+ this.commentsPreference = value;
+ }
+
+ public boolean getCommentsPreference()
+ {
+ return this.commentsPreference;
+ }
+}
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/SharedFlow.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/AddressData.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/AddressData.java?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/AddressData.java (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/AddressData.java Mon May 16 14:09:24 2005
@@ -0,0 +1,67 @@
+package jsf.data;
+
+public class AddressData
+{
+ private String street = "";
+ private String city = "";
+ private String state = "";
+ private String zip = "";
+
+
+ public void setState(String value)
+ {
+ state = value;
+ }
+
+ public void setCity(String value)
+ {
+ city = value;
+ }
+
+ public String getState()
+ {
+ return state;
+ }
+
+ public String getZip()
+ {
+ return zip;
+ }
+
+ public void setZip(String value)
+ {
+ zip = value;
+ }
+
+ public String getCity()
+ {
+ return city;
+ }
+
+ public String getStreet()
+ {
+ return street;
+ }
+
+ public void setStreet(String value)
+ {
+ street = value;
+ }
+
+ // pass in the actual address and the criteria for the address
+ public boolean isMatch(AddressData address, AddressData criteria)
+ {
+ assert (address != null);
+ assert (criteria != null);
+
+ boolean match = false;
+
+ if ((criteria.getCity() == null) ||
+ (criteria.getCity().equalsIgnoreCase(address.getCity())))
+ {
+ match = true;
+ }
+
+ return match;
+ }
+}
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/AddressData.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/PhysicianData.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/PhysicianData.java?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/PhysicianData.java (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/PhysicianData.java Mon May 16 14:09:24 2005
@@ -0,0 +1,108 @@
+package jsf.data;
+
+import java.io.Serializable;
+
+public class PhysicianData implements Serializable
+{
+ // this is our counter to generate id's
+ private static int identifier = 0;
+
+ private int id;
+ private String specialty;
+ private String gender;
+ private String firstName;
+ private String lastName;
+ private String[] hospitalAffiliations;
+ private String school;
+ private String bio;
+
+ public PhysicianData()
+ {
+ initialize();
+ }
+
+ public PhysicianData(String specialty, String gender, String firstName, String lastName)
+ {
+ initialize();
+
+ this.specialty = specialty;
+ this.gender = gender;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ }
+
+ protected void initialize()
+ {
+ this.id = identifier++;
+ }
+
+ public String getBio() {
+ return bio;
+ }
+
+ public void setBio(String bio) {
+ this.bio = bio;
+ }
+
+ public String[] getHospitalAffiliations() {
+ return hospitalAffiliations;
+ }
+
+ public void setHospitalAffiliations(String[] hospitalAffiliations) {
+ this.hospitalAffiliations = hospitalAffiliations;
+ }
+
+ public String getSchool() {
+ return school;
+ }
+
+
+ public void setSchool(String school) {
+ this.school = school;
+ }
+
+ public String getFirstName()
+ {
+ return this.firstName;
+ }
+
+ public void setFirstName(String firstName)
+ {
+ this.firstName = firstName;
+ }
+
+ public String getLastName()
+ {
+ return this.lastName;
+ }
+
+ public void setLastName(String lastName)
+ {
+ this.lastName = lastName;
+ }
+
+ public String getSpecialty()
+ {
+ return this.specialty;
+ }
+
+ public void setSpecialty(String specialty)
+ {
+ this.specialty = specialty;
+ }
+
+ public String getGender()
+ {
+ return this.gender;
+ }
+
+ public void setGender(String gender)
+ {
+ this.gender = gender;
+ }
+
+ public int getId()
+ {
+ return id;
+ }
+}
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/data/PhysicianData.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/messages.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/messages.properties?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/messages.properties (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/messages.properties Mon May 16 14:09:24 2005
@@ -0,0 +1,10 @@
+welcome=Welcome to Your Health Care Home Page
+intro=The jsfMedWeb sample application demonstrates the integration of Java Server Faces with Page Flows.
+
+homePageComments=Comments are included at the bottom of each page. You can hide/show these comments \
+using the radio buttons below. Changing this preference sets a value in the shared flow. \
+Pages in other Page Flows bind to this shared value to determine if comments should be rendered.
+
+commentsPreferenceLabel=Comments on Each Page
+
+physicianSearchLinkText=Get started: Locate a physician in your area
\ No newline at end of file
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/messages.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/Physician.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/Physician.java?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/Physician.java (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/Physician.java Mon May 16 14:09:24 2005
@@ -0,0 +1,127 @@
+package jsf.physician;
+
+import jsf.data.AddressData;
+import jsf.data.PhysicianData;
+
+import java.io.Serializable;
+
+public class Physician implements Serializable
+{
+ public static final String FAMILY = "family";
+ public static final String SPECIALIST = "specialist";
+
+ // sub objects not visible outside of package
+ private PhysicianData physician;
+ private AddressData address;
+
+ public Physician()
+ {
+ initialize();
+ }
+
+ public Physician(String specialty, String gender, String firstName, String lastName)
+ {
+ initialize();
+
+ physician.setSpecialty(specialty);
+ physician.setGender(gender);
+ physician.setFirstName(firstName);
+ physician.setLastName(lastName);
+ physician.setSchool("University of ...");
+ String[] hospitals = {"General Hospital", "Some Other Hospital"};
+ physician.setHospitalAffiliations(hospitals);
+ physician.setBio("Dr. So and so ...");
+ }
+
+ protected void initialize()
+ {
+ this.physician = new PhysicianData();
+ this.address = new AddressData();
+ }
+
+ public String getFirstName()
+ {
+ return physician.getFirstName();
+ }
+
+ public void setFirstName(String firstName)
+ {
+ physician.setFirstName(firstName);
+ }
+
+ public String getLastName()
+ {
+ return physician.getLastName();
+ }
+
+ public void setLastName(String lastName)
+ {
+ physician.setLastName(lastName);
+ }
+
+ public String getSpecialty()
+ {
+ return physician.getSpecialty();
+ }
+
+ public void setSpecialty(String specialty)
+ {
+ physician.setSpecialty(specialty);
+ }
+
+ public String getGender()
+ {
+ return physician.getGender();
+ }
+
+ public void setGender(String gender)
+ {
+ physician.setGender(gender);
+ }
+
+ public int getId()
+ {
+ return physician.getId();
+ }
+
+ public String getCity()
+ {
+ return address.getCity();
+ }
+
+ public void setCity(String value)
+ {
+ address.setCity(value);
+ }
+
+ public String getSchool()
+ {
+ return physician.getSchool();
+ }
+
+ public void setSchool(String value)
+ {
+ physician.setSchool(value);
+ }
+
+ public String getBio()
+ {
+ return physician.getBio();
+ }
+
+ public void setBio(String value)
+ {
+ physician.setBio(value);
+ }
+
+ public String[] getHospitalAffiliations()
+ {
+ return physician.getHospitalAffiliations();
+ }
+
+ public void setHospitalAffiliations(String[] value)
+ {
+ physician.setHospitalAffiliations(value);
+ }
+
+}
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/Physician.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianDataAccess.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianDataAccess.java?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianDataAccess.java (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianDataAccess.java Mon May 16 14:09:24 2005
@@ -0,0 +1,126 @@
+package jsf.physician;
+
+import java.util.ArrayList;
+
+public class PhysicianDataAccess
+{
+ private boolean initialized = false;
+ private ArrayList results;
+ private ArrayList data;
+
+ public PhysicianDataAccess()
+ {
+ initialize();
+ }
+
+ void initialize()
+ {
+ if (initialized == false)
+ {
+ data = new ArrayList();
+
+ addPhysician(new Physician("Ear", "female", "Doc", "Watson"));
+ addPhysician(new Physician("Nose", "male", "Doctor", "Watson"));
+ addPhysician(new Physician("Throat", "female", "Ima", "Cutter"));
+ addPhysician(new Physician("Throat", "female", "Lets", "Look"));
+ addPhysician(new Physician("Ear", "male", "Bill", "Later"));
+ addPhysician(new Physician("Nose", "female", "Pay", "Now"));
+ addPhysician(new Physician("Nose", "female", "Sue", "Mee"));
+ addPhysician(new Physician("Ear", "female", "Noah", "charge"));
+ addPhysician(new Physician("Ear", "female", "Coe", "Pay"));
+ addPhysician(new Physician("Throat", "female", "Fran", "Tic"));
+ addPhysician(new Physician("Ear", "male", "Carl", "Later"));
+ addPhysician(new Physician("Ear", "female", "Kidney", "Stone"));
+ addPhysician(new Physician("Ear", "female", "Ann ", "Esthesia"));
+ addPhysician(new Physician("Throat", "male", "Serge", "Ree"));
+ addPhysician(new Physician("Nose", "male", "Al", "Imentary"));
+ addPhysician(new Physician("Nose", "male", "Hal", "Itosis"));
+ addPhysician(new Physician("Nose", "female", "Gerri", "Atric"));
+ addPhysician(new Physician("Family", "female", "Jane", "Doe"));
+ addPhysician(new Physician("Family", "male", "Bill E", "Rubin"));
+ addPhysician(new Physician("Family", "male", "Serge", "Ree"));
+ addPhysician(new Physician("Nose", "male", "Cy", "Cosis"));
+ addPhysician(new Physician("Ear", "female", "Dee", "Pression"));
+ addPhysician(new Physician("Family", "male", "Lance", "It"));
+ addPhysician(new Physician("Nose", "male", "Ed", "Eema"));
+ addPhysician(new Physician("Ear", "female", "Julie", "Plumber"));
+ addPhysician(new Physician("Throat", "female", "Marie", "Jones"));
+
+ for (int i=0; i<data.size(); i++)
+ {
+ Physician p = (Physician)data.get(i);
+
+ if (i%2 == 0)
+ p.setCity("Boulder");
+ else
+ p.setCity("Denver");
+ }
+
+ initialized = true;
+ }
+ }
+
+ ArrayList getPhysicians(Physician criteria)
+ {
+ initialize();
+
+ // new search - no results yet
+ results = null;
+
+ for (int i = 0; i < data.size(); i++)
+ {
+ Physician doc = (Physician)data.get(i);
+
+ boolean match = false;
+ if ((criteria.getSpecialty() == null) ||
+ (criteria.getSpecialty().equalsIgnoreCase(doc.getSpecialty())))
+ {
+ match = true;
+ }
+
+ if (match == true)
+ {
+ match = false;
+ if ((criteria.getCity() == null) ||
+ (criteria.getCity().equalsIgnoreCase(doc.getCity())))
+ {
+ match = true;
+ }
+ }
+
+ // add the match to the results
+ if (match == true)
+ {
+ if (results == null)
+ results = new ArrayList();
+ results.add(doc);
+ }
+ }
+
+ return results;
+ }
+
+ Physician getPhysician(int id)
+ {
+ initialize();
+ Physician physician = null;
+
+ for (int i = 0; i < data.size(); i++)
+ {
+ Physician p = (Physician)data.get(i);
+ if (p.getId() == id)
+ {
+ physician = p;
+ break;
+ }
+ }
+
+ return physician;
+ }
+
+ void addPhysician(Physician physician)
+ {
+ data.add(physician);
+
+ }
+}
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianDataAccess.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianSession.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianSession.java?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianSession.java (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianSession.java Mon May 16 14:09:24 2005
@@ -0,0 +1,156 @@
+package jsf.physician;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import javax.faces.model.DataModel;
+import javax.faces.model.ListDataModel;
+
+public class PhysicianSession
+{
+ private static final int SORT_BY_LASTNAME = 0;
+ private static final int SORT_BY_GENDER = 1;
+
+ // default is sort by name ascending
+ private boolean ascending = true;
+ private int sortBy = SORT_BY_LASTNAME;
+
+ private PhysicianDataAccess dataAccess = null;
+ private Physician searchCriteria = null;
+
+ private DataModel physiciansModel = null;
+
+ // no arg constructor
+ public PhysicianSession()
+ {
+ this.dataAccess = new PhysicianDataAccess();
+ }
+
+ public void setSearchCriteria(Physician criteria)
+ {
+ this.searchCriteria = criteria;
+ }
+
+ public Physician getSearchCriteria()
+ {
+ return this.searchCriteria;
+ }
+
+ public void addPhysician(Physician physician)
+ {
+ this.dataAccess.addPhysician(physician);
+ }
+
+ public Physician getPhysician(int id)
+ {
+ assert(this.dataAccess != null);
+ return this.dataAccess.getPhysician(id);
+ }
+
+ public ArrayList getPhysicians(Physician criteria)
+ {
+ return this.dataAccess.getPhysicians(criteria);
+ }
+
+ public DataModel getSortedPhysiciansModel()
+ {
+ assert(this.searchCriteria != null);
+ ArrayList physicians = dataAccess.getPhysicians(searchCriteria);
+ sortPhysicians(physicians);
+
+ if (physiciansModel == null)
+ {
+ physiciansModel = new ListDataModel();
+ }
+
+ physiciansModel.setWrappedData(physicians);
+
+ return this.physiciansModel;
+ }
+
+ /**
+ * sort utilities
+ */
+ private static final Comparator ASC_LASTNAME_COMPARATOR = new Comparator()
+ {
+ public int compare (Object o1, Object o2)
+ {
+ String s1 = ((Physician)o1).getLastName();
+ String s2 = ((Physician)o2).getLastName();
+ return s1.compareTo(s2);
+ }
+ };
+
+ private static final Comparator DESC_LASTNAME_COMPARATOR = new Comparator()
+ {
+ public int compare (Object o1, Object o2)
+ {
+ String s1 = ((Physician)o1).getLastName();
+ String s2 = ((Physician)o2).getLastName();
+ return s2.compareTo(s1);
+ }
+ };
+
+ private static final Comparator ASC_GENDER_COMPARATOR = new Comparator()
+ {
+ public int compare (Object o1, Object o2)
+ {
+ String s1 = ((Physician)o1).getGender();
+ String s2 = ((Physician)o2).getGender();
+ return s1.compareTo(s2);
+ }
+ };
+
+ private static final Comparator DESC_GENDER_COMPARATOR = new Comparator()
+ {
+ public int compare (Object o1, Object o2)
+ {
+ String s1 = ((Physician)o1).getGender();
+ String s2 = ((Physician)o2).getGender();
+ return s2.compareTo(s1);
+ }
+ };
+
+ private void sortPhysicians(ArrayList physicians)
+ {
+ switch (sortBy)
+ {
+ case SORT_BY_LASTNAME:
+ Collections.sort(physicians,
+ ascending ? ASC_LASTNAME_COMPARATOR : DESC_LASTNAME_COMPARATOR);
+ break;
+ case SORT_BY_GENDER:
+ Collections.sort(physicians,
+ ascending ? ASC_GENDER_COMPARATOR : DESC_GENDER_COMPARATOR);
+ break;
+ }
+ }
+
+ public String setSortByLastName()
+ {
+ if (sortBy == SORT_BY_LASTNAME)
+ {
+ ascending = !ascending;
+ }
+ else
+ {
+ sortBy = SORT_BY_LASTNAME;
+ ascending = true;
+ }
+ return "success";
+ }
+
+ public String setSortByGender()
+ {
+ if (sortBy == SORT_BY_GENDER)
+ {
+ ascending = !ascending;
+ }
+ else
+ {
+ sortBy = SORT_BY_GENDER;
+ ascending = true;
+ }
+ return "success";
+ }
+}
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physician/PhysicianSession.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physiciansFlow/messages.properties
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physiciansFlow/messages.properties?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physiciansFlow/messages.properties (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physiciansFlow/messages.properties Mon May 16 14:09:24 2005
@@ -0,0 +1,67 @@
+// search form
+physicianTypeLabel=Physician Type:
+specialistTypeLabel= SpecialistType:
+genderLabel=Gender:
+cityLabel=City:
+resultsFormatTypeLabel=Results Format
+
+// information messages
+searchResultsYes=Physicians matching your search criteria:
+searchResultsNo=No physicians matching your search criteria were found. You may want to broaden your criteria.
+mailPrompt=Ask a question or send a comment
+mailConfirmation=Your message to Dr. {0} {1} has been sent.
+detailedResults=Detailed Search Results
+
+// grid
+specialtyColumnLabel=Specialty
+genderColumnLabel=Gender
+cityColumnLabel=City
+firstNameColumnLabel=First
+lastNameColumnLabel=Last
+detailsColumnLabel=More
+detailLabel=Details
+
+// details
+schoolColumnLabel=Medical School
+hospitalsColumnLabel=Affiliations
+bioHeading=Biography
+
+// explanatory comments
+commentsHeading=Comments
+
+searchPageCommentOne=The search button demonstrates how you can pass a form \
+bean to a Page Flow action after handling the command in the backing file. \
+In this case a command handler in the backing file is called to check the value \
+the user has set for the results format. The annotation on the command handler \
+has attributes to specify the Page Flow action to call and the bean to pass to the action.
+
+searchPageCommentTwo=The "detail" links in the results table show that you can raise a Page Flow action directly. \
+In this case a request parameter is passed to identify the selected row.
+
+searchPageCommentThree=Another approach is to get the data for a single row directly from \
+the JSF Data Model (the action "physicianDetailJSFStyle" in physiciansFlow.Controller demonstrates how this is done).
+
+searchPageCommentFour=The page also shows some JSF specific features. \
+Clicking either of the "Physician Type" radio buttons generates a value change event; \
+the ValueChangeListener in the backing file toggles the enabled value of the "Specialist Type" menu.
+
+searchPageCommentFive=The results table binds to a JFS DataModel exposed as a Page Flow property \
+and a JSF dataTable tag is used to display the results. \
+Sorting is an intra page event so the sorting links call command handler actions in the backing file \
+rather than Page Flow actions.
+
+physicianDetailPageCommentOne=The links at the top of the page call Page Flow actions (don't forget \
+to put commandLinks into an <h:form>).
+
+physicianDetailPageCommentTwo=The send mail link demonstrates how to pass a form bean directly to a Page Flow \
+action. The attribute tag nested in the command tag provides the necessary name value pair.
+
+but note that the form bean must be declared in the backing file. The code below also shows how \
+actionOutputs are used to pass values on to the next page.
+
+physicianDetailPageCommentThree=The list of hospitals is handled with a jstl "forEach" tag. \
+The JSF "verbatim" tag is used to make sure the jstl output is rendered correctly.
+
+detailedResultsPageCommentOne=This page uses a JSF dataTable tag around a JSF panelGrid to display the list of results.
+
+mailConfirmationPageCommentOne=No comments
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/jsf/physiciansFlow/messages.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/log4j.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/log4j.xml?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/log4j.xml (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/log4j.xml Mon May 16 14:09:24 2005
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="BEEHIVE_FILE_LOG" class="org.apache.log4j.RollingFileAppender">
+ <param name="File" value="beehive.log"/>
+ <param name="Append" value="true"/>
+ <param name="MaxFileSize" value="500000KB"/>
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1} [%x]: %m%n"/>
+ </layout>
+ </appender>
+
+ <appender name="BEEHIVE_CONSOLE_LOG" class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern" value="%d{DATE} %-5p %-15c{1} [%x]: %m%n"/>
+ </layout>
+ </appender>
+
+ <!-- Beehive -->
+ <category name="org.apache.beehive">
+ <priority value="warn"/>
+ <appender-ref ref="BEEHIVE_CONSOLE_LOG"/>
+ </category>
+
+ <!-- NetUI Script: this allows separate configuration of script error reporting -->
+ <category name="org.apache.beehive.netui.script">
+ <priority value="error"/>
+ <appender-ref ref="BEEHIVE_CONSOLE_LOG"/>
+ </category>
+
+ <!-- Struts -->
+ <category name="org.apache.struts">
+ <priority value="warn"/>
+ <appender-ref ref="BEEHIVE_CONSOLE_LOG"/>
+ </category>
+
+ <!-- Jakarta Commons -->
+ <category name="org.apache.commons">
+ <priority value="warn"/>
+ <appender-ref ref="BEEHIVE_CONSOLE_LOG"/>
+ </category>
+
+</log4j:configuration>
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/log4j.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/shared/SharedFlow.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/shared/SharedFlow.java?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/shared/SharedFlow.java (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/shared/SharedFlow.java Mon May 16 14:09:24 2005
@@ -0,0 +1,102 @@
+/*
+ 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:$
+*/
+package shared;
+
+import java.io.IOException;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowException;
+import org.apache.beehive.netui.pageflow.SharedFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+/**
+ * This shared flow can define actions, exception handlers, and state to be shared among page flows
+ * that reference it. A page flow references this shared flow inside a <code>Jpf.Controller</code>
+ * annotation as:
+ * <pre>
+ * sharedFlowRefs={
+ * @Jpf.SharedFlowRef(name="shared", type=shared.SharedFlow.class)
+ * }
+ * </pre>
+ *
+ * Once referenced, the following features apply:
+ * <ul>
+ * <li>
+ * An instance of this shared flow will be created and stored the first time the page
+ * flow is accessed.
+ * </li>
+ * <li>
+ * The page flow (or its pages) can reference actions using the pattern
+ * <i>shared-flow-name.action-name</i>, e.g., "shared.someAction".
+ * </li>
+ * <li>
+ * Unhandled exceptions in the page flow will be handled by <code>Jpf.Catch</code>
+ * annotations in this shared flow.
+ * </li>
+ * <li>
+ * In pages and annotations that bind to data using the expression language, properties
+ * in this shared flow are accessed through the <code>sharedFlow</code> binding context.
+ * </li>
+ * <li>
+ * A page flow can have an automatically-initialized member reference to this shared
+ * flow using the <code>Jpf.SharedFlowField</code> annotation, like this:
+ * <pre>
+ * @Jpf.SharedFlowField(name="shared")
+ * private shared.SharedFlow _mySharedFlowReference;
+ * </pre>
+ * </li>
+ * </ul>
+ */
+@Jpf.Controller(
+ catches={
+ @Jpf.Catch(type=PageFlowException.class, method="handlePageFlowException"),
+ @Jpf.Catch(type=Exception.class, method="handleException")
+ }
+)
+public class SharedFlow
+ extends SharedFlowController
+{
+ @Jpf.ExceptionHandler(
+ forwards={
+ @Jpf.Forward(name="errorPage", path="/resources/beehive/version1/jsps/error.jsp")
+ }
+ )
+ protected Forward handleException(Exception ex, String actionName, String message, Object form)
+ {
+ System.err.print("[" + getRequest().getContextPath() + "] ");
+ System.err.println("Unhandled exception caught in shared flow " + getDisplayName() + ":");
+ ex.printStackTrace();
+ return new Forward("errorPage");
+ }
+
+ /**
+ * Handler for native page flow exceptions (e.g., ActionNotFoundException, which is thrown when
+ * an unknown page flow action is requested). This handler allows these exceptions to write
+ * informative error pages to the response when the server is not in production mode, and it
+ * allows them to send an appropriate error on the response when the server is in production
+ * mode. To use the standard exception handler for these exceptions, simply remove this method
+ * and the Jpf.Catch annotation that references it.
+ */
+ @Jpf.ExceptionHandler
+ public Forward handlePageFlowException(PageFlowException ex, String actionName, String message, Object form)
+ throws IOException
+ {
+ ex.sendError(getRequest(), getResponse());
+ return null;
+ }
+}
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/src/shared/SharedFlow.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/validator-rules.xml
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/validator-rules.xml?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/validator-rules.xml (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/validator-rules.xml Mon May 16 14:09:24 2005
@@ -0,0 +1,287 @@
+<!DOCTYPE form-validation PUBLIC
+ "-//Apache Software Foundation//DTD Commons Validator Rules Configuration 1.1.3//EN"
+ "http://jakarta.apache.org/commons/dtds/validator_1_1_3.dtd">
+<!--
+ $Header: /home/cvs/jakarta-struts/conf/share/validator-rules.xml,v 1.52 2004/07/25 12:00:20 niallp Exp $
+ $Revision: 1.52 $
+ $Date: 2004/07/25 12:00:20 $
+
+ This file contains the default Struts Validator pluggable validator
+ definitions. It should be placed somewhere under /WEB-INF and
+ referenced in the struts-config.xml under the plug-in element
+ for the ValidatorPlugIn.
+
+ <plug-in className="org.apache.struts.validator.ValidatorPlugIn">
+ <set-property property="pathnames" value="/WEB-INF/validator-rules.xml,
+ /WEB-INF/validation.xml"/>
+ </plug-in>
+
+ These are the default error messages associated with
+ each validator defined in this file. They should be
+ added to your projects ApplicationResources.properties
+ file or you can associate new ones by modifying the
+ pluggable validators msg attributes in this file.
+
+ # Struts Validator Error Messages
+ errors.required={0} is required.
+ errors.minlength={0} can not be less than {1} characters.
+ errors.maxlength={0} can not be greater than {1} characters.
+ errors.invalid={0} is invalid.
+
+ errors.byte={0} must be a byte.
+ errors.short={0} must be a short.
+ errors.integer={0} must be an integer.
+ errors.long={0} must be a long.
+ errors.float={0} must be a float.
+ errors.double={0} must be a double.
+
+ errors.date={0} is not a date.
+ errors.range={0} is not in the range {1} through {2}.
+ errors.creditcard={0} is an invalid credit card number.
+ errors.email={0} is an invalid e-mail address.
+
+ Note: Starting in Struts 1.2.0 the default javascript definitions have
+ been consolidated to commons-validator. The default can be overridden
+ by supplying a <javascript> element with a CDATA section, just as
+ in struts 1.1.
+
+-->
+
+<form-validation>
+
+ <global>
+
+ <validator name="required"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateRequired"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ msg="errors.required"/>
+
+ <validator name="requiredif"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateRequiredIf"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ org.apache.commons.validator.Validator,
+ javax.servlet.http.HttpServletRequest"
+ msg="errors.required"/>
+
+ <validator name="validwhen"
+ msg="errors.required"
+ classname="org.apache.struts.validator.validwhen.ValidWhen"
+ method="validateValidWhen"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ org.apache.commons.validator.Validator,
+ javax.servlet.http.HttpServletRequest"/>
+
+
+ <validator name="minlength"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateMinLength"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.minlength"
+ jsFunction="org.apache.commons.validator.javascript.validateMinLength"/>
+
+
+ <validator name="maxlength"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateMaxLength"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.maxlength"
+ jsFunction="org.apache.commons.validator.javascript.validateMaxLength"/>
+
+
+
+ <validator name="mask"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateMask"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.invalid"/>
+
+
+ <validator name="byte"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateByte"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.byte"
+ jsFunctionName="ByteValidations"/>
+
+
+ <validator name="short"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateShort"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.short"
+ jsFunctionName="ShortValidations"/>
+
+
+ <validator name="integer"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateInteger"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.integer"
+ jsFunctionName="IntegerValidations"/>
+
+
+
+ <validator name="long"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateLong"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.long"/>
+
+
+ <validator name="float"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateFloat"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.float"
+ jsFunctionName="FloatValidations"/>
+
+ <validator name="double"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateDouble"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.double"/>
+
+
+ <validator name="date"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateDate"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.date"
+ jsFunctionName="DateValidations"/>
+
+
+ <validator name="intRange"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateIntRange"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends="integer"
+ msg="errors.range"/>
+
+
+ <validator name="floatRange"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateFloatRange"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends="float"
+ msg="errors.range"/>
+
+
+ <validator name="creditCard"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateCreditCard"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.creditcard"/>
+
+
+ <validator name="email"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateEmail"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.email"/>
+
+ <validator name="url"
+ classname="org.apache.struts.validator.FieldChecks"
+ method="validateUrl"
+ methodParams="java.lang.Object,
+ org.apache.commons.validator.ValidatorAction,
+ org.apache.commons.validator.Field,
+ org.apache.struts.action.ActionMessages,
+ javax.servlet.http.HttpServletRequest"
+ depends=""
+ msg="errors.url"/>
+
+ <!--
+ This simply allows struts to include the validateUtilities into a page, it should
+ not be used as a validation rule.
+ -->
+ <validator name="includeJavaScriptUtilities"
+ classname=""
+ method=""
+ methodParams=""
+ depends=""
+ msg=""
+ jsFunction="org.apache.commons.validator.javascript.validateUtilities"/>
+
+ </global>
+
+</form-validation>
Propchange: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/validator-rules.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.myfaces
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.myfaces?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.myfaces (added)
+++ incubator/beehive/trunk/samples/netui-jsf/WEB-INF/web.xml.myfaces Mon May 16 14:09:24 2005
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+ version="2.4">
+
+ <display-name>Beehive NetUI Samples Web Application</display-name>
+
+ <!-- Filter to perform Page Flow operations when JSPs are hit directly. -->
+ <filter>
+ <filter-name>PageFlowJspFilter</filter-name>
+ <filter-class>org.apache.beehive.netui.pageflow.PageFlowJspFilter</filter-class>
+ </filter>
+
+ <!-- Filter to perform Page Flow operations when JavaServer Faces pages are hit directly. -->
+ <filter>
+ <filter-name>PageFlowFacesFilter</filter-name>
+ <filter-class>org.apache.beehive.netui.pageflow.PageFlowFacesFilter</filter-class>
+ </filter>
+
+ <!--
+ It is possible - but certainly not required - to keep source files such as page flows and
+ JavaServer Faces backing beans mixed in with web content. In this case, and when the web
+ content directory itself is being deployed without being copied to some other build
+ location, it is important to prevent the source code from being URL-addressable. This
+ filter returns a specified error code when source files are requested.
+ -->
+ <filter>
+ <filter-name>PageFlowForbiddenFilter</filter-name>
+ <filter-class>org.apache.beehive.netui.pageflow.PageFlowForbiddenFilter</filter-class>
+ <init-param>
+ <param-name>response-code</param-name>
+ <param-value>404</param-value>
+ </init-param>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>PageFlowJspFilter</filter-name>
+ <url-pattern>*.jsp</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PageFlowJspFilter</filter-name>
+ <url-pattern>*.jspx</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PageFlowFacesFilter</filter-name>
+ <url-pattern>*.faces</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <filter-mapping>
+ <filter-name>PageFlowFacesFilter</filter-name>
+ <url-pattern>*.jsf</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ <dispatcher>INCLUDE</dispatcher>
+ </filter-mapping>
+
+ <!-- Prevent URL access to Java source code. -->
+ <filter-mapping>
+ <filter-name>PageFlowForbiddenFilter</filter-name>
+ <url-pattern>*.java</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+ </filter-mapping>
+
+ <!-- Prevent URL access to JavaServer Faces backing beans. -->
+ <filter-mapping>
+ <filter-name>PageFlowForbiddenFilter</filter-name>
+ <url-pattern>*.jsfb</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+ </filter-mapping>
+
+ <!-- Prevent URL access to shared flow source files. -->
+ <filter-mapping>
+ <filter-name>PageFlowForbiddenFilter</filter-name>
+ <url-pattern>*.jpfs</url-pattern>
+ <dispatcher>REQUEST</dispatcher>
+ </filter-mapping>
+
+ <!-- Configuration/init listener for MyFaces -->
+ <listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+
+ <!-- Action Servlet Configuration (with debugging) -->
+ <servlet>
+ <servlet-name>action</servlet-name>
+ <servlet-class>org.apache.beehive.netui.pageflow.PageFlowActionServlet</servlet-class>
+ <init-param>
+ <param-name>config</param-name>
+ <param-value>/WEB-INF/.pageflow-struts-generated/jpf-struts-config.xml</param-value>
+ </init-param>
+ <init-param>
+ <param-name>debug</param-name>
+ <param-value>2</param-value>
+ </init-param>
+ <init-param>
+ <param-name>detail</param-name>
+ <param-value>2</param-value>
+ </init-param>
+ <load-on-startup>2</load-on-startup>
+ </servlet>
+
+ <!-- The XmlHttpRequest handler Servlet -->
+ <servlet>
+ <servlet-name>XmlHttpRequestServlet</servlet-name>
+ <servlet-class>org.apache.beehive.netui.pageflow.xmlhttprequest.XmlHttpRequestServlet</servlet-class>
+ </servlet>
+
+ <!-- Faces Servlet -->
+ <servlet>
+ <servlet-name>Faces Servlet</servlet-name>
+ <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
+ <load-on-startup> 1 </load-on-startup>
+ </servlet>
+
+ <!-- Struts Action Servlet Mappings -->
+ <!-- Note that because Struts takes the *last* mapping here as the extension to add to
+ actions posted from forms, we must have *.do come after *.jpf (etc.). -->
+ <servlet-mapping>
+ <servlet-name>action</servlet-name>
+ <url-pattern>*.jpf</url-pattern>
+ </servlet-mapping>
+
+ <servlet-mapping>
+ <servlet-name>action</servlet-name>
+ <url-pattern>*.do</url-pattern>
+ </servlet-mapping>
+
+ <!-- XmlHttpRequest Servlet -->
+ <servlet-mapping>
+ <servlet-name>XmlHttpRequestServlet</servlet-name>
+ <url-pattern>*.xhr</url-pattern>
+ </servlet-mapping>
+
+ <!-- Faces Servlet Mapping -->
+ <servlet-mapping>
+ <servlet-name>Faces Servlet</servlet-name>
+ <url-pattern>*.faces</url-pattern>
+ </servlet-mapping>
+
+ <welcome-file-list>
+ <welcome-file>index.jsp</welcome-file>
+ </welcome-file-list>
+</web-app>
+
Added: incubator/beehive/trunk/samples/netui-jsf/index.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/index.jsp?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/index.jsp (added)
+++ incubator/beehive/trunk/samples/netui-jsf/index.jsp Mon May 16 14:09:24 2005
@@ -0,0 +1,32 @@
+<%--
+ 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-template:template templatePage="/resources/template/template.jsp">
+ <netui-template:setAttribute name="samTitle" value="Home Page"/>
+ <netui-template:section name="main">
+ <p>The following sample demonstrates integration of JavaServer Faces with Page Flow.
+ </p>
+ <dl>
+ <dt><a href="jsf/Controller.jpf">JSF Health Care Sample</a></dt>
+ </dl>
+ </netui-template:section>
+</netui-template:template>
Propchange: incubator/beehive/trunk/samples/netui-jsf/index.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/jsf/Controller.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/jsf/Controller.java?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/jsf/Controller.java (added)
+++ incubator/beehive/trunk/samples/netui-jsf/jsf/Controller.java Mon May 16 14:09:24 2005
@@ -0,0 +1,21 @@
+package jsf;
+
+import javax.servlet.http.HttpSession;
+
+import org.apache.beehive.netui.pageflow.Forward;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+
+@Jpf.Controller(
+ simpleActions={
+ @Jpf.SimpleAction(name="begin", path="home.faces"),
+ @Jpf.SimpleAction(name="locatePhysician", path="/jsf/physiciansFlow/Controller.jpf")
+ },
+ sharedFlowRefs={
+ @Jpf.SharedFlowRef(name="shared", type=jsf.SharedFlow.class)
+ }
+)
+public class Controller
+ extends PageFlowController
+{
+}
Propchange: incubator/beehive/trunk/samples/netui-jsf/jsf/Controller.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/jsf/error.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/jsf/error.jsp?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/jsf/error.jsp (added)
+++ incubator/beehive/trunk/samples/netui-jsf/jsf/error.jsp Mon May 16 14:09:24 2005
@@ -0,0 +1,69 @@
+<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
+<netui:html>
+ <head>
+ <title>NetUI Error</title>
+ <style>
+ table {
+ border: solid 1pt #90180F;
+ background-color: #ffffff;
+ }
+ body {
+ margin: 20pt 5%;
+ background-color: #fdf4b6;
+ font-family: Arial, Helvetica, sans-serif;
+ font-size: 10pt;
+ }
+ .caption {
+ font-weight: bold;
+ font-size: 20pt;
+ text-align: left;
+ width: 500px
+ }
+ th {vertical-align: top;
+ text-align: right;
+ font-size: 12pt;
+ color: #90180F;
+ width: 100px;
+ }
+ td {
+ text-align: left;
+ }
+ hr {
+ color: #90180F;
+ }
+ .posTitle {
+ position: relative;
+ color: #6C0C06;
+ left: -160pt;
+ top: -12pt;
+ }
+ .pfErrorLineOne {
+ color: red;
+ font-size: 12pt;
+ font-style: italic;
+ }
+ img {
+ border: solid 2pt #90180F;
+ }
+ </style>
+ <netui:base/>
+ </head>
+ <netui:body>
+ <div class="caption">
+ <netui:image src="${pageContext.request.contextPath}/resources/beehive/version1/images/error-header.jpg" width="338" height="96" alt="Page Flow Error"/>
+ <span class="posTitle">NetUI Error</span>
+ </div>
+ <table border="0" cellspacing='0' cellpadding='4'>
+ <c:if test="${request.errorMessage != null}">
+ <tr><th>Message:</th><td class="pfErrorLineOne"><netui:label value="${request.errorMessage}" defaultValue=" "/></td></tr>
+ </c:if>
+ <tr><th>Exception:</th><td class="pfErrorLineOne"><netui:exceptions showMessage="true"/></td></tr>
+ <tr><td colspan="2" style="min-width:342"><hr></td></tr>
+ <tr><th>Stack Trace:</th><td><netui:exceptions showMessage="false" showDevModeStackTrace="true"/></td></tr>
+ </table>
+ </netui:body>
+</netui:html>
+<%-- Some browsers will not display this page unless the response status code is 200. --%>
+<% response.setStatus(200); %>
Propchange: incubator/beehive/trunk/samples/netui-jsf/jsf/error.jsp
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/jsf/home.java
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/jsf/home.java?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/jsf/home.java (added)
+++ incubator/beehive/trunk/samples/netui-jsf/jsf/home.java Mon May 16 14:09:24 2005
@@ -0,0 +1,83 @@
+package jsf;
+
+import org.apache.beehive.netui.pageflow.FacesBackingBean;
+import org.apache.beehive.netui.pageflow.annotations.Jpf;
+import org.apache.beehive.netui.pageflow.PageFlowController;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+import javax.faces.event.ValueChangeEvent;
+
+
+/**
+ * This is the backing bean for JSF page "home.faces" (home.jsp).
+ */
+@Jpf.FacesBacking
+public class home extends FacesBackingBean
+{
+ @Jpf.SharedFlowField(name="shared")
+ SharedFlow sharedFlow;
+
+ /**
+ * Get the current commentsPreference
+ */
+ protected void onCreate()
+ {
+ boolean pref = sharedFlow.getCommentsPreference();
+
+ if (pref == false)
+ setCommentsPreference("hide");
+ else
+ setCommentsPreference("show");
+ }
+
+ protected FacesContext getFacesContext() {
+ return FacesContext.getCurrentInstance();
+ }
+
+ private String commentsPreference = "show";
+
+ public String getCommentsPreference()
+ {
+ return this.commentsPreference;
+ }
+
+ public void setCommentsPreference(String value)
+ {
+ this.commentsPreference = value;
+ }
+
+ /**
+ * Comments preference options
+ */
+ private SelectItem[] commentsPreferenceOptions = {
+ new SelectItem("hide", "Hide"),
+ new SelectItem("show", "Show")
+ };
+
+ public SelectItem[] getCommentsPreferenceOptions()
+ {
+ return this.commentsPreferenceOptions;
+ }
+
+ /**
+ * Handler for comments preference
+ */
+ public void commentsPreferenceChange(ValueChangeEvent vce)
+ {
+ // get the new value from the component
+ if (vce.getNewValue().equals("hide"))
+ {
+ setCommentsPreference("hide");
+ sharedFlow.setCommentsPreference(false);
+ }
+ else
+ {
+ setCommentsPreference("show");
+ sharedFlow.setCommentsPreference(true);
+ }
+
+ // bypass validation of other components by jumping to render response
+ getFacesContext().renderResponse();
+ }
+}
Propchange: incubator/beehive/trunk/samples/netui-jsf/jsf/home.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/beehive/trunk/samples/netui-jsf/jsf/home.jsp
URL: http://svn.apache.org/viewcvs/incubator/beehive/trunk/samples/netui-jsf/jsf/home.jsp?rev=170448&view=auto
==============================================================================
--- incubator/beehive/trunk/samples/netui-jsf/jsf/home.jsp (added)
+++ incubator/beehive/trunk/samples/netui-jsf/jsf/home.jsp Mon May 16 14:09:24 2005
@@ -0,0 +1,64 @@
+<%@ taglib prefix="f" uri="http://java.sun.com/jsf/core" %>
+<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html" %>
+<html>
+ <head>
+ <link rel="stylesheet" type="text/css" href="style.css" >
+ </head>
+ <body>
+ <f:view>
+ <f:loadBundle var="msgs" basename="jsf.messages" />
+ <h:form>
+ <!-- heading -->
+ <table align="center" style="margin-bottom: 15px" >
+ <tr>
+ <td>
+ <h:panelGrid columns="1" >
+ <f:facet name="header" >
+ <h:outputText value="#{msgs.welcome}" style="font-size: 24; font-weight: bold" />
+ </f:facet>
+ </h:panelGrid>
+ </td>
+ </tr>
+ </table>
+
+ <!-- intro -->
+ <table align="center" width="50%" style="margin-bottom: 15px; border: 1px solid blue; background-color: EEF3FB">
+ <tr>
+ <td>
+ <blockquote>
+ <h:outputText value="#{msgs.intro}" />
+ </blockquote>
+ <blockquote>
+ <h:outputText value="#{msgs.homePageComments}" />
+ </blockquote>
+ </td>
+ </tr>
+ </table>
+
+ <!-- link to physicians page flow -->
+ <table align="center" style="margin-bottom: 30px" >
+ <tr>
+ <td>
+ <h:commandLink action="locatePhysician" value="#{msgs.physicianSearchLinkText}" rendered="true"/>
+ </td>
+ </tr>
+ </table>
+
+ <!-- preferences -->
+ <table align="center" style="border: solid 1px blue" cellpadding="5">
+ <tr>
+ <td>
+ <h:outputLabel value="#{msgs.commentsPreferenceLabel}" for="commentsPreference" styleClass="widgetLabel" />
+ <h:selectOneRadio value="#{backing.commentsPreference}" id="commentsPreference" immediate="true" valueChangeListener="#{backing.commentsPreferenceChange}" onclick="onChange=this.form.submit();" layout="pageDirection" >
+ <f:selectItems value="#{backing.commentsPreferenceOptions}" id="commentsPreferenceOptions" />
+ </h:selectOneRadio>
+ </td>
+ </tr>
+ </tr>
+ </table>
+ </h:form>
+ </f:view>
+ </body>
+</html>
+
+
Propchange: incubator/beehive/trunk/samples/netui-jsf/jsf/home.jsp
------------------------------------------------------------------------------
svn:eol-style = native