From torresjennifer@example.com Fri Dec 01 19:36:11 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 38857 invoked from network); 1 Dec 2006 19:36:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 19:36:11 -0000 Received: (qmail 23335 invoked by uid 500); 1 Dec 2006 19:36:20 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 23289 invoked by uid 500); 1 Dec 2006 19:36:20 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 23279 invoked by uid 99); 1 Dec 2006 19:36:19 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 11:36:19 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 11:36:10 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 712131A9846; Fri, 1 Dec 2006 11:35:31 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481346 - /shale/framework/trunk/shale-dialog/src/main/java/org/apache/shale/dialog/DialogContext.java Date: Fri, 01 Dec 2006 19:35:31 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 11:35:29 2006 New Revision: 481346 URL: http://svn.apache.org/viewvc?view=rev&rev=481346 Log: Broken link. SHALE-306 Modified: shale/framework/trunk/shale-dialog/src/main/java/org/apache/shale/dialog/DialogContext.java Modified: shale/framework/trunk/shale-dialog/src/main/java/org/apache/shale/dialog/DialogContext.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog/src/main/java/org/apache/shale/dialog/DialogContext.java?view=diff&rev=481346&r1=481345&r2=481346 ============================================================================== --- shale/framework/trunk/shale-dialog/src/main/java/org/apache/shale/dialog/DialogContext.java (original) +++ shale/framework/trunk/shale-dialog/src/main/java/org/apache/shale/dialog/DialogContext.java Fri Dec 1 11:35:29 2006 @@ -95,7 +95,7 @@ /** - * <p>Advance the execution of this {@link DialogContext) instance, + * <p>Advance the execution of this {@link DialogContext} instance, * until an interaction with the user is required. At that * point, navigate to the appropriate view, call * <code>FacesContext.renderResponse()</code>, and return.</p> From torresjennifer@example.com Fri Dec 01 19:37:26 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 39091 invoked from network); 1 Dec 2006 19:37:25 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 19:37:25 -0000 Received: (qmail 24399 invoked by uid 500); 1 Dec 2006 19:37:34 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 24372 invoked by uid 500); 1 Dec 2006 19:37:34 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 24363 invoked by uid 99); 1 Dec 2006 19:37:34 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 11:37:34 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 11:37:25 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 4F9D41A9846; Fri, 1 Dec 2006 11:36:46 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481347 - /shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java Date: Fri, 01 Dec 2006 19:36:46 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 11:36:45 2006 New Revision: 481347 URL: http://svn.apache.org/viewvc?view=rev&rev=481347 Log: Typo. SHALE-306 Modified: shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java Modified: shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java?view=diff&rev=481347&r1=481346&r2=481347 ============================================================================== --- shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java (original) +++ shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogContext.java Fri Dec 1 11:36:45 2006 @@ -177,7 +177,7 @@ /** * <p>Flag outcome value that signals a need to transition to the - * start state for this dialg.</p> + * start state for this dialog.</p> */ private static final String START_OUTCOME = "org.apache.shale.dialog.basic.START_OUTCOME"; From torresjennifer@example.com Fri Dec 01 19:52:51 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 43679 invoked from network); 1 Dec 2006 19:52:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 19:52:49 -0000 Received: (qmail 49688 invoked by uid 500); 1 Dec 2006 19:52:56 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 49674 invoked by uid 500); 1 Dec 2006 19:52:56 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 49648 invoked by uid 99); 1 Dec 2006 19:52:56 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 11:52:56 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 11:52:46 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id CE4291A9846; Fri, 1 Dec 2006 11:52:07 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481357 - /shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java Date: Fri, 01 Dec 2006 19:52:07 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 11:52:06 2006 New Revision: 481357 URL: http://svn.apache.org/viewvc?view=rev&rev=481357 Log: Do not recreate view on null outcome. Reported by: Mario Buonopane, SHALE-341 Investigation and patch by: Gary VanMatre and Craig McClanahan Modified: shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java Modified: shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java?view=diff&rev=481357&r1=481356&r2=481357 ============================================================================== --- shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java (original) +++ shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java Fri Dec 1 11:52:06 2006 @@ -224,6 +224,13 @@ /** {@inheritDoc} */ public void advance(FacesContext context, String outcome) { + // If the incoming outcome is null, we want to stay in the same + // (view) state *without* recreating it, which would destroy + // any useful information that components might have stored + if (outcome == null) { + return; + } + SCXMLExecutor dialogExecutor = getExecutor(context); ((ShaleDialogELEvaluator) dialogExecutor.getEvaluator()). setFacesContext(context); From torresjennifer@example.com Fri Dec 01 20:19:10 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 52359 invoked from network); 1 Dec 2006 20:19:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 20:19:09 -0000 Received: (qmail 97321 invoked by uid 500); 1 Dec 2006 20:19:18 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 97299 invoked by uid 500); 1 Dec 2006 20:19:18 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 97284 invoked by uid 99); 1 Dec 2006 20:19:17 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 12:19:17 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 12:19:08 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 3B39F1A984D; Fri, 1 Dec 2006 12:18:29 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481373 - in /shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml: DialogProperties.java SCXMLDialogContext.java action/ViewAction.java config/ConfigurationParser.java Date: Fri, 01 Dec 2006 20:18:28 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 12:18:28 2006 New Revision: 481373 URL: http://svn.apache.org/viewvc?view=rev&rev=481373 Log: Introduce the second custom Commons SCXML action available to Shale dialogs out-of-the-box. The action with local name "view" (and namespace whose URI is defined in Globals.CUSTOM_SCXML_ACTIONS_URI) may be used to associate the next view state with the identifier of the JSF view to be rendered while the dialog is in that state. This provides a declarative alternative to specify a view ID in addition to the procedural alternative (DialogStateMapper). In presence of both means, the declarative specification gets priority as one would expect (and allows for special casing, conditionals etc.). This should cover most application requirements for mapping the SCXML states to views. SHALE-347 Added: shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/action/ViewAction.java (with props) Modified: shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/DialogProperties.java shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/config/ConfigurationParser.java Modified: shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/DialogProperties.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/DialogProperties.java?view=diff&rev=481373&r1=481372&r2=481373 ============================================================================== --- shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/DialogProperties.java (original) +++ shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/DialogProperties.java Fri Dec 1 12:18:28 2006 @@ -68,6 +68,35 @@ } + //------------------------------------------------------ View Identifiers + + /** + * The JSF view identifier of the next view to be rendered in + * this dialog. + */ + private String nextViewId = null; + + /** + * Get the JSF view identifier of the next view to be rendered in + * this dialog. + * + * @return The JSF view identifier + */ + public String getNextViewId() { + return nextViewId; + } + + /** + * Set the JSF view identifier of the next view to be rendered in + * this dialog. + * + * @param viewId The JSF view identifier + */ + public void setNextViewId(String nextViewId) { + this.nextViewId = nextViewId; + } + + //---------------------------------------------- Other instance variables /** Modified: shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java?view=diff&rev=481373&r1=481372&r2=481373 ============================================================================== --- shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java (original) +++ shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/SCXMLDialogContext.java Fri Dec 1 12:18:28 2006 @@ -345,10 +345,17 @@ * @param dp The <code>DialogProperties</code> for the current dialog */ private void navigateTo(String stateId, FacesContext context, DialogProperties dp) { - ValueBinding vb = context.getApplication().createValueBinding - ("#{" + Globals.STATE_MAPPER + "}"); - DialogStateMapper dsm = (DialogStateMapper) vb.getValue(context); - String viewId = dsm.mapStateId(name, stateId, context); + // Determine the view identifier + String viewId = dp.getNextViewId(); + if (viewId == null) { + ValueBinding vb = context.getApplication().createValueBinding + ("#{" + Globals.STATE_MAPPER + "}"); + DialogStateMapper dsm = (DialogStateMapper) vb.getValue(context); + viewId = dsm.mapStateId(name, stateId, context); + } else { + dp.setNextViewId(null); // one time use + } + // Navigate to the requested view identifier (if any) if (viewId == null) { return; Added: shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/action/ViewAction.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/action/ViewAction.java?view=auto&rev=481373 ============================================================================== --- shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/action/ViewAction.java (added) +++ shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/action/ViewAction.java Fri Dec 1 12:18:28 2006 @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + */ + +package org.apache.shale.dialog.scxml.action; + +import java.util.Collection; + +import org.apache.commons.logging.Log; +import org.apache.commons.scxml.ErrorReporter; +import org.apache.commons.scxml.EventDispatcher; +import org.apache.commons.scxml.SCInstance; +import org.apache.commons.scxml.SCXMLExpressionException; +import org.apache.commons.scxml.model.Action; +import org.apache.commons.scxml.model.ModelException; +import org.apache.shale.dialog.scxml.DialogProperties; +import org.apache.shale.dialog.scxml.Globals; + +/** + * <p>Custom Commons SCXML action to set the JSF view identifier of the + * next view to be rendered by this dialog.</p> + * + * @since 1.0.4 + * + * $Id$ + */ +public class ViewAction extends Action { + + /** + * <p>Set nextViewId in dialog properties, which will be the next view + * rendered by this dialog.</p> + * + * @param evtDispatcher The EventDispatcher for this execution instance + * @param errRep The ErrorReporter + * @param scInstance The state machine execution instance information + * @param appLog The application log + * @param derivedEvents The collection of internal events + * @throws ModelException If execution causes a non-deterministic state + * @throws SCXMLExpressionException Bad expression + */ + public void execute(EventDispatcher evtDispatcher, ErrorReporter errRep, + SCInstance scInstance, Log appLog, Collection derivedEvents) + throws ModelException, SCXMLExpressionException { + + DialogProperties dp = (DialogProperties) scInstance.getRootContext(). + get(Globals.DIALOG_PROPERTIES); + dp.setNextViewId(viewId); + + } + + /** + * The JSF view identifier for the next view to be rendered by + * this dialog. + */ + private String viewId = null; + + /** + * Get the view identifier. + * + * @return The view identifier + */ + public String getViewId() { + return viewId; + } + + /** + * Set the view identifier. + * + * @param viewId The view identifier + */ + public void setViewId(String viewId) { + this.viewId = viewId; + } + +} Propchange: shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/action/ViewAction.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/action/ViewAction.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Modified: shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/config/ConfigurationParser.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/config/ConfigurationParser.java?view=diff&rev=481373&r1=481372&r2=481373 ============================================================================== --- shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/config/ConfigurationParser.java (original) +++ shale/framework/trunk/shale-dialog-scxml/src/main/java/org/apache/shale/dialog/scxml/config/ConfigurationParser.java Fri Dec 1 12:18:28 2006 @@ -34,6 +34,7 @@ import org.apache.commons.scxml.model.SCXML; import org.apache.shale.dialog.scxml.Globals; import org.apache.shale.dialog.scxml.action.RedirectAction; +import org.apache.shale.dialog.scxml.action.ViewAction; import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.SAXException; @@ -234,14 +235,21 @@ Iterator iterator = metadata.entrySet().iterator(); - // Define the custom Commons SCXML actions used by Shale dialogs + // Define the custom Commons SCXML actions used by Shale dialogs and + // create a list of custom actions as needed by the SCXMLDigester API + List customDialogActions = new ArrayList(); + + // <shale:redirect> CustomAction redirectAction = new CustomAction(Globals.CUSTOM_SCXML_ACTIONS_URI, "redirect", RedirectAction.class); - - // Create a list of custom actions as needed by the SCXMLDigester API - List customDialogActions = new ArrayList(); customDialogActions.add(redirectAction); + + // <shale:view> + CustomAction viewAction = + new CustomAction(Globals.CUSTOM_SCXML_ACTIONS_URI, + "view", ViewAction.class); + customDialogActions.add(viewAction); while (iterator.hasNext()) { From torresjennifer@example.com Fri Dec 01 20:25:27 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 60834 invoked from network); 1 Dec 2006 20:25:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 20:25:27 -0000 Received: (qmail 10045 invoked by uid 500); 1 Dec 2006 20:25:36 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 10026 invoked by uid 500); 1 Dec 2006 20:25:36 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 10017 invoked by uid 99); 1 Dec 2006 20:25:35 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 12:25:35 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 12:25:26 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 5FE0B1A9846; Fri, 1 Dec 2006 12:24:47 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481376 - /shale/framework/trunk/shale-apps/shale-test-dialog-scxml/src/main/webapp/WEB-INF/wizard.xml Date: Fri, 01 Dec 2006 20:24:47 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 12:24:46 2006 New Revision: 481376 URL: http://svn.apache.org/viewvc?view=rev&rev=481376 Log: Illustrate use of <shale:view> via test application. Related to: SHALE-347 Modified: shale/framework/trunk/shale-apps/shale-test-dialog-scxml/src/main/webapp/WEB-INF/wizard.xml Modified: shale/framework/trunk/shale-apps/shale-test-dialog-scxml/src/main/webapp/WEB-INF/wizard.xml URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-apps/shale-test-dialog-scxml/src/main/webapp/WEB-INF/wizard.xml?view=diff&rev=481376&r1=481375&r2=481376 ============================================================================== --- shale/framework/trunk/shale-apps/shale-test-dialog-scxml/src/main/webapp/WEB-INF/wizard.xml (original) +++ shale/framework/trunk/shale-apps/shale-test-dialog-scxml/src/main/webapp/WEB-INF/wizard.xml Fri Dec 1 12:24:46 2006 @@ -32,6 +32,9 @@ <transition target="wizardpage1" cond="${outcome eq 'success'}"/> </state> + <!-- Since no view ID is explicitly specified, the DialogStateMapper is used + which by default uses an identity transform + (the view ID is the same as the state ID) --> <state id="wizardpage1"> <transition target="wizardcancelled" event="faces.outcome" cond="${outcome eq 'cancelled'}"/> <transition target="wizardfinished" event="faces.outcome" cond="${outcome eq 'finished'}"/> @@ -46,7 +49,7 @@ </onentry> <transition target="wizardcancelled" event="faces.outcome" cond="${outcome eq 'cancelled'}"/> <transition target="wizardfinished" event="faces.outcome" cond="${outcome eq 'finished'}"/> - <transition target="wizardpage3" event="faces.outcome" cond="${outcome eq 'next'}"/> + <transition target="page3" event="faces.outcome" cond="${outcome eq 'next'}"/> <transition target="wizardpage1" event="faces.outcome" cond="${outcome eq 'previous'}"/> <transition target="menu" event="faces.outcome" cond="${outcome eq 'exit'}"/> <onexit> @@ -55,7 +58,12 @@ </onexit> </state> - <state id="wizardpage3"> + <state id="page3"> + <onentry> + <!-- The view ID to be rendered while in this "view" state + is explicitly specified in this case --> + <shale:view viewId="/wizardpage3" /> + </onentry> <transition target="wizardcancelled" event="faces.outcome" cond="${outcome eq 'cancelled'}"/> <transition target="wizardfinished" event="faces.outcome" cond="${outcome eq 'finished'}"/> <transition target="wizardpage2" event="faces.outcome" cond="${outcome eq 'previous'}"/> From torresjennifer@example.com Fri Dec 01 21:17:46 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 7765 invoked from network); 1 Dec 2006 21:17:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 21:17:45 -0000 Received: (qmail 4444 invoked by uid 500); 1 Dec 2006 21:17:54 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 4407 invoked by uid 500); 1 Dec 2006 21:17:54 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 4397 invoked by uid 99); 1 Dec 2006 21:17:54 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:17:54 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:17:44 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 70F011A9846; Fri, 1 Dec 2006 13:17:05 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481395 - in /shale/framework/trunk: shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/ shale-remoting/src/main/java/org/apache/shale/remoting/impl/ shale-remoting/src/test/java/org/apache/shale/remoting/faces/ shale-validator/... Date: Fri, 01 Dec 2006 21:17:04 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 13:17:02 2006 New Revision: 481395 URL: http://svn.apache.org/viewvc?view=rev&rev=481395 Log: Organize imports in files that have unused imports. SHALE-310 Modified: shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogManager.java shale/framework/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java shale/framework/trunk/shale-remoting/src/test/java/org/apache/shale/remoting/faces/MappingsHelperTestCase.java shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/validator/AbstractValidator.java shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/AbstractValidatorTestCase.java shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/IntegerValidatorTestCase.java Modified: shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogManager.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogManager.java?view=diff&rev=481395&r1=481394&r2=481395 ============================================================================== --- shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogManager.java (original) +++ shale/framework/trunk/shale-dialog-basic/src/main/java/org/apache/shale/dialog/basic/BasicDialogManager.java Fri Dec 1 13:17:02 2006 @@ -18,11 +18,9 @@ package org.apache.shale.dialog.basic; import java.io.Serializable; -import java.net.URL; import java.util.HashMap; import java.util.Map; -import javax.faces.FacesException; import javax.faces.context.FacesContext; import org.apache.commons.logging.Log; Modified: shale/framework/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java?view=diff&rev=481395&r1=481394&r2=481395 ============================================================================== --- shale/framework/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java (original) +++ shale/framework/trunk/shale-remoting/src/main/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java Fri Dec 1 13:17:02 2006 @@ -24,21 +24,20 @@ import java.net.URL; import java.net.URLConnection; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Date; import java.util.HashMap; import java.util.Iterator; -import java.util.List; import java.util.Locale; import java.util.Map; import java.util.TimeZone; + import javax.faces.context.FacesContext; import javax.servlet.ServletContext; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.shale.remoting.impl.FilteringProcessor; import org.apache.shale.remoting.Processor; import org.apache.shale.remoting.faces.ResponseFactory; Modified: shale/framework/trunk/shale-remoting/src/test/java/org/apache/shale/remoting/faces/MappingsHelperTestCase.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-remoting/src/test/java/org/apache/shale/remoting/faces/MappingsHelperTestCase.java?view=diff&rev=481395&r1=481394&r2=481395 ============================================================================== --- shale/framework/trunk/shale-remoting/src/test/java/org/apache/shale/remoting/faces/MappingsHelperTestCase.java (original) +++ shale/framework/trunk/shale-remoting/src/test/java/org/apache/shale/remoting/faces/MappingsHelperTestCase.java Fri Dec 1 13:17:02 2006 @@ -18,9 +18,10 @@ package org.apache.shale.remoting.faces; import javax.faces.application.ViewHandler; -import javax.faces.component.UIViewRoot; + import junit.framework.Test; import junit.framework.TestSuite; + import org.apache.shale.remoting.Constants; import org.apache.shale.remoting.Mapping; import org.apache.shale.remoting.Mappings; Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java?view=diff&rev=481395&r1=481394&r2=481395 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java (original) +++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java Fri Dec 1 13:17:02 2006 @@ -17,12 +17,10 @@ package org.apache.shale.validator; -import java.io.IOException; import java.io.Serializable; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; -import java.net.URL; import java.text.MessageFormat; import java.util.ArrayList; import java.util.HashMap; @@ -32,6 +30,7 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.StringTokenizer; + import javax.faces.application.Application; import javax.faces.application.FacesMessage; import javax.faces.component.UIComponent; @@ -39,6 +38,7 @@ import javax.faces.context.FacesContext; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; + import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.validator.Arg; @@ -51,7 +51,6 @@ import org.apache.shale.util.ConverterHelper; import org.apache.shale.util.Messages; import org.apache.shale.util.Tags; -import org.xml.sax.SAXException; /** * <p>This is a JavaServer Faces <code>Validator</code> that uses Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/validator/AbstractValidator.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/validator/AbstractValidator.java?view=diff&rev=481395&r1=481394&r2=481395 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/validator/AbstractValidator.java (original) +++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/validator/AbstractValidator.java Fri Dec 1 13:17:02 2006 @@ -22,14 +22,13 @@ import java.text.MessageFormat; import java.util.Locale; import java.util.Map; -import java.util.MissingResourceException; -import java.util.ResourceBundle; + import javax.faces.application.FacesMessage; -import javax.faces.component.StateHolder; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; + import org.apache.commons.validator.Arg; import org.apache.commons.validator.ValidatorResources; import org.apache.shale.util.ConverterHelper; Modified: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/AbstractValidatorTestCase.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/AbstractValidatorTestCase.java?view=diff&rev=481395&r1=481394&r2=481395 ============================================================================== --- shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/AbstractValidatorTestCase.java (original) +++ shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/AbstractValidatorTestCase.java Fri Dec 1 13:17:02 2006 @@ -19,10 +19,12 @@ import java.util.Locale; import java.util.ResourceBundle; -import javax.faces.validator.Validator; + import javax.servlet.ServletContextEvent; + import junit.framework.Test; import junit.framework.TestSuite; + import org.apache.commons.validator.ValidatorAction; import org.apache.commons.validator.ValidatorResources; import org.apache.shale.test.base.AbstractJsfTestCase; Modified: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/IntegerValidatorTestCase.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/IntegerValidatorTestCase.java?view=diff&rev=481395&r1=481394&r2=481395 ============================================================================== --- shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/IntegerValidatorTestCase.java (original) +++ shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/IntegerValidatorTestCase.java Fri Dec 1 13:17:02 2006 @@ -18,19 +18,17 @@ package org.apache.shale.validator.validator; import java.util.Locale; -import java.util.ResourceBundle; + import javax.faces.component.UIForm; import javax.faces.component.UIInput; -import javax.faces.validator.Validator; import javax.faces.validator.ValidatorException; import javax.servlet.ServletContextEvent; + import junit.framework.Test; import junit.framework.TestSuite; -import org.apache.commons.validator.ValidatorAction; -import org.apache.commons.validator.ValidatorResources; + import org.apache.shale.test.base.AbstractJsfTestCase; import org.apache.shale.validator.faces.ValidatorLifecycleListener; -import org.apache.shale.validator.util.ShaleValidatorAction; /** * <p>Test case for <code>IntegerValidator</code>.</p> From torresjennifer@example.com Fri Dec 01 21:21:33 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 8695 invoked from network); 1 Dec 2006 21:21:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 21:21:32 -0000 Received: (qmail 8729 invoked by uid 500); 1 Dec 2006 21:21:41 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 8708 invoked by uid 500); 1 Dec 2006 21:21:41 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 8699 invoked by uid 99); 1 Dec 2006 21:21:41 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:21:41 -0800 X-ASF-Spam-Status: No, hits=-7.6 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,SUBJECT_DRUG_GAP_L X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:21:32 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 24D171A9846; Fri, 1 Dec 2006 13:20:53 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481399 - in /shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag: IntegerConverterTag.java IntegerValidatorTag.java Date: Fri, 01 Dec 2006 21:20:52 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 13:20:51 2006 New Revision: 481399 URL: http://svn.apache.org/viewvc?view=rev&rev=481399 Log: SVUIDs SHALE-320 Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/IntegerConverterTag.java shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/IntegerValidatorTag.java Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/IntegerConverterTag.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/IntegerConverterTag.java?view=diff&rev=481399&r1=481398&r2=481399 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/IntegerConverterTag.java (original) +++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/IntegerConverterTag.java Fri Dec 1 13:20:51 2006 @@ -36,6 +36,12 @@ /** + * Serial version UID. + */ + private static final long serialVersionUID = 1L; + + + /** * <p>Helper object for performing conversions.</p> */ private static final ConverterHelper HELPER = Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/IntegerValidatorTag.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/IntegerValidatorTag.java?view=diff&rev=481399&r1=481398&r2=481399 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/IntegerValidatorTag.java (original) +++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/tag/IntegerValidatorTag.java Fri Dec 1 13:20:51 2006 @@ -35,6 +35,12 @@ /** + * Serial version UID. + */ + private static final long serialVersionUID = 1L; + + + /** * <p>Helper object for performing conversions.</p> */ private static final ConverterHelper HELPER = From torresjennifer@example.com Fri Dec 01 21:28:35 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 10318 invoked from network); 1 Dec 2006 21:28:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 21:28:35 -0000 Received: (qmail 16687 invoked by uid 500); 1 Dec 2006 21:28:44 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 16669 invoked by uid 500); 1 Dec 2006 21:28:44 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 16660 invoked by uid 99); 1 Dec 2006 21:28:44 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:28:44 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:28:34 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id A66B11A9846; Fri, 1 Dec 2006 13:27:55 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481403 - /shale/framework/trunk/shale-core/src/main/java/org/apache/shale/util/Messages.java Date: Fri, 01 Dec 2006 21:27:55 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 13:27:54 2006 New Revision: 481403 URL: http://svn.apache.org/viewvc?view=rev&rev=481403 Log: Need to refresh the TCCL, rather than assigning it to a field (as appears to be the *intent*). SHALE-320 Modified: shale/framework/trunk/shale-core/src/main/java/org/apache/shale/util/Messages.java Modified: shale/framework/trunk/shale-core/src/main/java/org/apache/shale/util/Messages.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-core/src/main/java/org/apache/shale/util/Messages.java?view=diff&rev=481403&r1=481402&r2=481403 ============================================================================== --- shale/framework/trunk/shale-core/src/main/java/org/apache/shale/util/Messages.java (original) +++ shale/framework/trunk/shale-core/src/main/java/org/apache/shale/util/Messages.java Fri Dec 1 13:27:54 2006 @@ -284,16 +284,16 @@ assert locale != null; ResourceBundle rb = null; ClassLoader rbcl = cl; - if (cl == null) { - cl = Thread.currentThread().getContextClassLoader(); + if (rbcl == null) { + rbcl = Thread.currentThread().getContextClassLoader(); } synchronized (bundles) { rb = (ResourceBundle) bundles.get(locale); if (rb == null) { try { - rb = ResourceBundle.getBundle(name, locale, cl); + rb = ResourceBundle.getBundle(name, locale, rbcl); } catch (MissingResourceException e) { - rb = ResourceBundle.getBundle(name, defaultLocale, cl); + rb = ResourceBundle.getBundle(name, defaultLocale, rbcl); } if (rb == null) { if (log().isWarnEnabled()) { From torresjennifer@example.com Fri Dec 01 21:30:08 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 10623 invoked from network); 1 Dec 2006 21:30:07 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 21:30:07 -0000 Received: (qmail 18566 invoked by uid 500); 1 Dec 2006 21:30:16 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 18542 invoked by uid 500); 1 Dec 2006 21:30:16 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 18533 invoked by uid 99); 1 Dec 2006 21:30:16 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:30:16 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:30:06 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id E42091A9846; Fri, 1 Dec 2006 13:29:27 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481404 - /shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java Date: Fri, 01 Dec 2006 21:29:27 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 13:29:27 2006 New Revision: 481404 URL: http://svn.apache.org/viewvc?view=rev&rev=481404 Log: Use the app map reference established a line ago. SHALE-320 Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java?view=diff&rev=481404&r1=481403&r2=481404 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java (original) +++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/CommonsValidator.java Fri Dec 1 13:29:27 2006 @@ -461,8 +461,7 @@ FacesContext context = FacesContext.getCurrentInstance(); ExternalContext external = context.getExternalContext(); Map applicationMap = external.getApplicationMap(); - return (ValidatorResources) - context.getExternalContext().getApplicationMap().get(Globals.VALIDATOR_RESOURCES); + return (ValidatorResources) applicationMap.get(Globals.VALIDATOR_RESOURCES); } From torresjennifer@example.com Fri Dec 01 21:46:02 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 14785 invoked from network); 1 Dec 2006 21:46:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 21:46:02 -0000 Received: (qmail 51907 invoked by uid 500); 1 Dec 2006 21:46:11 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 51886 invoked by uid 500); 1 Dec 2006 21:46:11 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 51877 invoked by uid 99); 1 Dec 2006 21:46:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:46:11 -0800 X-ASF-Spam-Status: No, hits=-7.6 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,SUBJECT_DRUG_GAP_L X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:46:01 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 8FC241A9846; Fri, 1 Dec 2006 13:45:22 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481412 - /shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java Date: Fri, 01 Dec 2006 21:45:22 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 13:45:21 2006 New Revision: 481412 URL: http://svn.apache.org/viewvc?view=rev&rev=481412 Log: Seems to be inconsequential. SHALE-320 Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java?view=diff&rev=481412&r1=481411&r2=481412 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java (original) +++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java Fri Dec 1 13:45:21 2006 @@ -117,7 +117,6 @@ */ public ValidatorTag() { setValidatorId("org.apache.shale.CommonsValidator"); - FacesContext context = FacesContext.getCurrentInstance(); } From torresjennifer@example.com Fri Dec 01 21:48:49 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 15227 invoked from network); 1 Dec 2006 21:48:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Dec 2006 21:48:48 -0000 Received: (qmail 56597 invoked by uid 500); 1 Dec 2006 21:48:57 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 56578 invoked by uid 500); 1 Dec 2006 21:48:57 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 56569 invoked by uid 99); 1 Dec 2006 21:48:57 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:48:57 -0800 X-ASF-Spam-Status: No, hits=-7.6 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,SUBJECT_DRUG_GAP_L X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 13:48:47 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 49E401A9846; Fri, 1 Dec 2006 13:48:08 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481413 - /shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java Date: Fri, 01 Dec 2006 21:48:08 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: rahul Date: Fri Dec 1 13:48:06 2006 New Revision: 481413 URL: http://svn.apache.org/viewvc?view=rev&rev=481413 Log: Reorg imports. SHALE-310 Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java?view=diff&rev=481413&r1=481412&r2=481413 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java (original) +++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/faces/ValidatorTag.java Fri Dec 1 13:48:06 2006 @@ -20,9 +20,10 @@ import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; -import javax.faces.context.FacesContext; + import javax.faces.validator.Validator; import javax.servlet.jsp.JspException; + import org.apache.shale.util.Tags; import org.apache.shale.validator.CommonsValidator; From torresjennifer@example.com Sat Dec 02 00:43:54 2006 Return-Path: <torresjennifer@example.com> Delivered-To: torresjennifer@example.com Received: (qmail 57067 invoked from network); 2 Dec 2006 00:43:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Dec 2006 00:43:53 -0000 Received: (qmail 61529 invoked by uid 500); 2 Dec 2006 00:44:02 -0000 Delivered-To: torresjennifer@example.com Received: (qmail 61485 invoked by uid 500); 2 Dec 2006 00:44:02 -0000 Mailing-List: contact torresjennifer@example.com; run by ezmlm Precedence: bulk List-Help: <mailto:torresjennifer@example.com> List-Unsubscribe: <mailto:torresjennifer@example.com> List-Post: <mailto:torresjennifer@example.com> List-Id: <commits.shale.apache.org> Reply-To: torresjennifer@example.com Delivered-To: mailing list torresjennifer@example.com Received: (qmail 61472 invoked by uid 99); 2 Dec 2006 00:44:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 16:44:02 -0800 X-ASF-Spam-Status: No, hits=-7.6 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,SUBJECT_DRUG_GAP_L X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Dec 2006 16:43:50 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 01A011A984A; Fri, 1 Dec 2006 16:43:10 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r481462 [1/2] - in /shale/framework/trunk/shale-validator/src: main/java/org/apache/shale/validator/converter/ main/java/org/apache/shale/validator/util/ main/java/org/apache/shale/validator/validator/ main/resources/META-INF/ test/java/org... Date: Sat, 02 Dec 2006 00:43:09 -0000 To: torresjennifer@example.com From: torresjennifer@example.com X-Mailer: svnmailer-1.1.0 Message-Id: <torresjennifer@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: craigmcc Date: Fri Dec 1 16:43:07 2006 New Revision: 481462 URL: http://svn.apache.org/viewvc?view=rev&rev=481462 Log: Initial set of converters and validators for the common numeric types (double, float, integer, long, and short) that wrap Commons Validator 1.3 (soon to become 1.3.1) facilities. The client side Javascript for the new validators is not hooked up yet; that will happen soon. SHALE-342 Added: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/AbstractConverterTestCase.java (with props) shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/ConcreteConverter.java (with props) shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/DoubleConverterTestCase.java (with props) shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/FloatConverterTestCase.java (with props) shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/IntegerConverterTestCase.java (with props) shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/LongConverterTestCase.java (with props) shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/ShortConverterTestCase.java (with props) shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/DoubleValidatorTestCase.java (with props) shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/FloatValidatorTestCase.java (with props) shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/LongValidatorTestCase.java (with props) shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/ShortValidatorTestCase.java (with props) Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/converter/AbstractConverter.java shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/util/AbstractUtilities.java shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/validator/AbstractValidator.java shale/framework/trunk/shale-validator/src/main/resources/META-INF/faces-config.xml shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/validator/AbstractValidatorTestCase.java Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/converter/AbstractConverter.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/converter/AbstractConverter.java?view=diff&rev=481462&r1=481461&r2=481462 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/converter/AbstractConverter.java (original) +++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/converter/AbstractConverter.java Fri Dec 1 16:43:07 2006 @@ -33,6 +33,9 @@ // ------------------------------------------------------------ Constructors + // ------------------------------------------------------ Manifest Constants + + // -------------------------------------------------------------- Properties Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/util/AbstractUtilities.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/util/AbstractUtilities.java?view=diff&rev=481462&r1=481461&r2=481462 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/util/AbstractUtilities.java (original) +++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/util/AbstractUtilities.java Fri Dec 1 16:43:07 2006 @@ -41,7 +41,7 @@ /** * <p>Name of the resource bundle containing default message strings.</p> */ - static final String DEFAULT_RESOURCE_BUNDLE = + public static final String DEFAULT_RESOURCE_BUNDLE = "org.apache.shale.validator.resources.Bundle"; Modified: shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/validator/AbstractValidator.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/validator/AbstractValidator.java?view=diff&rev=481462&r1=481461&r2=481462 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/validator/AbstractValidator.java (original) +++ shale/framework/trunk/shale-validator/src/main/java/org/apache/shale/validator/validator/AbstractValidator.java Fri Dec 1 16:43:07 2006 @@ -61,13 +61,6 @@ /** - * <p>Name of the resource bundle containing default message templates.</p> - */ - static final String DEFAULT_RESOURCE_BUNDLE = - "org.apache.shale.validator.messages"; - - - /** * <p>Variable name in a <code>vars</code> map representing the maximum * value that should be accepted by this <code>Validator</code>.</p> */ Modified: shale/framework/trunk/shale-validator/src/main/resources/META-INF/faces-config.xml URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/main/resources/META-INF/faces-config.xml?view=diff&rev=481462&r1=481461&r2=481462 ============================================================================== --- shale/framework/trunk/shale-validator/src/main/resources/META-INF/faces-config.xml (original) +++ shale/framework/trunk/shale-validator/src/main/resources/META-INF/faces-config.xml Fri Dec 1 16:43:07 2006 @@ -61,20 +61,76 @@ <!-- ========== Custom Converters ========== --> <converter> + <converter-id>org.apache.shale.converter.Double</converter-id> + <converter-class> + org.apache.shale.validator.converter.DoubleConverter + </converter-class> + </converter> + + <converter> + <converter-id>org.apache.shale.converter.Float</converter-id> + <converter-class> + org.apache.shale.validator.converter.FloatConverter + </converter-class> + </converter> + + <converter> <converter-id>org.apache.shale.converter.Integer</converter-id> <converter-class> org.apache.shale.validator.converter.IntegerConverter </converter-class> </converter> + <converter> + <converter-id>org.apache.shale.converter.Long</converter-id> + <converter-class> + org.apache.shale.validator.converter.LongConverter + </converter-class> + </converter> + + <converter> + <converter-id>org.apache.shale.converter.Short</converter-id> + <converter-class> + org.apache.shale.validator.converter.ShortConverter + </converter-class> + </converter> + <!-- ========== Custom Validators ========== --> <validator> + <validator-id>org.apache.shale.validator.Double</validator-id> + <validator-class> + org.apache.shale.validator.validator.DoubleValidator + </validator-class> + </validator> + + <validator> + <validator-id>org.apache.shale.validator.Float</validator-id> + <validator-class> + org.apache.shale.validator.validator.FloatValidator + </validator-class> + </validator> + + <validator> <validator-id>org.apache.shale.validator.Integer</validator-id> <validator-class> org.apache.shale.validator.validator.IntegerValidator + </validator-class> + </validator> + + <validator> + <validator-id>org.apache.shale.validator.Long</validator-id> + <validator-class> + org.apache.shale.validator.validator.LongValidator + </validator-class> + </validator> + + <validator> + <validator-id>org.apache.shale.validator.Short</validator-id> + <validator-class> + org.apache.shale.validator.validator.ShortValidator </validator-class> </validator> Added: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/AbstractConverterTestCase.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/AbstractConverterTestCase.java?view=auto&rev=481462 ============================================================================== --- shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/AbstractConverterTestCase.java (added) +++ shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/AbstractConverterTestCase.java Fri Dec 1 16:43:07 2006 @@ -0,0 +1,124 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + */ + +package org.apache.shale.validator.converter; + +import java.util.Locale; +import java.util.ResourceBundle; +import javax.servlet.ServletContextEvent; +import org.apache.shale.test.base.AbstractJsfTestCase; +import org.apache.shale.validator.faces.ValidatorLifecycleListener; +import org.apache.shale.validator.util.AbstractUtilities; + +/** + * <p>Test case for the utility methods provided by + * <code>AbstractConverter</code>.</p> + */ +public class AbstractConverterTestCase extends AbstractJsfTestCase { + + + // ------------------------------------------------------------ Constructors + + + // Construct a new instance of this test case. + public AbstractConverterTestCase(String name) { + super(name); + } + + + // ---------------------------------------------------- Overall Test Methods + + + // Set up instance variables required by this test case. + protected void setUp() throws Exception { + + super.setUp(); + application.setMessageBundle("org.apache.shale.validator.TestBundle"); + facesContext.getViewRoot().setLocale(Locale.US); + + listener = new ValidatorLifecycleListener(); + listener.contextInitialized(new ServletContextEvent(servletContext)); + + converter = new ConcreteConverter(); + + } + + + // Tear down instance variables required by this test case. + protected void tearDown() throws Exception { + + converter = null; + + listener.contextDestroyed(new ServletContextEvent(servletContext)); + listener = null; + + super.tearDown(); + + } + + + // -------------------------------------------------------- Static Variables + + + /** + * <p>Default resource bundle for error message lookup + */ + protected static final ResourceBundle defaultBundle = + ResourceBundle.getBundle(AbstractUtilities.DEFAULT_RESOURCE_BUNDLE, Locale.US); + + + // ------------------------------------------------------ Instance Variables + + + /** + * <p>ValidatorLifecycleListener used to load configuration resources</p> + */ + protected ValidatorLifecycleListener listener = null; + + + /** + * <p>Converter instance under test.</p> + */ + protected ConcreteConverter converter = null; + + + // ------------------------------------------------- Individual Test Methods + + + // Test retrieving messages + public void testMessage() { + + String message = null; + + // Check a message that should be overridden by the application + message = converter.message(facesContext, "errors.long"); + assertNotNull(message); + assertEquals("Custom Long Error Message", message); + + // Check a message that should be grabbed from the default resources + message = converter.message(facesContext, "errors.integer"); + assertNotNull(message); + assertEquals(defaultBundle.getString("errors.integer"), message); + + // Check a message that should be undefined + message = converter.message(facesContext, "???undefined???"); + assertNull(message); + + } + + +} Propchange: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/AbstractConverterTestCase.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/AbstractConverterTestCase.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Added: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/ConcreteConverter.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/ConcreteConverter.java?view=auto&rev=481462 ============================================================================== --- shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/ConcreteConverter.java (added) +++ shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/ConcreteConverter.java Fri Dec 1 16:43:07 2006 @@ -0,0 +1,54 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + */ + +package org.apache.shale.validator.converter; + +import javax.faces.component.UIComponent; +import javax.faces.context.FacesContext; + +/** + * <p>Simple concrete implementation of <code>AbstractConverter</code>.</p> + */ +public class ConcreteConverter extends AbstractConverter { + + + public Object getAsObject(FacesContext context, UIComponent component, + String value) { + return value; + } + + + public String getAsString(FacesContext context, UIComponent component, + Object value) { + if (value == null) { + return null; + } else { + return value.toString(); + } + } + + + // Expose the following protected methods publicly for testing purposes + + + public String message(FacesContext context, String key) { + return super.message(context, key); + } + + + +} Propchange: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/ConcreteConverter.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/ConcreteConverter.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Added: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/DoubleConverterTestCase.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/DoubleConverterTestCase.java?view=auto&rev=481462 ============================================================================== --- shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/DoubleConverterTestCase.java (added) +++ shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/DoubleConverterTestCase.java Fri Dec 1 16:43:07 2006 @@ -0,0 +1,306 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + */ + +package org.apache.shale.validator.converter; + +import java.util.Locale; +import javax.faces.component.UIForm; +import javax.faces.component.UIInput; +import javax.faces.convert.ConverterException; +import javax.servlet.ServletContextEvent; +import org.apache.shale.test.base.AbstractJsfTestCase; +import org.apache.shale.validator.faces.ValidatorLifecycleListener; + +/** + * <p>Test case for <code>DoubleConverter</code>.</p> + */ +public class DoubleConverterTestCase extends AbstractJsfTestCase { + + + // ------------------------------------------------------------ Constructors + + + // Construct a new instance of this test case. + public DoubleConverterTestCase(String name) { + super(name); + } + + + // ---------------------------------------------------- Overall Test Methods + + + // Set up instance variables required by this test case. + protected void setUp() throws Exception { + + super.setUp(); + facesContext.getViewRoot().setLocale(Locale.US); + + listener = new ValidatorLifecycleListener(); + listener.contextInitialized(new ServletContextEvent(servletContext)); + + form = new UIForm(); + form.setId("form"); + facesContext.getViewRoot().getChildren().add(form); + + input = new UIInput(); + input.setId("input"); + form.getChildren().add(input); + + converter = new DoubleConverter(); + input.setConverter(converter); + + } + + + // Tear down instance variables required by this test case. + protected void tearDown() throws Exception { + + converter = null; + input = null; + form = null; + + listener.contextDestroyed(new ServletContextEvent(servletContext)); + listener = null; + + super.tearDown(); + + } + + + // -------------------------------------------------------- Static Variables + + + // Valid object values to be tested + private static final Double[] VALID_OBJECTS = + { new Double(Double.MIN_VALUE), + new Double(-123456789), + new Double(-123456.789), + new Double(-123456), + new Double(-123.456), + new Double(-123), + new Double(0), + new Double(123), + new Double(123.456), + new Double(123456), + new Double(123456.789), + new Double(123456789), + new Double(Double.MAX_VALUE), + }; + + + // Valid string values to be tested + private static final String[] VALID_STRINGS = + { String.valueOf(Double.MIN_VALUE), + "-123456789", + "-123456.789", + "-123456", + "-123.456", + "-123", + "0", + "123", + "123.456", + "123456", + "123456.789", + "123456789", + String.valueOf(Double.MAX_VALUE), + }; + + + // Valid string values with grouping (Locale.GERMANY) + private static final String[] VALID_STRINGS_DE = + { "-123.456.789", + "-123.456,789", + "-123.456", + "-123,456", + "123", + "123", + "123,456", + "123.456", + "123.456,789", + "123.456.789", + }; + + + // Valid string values with grouping (Locale.US) + private static final String[] VALID_STRINGS_US = + { "-123,456,789", + "-123,456.789", + "-123,456", + "-123.456", + "123", + "123", + "123.456", + "123,456", + "123,456.789", + "123,456,789", + }; + + + // ------------------------------------------------------ Instance Variables + + + /** + * <p>Converter instance under test.</p> + */ + private DoubleConverter converter = null; + + + /** + * <p>The form component for our input form.</p> + */ + private UIForm form = null; + + + /** + * <p>The text field component for our input form.</p> + */ + private UIInput input = null; + + + /** + * <p>ValidatorLifecycleListener used to load configuration resources</p> + */ + private ValidatorLifecycleListener listener = null; + + + // ------------------------------------------------- Individual Test Methods + + + /** + * <p>Tests for invalid Object input.</p> + */ + public void testInvalidObject() { + + + } + + + /** + * <p>Tests for valid Object input.</p> + */ + public void testValidObject() { + + for (int i = 0; i < VALID_OBJECTS.length; i++) { + Double value = VALID_OBJECTS[i]; + try { + String string = converter.getAsString(facesContext, input, value); + assertEquals("Double value " + value + + " equals String value " + string, + value.doubleValue(), Double.valueOf(strip(string)).doubleValue(), + (double) 0.001); + } catch (ConverterException e) { + fail("Should not have thrown ConverterException for value " + value); + } + } + + } + + + /** + * <p>Tests for invalid String input.</p> + */ + public void testInvalidString() { + + + } + + + /** + * <p>Tests for valid String input.</p> + */ + public void testValidString() { + + for (int i = 0; i < VALID_STRINGS.length; i++) { + String string = VALID_STRINGS[i]; + try { + Object value = converter.getAsObject(facesContext, input, string); + assertTrue(value instanceof Double); + assertEquals("String value " + string + + " equals Double value " + value, + Double.parseDouble(string), + ((Double) value).doubleValue(), + (double) 0.001); + } catch (ConverterException e) { + fail("Should not have thrown ConverterException for value " + string); + } + } + + } + + + /** + * <p>Tests for valid String input with grouping (Locale.GERMANY).</p> + */ + public void testValidStringDE() { + + facesContext.getViewRoot().setLocale(Locale.GERMANY); + for (int i = 0; i < VALID_STRINGS_DE.length; i++) { + String string = VALID_STRINGS_DE[i]; + Object value = converter.getAsObject(facesContext, input, string); + assertTrue(value instanceof Double); + assertEquals("String value " + string + + " equals Double value " + value, + Double.parseDouble(strip(string)), + ((Double) value).doubleValue(), + (double) 0.001); + } + + } + + + /** + * <p>Tests for valid String input with grouping (Locale.US).</p> + */ + public void testValidStringUS() { + + facesContext.getViewRoot().setLocale(Locale.US); + for (int i = 0; i < VALID_STRINGS_US.length; i++) { + String string = VALID_STRINGS_US[i]; + Object value = converter.getAsObject(facesContext, input, string); + assertTrue(value instanceof Double); + assertEquals("String value " + string + + " equals Double value " + value, + Double.parseDouble(strip(string)), + ((Double) value).doubleValue(), + (double) 0.001); + } + + } + + + private String strip(String value) { + char grouping = + Locale.US == facesContext.getViewRoot().getLocale() ? ',' : '.'; + while (true) { + int index = value.indexOf(grouping); + if (index < 0) { + break; + } + value = value.substring(0, index) + value.substring(index + 1); + } + // Switch the decimal point back as well if not US + if (Locale.US != facesContext.getViewRoot().getLocale()) { + int index = value.indexOf(','); + if (index >= 0) { + value = value.substring(0, index) + '.' + value.substring(index + 1); + } + } + return value; + } + + +} Propchange: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/DoubleConverterTestCase.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/DoubleConverterTestCase.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Added: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/FloatConverterTestCase.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/FloatConverterTestCase.java?view=auto&rev=481462 ============================================================================== --- shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/FloatConverterTestCase.java (added) +++ shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/FloatConverterTestCase.java Fri Dec 1 16:43:07 2006 @@ -0,0 +1,289 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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. + */ + +package org.apache.shale.validator.converter; + +import java.util.Locale; +import javax.faces.component.UIForm; +import javax.faces.component.UIInput; +import javax.faces.convert.ConverterException; +import javax.servlet.ServletContextEvent; +import org.apache.shale.test.base.AbstractJsfTestCase; +import org.apache.shale.validator.faces.ValidatorLifecycleListener; + +/** + * <p>Test case for <code>FloatConverter</code>.</p> + */ +public class FloatConverterTestCase extends AbstractJsfTestCase { + + + // ------------------------------------------------------------ Constructors + + + // Construct a new instance of this test case. + public FloatConverterTestCase(String name) { + super(name); + } + + + // ---------------------------------------------------- Overall Test Methods + + + // Set up instance variables required by this test case. + protected void setUp() throws Exception { + + super.setUp(); + facesContext.getViewRoot().setLocale(Locale.US); + + listener = new ValidatorLifecycleListener(); + listener.contextInitialized(new ServletContextEvent(servletContext)); + + form = new UIForm(); + form.setId("form"); + facesContext.getViewRoot().getChildren().add(form); + + input = new UIInput(); + input.setId("input"); + form.getChildren().add(input); + + converter = new FloatConverter(); + input.setConverter(converter); + + } + + + // Tear down instance variables required by this test case. + protected void tearDown() throws Exception { + + converter = null; + input = null; + form = null; + + listener.contextDestroyed(new ServletContextEvent(servletContext)); + listener = null; + + super.tearDown(); + + } + + + // -------------------------------------------------------- Static Variables + + + // Valid object values to be tested + private static final Float[] VALID_OBJECTS = + { new Float(Float.MIN_VALUE), + new Float((float) -123456), + new Float((float) -123.456), + new Float((float) -123), + new Float((float) 0), + new Float((float) 123), + new Float((float) 123.456), + new Float((float) 123456), + new Float(Float.MAX_VALUE), + }; + + + // Valid string values to be tested + private static final String[] VALID_STRINGS = + {// String.valueOf(Float.MIN_VALUE), // JDK format routines do not like this + "-123456", + "-123.456", + "-123", + "0", + "123", + "123.456", + "123456", + // String.valueOf(Float.MAX_VALUE), // JDK format routines do not like this + }; + + + // Valid string values with grouping (Locale.GERMANY) + private static final String[] VALID_STRINGS_DE = + { "-123.456", + "-123,456", + "123", + "123", + "123,456", + "123.456", + }; + + + // Valid string values with grouping (Locale.US) + private static final String[] VALID_STRINGS_US = + { "-123,456", + "-123.456", + "123", + "123", + "123.456", + "123,456", + }; + + + // ------------------------------------------------------ Instance Variables + + + /** + * <p>Converter instance under test.</p> + */ + private FloatConverter converter = null; + + + /** + * <p>The form component for our input form.</p> + */ + private UIForm form = null; + + + /** + * <p>The text field component for our input form.</p> + */ + private UIInput input = null; + + + /** + * <p>ValidatorLifecycleListener used to load configuration resources</p> + */ + private ValidatorLifecycleListener listener = null; + + + // ------------------------------------------------- Individual Test Methods + + + /** + * <p>Tests for invalid Object input.</p> + */ + public void testInvalidObject() { + + + } + + + /** + * <p>Tests for valid Object input.</p> + */ + public void testValidObject() { + + for (int i = 0; i < VALID_OBJECTS.length; i++) { + Float value = VALID_OBJECTS[i]; + try { + String string = converter.getAsString(facesContext, input, value); + assertEquals("Float value " + value + + " equals String value " + string, + value.floatValue(), Float.valueOf(strip(string)).floatValue(), + (float) 0.001); + } catch (ConverterException e) { + fail("Should not have thrown ConverterException for value " + value); + } + } + + } + + + /** + * <p>Tests for invalid String input.</p> + */ + public void testInvalidString() { + + + } + + + /** + * <p>Tests for valid String input.</p> + */ + public void testValidString() { + + for (int i = 0; i < VALID_STRINGS.length; i++) { + String string = VALID_STRINGS[i]; + try { + Object value = converter.getAsObject(facesContext, input, string); + assertEquals("String value " + string + + " equals Float value " + value, + Float.parseFloat(string), + ((Float) value).floatValue(), + (float) 0.001); + } catch (ConverterException e) { + fail("Should not have thrown ConverterException for value " + string); + } + } + + } + + + /** + * <p>Tests for valid String input with grouping (Locale.GERMANY).</p> + */ + public void testValidStringDE() { + + facesContext.getViewRoot().setLocale(Locale.GERMANY); + for (int i = 0; i < VALID_STRINGS_DE.length; i++) { + String string = VALID_STRINGS_DE[i]; + Object value = converter.getAsObject(facesContext, input, string); + assertTrue(value instanceof Float); + assertEquals("String value " + string + + " equals Float value " + value, + Float.parseFloat(strip(string)), + ((Float) value).floatValue(), + (float) 0.001); + } + + } + + + /** + * <p>Tests for valid String input with grouping (Locale.US).</p> + */ + public void testValidStringUS() { + + facesContext.getViewRoot().setLocale(Locale.US); + for (int i = 0; i < VALID_STRINGS_US.length; i++) { + String string = VALID_STRINGS_US[i]; + Object value = converter.getAsObject(facesContext, input, string); + assertTrue(value instanceof Float); + assertEquals("String value " + string + + " equals Float value " + value, + Float.parseFloat(strip(string)), + ((Float) value).floatValue(), + (float) 0.001); + } + + } + + + private String strip(String value) { + char grouping = + Locale.US == facesContext.getViewRoot().getLocale() ? ',' : '.'; + while (true) { + int index = value.indexOf(grouping); + if (index < 0) { + break; + } + value = value.substring(0, index) + value.substring(index + 1); + } + // Switch the decimal point back as well if not US + if (Locale.US != facesContext.getViewRoot().getLocale()) { + int index = value.indexOf(','); + if (index >= 0) { + value = value.substring(0, index) + '.' + value.substring(index + 1); + } + } + return value; + } + + +} Propchange: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/FloatConverterTestCase.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/FloatConverterTestCase.java ------------------------------------------------------------------------------ svn:keywords = Date Author Id Revision HeadURL Added: shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/IntegerConverterTestCase.java URL: http://svn.apache.org/viewvc/shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/IntegerConverterTestCase.java?view=auto&rev=481462 ============================================================================== --- shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/IntegerConverterTestCase.java (added) +++ shale/framework/trunk/shale-validator/src/test/java/org/apache/shale/validator/converter/IntegerConverterTestCase.java Fri Dec 1 16:43:07 2006 @@ -0,0 +1,275 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to you 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 +
{'source': 'Apache Software Foundation Public Mail Archives'}