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 [2/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...
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/web.xml.jsf-ri
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/web.xml.jsf-ri?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/web.xml.jsf-ri (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/WEB-INF/web.xml.jsf-ri Thu Sep 1 18:25:16 2005
@@ -0,0 +1,180 @@
+<?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>
+
+ <context-param>
+ <param-name>com.sun.faces.validateXml</param-name>
+ <param-value>true</param-value>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to validate the XML in your
+ faces-config.xml resources against the DTD. Default
+ value is false.
+ </description>
+ </context-param>
+
+ <context-param>
+ <param-name>com.sun.faces.verifyObjects</param-name>
+ <param-value>true</param-value>
+ <description>
+ Set this flag to true if you want the JavaServer Faces
+ Reference Implementation to verify that all of the application
+ objects you have configured (components, converters,
+ renderers, and validators) can be successfully created.
+ Default value is false.
+ </description>
+ </context-param>
+
+ <!-- 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 the JSF Reference Implementation -->
+ <listener>
+ <listener-class>com.sun.faces.config.ConfigureListener</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: struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/index.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/index.jsp?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/index.jsp (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/index.jsp Thu Sep 1 18:25:16 2005
@@ -0,0 +1,27 @@
+<%--
+ 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"%>
+
+<html>
+ <body>
+ <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>
+ </body>
+</html>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/home.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/home.jsp?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/home.jsp (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/home.jsp Thu Sep 1 18:25:16 2005
@@ -0,0 +1,64 @@
+<%--
+ 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:$
+--%>
+<%@ 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="org.apache.beehive.samples.netui.resources.jsf.messages" />
+ <h:form>
+ <!-- heading -->
+ <h:panelGrid columns="1" style="margin-bottom: 15px" >
+ <f:attribute name="align" value="center"/>
+ <h:panelGrid columns="1" >
+ <f:facet name="header" >
+ <h:outputText value="#{msgs.welcome}" style="font-size: 24; font-weight: bold" />
+ </f:facet>
+ </h:panelGrid>
+ </h:panelGrid>
+
+ <!-- intro -->
+ <h:panelGrid cellspacing="20" columns="1" width="50%" style="margin-bottom: 15px; border: 1px solid blue; background-color: EEF3FB">
+ <f:attribute name="align" value="center"/>
+ <h:outputText value="#{msgs.intro}" />
+ <h:outputText value="#{msgs.homePageNotes}" />
+ </h:panelGrid>
+
+ <!-- link to physicians page flow -->
+ <h:panelGrid columns="1" style="margin-bottom: 30px" >
+ <f:attribute name="align" value="center"/>
+ <h:commandLink action="locatePhysician" value="#{msgs.physicianSearchLinkText}" rendered="true"/>
+ </h:panelGrid>
+
+ <!-- preferences -->
+ <h:panelGrid columns="1" style="border: solid 1px blue" cellpadding="5">
+ <f:attribute name="align" value="center"/>
+ <h:outputLabel value="#{msgs.notesPreferenceLabel}" for="notesPreference" styleClass="widgetLabel" />
+ <h:selectOneRadio value="#{backing.notesPreference}" id="notesPreference" immediate="true" valueChangeListener="#{backing.notesPreferenceChange}" layout="pageDirection" >
+ <f:selectItems value="#{backing.notesPreferenceOptions}" id="notesPreferenceOptions" />
+ </h:selectOneRadio>
+ </h:panelGrid>
+ </h:form>
+ </f:view>
+ </body>
+</html>
+
+
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/confirmMailSent.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/confirmMailSent.jsp?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/confirmMailSent.jsp (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/confirmMailSent.jsp Thu Sep 1 18:25:16 2005
@@ -0,0 +1,66 @@
+<%--
+ 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 prefix="f" uri="http://java.sun.com/jsf/core"%>
+<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
+
+<html>
+ <head>
+ <title>Mail Confirmation</title>
+ <link rel="stylesheet" type="text/css" href="../style.css">
+ </head>
+ <body>
+ <f:view>
+ <f:loadBundle var="msgs" basename="org.apache.beehive.samples.netui.resources.jsf.physiciansFlow.messages" />
+ <h:form>
+ <!-- navigation links -->
+ <h:panelGrid cellspacing="0" cellpadding="0" width="90%" style="margin-bottom: 30; padding-bottom: 5px; border-bottom: 2px solid blue">
+ <f:attribute name="align" value="center"/>
+ <h:commandLink action="shared.home" value="Home" />
+ </h:panelGrid>
+
+ <!-- message to user -->
+ <h:panelGrid style="margin-bottom: 15" width="90%" >
+ <f:attribute name="align" value="center"/>
+
+ <h:panelGrid cellpadding="7">
+ <h:outputFormat value="#{msgs.mailConfirmation}">
+ <f:param value="#{pageInput.firstName}"/>
+ <f:param value="#{pageInput.lastName}"/>
+ </h:outputFormat>
+ </h:panelGrid>
+
+ <h:panelGrid cellpadding="7" columns="2">
+ <h:commandLink action="returnToPreviousPage" value="Return to Physician Details" />
+ <h:commandLink action="physicianSearch" value="Return to Search" />
+ </h:panelGrid>
+
+ </h:panelGrid>
+ </h:form>
+
+ <!-- explanatory notes block -->
+ <h:panelGrid width="90%" style="background-color: #EEF3FB; margin-bottom: 30; border:1px solid blue;" rendered="#{sharedFlow.shared.notesPreference}">
+ <f:attribute name="align" value="center"/>
+ <h:outputText value="#{msgs.notesHeading}" style="font-weight: bold"/>
+ <h:outputText value="#{msgs.mailConfirmationPageNoteOne}"/>
+ </h:panelGrid>
+ </f:view>
+ </body>
+</html>
+
+
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/physicianDetail.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/physicianDetail.jsp?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/physicianDetail.jsp (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/physicianDetail.jsp Thu Sep 1 18:25:16 2005
@@ -0,0 +1,128 @@
+<%--
+ 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 prefix="f" uri="http://java.sun.com/jsf/core"%>
+<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<html>
+ <head>
+ <title>Physician Detail</title>
+ <link rel="stylesheet" type="text/css" href="../style.css" >
+ </head>
+ <body>
+ <f:view>
+ <f:loadBundle var="msgs" basename="org.apache.beehive.samples.netui.resources.jsf.physiciansFlow.messages" />
+ <h:form>
+ <!-- navigation links -->
+ <h:panelGrid columns="2" cellpadding="0" width="90%" style="margin-bottom: 30; padding-bottom: 5px; border-bottom: 2px solid blue" >
+ <f:attribute name="align" value="center"/>
+ <h:panelGrid>
+ <f:attribute name="align" value="left"/>
+ <h:commandLink action="shared.home" value="Home" />
+ </h:panelGrid>
+ </h:panelGrid>
+
+ <!-- physician details -->
+ <h:panelGrid columns="2" style="background-color: #EEF3FB; border:solid 1px blue; margin-bottom: 30" >
+ <f:attribute name="align" value="center"/>
+
+ <h:panelGrid columns="2" cellpadding="7" >
+ <f:facet name="header" >
+ <h:outputText value="Dr. #{pageInput.physician.firstName} #{pageInput.physician.lastName}" />
+ </f:facet>
+ <h:outputText value="#{msgs.specialtyColumnLabel}: " />
+ <h:outputText value="#{pageInput.physician.specialty}" />
+ <h:outputText value="#{msgs.genderColumnLabel}: " />
+ <h:outputText value="#{pageInput.physician.gender}" />
+ <h:outputText value="#{msgs.cityColumnLabel}: " />
+ <h:outputText value="#{pageInput.physician.city}" />
+ <h:outputText value="#{msgs.schoolColumnLabel}: " />
+ <h:outputText value="#{pageInput.physician.school}" />
+ <h:outputText value="#{msgs.hospitalsColumnLabel}: " />
+ <h:panelGroup>
+ <c:forEach items="${pageInput.physician.hospitalAffiliations}" var="hospital" >
+ <f:verbatim>
+ <c:out value="${hospital}" />
+ <br>
+ </f:verbatim>
+ </c:forEach>
+ </h:panelGroup>
+ </h:panelGrid>
+
+ <h:panelGrid columns="1" cellpadding="7" >
+ <f:facet name="header" >
+ <h:outputText value="#{msgs.bioHeading}" />
+ </f:facet>
+ <!-- disabled because this is for output text only -->
+ <h:inputTextarea value="#{pageInput.physician.bio}" cols="40" rows="10" disabled="true" />
+ </h:panelGrid>
+ </h:panelGrid>
+
+ <!-- mail form -->
+ <h:panelGrid>
+ <f:attribute name="align" value="center"/>
+
+ <h:outputText value="#{msgs.mailPrompt}" style="font-weight: bold"/>
+
+ <h:inputTextarea value="#{backing.mailForm.message}" rows="6" cols="80" rendered="true" />
+
+ <h:panelGrid>
+ <f:attribute name="align" value="right"/>
+ <h:commandButton action="submitMailMessage" value="Send Mail" tabindex="1" >
+ <f:attribute name="submitFormBean" value="backing.mailForm" />
+ <f:param name="firstName" value="#{pageInput.physician.firstName}" />
+ <f:param name="lastName" value="#{pageInput.physician.lastName}" />
+ </h:commandButton>
+ </h:panelGrid>
+ </h:panelGrid>
+
+ <h:panelGrid>
+ <f:attribute name="align" value="center"/>
+ <h:commandLink action="physicianSearch" value="Return to Search" />
+ </h:panelGrid>
+
+ </h:form>
+
+ <!-- explanatory notes block -->
+ <h:panelGrid width="90%" cellpadding="5" style="background-color: #EEF3FB; margin-bottom: 30; border:1px solid blue;" rendered="#{sharedFlow.shared.notesPreference}">
+ <f:attribute name="align" value="center"/>
+
+ <h:outputText value="#{msgs.notesHeading}" style="font-weight: bold"/>
+
+ <h:outputText value="#{msgs.physicianDetailPageNoteOne}"/>
+
+ <h:outputText value="#{msgs.physicianDetailPageNoteTwo}"/>
+ <f:verbatim>
+ <pre>
+ <h:commandLink action="submitMailMessage" value="Send Mail" tabindex="1" />
+ <f:attribute name="submitFormBean" value="backing.mailForm" />
+ <f:param name="firstName" value="#{pageInput.physician.firstName}" />
+ <f:param name="lastName" value="#{pageInput.physician.lastName}" />
+ </h:commandLink>
+ </pre>
+ </f:verbatim>
+
+ <h:outputText value="#{msgs.physicianDetailPageNoteThree}"/>
+ </h:panelGrid>
+
+ </f:view>
+ </body>
+</html>
+
+
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/physicianResultsWithDetail.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/physicianResultsWithDetail.jsp?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/physicianResultsWithDetail.jsp (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/physicianResultsWithDetail.jsp Thu Sep 1 18:25:16 2005
@@ -0,0 +1,101 @@
+<%--
+ 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 prefix="f" uri="http://java.sun.com/jsf/core"%>
+<%@ taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
+<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
+
+<html>
+ <head>
+ <title>Physician Results with Details</title>
+ <link rel="stylesheet" type="text/css" href="../style.css">
+ </head>
+ <body>
+ <f:view>
+ <f:loadBundle var="msgs" basename="org.apache.beehive.samples.netui.resources.jsf.physiciansFlow.messages" />
+ <h:form>
+ <!-- navigation links -->
+ <h:panelGrid columns="2" cellpadding="0" width="90%" style="margin-bottom: 30; padding-bottom: 5px; border-bottom: 2px solid blue" >
+ <f:attribute name="align" value="center"/>
+ <h:panelGrid>
+ <f:attribute name="align" value="left"/>
+ <h:commandLink action="shared.home" value="Home" />
+ </h:panelGrid>
+ </h:panelGrid>
+
+ <!-- message to user -->
+ <h:panelGrid style="margin-bottom: 15" >
+ <f:attribute name="align" value="center"/>
+ <h:outputText value="#{msgs.detailedResults}" styleClass="infoMessage" />
+ </h:panelGrid>
+
+ <!-- detailed search results -->
+ <h:dataTable value="#{pageFlow.results}" var="physician" rendered="#{pageFlow.results != null}" styleClass="resultsTable" rowClasses="oddRow, evenRow" id="searchResults" cellpadding="7px" style="margin-bottom: 30">
+ <h:column>
+ <h:panelGrid columns="2" cellpadding="7">
+ <f:facet name="header">
+ <h:outputText value="Dr. #{physician.firstName} #{physician.lastName}" />
+ </f:facet>
+ <h:outputText value="#{msgs.specialtyColumnLabel}: " />
+ <h:outputText value="#{physician.specialty}" />
+ <h:outputText value="#{msgs.genderColumnLabel}: " />
+ <h:outputText value="#{physician.gender}" />
+ <h:outputText value="#{msgs.cityColumnLabel}: " />
+ <h:outputText value="#{physician.city}" />
+ <h:outputText value="#{msgs.schoolColumnLabel}: " />
+ <h:outputText value="#{physician.school}" />
+ <h:outputText value="#{msgs.hospitalsColumnLabel}: " />
+ <h:panelGroup>
+ <c:forEach items="${physician.hospitalAffiliations}" var="hospital">
+ <f:verbatim>
+ <c:out value="${hospital}" />
+ <br>
+ </f:verbatim>
+ </c:forEach>
+ </h:panelGroup>
+ </h:panelGrid>
+ </h:column>
+ <h:column>
+ <h:panelGrid columns="1" cellpadding="7">
+ <f:facet name="header">
+ <h:outputText value="#{msgs.bioHeading}" />
+ </f:facet>
+ <!-- disabled because this is for output text only -->
+ <h:inputTextarea value="#{physician.bio}" cols="40" rows="10" disabled="false"/>
+ </h:panelGrid>
+ </h:column>
+ </h:dataTable>
+
+ <h:panelGrid>
+ <f:attribute name="align" value="center"/>
+ <h:commandLink action="physicianSearch" value="Return to Search" />
+ </h:panelGrid>
+
+ </h:form>
+
+ <!-- explanatory notes block -->
+ <h:panelGrid width="90%" cellpadding="5" style="background-color: #EEF3FB; margin-bottom: 30; border:1px solid blue;" rendered="#{sharedFlow.shared.notesPreference}">
+ <f:attribute name="align" value="center"/>
+ <h:outputText value="#{msgs.notesHeading}" style="font-weight: bold" />
+ <h:outputText value="#{msgs.detailedResultsPageNoteOne}" rendered="#{sharedFlow.shared.notesPreference}" />
+ </h:panelGrid>
+ </f:view>
+ </body>
+</html>
+
+
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/search.jsp
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/search.jsp?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/search.jsp (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/physiciansFlow/search.jsp Thu Sep 1 18:25:16 2005
@@ -0,0 +1,161 @@
+<%--
+ 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://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+
+<html>
+ <head>
+ <title>Physician Search</title>
+ <link rel="stylesheet" type="text/css" href="../style.css" >
+ </head>
+ <body>
+ <f:view>
+ <f:loadBundle var="msgs" basename="org.apache.beehive.samples.netui.resources.jsf.physiciansFlow.messages" />
+ <h:form>
+ <!-- navigation links -->
+ <h:panelGrid columns="1" cellspacing="0" cellpadding="0" width="90%" style="margin-bottom: 30; padding-bottom: 5px; border-bottom: 2px solid blue" >
+ <f:attribute name="align" value="center"/>
+ <h:commandLink action="shared.home" value="Home" />
+ </h:panelGrid>
+
+ <!-- the search form -->
+ <h:panelGrid columns="2" width="470" cellpadding="7" style="margin-bottom: 30; border: solid 1px blue" >
+ <f:attribute name="align" value="center"/>
+
+ <h:outputLabel value="#{msgs.physicianTypeLabel}" for="physicianType" styleClass="widgetLabel" />
+ <h:selectOneRadio value="#{backing.physicianType}" id="physicianType" immediate="true" valueChangeListener="#{backing.physicianTypeChange}" onclick="onChange=this.form.submit();" layout="pageDirection" >
+ <f:selectItems value="#{backing.physicianTypes}" id="physicianTypes" />
+ </h:selectOneRadio>
+
+ <h:outputLabel value="#{msgs.specialistTypeLabel}" for="specialistType "styleClass="widgetLabel" />
+ <h:selectOneMenu value="#{backing.criteria.specialty}" disabled="#{backing.specialistsDisabled}" id="specialistType" styleClass="selectMenu" >
+ <f:selectItems value="#{backing.specialistTypes}" id="specialistTypes" />
+ </h:selectOneMenu>
+
+ <h:outputLabel value="#{msgs.cityLabel}" for="city" styleClass="widgetLabel" />
+
+ <h:panelGrid columns="2">
+ <h:selectOneMenu value="#{backing.criteria.city}" id="city" required="true" styleClass="selectMenu" >
+ <f:selectItems value="#{backing.cities}" id="cities" />
+ </h:selectOneMenu>
+ <h:message for="city" styleClass="validationMessage" style="color:#ff0000;" />
+ </h:panelGrid>
+
+ <h:outputLabel value="#{msgs.resultsFormatTypeLabel}" for="resultFormatType" styleClass="widgetLabel" />
+ <h:selectOneRadio value="#{backing.resultFormatType}" id="resultFormatType" layout="pageDirection" >
+ <f:selectItems value="#{backing.resultFormatTypes}" id="resultFormatTypes" />
+ </h:selectOneRadio>
+
+ <!-- here we submit a form to an action handler in the backing file -->
+ <h:commandButton action="#{backing.execute}" styleClass="submitButton" id="searchButton" value="Search" />
+ <f:facet name="td"/>
+ </h:panelGrid>
+
+ <!-- message to user -->
+ <h:panelGrid style="margin-bottom: 15" >
+ <f:attribute name="align" value="center"/>
+ <h:outputText value="#{msgs.searchResultsYes}" styleClass="infoMessage" rendered="#{pageFlow.results.rowCount > 0}" />
+ <h:outputText value="#{msgs.searchResultsNo}" styleClass="infoMessage" rendered="#{pageFlow.results.rowCount == 0}" />
+ </h:panelGrid>
+
+ <!-- search results -->
+ <h:dataTable value="#{pageFlow.results}" var="physician" rendered="#{pageFlow.results != null}" styleClass="resultsTable" rowClasses="oddRow, evenRow" id="searchResults" cellpadding="7px" >
+ <h:column>
+ <f:facet name="header" >
+ <h:outputText value="#{msgs.specialtyColumnLabel}" />
+ </f:facet>
+ <h:outputText value="#{physician.specialty}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header" >
+ <h:outputText value="#{msgs.firstNameColumnLabel}" />
+ </f:facet>
+ <h:outputText value="#{physician.firstName}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header" >
+ <h:commandLink action="#{backing.sortByLastName}" immediate="true" >
+ <h:outputText value="#{msgs.lastNameColumnLabel}" />
+ </h:commandLink>
+ </f:facet>
+ <h:outputText value="#{physician.lastName}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header" >
+ <h:commandLink action="#{backing.sortByGender}" immediate="true" >
+ <h:outputText value="#{msgs.genderColumnLabel}" />
+ </h:commandLink>
+ </f:facet>
+ <h:outputText value="#{physician.gender}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header" >
+ <h:outputText value="#{msgs.cityColumnLabel}" />
+ </f:facet>
+ <h:outputText value="#{physician.city}" />
+ </h:column>
+ <h:column>
+ <f:facet name="header" >
+ <h:outputText value="#{msgs.detailsColumnLabel}" />
+ </f:facet>
+ <!-- Here we call a page flow action directly -->
+ <h:commandLink value="#{msgs.detailLabel}" action="physicianDetail" >
+ <f:param name="physicianId" value="#{physician.id}" />
+ </h:commandLink>
+ </h:column>
+ </h:dataTable>
+ </h:form>
+
+ <!-- explanatory notes block -->
+ <h:panelGrid width="90%" cellpadding="5" style="background-color: #EEF3FB; margin-bottom: 30; border:1px solid blue;" rendered="#{sharedFlow.shared.notesPreference}">
+ <h:outputText value="#{msgs.notesHeading}" style="font-weight: bold"/>
+
+ <h:outputText value="#{msgs.searchPageNoteOne}"/>
+ <f:verbatim>
+ <pre>
+ @ti.commandHandler(
+ raiseActions = {
+ @ti.raiseAction(action="displayPhysiciansWithDetail", outputFormBean="searchForm"),
+ @ti.raiseAction(action="displayPhysiciansAbbreviated", outputFormBean="searchForm")
+ }
+ )
+ </pre>
+ </f:verbatim>
+
+
+ <h:outputText value="#{msgs.searchPageNoteTwo}"/>
+ <f:verbatim>
+ <pre>
+ <h:commandLink value="#{msgs.detailLabel}" action="physicianDetail" >
+ <f:param name="physicianId" value="#{physician.id}" />
+ </h:commandLink>
+ </pre>
+ </f:verbatim>
+
+
+ <h:outputText value="#{msgs.searchPageNoteThree}"/>
+
+ <h:outputText value="#{msgs.searchPageNoteFour}"/>
+
+ <h:outputText value="#{msgs.searchPageNoteFive}"/>
+ </h:panelGrid>
+
+ </f:view>
+ </body>
+</html>
Added: struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/style.css
URL: http://svn.apache.org/viewcvs/struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/style.css?rev=265811&view=auto
==============================================================================
--- struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/style.css (added)
+++ struts/sandbox/trunk/ti/wars/samples-jsf/src/webapp/jsf/style.css Thu Sep 1 18:25:16 2005
@@ -0,0 +1,76 @@
+
+
+body
+{
+background-color: #ffffff;
+background-repeat: no-repeat;
+font-family: Arial, Verdana;
+font-size: 14px;
+font-style: normal;
+font-weight: normal;
+/* color: #333333; */
+/* margin-top: 10px; */
+/* margin-left: 10px; */
+/* margin-right: 10px; */
+/* margin-bottom: 10px; */
+}
+
+/* Used for prompts in generated pages */
+.prompt
+{
+color: #993333;
+font-style: italic;
+}
+
+A:link, A:visited, A:active {
+color: #7777AA;
+text-decoration: underline;
+}
+
+A:hover {
+color: #9999FF;
+background: transparent;
+text-decoration: underline;
+}
+
+.resultsTable {
+ margin-right: auto;
+ margin-left: auto;
+ background-color: #EEF3FB;
+ border: solid 1px blue;
+}
+
+.oddRow {
+ background-color: #FFFFFF;
+}
+
+.evenRow {
+ background-color: #EEF3FB;
+}
+
+.widgetLabel {
+ font-size: 14px;
+ text-align: left;
+ font-weight: bold;
+}
+
+.validationMessage {
+ font-size: 12px;
+ text-align: left;
+ font-color: #ff0000;
+}
+
+.infoMessage {
+ font-size: 18px;
+ font-color: #ffffff;
+ font-weight: bold;
+}
+
+.selectMenu {
+ font-size: 14px;
+}
+
+.submitButton {
+ position: relative;
+ left: 50px;
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@struts.apache.org
For additional commands, e-mail: dev-help@struts.apache.org