You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by mr...@apache.org on 2005/09/02 03:25:25 UTC
svn commit: r265811 [1/2] - in /struts/sandbox/trunk/ti: ./
jars/core/src/java/org/apache/ti/ wars/samples-jsf/ wars/samples-jsf/src/
wars/samples-jsf/src/java/ wars/samples-jsf/src/java/jsf/
wars/samples-jsf/src/java/jsf/physiciansFlow/ wars/samples-j...
Author: mrdon
Date: Thu Sep 1 18:25:16 2005
New Revision: 265811
URL: http://svn.apache.org/viewcvs?rev=265811&view=rev
Log:
Adding JSF sample application
PR: 36454
Added:
struts/sandbox/trunk/ti/wars/samples-jsf/
struts/sandbox/trunk/ti/wars/samples-jsf/project.properties
struts/sandbox/trunk/ti/wars/samples-jsf/project.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/Controller.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/home.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/Controller.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/physicianDetail.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/physicianResultsWithDetail.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/search.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/SharedFlow.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/AddressData.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/PhysicianData.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/Physician.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/PhysicianDataAccess.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/PhysicianSession.java
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-Controller.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-home.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-physicianDetail.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-physicianResultsWithDetail.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-search.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/physiciansFlow/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/physiciansFlow/xwork.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/xwork.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/apache/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/apache/beehive/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/apache/beehive/samples/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/apache/beehive/samples/netui/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/apache/beehive/samples/netui/jsf/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/apache/beehive/samples/netui/jsf/xwork.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/log4j.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/messages.properties
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/physiciansFlow/
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/physiciansFlow/messages.properties
struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/site.properties
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/faces-config.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/web.xml
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/web.xml.jsf-ri
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/index.jsp
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/home.jsp
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/confirmMailSent.jsp
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/physicianDetail.jsp
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/physicianResultsWithDetail.jsp
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/search.jsp
struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/style.css
Modified:
struts/sandbox/trunk/ti/jars/core/src/java/org/apache/ti/Globals.java
struts/sandbox/trunk/ti/project.xml
Modified: struts/sandbox/trunk/ti/jars/core/src/java/org/apache/ti/Globals.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/jars/core/src/java/org/apache/ti/Globals.java?rev=265811&r1=265810&r2=265811&view=diff
==============================================================================
--- struts/sandbox/trunk/ti/jars/core/src/java/org/apache/ti/Globals.java (original)
+++ struts/sandbox/trunk/ti/jars/core/src/java/org/apache/ti/Globals.java Thu Sep 1 18:25:16 2005
@@ -22,9 +22,7 @@
import java.io.Serializable;
/**
- * Global manifest constants for the entire Struts Framework.
- *
- * @version $Rev: 170121 $ $Date: 2005-05-13 23:09:32 -0600 (Fri, 13 May 2005) $
+ * @todo Should this class simply go away? Do we want to expose public constants for these things (vs. APIs)?
*/
public class Globals implements Serializable {
Modified: struts/sandbox/trunk/ti/project.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/project.xml?rev=265811&r1=265810&r2=265811&view=diff
==============================================================================
--- struts/sandbox/trunk/ti/project.xml (original)
+++ struts/sandbox/trunk/ti/project.xml Thu Sep 1 18:25:16 2005
@@ -450,10 +450,7 @@
<dependency>
<groupId>myfaces</groupId>
<artifactId>myfaces-jsf-api</artifactId>
- <version>1.0.9rc3</version>
- <properties>
- <war.bundle>true</war.bundle>
- </properties>
+ <version>1.0.9</version>
</dependency>
<dependency>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/project.properties
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/project.properties?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/project.properties (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/project.properties Thu Sep 1 18:25:16 2005
@@ -0,0 +1 @@
+maven.compile.source=1.5
Added: struts/sandbox/trunk/ti/wars/samples-jsf/project.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/project.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/project.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/project.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,80 @@
+<?xml version="1.0"?>
+<!--
+/*
+ * Copyright 2001-2004 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.
+ */
+ -->
+
+
+<project>
+
+ <extend>../../project.xml</extend>
+ <groupId>struts</groupId>
+ <artifactId>struts-ti-jsf</artifactId>
+ <name>Struts Ti / JSF Sample Application</name>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>${maven.src.dir}/resources</directory>
+ <includes>
+ <include>**/*.properties</include>
+ <include>**/*.xml</include>
+ </includes>
+ </resource>
+ </resources>
+ </build>
+ <dependencies>
+ <dependency>
+ <groupId>struts</groupId>
+ <artifactId>struts-ti-core</artifactId>
+ <version>${pom.currentVersion}</version>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>struts</groupId>
+ <artifactId>struts-ti-java5</artifactId>
+ <version>${pom.currentVersion}</version>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>myfaces</groupId>
+ <artifactId>myfaces</artifactId>
+ <version>1.0.9</version>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <id>jstl</id>
+ <version>1.1.2</version>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ <dependency>
+ <groupId>taglibs</groupId>
+ <artifactId>standard</artifactId>
+ <version>1.1.2</version>
+ <properties>
+ <war.bundle>true</war.bundle>
+ </properties>
+ </dependency>
+ </dependencies>
+</project>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/Controller.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/Controller.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/Controller.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/Controller.java Thu Sep 1 18:25:16 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:$
+ */
+package jsf;
+
+import javax.servlet.http.HttpSession;
+
+import org.apache.ti.pageflow.Forward;
+import org.apache.ti.pageflow.PageFlowController;
+import org.apache.ti.pageflow.annotations.ti;
+
+@ti.controller(
+ simpleActions={
+ @ti.simpleAction(name="begin", path="home.faces"),
+ @ti.simpleAction(name="locatePhysician", path="/jsf/physiciansFlow/Controller.jpf")
+ },
+ sharedFlowRefs={
+ @ti.sharedFlowRef(name="shared", type=org.apache.beehive.samples.netui.jsf.SharedFlow.class)
+ }
+)
+public class Controller
+ extends PageFlowController
+{
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/home.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/home.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/home.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/home.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,103 @@
+/*
+ * 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 jsf;
+
+import org.apache.ti.pageflow.FacesBackingBean;
+import org.apache.ti.pageflow.annotations.ti;
+import org.apache.ti.pageflow.PageFlowController;
+
+import javax.faces.context.FacesContext;
+import javax.faces.model.SelectItem;
+import javax.faces.event.ValueChangeEvent;
+
+import org.apache.beehive.samples.netui.jsf.SharedFlow;
+
+
+/**
+ * This is the backing bean for JSF page "home.faces" (home.jsp).
+ */
+@ti.facesBacking
+public class home extends FacesBackingBean
+{
+ @ti.sharedFlowField(name="shared")
+ SharedFlow sharedFlow;
+
+ /**
+ * Get the current notesPreference
+ */
+ protected void onCreate()
+ {
+ setNotesPreference("show");
+
+ /* Shared flow isn't hooked up yet -- until then, this won't work
+ boolean pref = sharedFlow.getNotesPreference();
+
+ if (pref == false)
+ setNotesPreference("hide");
+ else
+ setNotesPreference("show");
+ */
+ }
+
+ protected FacesContext getFacesContext() {
+ return FacesContext.getCurrentInstance();
+ }
+
+ private String notesPreference = "show";
+
+ public String getNotesPreference()
+ {
+ return this.notesPreference;
+ }
+
+ public void setNotesPreference(String value)
+ {
+ this.notesPreference = value;
+ }
+
+ /**
+ * Notes preference options
+ */
+ private SelectItem[] notesPreferenceOptions = {
+ new SelectItem("hide", "Hide"),
+ new SelectItem("show", "Show")
+ };
+
+ public SelectItem[] getNotesPreferenceOptions()
+ {
+ return this.notesPreferenceOptions;
+ }
+
+ /**
+ * Handler for notes preference
+ */
+ public void notesPreferenceChange(ValueChangeEvent vce)
+ {
+ // get the new value from the component
+ if (vce.getNewValue().equals("hide"))
+ {
+ setNotesPreference("hide");
+ sharedFlow.setNotesPreference(false);
+ }
+ else
+ {
+ setNotesPreference("show");
+ sharedFlow.setNotesPreference(true);
+ }
+ }
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/Controller.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/Controller.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/Controller.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/Controller.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,247 @@
+/*
+ * 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 jsf.physiciansFlow;
+
+import java.io.Serializable;
+
+import javax.faces.model.DataModel;
+import javax.servlet.http.HttpSession;
+import javax.servlet.http.HttpServletRequest;
+
+import org.apache.ti.pageflow.FormData;
+import org.apache.ti.pageflow.Forward;
+import org.apache.ti.pageflow.PageFlowController;
+import org.apache.ti.pageflow.annotations.ti;
+import org.apache.ti.util.type.TypeUtils;
+
+import org.apache.beehive.samples.netui.jsf.physician.Physician;
+import org.apache.beehive.samples.netui.jsf.physician.PhysicianSession;
+
+/**
+ * This page flow controller for the physicians page flow.
+ */
+@ti.controller(
+ simpleActions={
+ @ti.simpleAction(name="begin", action="physicianSearch"),
+ @ti.simpleAction(name="physicianSearch", path="search.faces")
+ },
+ sharedFlowRefs={
+ @ti.sharedFlowRef(name="shared", type=org.apache.beehive.samples.netui.jsf.SharedFlow.class)
+ }
+)
+public class Controller
+ extends PageFlowController
+{
+ //
+ // Data Retrieval
+ //
+
+ // this object retrieves the data
+ private transient PhysicianSession physicianSession = null;
+
+ // the data model is used across pages so it is kept in the
+ // page flow rather than passed via an Action Output on the request
+ private transient DataModel results = null;
+
+ public DataModel getResults() {
+ return results;
+ }
+
+ void setResults(DataModel value) {
+ results = value;
+ }
+
+ /**
+ * find physicians based on criteria
+ */
+ protected void searchPhysicians(Physician criteria)
+ {
+ physicianSession.setSearchCriteria(criteria);
+ results = physicianSession.getSortedPhysiciansModel();
+ }
+
+ public void sortByGender()
+ {
+ // change the sort key
+ physicianSession.setSortByGender();
+ results = physicianSession.getSortedPhysiciansModel();
+ }
+
+ public void sortByLastName()
+ {
+ // change the sort key
+ physicianSession.setSortByLastName();
+ results = physicianSession.getSortedPhysiciansModel();
+ }
+
+ //
+ // Page Flow Lifecycle
+ //
+
+ /**
+ * Callback that is invoked when this controller instance is created.
+ */
+ protected void onCreate()
+ {
+ this.physicianSession = new PhysicianSession();
+ }
+
+ /**
+ * Callback that is invoked when this controller instance is destroyed.
+ */
+ protected void onDestroy(HttpSession session)
+ {
+ }
+
+ //
+ // Page Flow Actions
+ //
+ @ti.action(
+ forwards={
+ @ti.forward(
+ name="success",
+ path="physicianDetail.faces",
+ actionOutputs={
+ @ti.actionOutput(name="physician", type=Physician.class, required=true)
+ }
+ )
+ }
+ )
+ protected Forward physicianDetail()
+ {
+ Forward success = new Forward("success");
+
+ String paramValue = (String) getContext().getWebContext().getParam().get("physicianId");
+ int id = TypeUtils.convertToInt(paramValue);
+ Physician physician = physicianSession.getPhysician(id);
+ success.addActionOutput("physician", physician);
+ return success;
+ }
+
+
+ /*
+ * This action is equivalent to the "physicianDetail" action above
+ * but the row data (physician) is gotten directly from the JSF DataModel.
+ */
+ @ti.action(
+ forwards={
+ @ti.forward(
+ name="success",
+ path="physicianDetail.faces",
+ actionOutputs={
+ @ti.actionOutput(
+ name="physician",
+ type=Physician.class,
+ required=true
+ )
+ }
+ )
+ }
+ )
+ protected Forward physicianDetailJSFStyle()
+ {
+ Forward success = new Forward("success");
+
+ assert(this.results != null);
+ Physician physician = (Physician)results.getRowData();
+ success.addActionOutput("physician", physician);
+ return success;
+ }
+
+ @ti.action(
+ forwards={
+ @ti.forward(name="success", navigateTo=ti.NavigateTo.currentPage)
+ }
+ )
+ protected Forward displayPhysiciansAbbreviated(PhysicianSearchForm form)
+ {
+ Forward success = new Forward("success");
+ searchPhysicians(form.getSearchCriteria());
+ return success;
+ }
+
+ @ti.action(
+ forwards={
+ @ti.forward(name="success", path="physicianResultsWithDetail.faces")
+ }
+ )
+ protected Forward displayPhysiciansWithDetail(PhysicianSearchForm form)
+ {
+ Forward success = new Forward("success");
+ searchPhysicians(form.getSearchCriteria());
+ return success;
+ }
+
+ @ti.action(
+ forwards={
+ @ti.forward(name="success", path="confirmMailSent.faces")
+ }
+ )
+ protected Forward submitMailMessage(MailMessageForm form)
+ {
+ Forward success = new Forward("success");
+ success.addActionOutput("mailMessage", form.getMessage());
+ success.addActionOutput("firstName", form.getPhysician().getFirstName());
+ success.addActionOutput("lastName", form.getPhysician().getLastName());
+ return success;
+ }
+
+ //
+ // Form Beans
+ //
+ public static class MailMessageForm implements Serializable
+ {
+ private Physician physician;
+ private String message;
+
+ public void setMessage(String message)
+ {
+ this.message = message;
+ }
+
+ public String getMessage()
+ {
+ return this.message;
+ }
+
+ public void setPhysician(Physician physician)
+ {
+ this.physician = physician;
+ }
+
+ public Physician getPhysician()
+ {
+ return this.physician;
+ }
+ }
+
+ public static class PhysicianSearchForm implements Serializable
+ {
+ private Physician searchCriteria;
+
+ public void setSearchCriteria(Physician criteria)
+ {
+ this.searchCriteria = criteria;
+ }
+
+ public Physician getSearchCriteria()
+ {
+ return this.searchCriteria;
+ }
+ }
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/physicianDetail.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/physicianDetail.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/physicianDetail.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/physicianDetail.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,52 @@
+/*
+ * 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 jsf.physiciansFlow;
+
+import org.apache.ti.pageflow.FacesBackingBean;
+import org.apache.ti.pageflow.annotations.ti;
+
+import jsf.physiciansFlow.Controller.MailMessageForm;
+import org.apache.beehive.samples.netui.jsf.physician.Physician;
+
+/**
+ * This is the backing bean for JSF page "physicianDetail.faces" (physicianDetail.jsp).
+ */
+@ti.facesBacking
+public class physicianDetail extends FacesBackingBean
+{
+ private MailMessageForm mailForm = new MailMessageForm();
+
+ protected void onCreate()
+ {
+ // Initialize the MailMessageForm with the passed-in page input (passed as an action output
+ // from the calling action. We will pass this form bean to action "submitMailMessage" from
+ // a commandButton on physicianDetail.jsp.
+ mailForm = new MailMessageForm();
+ mailForm.setPhysician((Physician) getPageInput("physician"));
+ }
+
+ public void setMailForm(MailMessageForm form)
+ {
+ mailForm = form;
+ }
+
+ public MailMessageForm getMailForm()
+ {
+ return mailForm;
+ }
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/physicianResultsWithDetail.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/physicianResultsWithDetail.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/physicianResultsWithDetail.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/physicianResultsWithDetail.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,29 @@
+/*
+ * 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 jsf.physiciansFlow;
+
+import org.apache.ti.pageflow.FacesBackingBean;
+import org.apache.ti.pageflow.annotations.ti;
+
+/**
+ * This is the backing bean for JSF page "physicianResultsWithDetail.faces" (physicianResultsWithDetail.faces).
+ */
+@ti.facesBacking
+public class physicianResultsWithDetail extends FacesBackingBean
+{
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/search.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/search.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/search.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/jsf/physiciansFlow/search.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,233 @@
+/*
+ * 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 jsf.physiciansFlow;
+
+import javax.faces.component.UIComponent;
+import javax.faces.component.html.HtmlCommandButton;
+import javax.faces.component.html.HtmlSelectOneMenu;
+import javax.faces.component.html.HtmlSelectOneRadio;
+import javax.faces.context.ExternalContext;
+import javax.faces.context.FacesContext;
+import javax.faces.event.ActionEvent;
+import javax.faces.model.SelectItem;
+
+import org.apache.ti.pageflow.FacesBackingBean;
+import org.apache.ti.pageflow.PageFlowController;
+import org.apache.ti.pageflow.annotations.ti;
+
+import org.apache.beehive.samples.netui.jsf.physician.Physician;
+import jsf.physiciansFlow.Controller.PhysicianSearchForm;
+
+/**
+ * This is the backing bean for JSF page "search.faces" (search.jsp).
+ */
+@ti.facesBacking
+public class search extends FacesBackingBean
+{
+ @ti.pageFlowField
+ Controller pageFlow;
+
+ // page flow action form containing search criteria
+ // will be passed to page flow action
+ public PhysicianSearchForm searchForm = new PhysicianSearchForm();
+
+ // a bean to hold the search criteria input by the user
+ private Physician criteria;
+
+ // The type of physician - see "types" below
+ private String physicianType = Physician.FAMILY;
+
+ // start with the specialist choices disabled
+ private boolean specialistsDisabled = true;
+
+ // default setting is abbreviated results
+ private boolean showDetailedResults = false;
+
+ // The type of physician - see "types" below
+ private String resultFormatType = "shortFormat";
+
+ // Physician types
+ private SelectItem[] physicianTypes = {
+ new SelectItem(Physician.FAMILY, "Family Doctor"),
+ new SelectItem(Physician.SPECIALIST, "Specialist")
+ };
+
+ // Specialist types
+ private SelectItem[] specialistTypes = {
+ new SelectItem("ear", "ear"),
+ new SelectItem("nose", "nose"),
+ new SelectItem("throat", "throat")
+ };
+
+ // city options
+ private SelectItem[] cities = {
+ new SelectItem("Boulder", "Boulder"),
+ new SelectItem("Denver", "Denver")
+ };
+
+ // result format types (minimal info or lots of info)
+ private SelectItem[] resultFormatTypes = {
+ new SelectItem("shortFormat", "Abbreviated Physician Information"),
+ new SelectItem("detailedFormat", "Detailed Physician Information"),
+ };
+
+ protected FacesContext getFacesContext() {
+ return FacesContext.getCurrentInstance();
+ }
+
+ // get the current notesPreference
+ protected void onCreate()
+ {
+ criteria = new Physician();
+ criteria.setSpecialty(Physician.FAMILY);
+ }
+
+ protected void onDestroy()
+ {
+
+ }
+
+ /*
+ * getter for the "form" bean
+ */
+ public Physician getCriteria()
+ {
+ return this.criteria;
+ }
+
+ //
+ // Getters and setters for component values used in the search form
+ //
+ public String getPhysicianType()
+ {
+ return this.physicianType;
+ }
+
+ public void setPhysicianType(String type)
+ {
+ this.physicianType = type;
+ }
+
+ public String getResultFormatType()
+ {
+ return this.resultFormatType;
+ }
+
+ public void setResultFormatType(String type)
+ {
+ this.resultFormatType = type;
+ }
+
+ /**
+ * the specialist menu is enabled when the user chooses
+ * specialist from the physician type selector
+ */
+ public boolean getSpecialistsDisabled()
+ {
+ return this.specialistsDisabled;
+ }
+
+ private void setSpecialistsDisabled(boolean value)
+ {
+ this.specialistsDisabled = value;
+ }
+
+ //
+ // getters for all the selector components
+ //
+ public SelectItem[] getPhysicianTypes()
+ {
+ return this.physicianTypes;
+ }
+
+ public SelectItem[] getSpecialistTypes()
+ {
+ return this.specialistTypes;
+ }
+
+ public SelectItem[] getCities()
+ {
+ return this.cities;
+ }
+
+ public SelectItem[] getResultFormatTypes()
+ {
+ return this.resultFormatTypes;
+ }
+
+ // handler for selector interactions
+ public void physicianTypeChange(javax.faces.event.ValueChangeEvent vce)
+ {
+ // get the new value from the component
+ if (vce.getNewValue().equals(Physician.FAMILY))
+ {
+ setSpecialistsDisabled(true);
+ }
+ else
+ {
+ setSpecialistsDisabled(false);
+ }
+
+ // bypass validation of other components by jumping to render response
+ getFacesContext().renderResponse();
+ }
+
+ /**
+ * Action handler for the search command
+ * Pass the search form to one of two Page Flow actions,
+ * based on the users choice of results format
+ */
+ @ti.commandHandler(
+ raiseActions = {
+ @ti.raiseAction(action="displayPhysiciansWithDetail", outputFormBean="searchForm"),
+ @ti.raiseAction(action="displayPhysiciansAbbreviated", outputFormBean="searchForm")
+ }
+ )
+ public String execute()
+ {
+ // if the physician type is set to "Family Practicioner" ignore the value of specialty
+ if (physicianType.equals(Physician.FAMILY))
+ criteria.setSpecialty(Physician.FAMILY);
+
+ // put the criteria into the form that is passed to the page flow actions
+ searchForm.setSearchCriteria(criteria);
+
+ // If the user wants the detail format for results
+ // we use a different page to present the results
+ if (resultFormatType.equals("detailedFormat"))
+ {
+ return "displayPhysiciansWithDetail";
+ }
+ else // abbreviated results
+ {
+ return "displayPhysiciansAbbreviated";
+ }
+ }
+
+ public String sortByLastName()
+ {
+ pageFlow.sortByLastName();
+ return null; // stay on the page
+ }
+
+ public String sortByGender()
+ {
+ pageFlow.sortByGender();
+ return null; // stay on the page
+ }
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/SharedFlow.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/SharedFlow.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/SharedFlow.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/SharedFlow.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,47 @@
+/*
+ * 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 org.apache.beehive.samples.netui.jsf;
+
+import java.io.IOException;
+
+import org.apache.ti.pageflow.Forward;
+import org.apache.ti.pageflow.PageFlowException;
+import org.apache.ti.pageflow.SharedFlowController;
+import org.apache.ti.pageflow.annotations.ti;
+
+@ti.controller(
+ simpleActions={
+ @ti.simpleAction(name="home", path="/jsf/Controller.jpf")
+ }
+)
+
+public class SharedFlow
+ extends SharedFlowController
+{
+ private boolean notesPreference = true;
+
+ public void setNotesPreference(boolean value)
+ {
+ this.notesPreference = value;
+ }
+
+ public boolean getNotesPreference()
+ {
+ return this.notesPreference;
+ }
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/AddressData.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/AddressData.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/AddressData.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/AddressData.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,84 @@
+/*
+ * 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 org.apache.beehive.samples.netui.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;
+ }
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/PhysicianData.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/PhysicianData.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/PhysicianData.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/data/PhysicianData.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,125 @@
+/*
+ * 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 org.apache.beehive.samples.netui.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;
+ }
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/Physician.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/Physician.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/Physician.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/Physician.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,144 @@
+/*
+ * 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 org.apache.beehive.samples.netui.jsf.physician;
+
+import org.apache.beehive.samples.netui.jsf.data.AddressData;
+import org.apache.beehive.samples.netui.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);
+ }
+
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/PhysicianDataAccess.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/PhysicianDataAccess.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/PhysicianDataAccess.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/PhysicianDataAccess.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,143 @@
+/*
+ * 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 org.apache.beehive.samples.netui.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);
+
+ }
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/PhysicianSession.java
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/PhysicianSession.java?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/PhysicianSession.java (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/java/org/apache/beehive/samples/netui/jsf/physician/PhysicianSession.java Thu Sep 1 18:25:16 2005
@@ -0,0 +1,173 @@
+/*
+ * 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 org.apache.beehive.samples.netui.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";
+ }
+}
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-Controller.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-Controller.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-Controller.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-Controller.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<processed-annotations>
+ <type-name>Controller</type-name>
+ <annotated-element>
+ <element-name>sharedFlow</element-name>
+ <annotation>
+ <annotation-name>org.apache.ti.pageflow.annotations.ti.sharedFlowField</annotation-name>
+ <annotation-attribute>
+ <attribute-name>name</attribute-name>
+ <string-value>shared</string-value>
+ </annotation-attribute>
+ </annotation>
+ </annotated-element>
+</processed-annotations>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-home.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-home.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-home.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-home.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<processed-annotations>
+ <type-name>jsf.home</type-name>
+ <annotated-element>
+ <element-name>jsf.home</element-name>
+ <annotation>
+ <annotation-name>org.apache.ti.pageflow.annotations.ti.facesBacking</annotation-name>
+ </annotation>
+ </annotated-element>
+ <annotated-element>
+ <element-name>sharedFlow</element-name>
+ <annotation>
+ <annotation-name>org.apache.ti.pageflow.annotations.ti.sharedFlowField</annotation-name>
+ <annotation-attribute>
+ <attribute-name>name</attribute-name>
+ <string-value>shared</string-value>
+ </annotation-attribute>
+ </annotation>
+ </annotated-element>
+</processed-annotations>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-physicianDetail.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-physicianDetail.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-physicianDetail.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-physicianDetail.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<processed-annotations>
+ <type-name>jsf.physiciansFlow.physicianDetail</type-name>
+ <annotated-element>
+ <element-name>jsf.physiciansFlow.physicianDetail</element-name>
+ <annotation>
+ <annotation-name>org.apache.ti.pageflow.annotations.ti.facesBacking</annotation-name>
+ </annotation>
+ </annotated-element>
+</processed-annotations>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-physicianResultsWithDetail.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-physicianResultsWithDetail.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-physicianResultsWithDetail.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-physicianResultsWithDetail.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<processed-annotations>
+ <type-name>jsf.physiciansFlow.physicianResultsWithDetail</type-name>
+ <annotated-element>
+ <element-name>jsf.physiciansFlow.physicianResultsWithDetail</element-name>
+ <annotation>
+ <annotation-name>org.apache.ti.pageflow.annotations.ti.facesBacking</annotation-name>
+ </annotation>
+ </annotated-element>
+</processed-annotations>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-search.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-search.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-search.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jpf-annotations-jsf-physiciansFlow-search.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<processed-annotations>
+ <type-name>jsf.physiciansFlow.search</type-name>
+ <annotated-element>
+ <element-name>jsf.physiciansFlow.search</element-name>
+ <annotation>
+ <annotation-name>org.apache.ti.pageflow.annotations.ti.facesBacking</annotation-name>
+ </annotation>
+ </annotated-element>
+ <annotated-element>
+ <element-name>execute</element-name>
+ <annotation>
+ <annotation-name>org.apache.ti.pageflow.annotations.ti.commandHandler</annotation-name>
+ <annotation-attribute>
+ <attribute-name>raiseActions</attribute-name>
+ <annotation-value>
+ <annotation-name>org.apache.ti.pageflow.annotations.ti.raiseAction</annotation-name>
+ <annotation-attribute>
+ <attribute-name>outputFormBean</attribute-name>
+ <string-value>searchForm</string-value>
+ </annotation-attribute>
+ <annotation-attribute>
+ <attribute-name>action</attribute-name>
+ <string-value>displayPhysiciansWithDetail</string-value>
+ </annotation-attribute>
+ </annotation-value>
+ <annotation-value>
+ <annotation-name>org.apache.ti.pageflow.annotations.ti.raiseAction</annotation-name>
+ <annotation-attribute>
+ <attribute-name>outputFormBean</attribute-name>
+ <string-value>searchForm</string-value>
+ </annotation-attribute>
+ <annotation-attribute>
+ <attribute-name>action</attribute-name>
+ <string-value>displayPhysiciansAbbreviated</string-value>
+ </annotation-attribute>
+ </annotation-value>
+ </annotation-attribute>
+ </annotation>
+ </annotated-element>
+ <annotated-element>
+ <element-name>pageFlow</element-name>
+ <annotation>
+ <annotation-name>org.apache.ti.pageflow.annotations.ti.pageFlowField</annotation-name>
+ </annotation>
+ </annotated-element>
+</processed-annotations>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/physiciansFlow/xwork.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/physiciansFlow/xwork.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/physiciansFlow/xwork.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/physiciansFlow/xwork.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,104 @@
+<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN"
+ "http://www.opensymphony.com/xwork/xwork-1.0.dtd">
+
+<!-- Generated from /jsf/physiciansFlow/Controller.java. -->
+<xwork>
+ <package name="/jsf/physiciansFlow" namespace="/jsf/physiciansFlow">
+ <result-types>
+ <result-type name="pathResult" class="org.apache.ti.pageflow.xwork.PageFlowPathResult"/>
+ <result-type name="navigateToPageResult" class="org.apache.ti.pageflow.xwork.NavigateToPageResult"/>
+ <result-type name="navigateToActionResult" class="org.apache.ti.pageflow.xwork.NavigateToActionResult"/>
+ <result-type name="returnActionResult" class="org.apache.ti.pageflow.xwork.ReturnActionResult"/>
+ </result-types>
+
+ <!--
+ This is (hopefully) temporary. It's a dummy action that only contains metadata
+ (parameters) about this module.
+ -->
+ <action name="_moduleMetadata">
+ <param name="controllerClassName">jsf.physiciansFlow.Controller</param>
+ </action>
+
+ <!-- Generated from simple action "begin". -->
+ <action name="begin" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="simpleAction">true</param>
+ <param name="defaultForward">success</param>
+ <result name="success" type="pathResult">
+ <param name="location">physicianSearch.do</param>
+ </result>
+ </action>
+
+ <!-- Generated from simple action "physicianSearch". -->
+ <action name="physicianSearch" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="simpleAction">true</param>
+ <param name="defaultForward">success</param>
+ <result name="success" type="pathResult">
+ <param name="location">search.faces</param>
+ </result>
+ </action>
+
+ <!-- Generated from simple action "returnToPreviousPage". -->
+ <action name="returnToPreviousPage" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="simpleAction">true</param>
+ <param name="defaultForward">success</param>
+ <result name="success" type="navigateToPageResult">
+ <param name="previousPageIndex">1</param>
+ </result>
+ </action>
+
+ <!-- Generated from action method "physicianDetail". -->
+ <action name="physicianDetail" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <result name="success" type="pathResult">
+ <param name="location">physicianDetail.faces</param>
+ </result>
+ </action>
+
+ <!-- Generated from action method "physicianDetailJSFStyle". -->
+ <action name="physicianDetailJSFStyle" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <result name="success" type="pathResult">
+ <param name="location">physicianDetail.faces</param>
+ </result>
+ </action>
+
+ <!-- Generated from action method "displayPhysciansAbbreviated". -->
+ <action name="displayPhysiciansAbbreviated" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="formBeanType">jsf.physiciansFlow.Controller$PhysicianSearchForm</param>
+ <param name="formBeanAttribute">physicianSearchForm</param>
+ <result name="success" type="navigateToPageResult">
+ <param name="previousPageIndex">0</param>
+ </result>
+ </action>
+
+ <!-- Generated from action method "displayPhysiciansWithDetail". -->
+ <action name="displayPhysiciansWithDetail" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="formBeanType">jsf.physiciansFlow.Controller$PhysicianSearchForm</param>
+ <param name="formBeanAttribute">physicianSearchForm</param>
+ <result name="success" type="pathResult">
+ <param name="location">physicianResultsWithDetail.faces</param>
+ </result>
+ </action>
+
+ <!-- Generated from action method "submitMailMessage". -->
+ <action name="submitMailMessage" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="formBeanType">jsf.physiciansFlow.Controller$MailMessageForm</param>
+ <param name="formBeanAttribute">mailMessageForm</param>
+ <result name="success" type="pathResult">
+ <param name="location">confirmMailSent.faces</param>
+ </result>
+ </action>
+
+ <!--
+ Action "home" in shared flow org.apache.beehive.samples.netui.jsf.SharedFlow. Note that
+ this is just a mockup - shared flow actions won't necessarily be generated into
+ referencing page flow configs.
+ -->
+ <action name="shared.home" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="simpleAction">true</param>
+ <param name="defaultForward">success</param>
+ <result name="success" type="pathResult">
+ <param name="location">/jsf/Controller.jpf</param>
+ </result>
+ </action>
+
+ </package>
+</xwork>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/xwork.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/xwork.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/xwork.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/jsf/xwork.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,53 @@
+<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN"
+ "http://www.opensymphony.com/xwork/xwork-1.0.dtd">
+
+<!-- Generated from /jsf/Controller.java. -->
+<xwork>
+ <package name="/jsf" namespace="/jsf">
+ <result-types>
+ <result-type name="pathResult" class="org.apache.ti.pageflow.xwork.PageFlowPathResult"/>
+ <result-type name="navigateToPageResult" class="org.apache.ti.pageflow.xwork.NavigateToPageResult"/>
+ <result-type name="navigateToActionResult" class="org.apache.ti.pageflow.xwork.NavigateToActionResult"/>
+ <result-type name="returnActionResult" class="org.apache.ti.pageflow.xwork.ReturnActionResult"/>
+ </result-types>
+
+ <!--
+ This is (hopefully) temporary. It's a dummy action that only contains metadata
+ (parameters) about this module.
+ -->
+ <action name="_moduleMetadata">
+ <param name="controllerClassName">jsf.Controller</param>
+ </action>
+
+ <!-- Generated from simple action "begin". -->
+ <action name="begin" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="simpleAction">true</param>
+ <param name="defaultForward">success</param>
+ <result name="success" type="pathResult">
+ <param name="location">home.faces</param>
+ </result>
+ </action>
+
+ <!-- Generated from simple action "locatePhysician". -->
+ <action name="locatePhysician" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="simpleAction">true</param>
+ <param name="defaultForward">success</param>
+ <result name="success" type="pathResult">
+ <param name="location">/jsf/physiciansFlow/Controller.jpf</param>
+ </result>
+ </action>
+
+ <!--
+ Action "home" in shared flow org.apache.beehive.samples.netui.jsf.SharedFlow. Note that
+ this is just a mockup - shared flow actions won't necessarily be generated into
+ referencing page flow configs.
+ -->
+ <action name="shared.home" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="simpleAction">true</param>
+ <param name="defaultForward">success</param>
+ <result name="success" type="pathResult">
+ <param name="location">/jsf/Controller.jpf</param>
+ </result>
+ </action>
+ </package>
+</xwork>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/apache/beehive/samples/netui/jsf/xwork.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/apache/beehive/samples/netui/jsf/xwork.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/apache/beehive/samples/netui/jsf/xwork.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/_pageflow-config/org/apache/beehive/samples/netui/jsf/xwork.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,32 @@
+<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN"
+ "http://www.opensymphony.com/xwork/xwork-1.0.dtd">
+
+<!-- Generated from /org/apache/beehive/samples/netui/jsf/SharedFlow.java. -->
+<xwork>
+ <package name="/-org/apache/beehive/samples/netui/jsf" namespace="/-org/apache/beehive/samples/netui/jsf">
+ <result-types>
+ <result-type name="pathResult" class="org.apache.ti.pageflow.xwork.PageFlowPathResult"/>
+ <result-type name="navigateToPageResult" class="org.apache.ti.pageflow.xwork.NavigateToPageResult"/>
+ <result-type name="navigateToActionResult" class="org.apache.ti.pageflow.xwork.NavigateToActionResult"/>
+ <result-type name="returnActionResult" class="org.apache.ti.pageflow.xwork.ReturnActionResult"/>
+ </result-types>
+
+ <!--
+ This is (hopefully) temporary. It's a dummy action that only contains metadata
+ (parameters) about this module.
+ -->
+ <action name="_moduleMetadata">
+ <param name="controllerClassName">org.apache.beehive.samples.netui.jsf.SharedFlow</param>
+ <param name="sharedFlow">true</param>
+ </action>
+
+ <!-- Generated from simple action "home" -->
+ <action name="begin" class="org.apache.ti.pageflow.xwork.PageFlowAction">
+ <param name="simpleAction">true</param>
+ <param name="defaultForward">success</param>
+ <result name="success" type="pathResult">
+ <param name="location">/jsf/Controller.jpf</param>
+ </result>
+ </action>
+ </package>
+</xwork>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/log4j.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/log4j.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/log4j.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/log4j.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="STRUTSTI_FILE_LOG" class="org.apache.log4j.RollingFileAppender">
+ <param name="File" value="STRUTSTI.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="STRUTSTI_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>
+
+ <!-- STRUTSTI -->
+ <category name="org.apache.ti">
+ <priority value="warn"/>
+ <appender-ref ref="STRUTSTI_CONSOLE_LOG"/>
+ </category>
+
+ <!-- Jakarta Commons -->
+ <category name="org.apache.commons">
+ <priority value="warn"/>
+ <appender-ref ref="STRUTSTI_CONSOLE_LOG"/>
+ </category>
+
+</log4j:configuration>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/messages.properties
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/messages.properties?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/messages.properties (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/messages.properties Thu Sep 1 18:25:16 2005
@@ -0,0 +1,10 @@
+welcome=Welcome to Your Health Care Home Page
+intro=The netui-jsf sample application demonstrates the integration of Java Server Faces with Beehive Page Flow.
+
+homePageNotes=Notes are included at the bottom of each page. You can hide/show these notes \
+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 notes should be rendered.
+
+notesPreferenceLabel=Notes on Each Page
+
+physicianSearchLinkText=Get started: Locate a physician in your area
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/physiciansFlow/messages.properties
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/physiciansFlow/messages.properties?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/physiciansFlow/messages.properties (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/jsf/physiciansFlow/messages.properties Thu Sep 1 18:25:16 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 notes
+notesHeading=Notes
+
+searchPageNoteOne=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.
+
+searchPageNoteTwo=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.
+
+searchPageNoteThree=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).
+
+searchPageNoteFour=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.
+
+searchPageNoteFive=The results table binds to a JSF 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.
+
+physicianDetailPageNoteOne=The links at the top of the page call Page Flow actions (don't forget \
+to put commandLinks into an <h:form>).
+
+physicianDetailPageNoteTwo=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.
+
+physicianDetailPageNoteThree=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.
+
+detailedResultsPageNoteOne=This page uses a JSF dataTable tag around a JSF panelGrid to display the list of results.
+
+mailConfirmationPageNoteOne=No notes
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/site.properties
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/site.properties?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/site.properties (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/resources/org/apache/beehive/samples/netui/resources/site.properties Thu Sep 1 18:25:16 2005
@@ -0,0 +1,2 @@
+browserTitle=Beehive Page Flow / JSF Samples
+welcome=Welcome to the Page Flow / JSF Samples
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/faces-config.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/faces-config.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/faces-config.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/faces-config.xml Thu Sep 1 18:25:16 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.ti.pageflow.faces.PageFlowApplicationFactory</application-factory>
+ </factory>
+
+</faces-config>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/web.xml?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/web.xml (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/web.xml Thu Sep 1 18:25:16 2005
@@ -0,0 +1,103 @@
+<?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.ti.servlet.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.ti.servlet.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.ti.servlet.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>PageFlowFacesFilter</filter-name>
+ <url-pattern>*.faces</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>
+
+ <!-- Configuration/init listener for MyFaces -->
+ <listener>
+ <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
+ </listener>
+
+ <!-- Action Servlet -->
+ <servlet>
+ <servlet-name>action</servlet-name>
+ <servlet-class>org.apache.ti.servlet.StrutsTiServlet</servlet-class>
+ <load-on-startup>2</load-on-startup>
+ </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>
+
+ <!-- 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>
+
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org