Author: craigmcc Date: Thu Jun 1 10:04:20 2006 New Revision: 410891 URL: http://svn.apache.org/viewvc?rev=410891&view=rev Log: Add a use case that, when run manually, can illustrate the SHALE-182 issue. Next step will be an automated test for it, plus a fix to the underlying bug.
Added: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/token/ struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/token/Test.java (with props) struts/shale/trunk/use-cases/src/web/token/ struts/shale/trunk/use-cases/src/web/token/test.jsp (with props) Modified: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle.properties struts/shale/trunk/use-cases/src/web/WEB-INF/faces-config.xml struts/shale/trunk/use-cases/src/web/usecases.jsp Added: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/token/Test.java URL: http://svn.apache.org/viewvc/struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/token/Test.java?rev=410891&view=auto ============================================================================== --- struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/token/Test.java (added) +++ struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/token/Test.java Thu Jun 1 10:04:20 2006 @@ -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 languamount governing permissions and + * limitations under the License. + */ + +package org.apache.shale.usecases.token; + +import org.apache.shale.view.AbstractViewController; + +/** + * <p>Backing bean for the token use case.</p> + * + * $Id$ + */ +public class Test extends AbstractViewController { + + + // -------------------------------------------------------------- Properties + + + /** + * <p>The input value. The actual content is ignored ... it is only here + * to provide an input field with a required validation.</p> + */ + private String value = null; + + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + + +} Propchange: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/token/Test.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/token/Test.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Modified: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle.properties URL: http://svn.apache.org/viewvc/struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle.properties?rev=410891&r1=410890&r2=410891&view=diff ============================================================================== --- struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle.properties (original) +++ struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle.properties Thu Jun 1 10:04:20 2006 @@ -112,6 +112,13 @@ subview.first.title=Subview Processing (Page 1 of 2) subview.second.title=Subview Processing (Page 2 of 2) +# Token Messages +token.test.title=Shale Token Test +token.test.description=This test includes the Token component. It should allow exactly one submit of the form once you satisfy the "required" constraint on the text field. +token.test.heading=Simple Form With One Required Field +token.test.label=Required Field: + + # Use Cases Menu Messages usecases.categories=List Categories (Remoting) usecases.ajax=Ajax Examples @@ -129,6 +136,8 @@ usecases.states=List State Names (Remoting) usecases.subview=Subview Processing usecases.title=Shale Framework Use Cases +usecases.tokentest=Token Processing Test +usecases.tokentests=Token Processing Tests usecases.validator=Commons Validator Integration usecases.validate=Validation (client- and server-side) usecases.tiles=Tiles Modified: struts/shale/trunk/use-cases/src/web/WEB-INF/faces-config.xml URL: http://svn.apache.org/viewvc/struts/shale/trunk/use-cases/src/web/WEB-INF/faces-config.xml?rev=410891&r1=410890&r2=410891&view=diff ============================================================================== --- struts/shale/trunk/use-cases/src/web/WEB-INF/faces-config.xml (original) +++ struts/shale/trunk/use-cases/src/web/WEB-INF/faces-config.xml Thu Jun 1 10:04:20 2006 @@ -140,6 +140,35 @@ </navigation-rule> + <!-- ============================= TOKEN Test ============================ --> + + + <!-- ViewController Beans --> + + <managed-bean> + <managed-bean-name>token$test</managed-bean-name> + <managed-bean-class> + org.apache.shale.usecases.token.Test + </managed-bean-class> + <managed-bean-scope>request</managed-bean-scope> + </managed-bean> + + + <!-- Navigation Rules --> + + <navigation-rule> + <navigation-case> + <from-outcome>token$test</from-outcome> + <to-view-id>/token/test.faces</to-view-id> + <redirect/> + </navigation-case> + <navigation-case> + <from-outcome>usecases$toplevel</from-outcome> + <to-view-id>/usecases.faces</to-view-id> + </navigation-case> + </navigation-rule> + + <!-- ============================ VALIDATE Test ========================== --> Added: struts/shale/trunk/use-cases/src/web/token/test.jsp URL: http://svn.apache.org/viewvc/struts/shale/trunk/use-cases/src/web/token/test.jsp?rev=410891&view=auto ============================================================================== --- struts/shale/trunk/use-cases/src/web/token/test.jsp (added) +++ struts/shale/trunk/use-cases/src/web/token/test.jsp Thu Jun 1 10:04:20 2006 @@ -0,0 +1,77 @@ +<[EMAIL PROTECTED] 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 prefix="s" uri="http://struts.apache.org/shale/core" %> + +<%-- + + 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. + +--%> + +<f:view> +<[EMAIL PROTECTED] file="../messages.jspf"%> +<html> +<head> +<title> + <h:outputText value="#{messages['token.test.title']}"/> +</title> +</head> +<body> + + <h:form id="form"> + + <h:messages globalOnly="false"/> + + <h:panelGrid id="grid" + columns="3"> + + <h:outputLabel for="value" + value="#{messages['token.test.label']}"/> + <h:inputText id="value" + required="true" + value="#{token$test.value}"/> + <h:message for="value"/> + + <h:outputLabel for="token" + value=""/> + <s:token id="token"/> + <h:message for="token"/> + + <h:outputText value=""/> + <h:commandButton value="Submit" + action="usecases$toplevel"/> + <h:outputText value=""/> + + </h:panelGrid> + + <f:verbatim><p></f:verbatim> + + <h:outputText value="#{messages['token.test.description']}" + escape="false" + style="font-style: italic"/> + + <f:verbatim><p></f:verbatim> + + <h:commandLink id="back" + immediate="true" + value="#{messages['usecases.primary']}" + action="usecases$toplevel"/> + + </h:form> + +</body> +</html> +</f:view> Propchange: struts/shale/trunk/use-cases/src/web/token/test.jsp ------------------------------------------------------------------------------ svn:eol-style = native Propchange: struts/shale/trunk/use-cases/src/web/token/test.jsp ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Modified: struts/shale/trunk/use-cases/src/web/usecases.jsp URL: http://svn.apache.org/viewvc/struts/shale/trunk/use-cases/src/web/usecases.jsp?rev=410891&r1=410890&r2=410891&view=diff ============================================================================== --- struts/shale/trunk/use-cases/src/web/usecases.jsp (original) +++ struts/shale/trunk/use-cases/src/web/usecases.jsp Thu Jun 1 10:04:20 2006 @@ -170,6 +170,18 @@ </h:panelGrid> + <h1><h:outputText value="#{messages['usecases.tokentests']}"/></h1> + + <h:panelGrid columns="1"> + + <h:commandLink id="tokentest" + action="token$test"> + <h:outputText value="#{messages['usecases.tokentest']}"/> + + </h:commandLink> + + </h:panelGrid> + <h1><h:outputText value="#{messages['usecases.validator']}"/></h1> <h:panelGrid columns="1">