svn commit: r397299 - /struts/shale/trunk/xdocs/issue-tracking.xml
Author: craigmcc Date: Wed Apr 26 13:57:54 2006 New Revision: 397299 URL: http://svn.apache.org/viewcvs?rev=397299view=rev Log: Update the documentation about issue tracking to reflect the change from Bugzilla to JIRA. Modified: struts/shale/trunk/xdocs/issue-tracking.xml Modified: struts/shale/trunk/xdocs/issue-tracking.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/xdocs/issue-tracking.xml?rev=397299r1=397298r2=397299view=diff == --- struts/shale/trunk/xdocs/issue-tracking.xml (original) +++ struts/shale/trunk/xdocs/issue-tracking.xml Wed Apr 26 13:57:54 2006 @@ -21,43 +21,44 @@ body !-- == -- section name=Issue tracking -p - Shale uses a href=http://issues.apache.org/bugzilla/;ASF Bugzilla/a for tracking issues. - To use Bugzilla you may need to a href=http://issues.apache.org/bugzilla/createaccount.cgi;create an account/a. -/p -p - If you would like to report a bug, or raise an enhancement request with - Shale please do the following: - ol - lia href=http://issues.apache.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMEDamp;bug_status=NEWamp;bug_status=ASSIGNEDamp;bug_status=REOPENEDamp;bug_status=NEEDINFOamp;product=Strutsamp;component=Shale;Search existing open bugs/a. - If you find your issue listed then please add a comment with your details./li + +pShale uses a href=http://issues.apache.org/struts/;JIRA/a for +tracking issues. To add new issues or comments in JIRA, you may need to +a href=http://issues.apache.org/struts/secure/Signup!default.jspa;register/a +and log in first./p + +pIf you would like to report a bug, or raise an enhancement request with +Shale please do the following:/p +ol + liUse the links below to search existing bug reports and RFEs + (request for enhancement). If you find your issue listed, + then please add a comment with your details./li liSearch the a href=http://mail-archives.apache.org/mod_mbox/struts-dev/;Search the mailing list archive/a. You may find your issue or idea has already been discussed./li - lia href=http://issues.apache.org/bugzilla/enter_bug.cgi?product=Strutsamp;version=unspecifiedamp;component=Shaleamp;rep_platform=Allamp;op_sys=Allamp;priority=P1amp;bug_severity=normalamp;bug_status=NEWamp;assigned_to=dev%40struts.apache.orgamp;short_desc=%5BShale%5D%20%22Your%20subject%20heading%20here%22amp;comment=Please%20provide%20details%20here.%20Its%20best%20to%20submit%20patches%20that%20alter%0D%0Aexisting%20file%20content%20in%20%22unified%20cvs%20diff%22%20format.%20%0D%0A%0D%0ASubmissions%20that%20provide%20new%20files%20can%20be%20supplied%20as%20direct%20file%0D%0Aattachments%20or%20archives%20in%20zip%20or%20tar.gz%20format.%20please%20be%20kind%20%0D%0Aenough%20to%20identify%20the%20format%20of%20the%20attached%20archive%20as%20bugzilla%0D%0Atends%20to%20strip%20these%20characterstics%20by%20removing%20the%20files%20extension.amp;commentprivacy=0amp;form_name=enter_bug;Submit a bug report or enhancement request/a. - Please prefix all new issues with [shale] in the summary line. - /li + lia href=http://issues.apache.org/struts/secure/CreateIssue!default.jspa; + Create a new issue in JIRA/a, for project Shale with + the appropriate issue type. (NOTE: because JIRA now has + a project set up for Shale, there is no longer a need to + follow the former convention of prefixing issue subjects + with [shale].)/li /ol -/p -p - Please also remember these points: - ul + +pPlease also remember these points:/p +ul lithe more information you provide, the better we can help you/li litest cases are vital, particularly for any proposed enhancements/li lithe developers of Shale are all unpaid volunteers/li - /ul -/p -p - For more information on subversion and creating patches see the - a href=http://www.apache.org/dev/contributors.html;Apache Contributors Guide/a. -/p -p - You may also find these links useful: - ul - lia href=http://issues.apache.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMEDamp;bug_status=NEWamp;bug_status=ASSIGNEDamp;bug_status=REOPENEDamp;bug_status=NEEDINFOamp;product=Strutsamp;component=Shale;All Open Shale bugs/a/li - lia href=http://issues.apache.org/bugzilla/buglist.cgi?bug_status=RESOLVEDamp;bug_status=VERIFIEDamp;bug_status=CLOSEDamp;product=Strutsamp;component=Shale;All Closed Shale bugs/a/li - lia href=http://issues.apache.org/bugzilla/buglist.cgi?bug_status=UNCONFIRMEDamp;bug_status=NEWamp;bug_status=ASSIGNEDamp;bug_status=REOPENEDamp;bug_status=NEEDINFOamp;bug_status=RESOLVEDamp;bug_status=VERIFIEDamp;bug_status=CLOSEDamp;product=Strutsamp;component=Shale;All Shale bugs/a/li - /ul -/p +/ul + +pFor more information on subversion and creating patches see the +a href=http://www.apache.org/dev/contributors.html;Apache Contributors Guide/a./p + +pYou may also find these links useful:/p +ul + lia href=http
svn commit: r394208 - in /struts/shale/trunk: blank/build.xml clay-plugin/build.xml core-library/build.xml mailreader/build.xml sql-browser/build.xml test-framework/build.xml tiger/build.xml use-cases
Author: craigmcc Date: Fri Apr 14 15:05:19 2006 New Revision: 394208 URL: http://svn.apache.org/viewcvs?rev=394208view=rev Log: Switch the classname used to detect MyFaces to one that did not change between 1.1.1 and 1.1.2. Modified: struts/shale/trunk/blank/build.xml struts/shale/trunk/clay-plugin/build.xml struts/shale/trunk/core-library/build.xml struts/shale/trunk/mailreader/build.xml struts/shale/trunk/sql-browser/build.xml struts/shale/trunk/test-framework/build.xml struts/shale/trunk/tiger/build.xml struts/shale/trunk/use-cases/build.xml Modified: struts/shale/trunk/blank/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/blank/build.xml?rev=394208r1=394207r2=394208view=diff == --- struts/shale/trunk/blank/build.xml (original) +++ struts/shale/trunk/blank/build.xml Fri Apr 14 15:05:19 2006 @@ -44,7 +44,7 @@ available property=license.present file=${basedir}/LICENSE.txt/ available property=myfaces.present - classname=org.apache.myfaces.config.MyfacesConfig + classname=org.apache.myfaces.application.ActionListenerImpl classpathref=search.classpath/ available property=notice.present file=${basedir}/NOTICE.txt/ Modified: struts/shale/trunk/clay-plugin/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/build.xml?rev=394208r1=394207r2=394208view=diff == --- struts/shale/trunk/clay-plugin/build.xml (original) +++ struts/shale/trunk/clay-plugin/build.xml Fri Apr 14 15:05:19 2006 @@ -49,7 +49,7 @@ classname=com.sun.faces.RIConstants classpath=${jsf-impl.jar}/ available property=myfaces.present - classname=org.apache.myfaces.config.MyfacesConfig + classname=org.apache.myfaces.application.ActionListenerImpl classpath=${jsf-impl.jar}/ !-- Build Defaults -- Modified: struts/shale/trunk/core-library/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/build.xml?rev=394208r1=394207r2=394208view=diff == --- struts/shale/trunk/core-library/build.xml (original) +++ struts/shale/trunk/core-library/build.xml Fri Apr 14 15:05:19 2006 @@ -155,8 +155,8 @@ classname=com.sun.faces.RIConstants classpath=${jsf-impl.jar}/ available property=myfaces.present - classname=org.apache.myfaces.config.MyfacesConfig -classpath=${jsf-impl.jar}/ + classname=org.apache.myfaces.application.ActionListenerImpl + classpathref=compile.classpath/ available property=tiles.present classname=org.apache.tiles.servlets.TilesServlet classpathref=compile.classpath/ Modified: struts/shale/trunk/mailreader/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/build.xml?rev=394208r1=394207r2=394208view=diff == --- struts/shale/trunk/mailreader/build.xml (original) +++ struts/shale/trunk/mailreader/build.xml Fri Apr 14 15:05:19 2006 @@ -44,7 +44,7 @@ available property=license.present file=${basedir}/LICENSE.txt/ available property=myfaces.present - classname=org.apache.myfaces.config.MyfacesConfig + classname=org.apache.myfaces.application.ActionListenerImpl classpathref=search.classpath/ available property=notice.present file=${basedir}/NOTICE.txt/ Modified: struts/shale/trunk/sql-browser/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/sql-browser/build.xml?rev=394208r1=394207r2=394208view=diff == --- struts/shale/trunk/sql-browser/build.xml (original) +++ struts/shale/trunk/sql-browser/build.xml Fri Apr 14 15:05:19 2006 @@ -44,7 +44,7 @@ available property=license.present file=${basedir}/LICENSE.txt/ available property=myfaces.present - classname=org.apache.myfaces.config.MyfacesConfig
svn commit: r393147 - /struts/shale/trunk/core-library/src/java/org/apache/shale/remote/
Author: craigmcc Date: Mon Apr 10 23:09:04 2006 New Revision: 393147 URL: http://svn.apache.org/viewcvs?rev=393147view=rev Log: Mark classes in this package as deprecated, with references to using the functionality in org.apache.shale.remoting instead. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remote/AbstractListCompletions.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/AbstractSelectItems.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/BasicListCompletions.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/BasicSelectItems.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/ContextAttributes.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/EvaluateExpression.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/MapEntry.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/RemoteCommand.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/RemoteContext.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/RequestAttributes.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/ResponseWrapper.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/ServletRemoteContext.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/package.html Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remote/AbstractListCompletions.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remote/AbstractListCompletions.java?rev=393147r1=393146r2=393147view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remote/AbstractListCompletions.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remote/AbstractListCompletions.java Mon Apr 10 23:09:04 2006 @@ -30,6 +30,9 @@ * compared to a set of legal values, and causing the selection of those that * match./p * + * @deprecated Use corresponding functionality from the + * codeorg.apache.shale.remoting/code package + * * $Id$ */ Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remote/AbstractSelectItems.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remote/AbstractSelectItems.java?rev=393147r1=393146r2=393147view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remote/AbstractSelectItems.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remote/AbstractSelectItems.java Mon Apr 10 23:09:04 2006 @@ -30,6 +30,9 @@ * of codeSelectItem/code beans, optionally filtered by matching the * label against a test String, and rendering the result as an XML document./p * + * @deprecated Use corresponding functionality from the + * codeorg.apache.shale.remoting/code package + * * $Id$ */ Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remote/BasicListCompletions.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remote/BasicListCompletions.java?rev=393147r1=393146r2=393147view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remote/BasicListCompletions.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remote/BasicListCompletions.java Mon Apr 10 23:09:04 2006 @@ -24,6 +24,9 @@ * key to be used may be configured by calling codesetAttributeKey()/code, * and defaults to the value of the manifest constant codeATTRIBUTE_KEY/code./p * + * @deprecated Use corresponding functionality from the + * codeorg.apache.shale.remoting/code package + * * $Id$ */ Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remote/BasicSelectItems.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remote/BasicSelectItems.java?rev=393147r1=393146r2=393147view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remote/BasicSelectItems.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remote/BasicSelectItems.java Mon Apr 10 23:09:04 2006 @@ -25,6 +25,9 @@ * key to be used may be configured by calling codesetAttributeKey()/code, * and defaults to the value of the manifest constant codeATTRIBUTE_KEY/code./p * + * @deprecated Use corresponding functionality from the + * codeorg.apache.shale.remoting/code package + * * $Id$ */ Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remote
svn commit: r393148 - in /struts/shale/trunk/core-library/src/java/org/apache/shale: faces/ShaleApplicationFilter.java resources/Bundle.properties view/Constants.java view/faces/ViewViewHandler.java
Author: craigmcc Date: Mon Apr 10 23:09:52 2006 New Revision: 393148 URL: http://svn.apache.org/viewcvs?rev=393148view=rev Log: Migrate the initialization logic for configuring which ViewControllerMapper instance will be used from ShaleApplicationFiter to ViewViewHandler, since the org.apache.shale.view package is the only place this is actually used. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewViewHandler.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java?rev=393148r1=393147r2=393148view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java Mon Apr 10 23:09:52 2006 @@ -158,16 +158,6 @@ org/apache/shale/faces/shale-config.xml; -/** - * pThe name of the context initialization parameter that defines the - * fully qualified class name of the [EMAIL PROTECTED] ViewControllerMapper} to be - * used is stored. If not present, the default value is - * codeorg.apache.shale.view.DefaultViewControllerMapper/code./p - */ -public static final String VIEW_CONTROLLER_MAPPER = - org.apache.shale.view.VIEW_CONTROLLER_MAPPER; - - // -- Instance Variables @@ -316,8 +306,6 @@ } context = config.getServletContext(); -context.setAttribute(Constants.VIEW_MAPPER, - getViewControllerMapper()); // Initialize the Shale Tiger Extensions (if present) initTiger(config); @@ -391,46 +379,6 @@ parser.parse(url); return catalog; - -} - - -/** - * pCreate and return the [EMAIL PROTECTED] ViewControllerMapper} instance - * we will use for this application - * - * @exception ServletException if no instance can be created - */ -private ViewControllerMapper getViewControllerMapper() throws ServletException { - -String className = context.getInitParameter(VIEW_CONTROLLER_MAPPER); -if (className == null) { -className = org.apache.shale.view.impl.DefaultViewControllerMapper; -} -ClassLoader cl = Thread.currentThread().getContextClassLoader(); -if (cl == null) { -cl = this.getClass().getClassLoader(); -} -try { -Class clazz = cl.loadClass(className); -return (ViewControllerMapper) clazz.newInstance(); -} catch (ClassCastException e) { -throw new ServletException - (messages.getMessage(filter.vcmCast, - new Object[] { className }), e); -} catch (ClassNotFoundException e) { -throw new ServletException - (messages.getMessage(filter.vcmClass, - new Object[] { className }), e); -} catch (IllegalAccessException e) { -throw new ServletException - (messages.getMessage(filter.vcmAccess, - new Object[] { className }), e); -} catch (InstantiationException e) { -throw new ServletException - (messages.getMessage(filter.vcmInstantiate, - new Object[] { className }), e); -} } Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties?rev=393148r1=393147r2=393148view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties Mon Apr 10 23:09:52 2006 @@ -23,16 +23,16 @@ filter.initException=Exception occurred during init command filter.initializing=Initializing Shale Application Filter filter.parsingResource=Parsing default resource {0} -filter.vcmAccess=ViewControllerMapper class {0} does not have a public no-args constructor -filter.vcmCast=Class {0} does not implement ViewControllerMapper -filter.vcmClass=Cannot find ViewControllerMapper class {0} -filter.vcmInstantiate=ViewControllerMapper class {0} instance cannot be instantiated
svn commit: r389377 - in /struts/shale/trunk: build.properties.sample test-framework/build.xml use-cases/build.xml
Author: craigmcc Date: Mon Mar 27 19:10:03 2006 New Revision: 389377 URL: http://svn.apache.org/viewcvs?rev=389377view=rev Log: *Partial* fix for issue 38627 (undefined htmlunit.home breaks the build) by changing the way that HtmlUnit is autodetected in test-framework/build.xml (which was where the failure occurred). You should now be able to do an ant clean release test from the top level directory without setting htmlunit.home -- although you'll want to review the changes to build.properties.sample if you *do* have HtmlUnit available. Also modified the use-cases/build.xml script to only compile and execute system tests only if HtmlUnit is present. These changes have to be propogated to the other webapp build scripts before the issue can be closed. PR: Bugzilla #38627 Submitted By: Dennis C. Byrnne dennis AT dbyrne.net Modified: struts/shale/trunk/build.properties.sample struts/shale/trunk/test-framework/build.xml struts/shale/trunk/use-cases/build.xml Modified: struts/shale/trunk/build.properties.sample URL: http://svn.apache.org/viewcvs/struts/shale/trunk/build.properties.sample?rev=389377r1=389376r2=389377view=diff == --- struts/shale/trunk/build.properties.sample (original) +++ struts/shale/trunk/build.properties.sample Mon Mar 27 19:10:03 2006 @@ -78,3 +78,11 @@ # (Optional) The path to a Tomcat 5.0.x installation tomcat50.home=c:/java/jakarta-tomcat-5.0.28 + +# (Optional) The following three declarations must be declared and updated +# together, whenever we switch versions of HtmlUnit. The following defaults +# reflect HtmlUnit 1.6 (which is the currently expected version). +htmlunit.home=/usr/local/htmlunit-1.6 +htmlunit.jar=htmlunit-1.6.jar +commons-httpclient.jar=httpclient-3.0-rc2.jar + Modified: struts/shale/trunk/test-framework/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/build.xml?rev=389377r1=389376r2=389377view=diff == --- struts/shale/trunk/test-framework/build.xml (original) +++ struts/shale/trunk/test-framework/build.xml Mon Mar 27 19:10:03 2006 @@ -80,8 +80,8 @@ pathelement location=${shale-core.jar}/ pathelement location=${build.home}/classes/ pathelement location=${junit.jar}/ -fileset dir=${htmlunit.home}/lib - includes=htmlunit*.jar commons-httpclient*.jar/ +pathelement location=${htmlunit.jar}/ +pathelement location=${commons-httpclient.jar}/ /path @@ -92,7 +92,7 @@ /path -!-- Maintenance Targets -- + !-- Maintenance Targets -- target name=clean Modified: struts/shale/trunk/use-cases/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/use-cases/build.xml?rev=389377r1=389376r2=389377view=diff == --- struts/shale/trunk/use-cases/build.xml (original) +++ struts/shale/trunk/use-cases/build.xml Mon Mar 27 19:10:03 2006 @@ -114,14 +114,17 @@ !-- System Integration Test Classpath -- path id=systest.classpath -fileset dir=${htmlunit.home}/lib - includes=*.jar/ -pathelement location=${junit.jar}/ +path refid=test.classpath/ +pathelement location=${htmlunit.jar}/ +pathelement location=${commons-httpclient.jar}/ pathelement location=${build.home}/systest-classes/ /path !-- Conditional Processing Flags -- + available property=htmlunit.present + classname=com.gargoylesoftware.htmlunit.Assert + classpathref=systest.classpath/ available property=jsfri.present classname=com.sun.faces.RIConstants classpath=${jsf-impl.jar}/ @@ -162,6 +165,7 @@ echo message=shale-core.jar = ${shale-core.jar}/ echo message=shale-clay.jar = ${shale-clay.jar}/ echo message=spring-core.jar = ${spring-core.jar}/ +echo message=htmlunit.present = ${htmlunit.present}/ echo message=jsfri.present =${jsfri.present}/ echo message=myfaces.present = ${myfaces.present}/ echo message=spring.present = ${spring.present}/ @@ -487,7 +491,8 @@ !-- === System Integration Tests -- - target name=systest.compile + target name=systest.compile +if=htmlunit.present mkdir dir=${build.home}/systest-classes/ @@ -513,14 +518,20 @@ target name=systest depends=systest.compile - description=Execute system integration tests + description=Execute system integration tests +if=htmlunit.present junit fork=yes printSummary=yes
svn commit: r387384 - /struts/shale/trunk/build.xml
Author: craigmcc Date: Mon Mar 20 18:47:23 2006 New Revision: 387384 URL: http://svn.apache.org/viewcvs?rev=387384view=rev Log: Add sources for the sql-browser example to the release artifacts. Modified: struts/shale/trunk/build.xml Modified: struts/shale/trunk/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/build.xml?rev=387384r1=387383r2=387384view=diff == --- struts/shale/trunk/build.xml (original) +++ struts/shale/trunk/build.xml Mon Mar 20 18:47:23 2006 @@ -822,6 +822,18 @@ excludes=lib/**/ /copy +!-- Copy sql-browser artifacts -- +mkdirdir=${target.dir}/sql-browser/ +mkdirdir=${target.dir}/sql-browser/ext/ +mkdirdir=${target.dir}/sql-browser/lib/ +copy todir=${target.dir}/sql-browser + filesetdir=sql-browser + includes=*.xml *.txt default.properties src/** xdocs/** + excludes=**/.svn/ + filesetdir=sql-browser/dist/ + includes=docs/**/ +/copy + /target - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r385020 - /struts/shale/trunk/docs/release-notes-1.0.1.html
Author: craigmcc Date: Fri Mar 10 21:56:37 2006 New Revision: 385020 URL: http://svn.apache.org/viewcvs?rev=385020view=rev Log: Add initial crack at the release notes for 1.0.1 (phew ... we did quite a lot of stuff!). Still need to refine the list of outstanding issues in section 4. Added: struts/shale/trunk/docs/release-notes-1.0.1.html (with props) Added: struts/shale/trunk/docs/release-notes-1.0.1.html URL: http://svn.apache.org/viewcvs/struts/shale/trunk/docs/release-notes-1.0.1.html?rev=385020view=auto == --- struts/shale/trunk/docs/release-notes-1.0.1.html (added) +++ struts/shale/trunk/docs/release-notes-1.0.1.html Fri Mar 10 21:56:37 2006 @@ -0,0 +1,303 @@ +!-- + + Copyright 2006 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. + + $Id$ + +-- + + +html + + head +titleApache Shale (Version 1.0.1) Release Notes/title + /head + + body + +div align=center + h1Apache Shale (Version 1.0.1) Release Notes/h1 +/div + +ul +lia href=#IntroductionIntroduction/a/li +lia href=#IncludedWhat Is Included/a/li +lia href=#ChangesChanges From Previous Releases/a/li +lia href=#KnownKnown Issues In This Release/a/li +/ul + +a name=Introduction/a +h31.0 Introduction/h3 + +pWelcome to the a href=http://struts.apache.org/struts-shale/;Apache +Shale Framework/a. Shale is a next generation framework for building web +applications using Java technology, and builds upon the framework and +component APIs provided by a href=http://java.sun.com/j2ee/javaserverfaces/; +JavaServer Faces/a./p + +pThis is the second milestone release of Shale, released to encourage +experimentation and gather feedback on usage issues and requested features. +This should be treated as an alpha quality release. However, many of +the APIs in Shale are reasonably stable -- for details, see +a href=http://struts.apache.org/struts-shale/api-stability.html; +Shale API Target Audiences and Stability Ratings/a. + +a name=Included/a +h32.0 What Is Included/h3 + +pA release of Shale includes several primary categories of materials:/p +ul +lia href=../distShale distribution libraries/a: +ul +licodeshale-core.jar/code - Core framework functionality/li +licodeshale-clay.jar/code - Clay plug-in/li +licodeshale-designtime.jar/code - Optional design time integration +with a href=http://developers.sun.com/jscreator/;Sun Java +Studio Creator 2/a/li +licodeshale-remoting.jar/code - Standalone library for components +and applications that wish to support asynchronous callbacks, +such as AJAX requests./li +licodeshale-spring.jar/code - Optional integration layer with +adapters for the a href=http://springframework.org;Spring +Framework/a/li +licodeshale-test.jar/code - Unit test framework/code/li +licodeshale-tiger.jar/code - Optional core extensions that are +available if you are using Java SE 5 (Tiger)/li +licodeshale-tiles.jar/code - Optional integration layer with +the emstandalone/em version of Tiles, currently under +development as part of the a href=http://struts.apache.org; +Apache Struts/a project./li +licodetiles-core.jar/code - For convenience, a copy of the +Standalone Tiles distribution is included here, to avoid the +requirement to extract it from the sample applications./li +/ul +lia href=../webappsExample web applications/a +ul +licodeshale-blank.war/code - Very simple starter application that +includes all of the configuration files and libraries that a typical +Shale application will require./li +licodeshale-mailreader.war/code - Canonical Struts 1.x example +application, converted to use JavaServer Faces and Shale facilities./li +licodeshale-sql-browser.war/code - Simple implementation of an +SQL browsing application that illustrates dynamic changes to the +JSF component tree./li +licodeshale-usecases.war/code Omnibus example application +that illustrates the use of most Shale features./li +/ul/li +liSource code and JavaDocs for the following modules: +ul
svn commit: r384404 - in /struts/shale/trunk/test-framework/src/java/org/apache/shale/test: base/AbstractJsfTestCase.java mock/MockRenderKitFactory.java
Author: craigmcc Date: Wed Mar 8 18:25:34 2006 New Revision: 384404 URL: http://svn.apache.org/viewcvs?rev=384404view=rev Log: Fix MockRenderKitFactory to address issue 38294 in a way that preserves backwards compatibility. * Remove automatic creation of the default HTML BASIC RenderKit from the constructor of MockRenderKitFactory. * Change AbstractJsfTestCase to create a MockRenderKit instance, and add it to the factory. * To preserve backwards compatibility for users of MockRenderKitFactory that do not use AbstractJsfTestCase, make getRenderKit() create a MockRenderKit on the fly (if necessary) for the HTML BASIC render kit. PR: Bugzilla #38294 Submitted by: Dennic C Byrne dennis AT dbyrne.net Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKitFactory.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java?rev=384404r1=384403r2=384404view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java Wed Mar 8 18:25:34 2006 @@ -136,8 +136,8 @@ facesContext.setApplication(application); RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY); -renderKit = (MockRenderKit) - renderKitFactory.getRenderKit(null, RenderKitFactory.HTML_BASIC_RENDER_KIT); +renderKit = new MockRenderKit(); +renderKitFactory.addRenderKit(RenderKitFactory.HTML_BASIC_RENDER_KIT, renderKit); } Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKitFactory.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKitFactory.java?rev=384404r1=384403r2=384404view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKitFactory.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKitFactory.java Wed Mar 8 18:25:34 2006 @@ -42,8 +42,6 @@ public MockRenderKitFactory() { renderKits = new HashMap(); -renderKits.put(RenderKitFactory.HTML_BASIC_RENDER_KIT, - new MockRenderKit()); } @@ -80,6 +78,18 @@ } RenderKit renderKit = (RenderKit) renderKits.get(renderKitId); if (renderKit == null) { +// Issue 38294 -- We removed the automatic creation of the +// default renderkit in the constructor, allowing it to be +// added by AbstractJsfTestCase in the usual case. To preserve +// backwards compatibility, however, create one on the fly +// if the user asks for the default HTML renderkit and it has +// not been manually added yet +if (RenderKitFactory.HTML_BASIC_RENDER_KIT.equals(renderKitId)) { +renderKit = new MockRenderKit(); +renderKits.put(RenderKitFactory.HTML_BASIC_RENDER_KIT, + renderKit); +return renderKit; +} throw new IllegalArgumentException(renderKitId); } return renderKit; - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r382587 - in /struts/shale/trunk/core-library: ./ src/conf/ src/designtime/org/apache/shale/component/ src/designtime/org/apache/shale/design/ src/designtime/org/apache/shale/validator/ sr
Author: craigmcc Date: Thu Mar 2 16:25:46 2006 New Revision: 382587 URL: http://svn.apache.org/viewcvs?rev=382587view=rev Log: Add static design time information (BeanInfo classes) for the three nonvisual components and the converter. Doesn't import successfully yet ... I get a wierd NoClassDefFoundError for LogFactory that I need to investigate on multiple platforms. Added: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java (with props) struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/TokenBeanInfo.java (with props) struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/ValidatorScriptBeanInfo.java (with props) struts/shale/trunk/core-library/src/designtime/org/apache/shale/validator/CommonsValidatorBeanInfo.java (with props) struts/shale/trunk/core-library/src/test/org/apache/shale/design/ struts/shale/trunk/core-library/src/test/org/apache/shale/design/DesignTimeTestCase.java (with props) Modified: struts/shale/trunk/core-library/build.xml struts/shale/trunk/core-library/src/conf/complib-config.xml struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/Bundle.properties struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java struts/shale/trunk/core-library/src/java/org/apache/shale/taglib/CommonsValidatorTag.java struts/shale/trunk/core-library/src/java/org/apache/shale/validator/CommonsValidator.java Modified: struts/shale/trunk/core-library/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/build.xml?rev=382587r1=382586r2=382587view=diff == --- struts/shale/trunk/core-library/build.xml (original) +++ struts/shale/trunk/core-library/build.xml Thu Mar 2 16:25:46 2006 @@ -136,8 +136,14 @@ pathelement location=${spring-core.jar}/ pathelement location=${spring-web.jar}/ pathelement location=${build.home}/classes/ +pathelement location=${build.home}/creator2/ pathelement location=${build.home}/test-classes/ pathelement location=${tiles.jar}/ +pathelement location=${lib.dir}/creator2/com-sun-rave-designtime.jar/ +pathelement location=${lib.dir}/creator2/jsfcl.jar/ +pathelement location=${lib.dir}/creator2/jsfcl-dt.jar/ +pathelement location=${lib.dir}/creator2/openide.jar/ +pathelement location=${lib.dir}/creator2/propertyeditors.jar/ /path !-- Conditional Processing Flags -- @@ -446,6 +452,8 @@ fileset dir=${build.home}/lib includes=shale-core.jar shale-designtime.jar shale-remoting.jar shale-doc.zip shale-src.zip/ /copy +copytodir=${build.home}/complib + file=${commons-validator.jar}/ mkdir dir=${build.home}/complib/META-INF/ copytodir=${build.home}/complib/META-INF file=src/conf/complib-config.xml/ @@ -527,6 +535,8 @@ source=${platform.source} target=${platform.target} classpath refid=test.classpath / + excludename=org/apache/shale/design/** +unless=creator2.present/ /javac !-- Copy non-Java Sources -- Modified: struts/shale/trunk/core-library/src/conf/complib-config.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/conf/complib-config.xml?rev=382587r1=382586r2=382587view=diff == --- struts/shale/trunk/core-library/src/conf/complib-config.xml (original) +++ struts/shale/trunk/core-library/src/conf/complib-config.xml Thu Mar 2 16:25:46 2006 @@ -30,6 +30,7 @@ runtimePath pathElementshale-core.jar/pathElement pathElementshale-remoting.jar/pathElement +pathElementcommons-validator.jar/pathElement /runtimePath designTimePath prependRuntimePath=true Added: struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java?rev=382587view=auto == --- struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java (added) +++ struts/shale/trunk/core-library/src/designtime/org/apache/shale/component/SubviewBeanInfo.java Thu Mar 2 16:25:46 2006 @@ -0,0 +1,72 @@ +/* + * Copyright 2006 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
svn commit: r382238 - in /struts/shale/trunk/core-library: build.xml src/conf/COMPLIB.MF src/conf/complib-bundle.properties src/conf/complib-config.xml
Author: craigmcc Date: Wed Mar 1 17:52:37 2006 New Revision: 382238 URL: http://svn.apache.org/viewcvs?rev=382238view=rev Log: More infrastructure to create the component import library (complib) for Java Studio Creator 2. (This is all optional if you don't have Creator.) Before the complib is actually useful, the next step will be to create the BeanInfo and DesignInfo classes that provide the appropriate design time behavior. Added: struts/shale/trunk/core-library/src/conf/COMPLIB.MF struts/shale/trunk/core-library/src/conf/complib-bundle.properties (with props) struts/shale/trunk/core-library/src/conf/complib-config.xml (with props) Modified: struts/shale/trunk/core-library/build.xml Modified: struts/shale/trunk/core-library/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/build.xml?rev=382238r1=382237r2=382238view=diff == --- struts/shale/trunk/core-library/build.xml (original) +++ struts/shale/trunk/core-library/build.xml Wed Mar 1 17:52:37 2006 @@ -89,6 +89,7 @@ path id=creator2.classpath pathelement location=${jsf-api.jar}/ pathelement location=${build.home}/classes/ +pathelement location=${build.home}/creator2/ pathelement location=${lib.dir}/creator2/com-sun-rave-designtime.jar/ pathelement location=${lib.dir}/creator2/jsfcl.jar/ pathelement location=${lib.dir}/creator2/jsfcl-dt.jar/ @@ -340,6 +341,16 @@ /target + targetname=library-creator2 depends=creator2 if=creator2.present + description=Package Creator2 design time library + +jar jarfile=${build.home}/lib/shale-designtime.jar + basedir=${build.home}/creator2 + manifest=${build.home}/conf/MANIFEST.MF-core/ + + /target + + targetname=library-remoting depends=compile description=Package Remoting support library mkdirdir=${build.home}/shale-remoting/ @@ -388,7 +399,7 @@ /target - targetname=library depends=library-core, library-remoting, library-spring, library-tiles + targetname=library depends=library-core, library-remoting, library-spring, library-tiles, library-creator2 description=Package all libraries/ @@ -419,7 +430,37 @@ !-- Create Binary Distribution -- - target name=dist depends=docs + target name=complib depends=docs if=creator2.present + description=Create Creator2 component import library + +!-- Create zip files containing sources and javadocs -- +zip zipfile=${build.home}/lib/shale-doc.zip + basedir=${dist.home}/docs/api/ +zip zipfile=${build.home}/lib/shale-src.zip + basedir=src/java + excludes=**/.svn/**/ + +!-- Construct the component import archive -- +mkdir dir=${build.home}/complib/ +copytodir=${build.home}/complib + fileset dir=${build.home}/lib + includes=shale-core.jar shale-designtime.jar shale-remoting.jar shale-doc.zip shale-src.zip/ +/copy +mkdir dir=${build.home}/complib/META-INF/ +copytodir=${build.home}/complib/META-INF + file=src/conf/complib-config.xml/ +copytodir=${build.home}/complib/META-INF + file=src/conf/complib-bundle.properties/ + +mkdir dir=${dist.home}/lib/ +jar jarfile=${dist.home}/lib/shale.complib + basedir=${build.home}/complib + manifest=src/conf/COMPLIB.MF/ + + /target + + + target name=dist depends=docs,complib description=Create binary distribution mkdir dir=${dist.home}/ Added: struts/shale/trunk/core-library/src/conf/COMPLIB.MF URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/conf/COMPLIB.MF?rev=382238view=auto == --- struts/shale/trunk/core-library/src/conf/COMPLIB.MF (added) +++ struts/shale/trunk/core-library/src/conf/COMPLIB.MF Wed Mar 1 17:52:37 2006 @@ -0,0 +1,2 @@ +X-Rave-API-Compatibility-Version: 2.0 +X-Rave-Complib-Configuration: META-INF/complib-config.xml Added: struts/shale/trunk/core-library/src/conf/complib-bundle.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/conf/complib-bundle.properties?rev=382238view=auto == --- struts/shale/trunk/core-library/src/conf/complib-bundle.properties (added) +++ struts/shale/trunk/core-library/src/conf/complib-bundle.properties Wed Mar 1 17:52:37 2006 @@ -0,0 +1,21 @@ +# 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
svn commit: r381930 [1/3] - /struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/
Author: craigmcc Date: Tue Feb 28 22:41:06 2006 New Revision: 381930 URL: http://svn.apache.org/viewcvs?rev=381930view=rev Log: Correct line endings from a Windows initial commit. Why, oh why, does the Windows version of the Subversion command line client seem to ignore the default settings for native EOL propogation that the Linux client respects? Modified: struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractActionSourceBeanInfo.java struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractBeanInfo.java struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractDesignInfo.java struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractEditableValueHolderBeanInfo.java struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractValueHolderBeanInfo.java struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/Categories.java Modified: struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractActionSourceBeanInfo.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractActionSourceBeanInfo.java?rev=381930r1=381929r2=381930view=diff == --- struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractActionSourceBeanInfo.java (original) +++ struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractActionSourceBeanInfo.java Tue Feb 28 22:41:06 2006 @@ -1,148 +1,148 @@ -/* - * Copyright 2006 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. - * - * $Id$ - */ - -package org.apache.shale.design; - -import com.sun.jsfcl.std.Action; -import com.sun.rave.designtime.Constants; -import com.sun.rave.designtime.markup.AttributeDescriptor; -import java.beans.EventSetDescriptor; -import java.beans.IntrospectionException; -import java.beans.PropertyDescriptor; -import java.lang.reflect.Method; -import javax.faces.event.ActionEvent; -import javax.faces.event.ActionListener; - -/** - * pConvenience base class for codeBeanInfo/code implementations for - * JavaServer Faces components that implement codeActionSource/code./p - */ -public class AbstractActionSourceBeanInfo extends AbstractBeanInfo { - - -// Constructors - - -/** - * pCreate a new codeBeanInfo/code instance for the specified - * bean class. Default the icon filenames based on the simple class - * name of the bean class./p - * - * @param clazz Bean class for which to create a codeBeanInfo/code - */ -public AbstractActionSourceBeanInfo(Class clazz) { -super(clazz); -} - - -// --- Protected Methods - - -/** - * pAdd the additional event sets defined by codeActionSource/code./p - */ -protected void initEventSetDescriptors() throws Exception { - -super.initEventSetDescriptors(); - -EventSetDescriptor event = null; -Method method = null; - -method = Action.class.getMethod -(action, - new Class[] { }); -event = new EventSetDescriptor -(action, - Action.class, - new Method[] { method }, - null, - null); -event.setValue(Constants.EventSetDescriptor.BINDING_PROPERTY, - propertyDescriptor(action)); -event.setValue(Constants.EventDescriptor.DEFAULT_EVENT_BODY, - bundle.getString(ActionSource.actionHandler)); -eventDescriptorsList.add(event); - -method = ActionListener.class.getMethod -(processAction, - new Class[] { ActionEvent.class }); -event = new EventSetDescriptor -(actionListener, - ActionListener.class, - new Method[] { method }, - null, - null); -event.setHidden(true); -event.setValue(Constants.EventSetDescriptor.BINDING_PROPERTY, - propertyDescriptor(actionListener)); -event.setValue(Constants.EventDescriptor.DEFAULT_EVENT_BODY, - bundle.getString
svn commit: r381930 [3/3] - /struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/
Modified: struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractEditableValueHolderBeanInfo.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractEditableValueHolderBeanInfo.java?rev=381930r1=381929r2=381930view=diff == --- struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractEditableValueHolderBeanInfo.java (original) +++ struts/shale/trunk/core-library/src/designtime/org/apache/shale/design/AbstractEditableValueHolderBeanInfo.java Tue Feb 28 22:41:06 2006 @@ -1,195 +1,195 @@ -/* - * Copyright 2006 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. - * - * $Id$ - */ - -package org.apache.shale.design; - -import com.sun.rave.designtime.Constants; -import com.sun.rave.designtime.Constants.EventDescriptor; -import com.sun.rave.designtime.markup.AttributeDescriptor; -import java.beans.EventSetDescriptor; -import java.beans.IntrospectionException; -import java.beans.PropertyDescriptor; -import java.lang.reflect.Method; -import javax.faces.component.UIComponent; -import javax.faces.context.FacesContext; -import javax.faces.event.ValueChangeEvent; -import javax.faces.event.ValueChangeListener; -import javax.faces.validator.Validator; - -/** - * pConvenience base class for codeBeanInfo/code implementations for - * JavaServer Faces components that implement codeEditableValueHolder/code./p - */ -public class AbstractEditableValueHolderBeanInfo extends AbstractValueHolderBeanInfo { - - -// Constructors - - -/** - * pCreate a new codeBeanInfo/code instance for the specified - * bean class. Default the icon filenames based on the simple class - * name of the bean class./p - * - * @param clazz Bean class for which to create a codeBeanInfo/code - */ -public AbstractEditableValueHolderBeanInfo(Class clazz) { -super(clazz); -} - - -// --- Protected Methods - - -/** - * pAdd the additional event sets defined by codeEditableValueHolder/code./p - */ -protected void initEventSetDescriptors() throws Exception { - -super.initEventSetDescriptors(); - -EventSetDescriptor event = null; -Method method = null; - -method = ValueChangeListener.class.getMethod -(processValueChange, - new Class[] { ValueChangeEvent.class }); -event = new EventSetDescriptor -(valueChange, - ValueChangeListener.class, - new Method[] { method }, - null, - null); -event.setValue(Constants.EventSetDescriptor.BINDING_PROPERTY, - propertyDescriptor(valueChangeListener)); -eventDescriptorsList.add(event); - -method = Validator.class.getMethod -(validate, - new Class[] { FacesContext.class, - UIComponent.class, - Object.class }); -event = new EventSetDescriptor -(validator, - Validator.class, - new Method[] { method }, - null, - null); -event.setValue(Constants.EventSetDescriptor.BINDING_PROPERTY, - propertyDescriptor(validator)); -event.setValue(Constants.EventDescriptor.DEFAULT_EVENT_BODY, - bundle.getString(EditableValueHolder.validatorHandler)); -event.setValue(Constants.EventDescriptor.PARAMETER_NAMES, - new String[] { context, - component, - value }); -event.setValue(Constants.EventDescriptor.REQUIRED_IMPORTS, - new String[] { javax.faces.application.FacesMessage, - javax.faces.validator.ValidatorException }); -eventDescriptorsList.add(event); - -} - - -/** - * pAdd the additional properties defined by codeEditableValueHolder/code./p - */ -protected void initPropertyDescriptors() throws Exception { - -super.initPropertyDescriptors(); - -AttributeDescriptor ad = null; -
svn commit: r379364 - /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java
Author: craigmcc Date: Mon Feb 20 22:14:21 2006 New Revision: 379364 URL: http://svn.apache.org/viewcvs?rev=379364view=rev Log: Establish a new thread context class loader for each individual test. Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java?rev=379364r1=379363r2=379364view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java Mon Feb 20 22:14:21 2006 @@ -16,6 +16,8 @@ package org.apache.shale.test.base; +import java.net.URL; +import java.net.URLClassLoader; import javax.faces.FactoryFinder; import javax.faces.application.ApplicationFactory; import javax.faces.component.UIViewRoot; @@ -87,6 +89,11 @@ // Set up instance variables required by this test case. public void setUp() { +// Set up a new thread context class loader +threadContextClassLoader = Thread.currentThread().getContextClassLoader(); +Thread.currentThread().setContextClassLoader(new URLClassLoader(new URL[0], + this.getClass().getClassLoader())); + // Set up Servlet API Objects servletContext = new MockServletContext(); config = new MockServletConfig(servletContext); @@ -160,6 +167,9 @@ session = null; FactoryFinder.releaseFactories(); +Thread.currentThread().setContextClassLoader(threadContextClassLoader); +threadContextClassLoader = null; + } @@ -180,5 +190,7 @@ protected MockServletContext servletContext = null; protected MockHttpSession session = null; +// Thread context class loader saved and restored after each test +private ClassLoader threadContextClassLoader = null; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r378996 - /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java
Author: craigmcc Date: Sun Feb 19 17:13:21 2006 New Revision: 378996 URL: http://svn.apache.org/viewcvs?rev=378996view=rev Log: Create an empty TestSuite instead of one that analyzes AbstractJsfTestCase for test methods (there will not be any). Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java?rev=378996r1=378995r2=378996view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java Sun Feb 19 17:13:21 2006 @@ -138,7 +138,7 @@ // Return the tests included in this test case. public static Test suite() { -return (new TestSuite(AbstractJsfTestCase.class)); +return (new TestSuite()); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r379038 - /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java
Author: craigmcc Date: Sun Feb 19 22:51:50 2006 New Revision: 379038 URL: http://svn.apache.org/viewcvs?rev=379038view=rev Log: Call FactoryFinder.releaseFactories() at the end of tearDown() in addition to the beginning of setUp() in case test methods are playing fast and loose with JUnit test lifecycle methods. Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java?rev=379038r1=379037r2=379038view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java Sun Feb 19 22:51:50 2006 @@ -157,6 +157,7 @@ response = null; servletContext = null; session = null; +FactoryFinder.releaseFactories(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r378336 - /struts/shale/trunk/sql-browser/src/web/query.jsp
Author: craigmcc Date: Thu Feb 16 10:50:37 2006 New Revision: 378336 URL: http://svn.apache.org/viewcvs?rev=378336view=rev Log: Fix a typo in a value binding expression. Submitted by: Ryan Lubke Ryan.Lubke AT sun.com Modified: struts/shale/trunk/sql-browser/src/web/query.jsp Modified: struts/shale/trunk/sql-browser/src/web/query.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/sql-browser/src/web/query.jsp?rev=378336r1=378335r2=378336view=diff == --- struts/shale/trunk/sql-browser/src/web/query.jsp (original) +++ struts/shale/trunk/sql-browser/src/web/query.jsp Thu Feb 16 10:50:37 2006 @@ -43,7 +43,7 @@ value=#{messages['sqlbrowser.dataSource']}/ h:selectOneMenu id=dataSource - value=#{query.dataSource + value=#{query.dataSource} f:selectItems value=#{appbean.dataSources}/ /h:selectOneMenu - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r378398 - in /struts/shale/trunk: mailreader/src/web/subscription.jsp use-cases/src/web/ajax/zipCode.jsp
Author: craigmcc Date: Thu Feb 16 15:43:40 2006 New Revision: 378398 URL: http://svn.apache.org/viewcvs?rev=378398view=rev Log: Fixed more typos in EL expressions (missing trailing curly brace). Thanks to Ryan Lubke (Ryan.Lubke AT sun.com) for finding these. Modified: struts/shale/trunk/mailreader/src/web/subscription.jsp struts/shale/trunk/use-cases/src/web/ajax/zipCode.jsp Modified: struts/shale/trunk/mailreader/src/web/subscription.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/subscription.jsp?rev=378398r1=378397r2=378398view=diff == --- struts/shale/trunk/mailreader/src/web/subscription.jsp (original) +++ struts/shale/trunk/mailreader/src/web/subscription.jsp Thu Feb 16 15:43:40 2006 @@ -88,9 +88,9 @@ h:panelGroup h:message id=hostMessages for=host - rendered=#{state.mode == 'CREATE'/ + rendered=#{state.mode == 'CREATE'}/ h:outputText value= - rendered=#{state.mode != 'CREATE'/ + rendered=#{state.mode != 'CREATE'}/ /h:panelGroup %-- Third row --% Modified: struts/shale/trunk/use-cases/src/web/ajax/zipCode.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/use-cases/src/web/ajax/zipCode.jsp?rev=378398r1=378397r2=378398view=diff == --- struts/shale/trunk/use-cases/src/web/ajax/zipCode.jsp (original) +++ struts/shale/trunk/use-cases/src/web/ajax/zipCode.jsp Thu Feb 16 15:43:40 2006 @@ -34,7 +34,7 @@ function zipChanged(zip) { sendRequest(%= request.getContextPath() % + - dynamic/remoting$business/cityAndStateForZip.faces + + /dynamic/remoting$business/cityAndStateForZip.faces + ?zip= + escape(zip), processZipCodeSelection); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r378130 - /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java
Author: craigmcc Date: Wed Feb 15 16:50:45 2006 New Revision: 378130 URL: http://svn.apache.org/viewcvs?rev=378130view=rev Log: Add a mock implementation of java.security.Principal to make working with things like MockHttpServletRequest.setUserPrincipal() easier. Added: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java (with props) Added: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java?rev=378130view=auto == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java (added) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java Wed Feb 15 16:50:45 2006 @@ -0,0 +1,63 @@ +/* + * Copyright 2006 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. + */ + +package org.apache.shale.test.mock; + +import java.security.Principal; + +/** + * pMock implementation of codePrincipal/code./p + */ +public class MockPrincipal implements Principal { + + +// Constructors + + +public MockPrincipal() { +this(null); +} + + +public MockPrincipal(String name) { +this.name = name; +} + + +// -- Instance Variables + + +private String name = null; + + +// - Mock Object Methods + + + +public void setName(String name) { +this.name = name; +} + + +// --- Principal Methods + + +public String getName() { +return this.name; +} + + +} Propchange: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java -- svn:eol-style = native Propchange: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrincipal.java -- svn:keywords = Date Author Id Revision HeadURL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r377457 - /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java
Author: craigmcc Date: Mon Feb 13 10:58:46 2006 New Revision: 377457 URL: http://svn.apache.org/viewcvs?rev=377457view=rev Log: Add a getter to access the underlying writer. PR: Bugzlla #38628 Submitted by: Dennis C. Byrne dennis AT dbyrne.net Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java?rev=377457r1=377456r2=377457view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java Mon Feb 13 10:58:46 2006 @@ -49,6 +49,10 @@ // - Mock Object Methods +public Writer getWriter() { +return this.writer; +} + // -- ResponseWriter Methods - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r376888 - in /struts/shale/trunk/use-cases/src: systest/org/apache/shale/usecases/systest/UseCasesTestCase.java web/WEB-INF/web.xml
Author: craigmcc Date: Fri Feb 10 15:33:00 2006 New Revision: 376888 URL: http://svn.apache.org/viewcvs?rev=376888view=rev Log: Switch to client side state saving by default, and update a test case to reflect the change in the deployed application name. Modified: struts/shale/trunk/use-cases/src/systest/org/apache/shale/usecases/systest/UseCasesTestCase.java struts/shale/trunk/use-cases/src/web/WEB-INF/web.xml Modified: struts/shale/trunk/use-cases/src/systest/org/apache/shale/usecases/systest/UseCasesTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/use-cases/src/systest/org/apache/shale/usecases/systest/UseCasesTestCase.java?rev=376888r1=376887r2=376888view=diff == --- struts/shale/trunk/use-cases/src/systest/org/apache/shale/usecases/systest/UseCasesTestCase.java (original) +++ struts/shale/trunk/use-cases/src/systest/org/apache/shale/usecases/systest/UseCasesTestCase.java Fri Feb 10 15:33:00 2006 @@ -97,7 +97,7 @@ if (semicolon = 0) { action = action.substring(0, semicolon); } -assertEquals(/struts-shale-usecases/usecases.faces, action); +assertEquals(/shale-usecases/usecases.faces, action); assertEquals(application/x-www-form-urlencoded, form.getEnctypeAttribute()); assertEquals(, form.getLangAttribute()); assertEquals(post, form.getMethodAttribute()); Modified: struts/shale/trunk/use-cases/src/web/WEB-INF/web.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/use-cases/src/web/WEB-INF/web.xml?rev=376888r1=376887r2=376888view=diff == --- struts/shale/trunk/use-cases/src/web/WEB-INF/web.xml (original) +++ struts/shale/trunk/use-cases/src/web/WEB-INF/web.xml Fri Feb 10 15:33:00 2006 @@ -29,7 +29,7 @@ !-- Select JSF State Saving Mode -- context-param param-namejavax.faces.STATE_SAVING_METHOD/param-name -param-valueserver/param-value +param-valueclient/param-value /context-param !-- Commons Chain Configuration Resources -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r376889 - in /struts/shale/trunk/core-library: build.xml src/java/org/apache/shale/remoting/XhtmlHelper.java src/java/org/apache/shale/remoting/faces/MappingsHelper.java src/java/org/apach
Author: craigmcc Date: Fri Feb 10 15:34:09 2006 New Revision: 376889 URL: http://svn.apache.org/viewcvs?rev=376889view=rev Log: Refactor the configuration of remoting support into a helper class so that it can be used from more than one place. Call it from XhtmlHelper if the very first thing that happens is a non-Faces request forwarding to a Faces response. Added: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/MappingsHelper.java (with props) Modified: struts/shale/trunk/core-library/build.xml struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java Modified: struts/shale/trunk/core-library/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/build.xml?rev=376889r1=376888r2=376889view=diff == --- struts/shale/trunk/core-library/build.xml (original) +++ struts/shale/trunk/core-library/build.xml Fri Feb 10 15:34:09 2006 @@ -113,6 +113,7 @@ pathelement location=${commons-logging.jar}/ pathelement location=${commons-validator.jar}/ pathelement location=${jsf-api.jar}/ +pathelement location=${jsf-impl.jar}/ pathelement location=${jsp-api.jar}/ pathelement location=${junit.jar}/ pathelement location=${servlet-api.jar}/ @@ -464,6 +465,10 @@ value=${test.level}/ sysproperty key=documentRoot value=${build.home}/test-classes/ + sysproperty key=jsfri + value=${jsfri.present}/ + sysproperty key=myfaces + value=${myfaces.present}/ classpath refid=test.classpath/ formatter type=plain usefile=false/ Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java?rev=376889r1=376888r2=376889view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java Fri Feb 10 15:34:09 2006 @@ -25,6 +25,7 @@ import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.context.ResponseWriter; +import org.apache.shale.remoting.faces.MappingsHelper; /** * pHelper bean for rendering links to download resources commonly used @@ -39,7 +40,7 @@ public class XhtmlHelper { -// -- Manifest Constants +// -- Manifest Constants /** @@ -49,6 +50,15 @@ protected static final String PREFIX = org.apache.shale.remoting.LINKED; +// -- Instance Variables + + +/** + * pHelper to retrieve the [EMAIL PROTECTED] Mappings} instance for this application./p + */ +private MappingsHelper helper = new MappingsHelper(); + + // -- Public Methods @@ -197,9 +207,7 @@ } // Acquire a reference to the Mappings instance for this application -Mappings mappings = (Mappings) - context.getExternalContext().getApplicationMap(). - get(Constants.MAPPINGS_ATTR); +Mappings mappings = helper.getMappings(context); if (mappings == null) { throw new IllegalStateException (resourceBundle(context).getString(xhtml.noMappings)); Added: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/MappingsHelper.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/MappingsHelper.java?rev=376889view=auto == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/MappingsHelper.java (added) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/MappingsHelper.java Fri Feb 10 15:34:09 2006 @@ -0,0 +1,406 @@ +/* + * Copyright 2005-2006 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
svn commit: r376906 - in /struts/shale/trunk/core-library/src/java/org/apache/shale/remoting: XhtmlHelper.java faces/RemotingPhaseListener.java impl/MappingImpl.java
Author: craigmcc Date: Fri Feb 10 17:46:26 2006 New Revision: 376906 URL: http://svn.apache.org/viewcvs?rev=376906view=rev Log: Deal with the fact that, in a portlet environment: * There will be no mapping for FacesServlet in web.xml * We need to map the resource URLs with ViewHandler.getActionURL() to make sure the JSF portlet sees them. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MappingImpl.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java?rev=376906r1=376905r2=376906view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java Fri Feb 10 17:46:26 2006 @@ -213,14 +213,6 @@ (resourceBundle(context).getString(xhtml.noMappings)); } -// Acquire the first mapping to be used for FacesServlet -String patterns[] = mappings.getPatterns(); -if ((patterns == null) || (patterns.length 1)) { -throw new IllegalArgumentException - (resourceBundle(context).getString(xhtml.noServletMapping)); -} -String pattern = patterns[0]; // Arbitrarily choose the first one - // Acquire the Mapping instance to be used for the requesed mechanism List list = mappings.getMappings(); if (list == null) { Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java?rev=376906r1=376905r2=376906view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java Fri Feb 10 17:46:26 2006 @@ -83,8 +83,8 @@ // Acquire a reference to the FacesContext for this request FacesContext context = event.getFacesContext(); -if (log().isTraceEnabled()) { -log().trace(Checking view identifier ' + context.getViewRoot().getViewId() + '); +if (log().isInfoEnabled()) { +log().info(Checking view identifier ' + context.getViewRoot().getViewId() + '); } // Match this view identifier against our configured patterns @@ -93,8 +93,8 @@ Mapping mapping = (Mapping) mappings.next(); String resourceId = mapping.mapViewId(context); if (resourceId != null) { -if (log().isDebugEnabled()) { -log().debug(View identifier ' + context.getViewRoot().getViewId() + +if (log().isInfoEnabled()) { +log().info(View identifier ' + context.getViewRoot().getViewId() + ' matched pattern ' + mapping.getPattern() + ' with resource id ' + resourceId + '); } Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MappingImpl.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MappingImpl.java?rev=376906r1=376905r2=376906view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MappingImpl.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MappingImpl.java Fri Feb 10 17:46:26 2006 @@ -151,13 +151,20 @@ /** [EMAIL PROTECTED] */ public String mapResourceId(FacesContext context, String resourceId) { -// Acquire the servlet mapping to be used for FacesServlet +// Acquire the servlet mapping to be used for FacesServlet (if any -- +// there will not be such a mapping in a portlet environment) String patterns[] = getMappings().getPatterns(); -String pattern = patterns[0]; // Arbitrarily choose the first one +String pattern = null; +if ((patterns != null) (patterns.length 0)) { +pattern = patterns[0]; // Arbitrarily choose the first one +} // Configure the entire URL we will return -StringBuffer sb = new StringBuffer(context.getExternalContext().getRequestContextPath()); -if (pattern.endsWith
svn commit: r376140 - in /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock: MockFacesContext.java MockPropertyResolver.java MockServlet.java MockValueBinding.java
Author: craigmcc Date: Wed Feb 8 17:10:34 2006 New Revision: 376140 URL: http://svn.apache.org/viewcvs?rev=376140view=rev Log: Clean up several more unsupported operations on the mock classes. In particular, the isReadonly() and getType() calls on property resolver now work, so they will work on value bindings and method bindings as well. Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockFacesContext.java struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPropertyResolver.java struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockServlet.java struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockValueBinding.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockFacesContext.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockFacesContext.java?rev=376140r1=376139r2=376140view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockFacesContext.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockFacesContext.java Wed Feb 8 17:10:34 2006 @@ -120,8 +120,18 @@ public Severity getMaximumSeverity() { - -throw new UnsupportedOperationException(); + +Severity severity = null; +Iterator messages = getMessages(); +while (messages.hasNext()) { +FacesMessage message = (FacesMessage) messages.next(); +if (severity == null) { +severity = message.getSeverity(); +} else if (message.getSeverity().getOrdinal() severity.getOrdinal()) { +severity = message.getSeverity(); +} +} +return severity; } Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPropertyResolver.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPropertyResolver.java?rev=376140r1=376139r2=376140view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPropertyResolver.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPropertyResolver.java Wed Feb 8 17:10:34 2006 @@ -16,6 +16,7 @@ package org.apache.shale.test.mock; +import java.beans.PropertyDescriptor; import java.lang.reflect.InvocationTargetException; import java.util.Map; @@ -28,10 +29,6 @@ /** * pMock implementation of codePropertyResolver/code./p * - * pThis implementation supports only getValue() and setValue(), to the - * extent that codePropertyUtils.getSimpleProperty()/code and - * codePropertyUtils.setSimpleProperty()/code execute correctly./p - * * $Id$ */ @@ -89,7 +86,7 @@ public Object getValue(Object base, int index) throws PropertyNotFoundException { -throw new UnsupportedOperationException(); +return getValue(base, + index); } @@ -121,7 +118,7 @@ public void setValue(Object base, int index, Object value) throws PropertyNotFoundException { -throw new UnsupportedOperationException(); +setValue(base, + index, value); } @@ -129,7 +126,11 @@ public boolean isReadOnly(Object base, Object property) throws PropertyNotFoundException { -throw new UnsupportedOperationException(); +if (base == null) { +throw new NullPointerException(); +} + String name = property.toString(); +return !PropertyUtils.isWriteable(base, name); } @@ -137,7 +138,7 @@ public boolean isReadOnly(Object base, int index) throws PropertyNotFoundException { -throw new UnsupportedOperationException(); +return isReadOnly(base, + index); } @@ -145,7 +146,19 @@ public Class getType(Object base, Object property) throws PropertyNotFoundException { -throw new UnsupportedOperationException(); +if (base == null) { +throw new NullPointerException(); +} + String name = property.toString(); +try { +return PropertyUtils.getPropertyType(base, name); +} catch (IllegalAccessException e) { +throw new EvaluationException(e); +} catch (InvocationTargetException e) { +throw new EvaluationException(e.getTargetException()); +} catch (NoSuchMethodException e) { +throw new PropertyNotFoundException(name); +} } @@ -153,7 +166,7 @@ public Class getType(Object base, int index) throws PropertyNotFoundException { -throw new UnsupportedOperationException(); +return getType(base, + index
svn commit: r375303 - /struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/faces-config.xml
Author: craigmcc Date: Mon Feb 6 08:11:49 2006 New Revision: 375303 URL: http://svn.apache.org/viewcvs?rev=375303view=rev Log: Add an empty META-INF/faces-config.xml resource for the component library JAR that is built up in the Tiger Extensions unit tests. This is now needed to trigger scanning the JAR for classes with Tiger Extensions annotations. Added: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/faces-config.xml (with props) Added: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/faces-config.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/faces-config.xml?rev=375303view=auto == --- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/faces-config.xml (added) +++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/faces-config.xml Mon Feb 6 08:11:49 2006 @@ -0,0 +1,38 @@ +?xml version=1.0? + + +!DOCTYPE faces-config PUBLIC + -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN + http://java.sun.com/dtd/web-facesconfig_1_1.dtd; + + +!-- + + Copyright 2006 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. + + $Id$ + +-- + + +!-- === MARKER CONFIGURATION RESOURCE = -- + + +faces-config + + !-- Empty configuration resource to flag the containing JAR file + as having classes to be analyzed for annotations -- + +/faces-config Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/faces-config.xml -- svn:eol-style = native Propchange: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/faces-config.xml -- svn:keywords = Date Author Id Revision HeadURL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r375458 - in /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock: MockExternalContext.java MockViewHandler.java
Author: craigmcc Date: Mon Feb 6 19:45:21 2006 New Revision: 375458 URL: http://svn.apache.org/viewcvs?rev=375458view=rev Log: Implement some more methods that will be needed when you actually call renderers in a test case. Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockExternalContext.java struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockViewHandler.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockExternalContext.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockExternalContext.java?rev=375458r1=375457r2=375458view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockExternalContext.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockExternalContext.java Mon Feb 6 19:45:21 2006 @@ -115,7 +115,7 @@ public String encodeActionURL(String sb) { -throw new UnsupportedOperationException(); +return sb; } @@ -129,7 +129,7 @@ public String encodeResourceURL(String sb) { -throw new UnsupportedOperationException(); +return sb; } Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockViewHandler.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockViewHandler.java?rev=375458r1=375457r2=375458view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockViewHandler.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockViewHandler.java Mon Feb 6 19:45:21 2006 @@ -107,14 +107,16 @@ public String getActionURL(FacesContext context, String viewId) { -throw new UnsupportedOperationException(); +return FacesContext.getCurrentInstance().getExternalContext(). +getRequestContextPath() + viewId; } public String getResourceURL(FacesContext context, String path) { -throw new UnsupportedOperationException(); +return FacesContext.getCurrentInstance().getExternalContext(). +getRequestContextPath() + path; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r375191 - in /struts/shale/trunk: tiger/ tiger/src/java/org/apache/shale/tiger/faces/ tiger/src/test/org/apache/shale/tiger/faces/ xdocs/
Author: craigmcc Date: Sun Feb 5 21:40:57 2006 New Revision: 375191 URL: http://svn.apache.org/viewcvs?rev=375191view=rev Log: Commit the code that actually implements all of the fix for issue 38487 (narrow the set of jars scanned for annotations to those that have a META-INF/faces-config.xml resource), plus fix a bug that caused the actual parsing of such resources to be skipped. Modified: struts/shale/trunk/tiger/build.xml struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/LifecycleListener.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/LifecycleListenerTestCase.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/VariableResolverImplTestCase.java struts/shale/trunk/xdocs/features-tiger-extensions.xml Modified: struts/shale/trunk/tiger/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/build.xml?rev=375191r1=375190r2=375191view=diff == --- struts/shale/trunk/tiger/build.xml (original) +++ struts/shale/trunk/tiger/build.xml Sun Feb 5 21:40:57 2006 @@ -263,10 +263,15 @@ !-- Copy non-Java Sources -- copytodir=${build.home}/test-classes fileset dir=src/test -exclude name=**/*.java/ +exclude name=**/*.java **/faces-config.xml/ /fileset /copy +!-- Copy manifest for jar file -- +mkdir dir=${build.home}/test-classes/META-INF/ +copytodir=${build.home}/test-classes/META-INF + file=src/test/org/apache/shale/tiger/faces/faces-config.xml/ + !-- Copy runtime objects to webapp structure -- mkdir dir=${build.home}/test-webapp/WEB-INF/classes/org/apache/shale/tiger/faces/ copy todir=${build.home}/test-webapp/WEB-INF/classes/org/apache/shale/tiger/faces @@ -293,7 +298,7 @@ mkdir dir=${build.home}/test-webapp/WEB-INF/lib/ jar destfile=${build.home}/test-webapp/WEB-INF/lib/test.jar basedir=${build.home}/test-classes - includes=org/apache/shale/tiger/config/TestBean3.class/ + includes=org/apache/shale/tiger/config/TestBean3.class META-INF/faces-config.xml/ /target Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/LifecycleListener.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/LifecycleListener.java?rev=375191r1=375190r2=375191view=diff == --- struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/LifecycleListener.java (original) +++ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/LifecycleListener.java Sun Feb 5 21:40:57 2006 @@ -113,7 +113,7 @@ * inside application JARs./p */ private static final String FACES_CONFIG_IMPLICIT = -META_INF/faces-config.xml; +META-INF/faces-config.xml; /** @@ -157,7 +157,17 @@ /** * pConfigure a [EMAIL PROTECTED] FacesConfigConfig} bean representing metadata * from the codefaces-config.xml/code resource(s) for this - * application, and store it in an application scope attribute./p + * application, and store it in an application scope attribute. In + * addition, scan classes in the following locations for Shale Tiger + * Extensions specific runtime annotations:/p + * ul + * liAll classes under code/WEB-INF/classes/code./li + * liAll classes in JAR files under code/WEB-INF/lib/code that + * contain an embedded codeMETA-INF/faces-config.xml/code + * resource (the contents of that resource are irrelevant; it is + * simply used to flag a JAR file as containing JavaServer Faces + * related artifacts)./li + * /ul * * @param event codeServletContextEvent/code. representing the * application that is starting up @@ -274,8 +284,8 @@ /** - * pReturn a list of classes from the specified JAR archive. If this - * archive has no classes in it, a zero-length list is returned./p + * pReturn a list of classes to examine from the specified JAR archive. + * If this archive has no classes in it, a zero-length list is returned./p * * @param context codeServletContext/code instance for * this application @@ -286,11 +296,12 @@ private ListClass archiveClasses(ServletContext context, JarFile jar) throws ClassNotFoundException { +// Accumulate and return a list of classes in this JAR file +ListClass list = new ArrayListClass(); ClassLoader loader = Thread.currentThread().getContextClassLoader(); if (loader == null) { loader = this.getClass().getClassLoader(); } -ListClass list = new ArrayListClass(); EnumerationJarEntry entries = jar.entries(); while
svn commit: r374955 - in /struts/shale/trunk/sql-browser/src: java/org/apache/shale/examples/sqlbrowser/Query.java web/query.jsp
Author: craigmcc Date: Sat Feb 4 17:06:42 2006 New Revision: 374955 URL: http://svn.apache.org/viewcvs?rev=374955view=rev Log: Example now works with the RI's version of UIData and ResultSetDataModel, but not with the MyFaces version. Need to investigate that further. Modified: struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java struts/shale/trunk/sql-browser/src/web/query.jsp Modified: struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java?rev=374955r1=374954r2=374955view=diff == --- struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java (original) +++ struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java Sat Feb 4 17:06:42 2006 @@ -27,6 +27,7 @@ import java.util.List; import javax.faces.application.FacesMessage; import javax.faces.component.UIColumn; +import javax.faces.component.UIComponent; import javax.faces.component.html.HtmlDataTable; import javax.faces.component.html.HtmlOutputText; import javax.faces.context.FacesContext; @@ -34,6 +35,7 @@ import javax.sql.DataSource; import org.apache.shale.tiger.managed.Bean; import org.apache.shale.tiger.managed.Scope; +import org.apache.shale.tiger.view.Destroy; import org.apache.shale.tiger.view.Prerender; import org.apache.shale.tiger.view.View; @@ -48,6 +50,24 @@ // -- Instance Variables +/** + * pThe JDBC connection we will be using./p + */ +private Connection conn = null; + + +/** + * pThe JDBC result set we will be using./p + */ +private ResultSet rs = null; + + +/** + * pThe JDBC statement we will be using./p + */ +private PreparedStatement stmt = null; + + // -- JSF Properties @@ -150,9 +170,6 @@ // Perform the query and dynamically set up the results FacesContext context = FacesContext.getCurrentInstance(); -Connection conn = null; -PreparedStatement stmt = null; -ResultSet rs = null; try { // Look up the appropriate data source @@ -174,13 +191,12 @@ ResultSetMetaData rsmd = rs.getMetaData(); System.err.println(prerender(): There are + rsmd.getColumnCount() + columns); -// Wire up our table binding -System.err.println(prerender(): Wiring up our table binding); -resultSetDataModel = new ResultSetDataModel(); -resultSetDataModel.setWrappedData(rs); -results.setValueBinding(value, - context.getApplication().createValueBinding(#{query.resultSetDataModel})); +// Set up the data model for our result set +System.err.println(prerender(): Wiring up our data model); +resultSetDataModel = new ResultSetDataModel(rs); System.err.println(prerender(): There are + resultSetDataModel.getRowCount() + rows); +results.setFirst(0); +results.setRows(10); // Dynamically create columns as needed System.err.println(prerender(): Dynamically creating columns); @@ -189,6 +205,7 @@ for (int i = 1; i = rsmd.getColumnCount(); i++) { // SQL stuff is one-relative System.err.println(prerender(): Adding column ' + rsmd.getColumnName(i) + '); UIColumn column = new UIColumn(); +column.setId(column + i); children.add(column); HtmlOutputText header = new HtmlOutputText(); String label = rsmd.getColumnLabel(i); @@ -198,55 +215,110 @@ header.setValue(label); column.setHeader(header); HtmlOutputText data = new HtmlOutputText(); -column.getChildren().add(data); +data.setId(data + i); data.setValueBinding(value, - context.getApplication().createValueBinding(#{currentRow[' + rsmd.getColumnName(i) + ']})); + context.getApplication().createValueBinding(#{current[' + rsmd.getColumnName(i) + ']})); +System.err.println(prerender(): Value binding is + data.getValueBinding(value).getExpressionString()); +column.getChildren().add(data); +} + +// Position to first row to ensure that we can +System.err.println(prerender(): Check positionability of initial rows); +for (int i = 0; i 10; i++) { +resultSetDataModel.setRowIndex(i); +System.err.println(prerender(): Row + i + exists? + resultSetDataModel.isRowAvailable
svn commit: r374957 - in /struts/shale/trunk/sql-browser/src: java/org/apache/shale/examples/sqlbrowser/Listener.java java/org/apache/shale/examples/sqlbrowser/Query.java web/WEB-INF/faces-config.xml
Author: craigmcc Date: Sat Feb 4 18:11:17 2006 New Revision: 374957 URL: http://svn.apache.org/viewcvs?rev=374957view=rev Log: Clean up the debugging print statements, and add a bit more data to the demo data source. Removed: struts/shale/trunk/sql-browser/src/web/messages.jspf struts/shale/trunk/sql-browser/src/web/welcome.jsp Modified: struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Listener.java struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java struts/shale/trunk/sql-browser/src/web/WEB-INF/faces-config.xml struts/shale/trunk/sql-browser/src/web/query.jsp Modified: struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Listener.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Listener.java?rev=374957r1=374956r2=374957view=diff == --- struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Listener.java (original) +++ struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Listener.java Sat Feb 4 18:11:17 2006 @@ -137,11 +137,37 @@ state varchar(2) + ), insert into zip_codes (zip_code, city, state) + - values ('97062', 'Tualatin', 'OR'), + values ('97005', 'Beaverton', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97006', 'Beaverton', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97007', 'Beaverton', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97008', 'Beaverton', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97075', 'Beaverton', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97076', 'Beaverton', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97077', 'Beaverton', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97078', 'Beaverton', 'OR'), insert into zip_codes (zip_code, city, state) + values ('97034', 'Lake Oswego', 'OR'), insert into zip_codes (zip_code, city, state) + values ('97035', 'Lake Oswego', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97062', 'Tualatin', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97068', 'West Linn', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97140', 'Sherwood', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97223', 'Tigard', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97224', 'Tigard', 'OR'), +insert into zip_codes (zip_code, city, state) + + values ('97281', 'Tigard', 'OR'), }; Modified: struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java?rev=374957r1=374956r2=374957view=diff == --- struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java (original) +++ struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java Sat Feb 4 18:11:17 2006 @@ -23,7 +23,6 @@ import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; -import java.util.Iterator; import java.util.List; import javax.faces.application.FacesMessage; import javax.faces.component.UIColumn; @@ -153,7 +152,6 @@ } - // - View Controller Methods @@ -174,36 +172,25 @@ // Look up the appropriate data source // FIXME - add JNDI lookup support for non-internal -System.err.println(prerender(): Acquire DataSource and Connection); DataSource ds = (DataSource) context.getExternalContext().getApplicationMap().get(Listener.INTERNAL_DATA_SOURCE); conn = ds.getConnection(); // Execute the requested query -System.err.println(prerender(): Prepare and execute query); stmt = conn.prepareStatement(query, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY); rs = stmt.executeQuery(); -// Acquire the result set metadata -System.err.println(prerender(): Acquiring result set metadata); -ResultSetMetaData rsmd = rs.getMetaData(); -System.err.println(prerender
svn commit: r374959 - /struts/shale/trunk/build.xml
Author: craigmcc Date: Sat Feb 4 18:22:54 2006 New Revision: 374959 URL: http://svn.apache.org/viewcvs?rev=374959view=rev Log: Add the sql-browser example to the set of examples built by ant release and included in the nightly build artifacts. WARNING: There is a bug in the MyFaces 1.1.1 implementation of the renderer for the h:dataTable component that causes it to render zero rows, even though the executed SQL query returns a nonzero number of rows. The example app works fine with the JSF RI (to see it in action, execute select * from zip_codes). This has been reported to the MyFaces issue tracking system ... see the following for current status on this issue: http://issues.apache.org/jira/browse/MYFACES-1092 Modified: struts/shale/trunk/build.xml Modified: struts/shale/trunk/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/build.xml?rev=374959r1=374958r2=374959view=diff == --- struts/shale/trunk/build.xml (original) +++ struts/shale/trunk/build.xml Sat Feb 4 18:22:54 2006 @@ -789,9 +789,12 @@ /target - !-- Subtarget of release for JDK 1.4 web applicatons -- + !-- Subtarget of release for JDK 1.5 web applicatons -- targetname=release.15.webapps if=jdk15.present +copy todir=${dist.dir} + file=sql-browser/dist/shale-sql-browser-${project.version}.war/ + /target @@ -922,6 +925,10 @@ !-- Recursively execute ${target} across JDK 1.5 example apps -- targetname=execute.15.examples if=jdk15.present + +echo message=Executing ${target} on module sql-browser/ +ant dir=${basedir}/sql-browser + target=${target}/ /target - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r374964 - /struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java
Author: craigmcc Date: Sat Feb 4 19:04:15 2006 New Revision: 374964 URL: http://svn.apache.org/viewcvs?rev=374964view=rev Log: Log a warning when Messages.getMessage(String,Locale) cannot find a string for the specified key. PR: Bugzilla #38496 Submitted by: Hermod Opstveldt hermod.opstveldt AT dnb.no Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java?rev=374964r1=374963r2=374964view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java Sat Feb 4 19:04:15 2006 @@ -22,6 +22,8 @@ import java.util.Map; import java.util.MissingResourceException; import java.util.ResourceBundle; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; /** * pUtility wrapper around resource bundles that provides locale-specific @@ -116,6 +118,12 @@ private MessageFormat format = new MessageFormat(); +/** + * pLog instance for this class./p + */ +private transient Log log = null; + + // -- Properties @@ -227,6 +235,10 @@ try { return rb.getString(key); } catch (MissingResourceException e) { +if (log().isWarnEnabled()) { +log().warn(Key + key + was not found in resource bundle ' + + getName() + ' for locale ' + locale + '); +} return null; } @@ -286,6 +298,19 @@ } return rb; } + +} + + +/** + * pReturn the codeLog/code instance for this class./p + */ +private Log log() { + +if (log == null) { +log = LogFactory.getLog(Messages.class); +} +return log; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r374967 - /struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java
Author: craigmcc Date: Sat Feb 4 19:13:02 2006 New Revision: 374967 URL: http://svn.apache.org/viewcvs?rev=374967view=rev Log: Add convenience accessors for maps of request headers and request parameters included in the current request. PR: Bugzilla #38510. Submitted by: Matthias Wessendorf mailings AT matthias-wessendorf.de Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java?rev=374967r1=374966r2=374967view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/view/AbstractFacesBean.java Sat Feb 4 19:13:02 2006 @@ -105,12 +105,36 @@ /** + * pReturn a codeMap/code of the request headers included in this + * request. If there is more than one header for a particular header + * name, only the first value is included in this map./p + */ +protected Map getRequestHeaderMap() { + +return getExternalContext().getRequestHeaderMap(); + +} + + +/** * pReturn a codeMap/code of the request scope attributes * for this request./p */ protected Map getRequestMap() { return getExternalContext().getRequestMap(); + +} + + +/** + * pReturn a codeMap/code of the request parameters included in this + * request. If there is more than one value for a particular parameter + * name, only the first value is included in this map./p + */ +protected Map getRequestParameterMap() { + +return getExternalContext().getRequestParameterMap(); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r374968 - /struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java
Author: craigmcc Date: Sat Feb 4 19:23:48 2006 New Revision: 374968 URL: http://svn.apache.org/viewcvs?rev=374968view=rev Log: Add a warning if a specified resource bundle cannot be found as well. PR: Bugzilla #38494 Submitted by: Hermod Opstvedt hermod.opstvedt AT dnb.no Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java?rev=374968r1=374967r2=374968view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java Sat Feb 4 19:23:48 2006 @@ -294,7 +294,14 @@ } catch (MissingResourceException e) { rb = ResourceBundle.getBundle(name, defaultLocale, cl); } -bundles.put(locale, rb); +if (rb == null) { +if (log().isWarnEnabled()) { +log().warn(Resource bundle ' + getName() + + ' was not found for locale ' + locale + '); +} +} else { +bundles.put(locale, rb); +} } return rb; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r373633 - in /struts/shale/trunk/core-library/src/java/org/apache/shale: faces/ShalePropertyResolver.java util/LoadBundle.java util/Messages.java
Author: craigmcc Date: Mon Jan 30 15:49:55 2006 New Revision: 373633 URL: http://svn.apache.org/viewcvs?rev=373633view=rev Log: Improve usability of the LoadBundle and Messages helper classes, by explicitly loading the default resource bundle if the requested one is not found. This needs to be reviewed to see if we should also do the strip suffixes trick that ResourceBundle itself does (but only after explicitly finding a bundle with the specified name, which is not particularly friendly). Also, customize the Shale property resolver so that expressions like: #{myLoadBundle['message.key']} work instead of (actually, for backwards compatibility, in addition to): #{myLoadBundle.map['message.key']} In this way, you can directly substitute use of the LoadBundle helper class, which makes the resources available to Java event handlers as well, by simply removing all f:loadBundle tags from your JSP pages, and creating a managed bean (typically in application scope) for the corresponding var name. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePropertyResolver.java struts/shale/trunk/core-library/src/java/org/apache/shale/util/LoadBundle.java struts/shale/trunk/core-library/src/java/org/apache/shale/util/Messages.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePropertyResolver.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePropertyResolver.java?rev=373633r1=373632r2=373633view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePropertyResolver.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePropertyResolver.java Mon Jan 30 15:49:55 2006 @@ -16,6 +16,8 @@ package org.apache.shale.faces; +import java.beans.Beans; +import java.util.Map; import javax.faces.el.EvaluationException; import javax.faces.el.PropertyNotFoundException; import javax.faces.el.PropertyResolver; @@ -23,6 +25,7 @@ import javax.naming.Name; import javax.naming.NameNotFoundException; import javax.naming.NamingException; +import org.apache.shale.util.LoadBundle; /** * pShale-specific PropertyResolver for evaluating JavaServer Faces @@ -34,6 +37,18 @@ * to the codelookup()/code method of the codeContext/code. * The Context has no way to describe whether it is read only or not, * so codeisReadOnly()/code returns codefalse/code./li + * listrongorg.apache.shale.util.LoadBundle/strong - Special handling + * as follows, based on the requested property name: + * ul + * licodemap/code - Delegates to the original resolver's handling + * of the codemap/code property. This is for backwards compatibility + * with applications depending on this behavior from the 1.0.0 + * version of the class./li + * liAny other property is considered to be a resource bundle key, which + * will be used to look up the corresponding value from the underlying + * resource bundle, using the codeLocale/code from the current + * view for selecting the appropriate translation./li + * /ul/li * /ul * pAll other evaluations are delegated to the previous implementation * that was passed to our constructor./p @@ -63,7 +78,7 @@ /** - * pThe original codeVariableResolver/code passed to our constructor./p + * pThe original codePropertyResolver/code passed to our constructor./p */ private PropertyResolver original = null; @@ -72,8 +87,19 @@ /** - * pLook up and return the named object corresponding to the - * specified property name from this Context./p + * pFor a base object of type codeContext/code, look up and return + * the named object corresponding to the specified property name from + * this codeContext/code./p + * + * p(Since 1.0.1) For a base object of type codeLoadBundle/code, + * treat the property expression as follows:/p + * ul + * liIf the property name is codemap/code, call the corresponding + * property getter and return that value./li + * liOtherwise, treat the property name as a message key, and look up + * and return the corresponding value from the codeMap/code that + * is returned by the codegetMap()/code call./li + * /ul * * @param base Base object from which to return a property * @param property Property to be returned @@ -100,6 +126,13 @@ } catch (NamingException e) { throw new EvaluationException(e); } +} else if (base instanceof LoadBundle) { +Map map = ((LoadBundle) base).getMap(); +if (map.equals(property)) { +return map; +} else { +return map.get(property); +} } else { return
svn commit: r373634 - in /struts/shale/trunk/mailreader/src/web: WEB-INF/faces-config.xml index.jsp logon.jsp mainMenu.jsp registration.jsp subscription.jsp
Author: craigmcc Date: Mon Jan 30 15:51:22 2006 New Revision: 373634 URL: http://svn.apache.org/viewcvs?rev=373634view=rev Log: Modify to use the LoadBundle replacement for f:loadBundle. Among other things, this will make it straightforward to transliterate the MailReader example for using Clay, where f:loadBundle has to be treated as a hack since it is not actually a JSF component. Modified: struts/shale/trunk/mailreader/src/web/WEB-INF/faces-config.xml struts/shale/trunk/mailreader/src/web/index.jsp struts/shale/trunk/mailreader/src/web/logon.jsp struts/shale/trunk/mailreader/src/web/mainMenu.jsp struts/shale/trunk/mailreader/src/web/registration.jsp struts/shale/trunk/mailreader/src/web/subscription.jsp Modified: struts/shale/trunk/mailreader/src/web/WEB-INF/faces-config.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/WEB-INF/faces-config.xml?rev=373634r1=373633r2=373634view=diff == --- struts/shale/trunk/mailreader/src/web/WEB-INF/faces-config.xml (original) +++ struts/shale/trunk/mailreader/src/web/WEB-INF/faces-config.xml Mon Jan 30 15:51:22 2006 @@ -162,6 +162,20 @@ managed-bean +descriptionLocalized resources for this application./description +managed-bean-namemessages/managed-bean-name +managed-bean-class + org.apache.shale.util.LoadBundle +/managed-bean-class +managed-bean-scopeapplication/managed-bean-scope +managed-property + property-namebasename/property-name + valueorg.apache.shale.examples.mailreader.ApplicationResources/value +/managed-property + /managed-bean + + + managed-bean descriptionSession scope bean maintaining state information./description managed-bean-namestate/managed-bean-name managed-bean-class Modified: struts/shale/trunk/mailreader/src/web/index.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/index.jsp?rev=373634r1=373633r2=373634view=diff == --- struts/shale/trunk/mailreader/src/web/index.jsp (original) +++ struts/shale/trunk/mailreader/src/web/index.jsp Mon Jan 30 15:51:22 2006 @@ -23,8 +23,6 @@ f:view -f:loadBundle basename=org.apache.shale.examples.mailreader.ApplicationResources - var=messages/ html head title Modified: struts/shale/trunk/mailreader/src/web/logon.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/logon.jsp?rev=373634r1=373633r2=373634view=diff == --- struts/shale/trunk/mailreader/src/web/logon.jsp (original) +++ struts/shale/trunk/mailreader/src/web/logon.jsp Mon Jan 30 15:51:22 2006 @@ -23,8 +23,6 @@ f:view -f:loadBundle basename=org.apache.shale.examples.mailreader.ApplicationResources - var=messages/ html head title Modified: struts/shale/trunk/mailreader/src/web/mainMenu.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/mainMenu.jsp?rev=373634r1=373633r2=373634view=diff == --- struts/shale/trunk/mailreader/src/web/mainMenu.jsp (original) +++ struts/shale/trunk/mailreader/src/web/mainMenu.jsp Mon Jan 30 15:51:22 2006 @@ -23,8 +23,6 @@ f:view -f:loadBundle basename=org.apache.shale.examples.mailreader.ApplicationResources - var=messages/ html head title Modified: struts/shale/trunk/mailreader/src/web/registration.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/registration.jsp?rev=373634r1=373633r2=373634view=diff == --- struts/shale/trunk/mailreader/src/web/registration.jsp (original) +++ struts/shale/trunk/mailreader/src/web/registration.jsp Mon Jan 30 15:51:22 2006 @@ -22,8 +22,6 @@ -- f:view -f:loadBundle basename=org.apache.shale.examples.mailreader.ApplicationResources - var=messages/ html head title Modified: struts/shale/trunk/mailreader/src/web/subscription.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/subscription.jsp?rev=373634r1=373633r2=373634view=diff == --- struts/shale/trunk/mailreader/src/web/subscription.jsp (original) +++ struts/shale/trunk/mailreader/src/web/subscription.jsp Mon Jan 30 15:51:22 2006 @@ -23,8 +23,6 @@ f:view -f:loadBundle basename=org.apache.shale.examples.mailreader.ApplicationResources - var=messages/ html head title - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r373652 - /struts/shale/trunk/core-library/src/java/org/apache/shale/util/LoadBundle.java
Author: craigmcc Date: Mon Jan 30 16:38:16 2006 New Revision: 373652 URL: http://svn.apache.org/viewcvs?rev=373652view=rev Log: Improve the usability of the exception you get if LoadBundle.getMap() is called outside the scope of a JSF request. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/util/LoadBundle.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/util/LoadBundle.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/util/LoadBundle.java?rev=373652r1=373651r2=373652view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/util/LoadBundle.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/util/LoadBundle.java Mon Jan 30 16:38:16 2006 @@ -29,6 +29,7 @@ import java.util.MissingResourceException; import java.util.ResourceBundle; import java.util.Set; +import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; @@ -137,6 +138,9 @@ * of the application resource bundle specified by the codebasename/code * property, localized for the codeLocale/code stored in the * codeUIViewRoot/code for the current request./p +* +* @exception IllegalStateException if we are not inside a Faces request, +* or if there is not a current view root with a valid locale */ public Map getMap() { @@ -148,9 +152,19 @@ throw new IllegalStateException(The 'basename' property cannot be null); // FIXME - i18n } FacesContext context = FacesContext.getCurrentInstance(); - assert context != null; - Locale locale = context.getViewRoot().getLocale(); - assert locale != null; + UIViewRoot root = null; + Locale locale = null; + if (context != null) { + root = context.getViewRoot(); + } + if (root != null) { + locale = root.getLocale(); + } + if (locale == null) { + throw new IllegalStateException(Cannot retrieve locale-specific map if there + + is not a current Faces request, containing a valid view root, with + + a Locale instance inside.); + } // Look up the requested resource bundle final ResourceBundle bundle = getBundle(basename, locale); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r373732 [2/2] - in /struts/shale/trunk/sql-browser: ./ ext/ lib/ nbproject/ src/ src/conf/ src/java/ src/java/org/ src/java/org/apache/ src/java/org/apache/shale/ src/java/org/apache/shale
Added: struts/shale/trunk/sql-browser/src/systest/org/apache/shale/blank/systest/WelcomeTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/sql-browser/src/systest/org/apache/shale/blank/systest/WelcomeTestCase.java?rev=373732view=auto == --- struts/shale/trunk/sql-browser/src/systest/org/apache/shale/blank/systest/WelcomeTestCase.java (added) +++ struts/shale/trunk/sql-browser/src/systest/org/apache/shale/blank/systest/WelcomeTestCase.java Mon Jan 30 22:03:15 2006 @@ -0,0 +1,100 @@ +/* + * Copyright 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. + * + * $Id$ + */ + +package org.apache.shale.blank.systest; + +import java.util.ResourceBundle; +import junit.framework.Test; +import junit.framework.TestSuite; +import org.apache.shale.test.htmlunit.AbstractHtmlUnitTestCase; + +/** + * pSystem test case for the code/welcome.jsp/code page./p + */ +public class WelcomeTestCase extends AbstractHtmlUnitTestCase { + + +// Constructors + + +/** + * pConstruct a new instance of this test case./p + * + * @param name Name of the new test case + */ +public WelcomeTestCase(String name) { + +super(name); + +} + + +// -- Instance Variables + + +private ResourceBundle bundle = +ResourceBundle.getBundle(org.apache.shale.blank.Bundle); + + +// -- Test Setup Methods + + +/** + * pSet up the instance variables required for this test case./p + */ +public void setUp() throws Exception { + +super.setUp(); +page(/); + +} + + +/** + * pReturn the set of tests included in this test suite./p + */ +public static Test suite() { + +return (new TestSuite(WelcomeTestCase.class)); + +} + + +/** + * pTear down instance variables required by this test case./p + */ +public void tearDown() { + +super.tearDown(); + +} + + + +// - Individual Test Methods + + +// Test a pristine instance of this page +public void testPristine() throws Exception { + +assertEquals(bundle.getString(welcome.title), title()); + +} + + +} Propchange: struts/shale/trunk/sql-browser/src/systest/org/apache/shale/blank/systest/WelcomeTestCase.java -- svn:eol-style = native Propchange: struts/shale/trunk/sql-browser/src/systest/org/apache/shale/blank/systest/WelcomeTestCase.java -- svn:keywords = Date Author Id Revision HeadURL Added: struts/shale/trunk/sql-browser/src/test/org/apache/shale/blank/WelcomeBeanTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/sql-browser/src/test/org/apache/shale/blank/WelcomeBeanTestCase.java?rev=373732view=auto == --- struts/shale/trunk/sql-browser/src/test/org/apache/shale/blank/WelcomeBeanTestCase.java (added) +++ struts/shale/trunk/sql-browser/src/test/org/apache/shale/blank/WelcomeBeanTestCase.java Mon Jan 30 22:03:15 2006 @@ -0,0 +1,107 @@ +/* + * Copyright 2006 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. + * + * $Id$ + */ + +package org.apache.shale.blank; + +import junit.framework.Test; +import junit.framework.TestSuite; +import org.apache.shale.test.base.AbstractViewControllerTestCase; + +/** + * pTest case for the [EMAIL PROTECTED] WelcomeBean} ViewController implementation./p + * + * $Id$ + */ +public class WelcomeBeanTestCase extends AbstractViewControllerTestCase { + + +//
svn commit: r373734 - /struts/shale/trunk/sql-browser/src/test/org/apache/shale/blank/WelcomeBeanTestCase.java
Author: craigmcc Date: Mon Jan 30 22:06:32 2006 New Revision: 373734 URL: http://svn.apache.org/viewcvs?rev=373734view=rev Log: Remove spurious test case inherited from the blank app. Removed: struts/shale/trunk/sql-browser/src/test/org/apache/shale/blank/WelcomeBeanTestCase.java - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r373749 - in /struts/shale/trunk/sql-browser: derby.log src/java/org/apache/shale/examples/sqlbrowser/Application.java src/java/org/apache/shale/examples/sqlbrowser/Listener.java src/java/
Author: craigmcc Date: Mon Jan 30 23:22:54 2006 New Revision: 373749 URL: http://svn.apache.org/viewcvs?rev=373749view=rev Log: Update the basic application to create a trivial table ZIP_CODES. Unfortunately it doesn't actually display the data yet ... something wierd between JSF and Derby, I think ... Modified: struts/shale/trunk/sql-browser/derby.log struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Application.java struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Listener.java struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Query.java Modified: struts/shale/trunk/sql-browser/derby.log URL: http://svn.apache.org/viewcvs/struts/shale/trunk/sql-browser/derby.log?rev=373749r1=373748r2=373749view=diff == --- struts/shale/trunk/sql-browser/derby.log (original) +++ struts/shale/trunk/sql-browser/derby.log Mon Jan 30 23:22:54 2006 @@ -1,10 +1,10 @@ -2006-01-31 05:59:02.653 GMT: - Booting Derby version The Apache Software Foundation - Apache Derby - 10.1.2.1 - (330608): instance c013800d-0109-1f0a-ea90-004fd248 +2006-01-31 07:20:22.377 GMT: + Booting Derby version The Apache Software Foundation - Apache Derby - 10.1.2.1 - (330608): instance c013800d-0109-1f55-5f40-009eca30 on database directory /home/craigmcc/jakarta-tomcat-5.0.28/work/Catalina/localhost/shale-sql-browser/DATABASE Database Class Loader started - derby.database.classpath='' -2006-01-31 06:00:37.431 GMT: -Shutting down instance c013800d-0109-1f0a-ea90-004fd248 +2006-01-31 07:22:11.658 GMT: +Shutting down instance c013800d-0109-1f55-5f40-009eca30 Modified: struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Application.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Application.java?rev=373749r1=373748r2=373749view=diff == --- struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Application.java (original) +++ struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Application.java Mon Jan 30 23:22:54 2006 @@ -136,7 +136,7 @@ FacesContext context = FacesContext.getCurrentInstance(); // FIXME - localize the label -list.add(new SelectItem(, Embedded)); +list.add(new SelectItem(, (Internal))); } Modified: struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Listener.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Listener.java?rev=373749r1=373748r2=373749view=diff == --- struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Listener.java (original) +++ struts/shale/trunk/sql-browser/src/java/org/apache/shale/examples/sqlbrowser/Listener.java Mon Jan 30 23:22:54 2006 @@ -19,7 +19,9 @@ package org.apache.shale.examples.sqlbrowser; import java.io.File; +import java.sql.Connection; import java.sql.SQLException; +import java.sql.Statement; import java.util.logging.Level; import java.util.logging.Logger; import javax.faces.FacesException; @@ -97,8 +99,6 @@ // Calculate a database URL for the database to be created ServletContext context = event.getServletContext(); File tempDir = (File) context.getAttribute(javax.servlet.context.tempdir); -//String url = jdbc:derby: + tempDir.getAbsolutePath() + -// File.separator + DATABASE; String url = tempDir.getAbsolutePath() + File.separator + DATABASE; if (logger.isLoggable(Level.INFO)) { logger.log(Level.INFO, Creating database + url); @@ -107,6 +107,7 @@ // Create and publish a data source for the embedded database try { ds = new InternalDataSource(url); +populate(ds); } catch (SQLException e) { if (logger.isLoggable(Level.SEVERE)) { while (e != null) { @@ -117,6 +118,78 @@ throw new FacesException(SQLException occurred during startup (see log for details): + e.getMessage()); } context.setAttribute(INTERNAL_DATA_SOURCE, ds); + +} + + +// - Private Static Data + + +/** + * pInitialization commands for the internal database. If an exception + * occurs on the first one (presumed to be a CREATE TABLE), then the + * database is assumed to be already populated./p + */ +private static final String populate[] = { +create table zip_codes
svn commit: r373031 - /struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java
Author: craigmcc Date: Fri Jan 27 15:35:14 2006 New Revision: 373031 URL: http://svn.apache.org/viewcvs?rev=373031view=rev Log: Promote the mapResourceId() method from protected to public scope, since it is generally useful. No functional change -- the big diff is because the method was moved in the source file. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java?rev=373031r1=373030r2=373031view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java Fri Jan 27 15:35:14 2006 @@ -157,39 +157,8 @@ link(context, resourceId); } -// --- Protected Methods -/** - * pMark the specified resource identifier as having already been - * linked in the current request./p - * - * @param context codeFacesContext/code for the current request - * @param resourceId Resource identifier to mark as having been linked - */ -protected void link(FacesContext context, String resourceId) { - -context.getExternalContext().getRequestMap(). -put(PREFIX + resourceId, Boolean.TRUE); - -} - - -/** - * pReturn codetrue/code if the specified resource identifier has - * already been linked in the current request, and should therefore not - * be linked again./p - * - * @param context codeFacesContext/code for the current request - * @param resourceId Resource identifier to check for prior linking - */ -protected boolean linked(FacesContext context, String resourceId) { - -return context.getExternalContext().getRequestMap(). -containsKey(PREFIX + resourceId); - -} - /** * pMap the specified resource identifier to a request URL, taking into @@ -205,8 +174,8 @@ * @exception IllegalStateException if a configuration error prevents * the mapping of this resource identifier to a corresponding URI */ -protected String mapResourceId(FacesContext context, Mechanism mechanism, - String resourceId) { +public String mapResourceId(FacesContext context, Mechanism mechanism, +String resourceId) { // Validate our incoming parameters if (resourceId == null) { @@ -255,6 +224,40 @@ // Ask this Mapping to map the resource identifier appropriately return mapping.mapResourceId(context, resourceId); + +} + + +// --- Protected Methods + + +/** + * pMark the specified resource identifier as having already been + * linked in the current request./p + * + * @param context codeFacesContext/code for the current request + * @param resourceId Resource identifier to mark as having been linked + */ +protected void link(FacesContext context, String resourceId) { + +context.getExternalContext().getRequestMap(). +put(PREFIX + resourceId, Boolean.TRUE); + +} + + +/** + * pReturn codetrue/code if the specified resource identifier has + * already been linked in the current request, and should therefore not + * be linked again./p + * + * @param context codeFacesContext/code for the current request + * @param resourceId Resource identifier to check for prior linking + */ +protected boolean linked(FacesContext context, String resourceId) { + +return context.getExternalContext().getRequestMap(). +containsKey(PREFIX + resourceId); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r373053 - /struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java
Author: craigmcc Date: Fri Jan 27 16:53:46 2006 New Revision: 373053 URL: http://svn.apache.org/viewcvs?rev=373053view=rev Log: Correctly set the logging level of a debugging message. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java?rev=373053r1=373052r2=373053view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java Fri Jan 27 16:53:46 2006 @@ -66,8 +66,8 @@ // Create and execute a method binding based on this resource identifier MethodBinding mb = mapResourceId(context, resourceId); -if (log().isInfoEnabled()) { -log().info(Translated resource id ' + resourceId + +if (log().isDebugEnabled()) { +log().debug(Translated resource id ' + resourceId + ' to method binding expression ' + mb.getExpressionString() + '); } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r373090 - /struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java
Author: craigmcc Date: Fri Jan 27 22:28:45 2006 New Revision: 373090 URL: http://svn.apache.org/viewcvs?rev=373090view=rev Log: When utilized by a component inside a tool at design time, it is likely that the initialization normally performed on the first request to our phase listener will not have been performed. Therefore, make mapResourceId() simply return the incoming resource identifier unchanged, since it will not actually be used anyway. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java?rev=373090r1=373089r2=373090view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java Fri Jan 27 22:28:45 2006 @@ -16,6 +16,7 @@ package org.apache.shale.remoting; +import java.beans.Beans; import java.io.IOException; import java.util.ArrayList; import java.util.Iterator; @@ -185,6 +186,14 @@ if (mechanism == null) { throw new IllegalArgumentException (resourceBundle(context).getString(xhtml.noMechanism)); +} + +// If we are running inside a design time tool, the runtime +// initialization might not have been performed. Therefore, +// just return the incoming resource identifier unchanged, sinc +// it is not going to be executed anyway. +if (Beans.isDesignTime()) { +return resourceId; } // Acquire a reference to the Mappings instance for this application - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r372735 - in /struts/shale/trunk: core-library/src/java/org/apache/shale/faces/ test-framework/src/java/org/apache/shale/test/mock/ tiger/ tiger/src/java/org/apache/shale/tiger/faces/ tige
Author: craigmcc Date: Thu Jan 26 21:12:47 2006 New Revision: 372735 URL: http://svn.apache.org/viewcvs?rev=372735view=rev Log: Fix a number of overlapping issues preventing the Shale Tiger Extensions from working reliably. * MockServletContext - the initial implementation of getResourcePaths() incorrectly recursed through subdirectories, due to a misread of the spec language on my part. Real containers don't recurse -- that is up to the application. Make the mock implementation act that way. * ShaleVariableResolver - correct the class name of the Tiger Extensions replacement resolver. * ShaleApplicationFilter - refactor the startup of the Shale Tiger extensions by calling the contextInitialized() and contextDestroyed() methods on LifecycleListener from the filter's init() and destroy() methods. This guarantees that the underlying JSF implementation has actually been initialized first, which is a requirement -- I was just lucky on my original tests of this. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleVariableResolver.java struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockServletContext.java struts/shale/trunk/tiger/build.xml struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/LifecycleListener.java struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/LifecycleListenerTestCase.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java?rev=372735r1=372734r2=372735view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java Thu Jan 26 21:12:47 2006 @@ -17,7 +17,10 @@ package org.apache.shale.faces; import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.net.URL; +import javax.faces.FacesException; import javax.faces.FactoryFinder; import javax.faces.lifecycle.Lifecycle; @@ -26,6 +29,7 @@ import javax.servlet.FilterChain; import javax.servlet.FilterConfig; import javax.servlet.ServletContext; +import javax.servlet.ServletContextEvent; import javax.servlet.ServletException; import javax.servlet.ServletRequest; import javax.servlet.ServletResponse; @@ -218,6 +222,9 @@ } } +// Finialize the Shale Tiger Extensions (if present) +destroyTiger(); + // Clean up JavaServer Faces integration linkages context = null; catalog = null; @@ -312,6 +319,9 @@ context.setAttribute(Constants.VIEW_MAPPER, getViewControllerMapper()); +// Initialize the Shale Tiger Extensions (if present) +initTiger(config); + // Look up the shale catalog and ensure standard is defined try { catalog = getCatalog(); @@ -420,6 +430,96 @@ throw new ServletException (messages.getMessage(filter.vcmInstantiate, new Object[] { className }), e); +} + +} + + +/** + * pThe servlet context listener object for the Shale Tiger + * Extensions library, if it is present. This object is accessed + * only via reflection, to avoid classpath problems if the + * codeshale-tiger.jar/code archive is not included./p + */ +private Object tiger = null; + + +/** + * pFinalize the Shale Tiger Extensions (if present)./p + */ +private void destroyTiger() { + +// If we have a tiger listener instance, send the contextDestroyed event +if (tiger != null) { +ServletContextEvent event = new ServletContextEvent(context); +try { +Method method = + tiger.getClass().getMethod(contextDestroyed, + new Class[] { ServletContextEvent.class }); +method.invoke(tiger, new Object[] { event }); +} catch (InvocationTargetException e) { +Throwable cause = e.getCause(); +if (cause instanceof RuntimeException) { +throw (RuntimeException) cause; +} else { +throw new FacesException(cause); +} +} catch (RuntimeException e) { +throw e; +} catch (Exception e
svn commit: r372737 - /struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/LifecycleListenerTestCase.java
Author: craigmcc Date: Thu Jan 26 21:14:20 2006 New Revision: 372737 URL: http://svn.apache.org/viewcvs?rev=372737view=rev Log: Remove spurious comment-outs on a couple of assertions. Modified: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/LifecycleListenerTestCase.java Modified: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/LifecycleListenerTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/LifecycleListenerTestCase.java?rev=372737r1=372736r2=372737view=diff == --- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/LifecycleListenerTestCase.java (original) +++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/LifecycleListenerTestCase.java Thu Jan 26 21:14:20 2006 @@ -126,7 +126,7 @@ assertNotNull(config); MapString,ManagedBeanConfig mbMap = fcConfig.getManagedBeans(); assertNotNull(mbMap); -//assertEquals(4, mbMap.size()); +assertEquals(4, mbMap.size()); ManagedPropertyConfig mpConfig = null; @@ -199,7 +199,7 @@ assertNull(bean2.getMapEntries()); MapString,ManagedPropertyConfig bean2Map = bean2.getProperties(); assertNotNull(bean2Map); - // assertEquals(8, bean2Map.size()); +assertEquals(8, bean2Map.size()); mpConfig = bean2.getProperty(byteProperty); assertNotNull(mpConfig); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r372302 - in /struts/shale/trunk/test-framework/src/java/org/apache/shale/test: base/AbstractJsfTestCase.java mock/MockApplication.java
Author: craigmcc Date: Wed Jan 25 12:07:20 2006 New Revision: 372302 URL: http://svn.apache.org/viewcvs?rev=372302view=rev Log: Ensure that the instance returned by RenderKitFactory.getRenderKit() is the same as the instance in the renderKit variable. Improve the exception messages on component lookups that fail. Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java?rev=372302r1=372301r2=372302view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/base/AbstractJsfTestCase.java Wed Jan 25 12:07:20 2006 @@ -128,13 +128,8 @@ facesContext.setApplication(application); RenderKitFactory renderKitFactory = (RenderKitFactory) FactoryFinder.getFactory(FactoryFinder.RENDER_KIT_FACTORY); -renderKit = new MockRenderKit(); -try { - renderKitFactory.addRenderKit(RenderKitFactory.HTML_BASIC_RENDER_KIT, - renderKit); -} catch (IllegalArgumentException e) { -; -} +renderKit = (MockRenderKit) + renderKitFactory.getRenderKit(null, RenderKitFactory.HTML_BASIC_RENDER_KIT); } Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java?rev=372302r1=372301r2=372302view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java Wed Jan 25 12:07:20 2006 @@ -272,7 +272,14 @@ public UIComponent createComponent(String componentType) { +if (componentType == null) { +throw new NullPointerException(Requested component type is null); +} String componentClass = (String) components.get(componentType); +if (componentClass == null) { +throw new FacesException(No component class registered for component type ' + +componentType + '); +} try { Class clazz = Class.forName(componentClass); return ((UIComponent) clazz.newInstance()); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r372303 - in /struts/shale/trunk: tiger/ tiger/nbproject/ tiger/src/java/org/apache/shale/tiger/faces/ tiger/src/java/org/apache/shale/tiger/register/ tiger/src/test/org/apache/shale/tiger
Author: craigmcc Date: Wed Jan 25 12:09:24 2006 New Revision: 372303 URL: http://svn.apache.org/viewcvs?rev=372303view=rev Log: The Shale Tiger Extensions now support the ability for JSF components, converters, renderers, and validators to register themselves with the JSF runtime, without having to be declared in a faces-config.xml file. Thanks to Gary vanMatre for the suggestion to do this. Added: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/FacesComponent.java (with props) struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/FacesConverter.java (with props) struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/FacesRenderer.java (with props) struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/FacesValidator.java (with props) struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/package.html (with props) struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/MyComponent.java (with props) struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/MyConverter.java (with props) struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/MyRenderer.java (with props) struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/MyValidator.java (with props) Modified: struts/shale/trunk/tiger/build.xml struts/shale/trunk/tiger/nbproject/project.xml struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/LifecycleListener.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/LifecycleListenerTestCase.java struts/shale/trunk/xdocs/features-tiger-extensions.xml Modified: struts/shale/trunk/tiger/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/build.xml?rev=372303r1=372302r2=372303view=diff == --- struts/shale/trunk/tiger/build.xml (original) +++ struts/shale/trunk/tiger/build.xml Wed Jan 25 12:09:24 2006 @@ -273,6 +273,13 @@ /fileset /copy +!-- Copy runtime objects to webapp structure -- +mkdir dir=${build.home}/test-webapp/WEB-INF/classes/org/apache/shale/tiger/faces/ +copy todir=${build.home}/test-webapp/WEB-INF/classes/org/apache/shale/tiger/faces + fileset dir=${build.home}/test-classes/org/apache/shale/tiger/faces + includes=My*.class/ +/copy + /target Modified: struts/shale/trunk/tiger/nbproject/project.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/nbproject/project.xml?rev=372303r1=372302r2=372303view=diff == --- struts/shale/trunk/tiger/nbproject/project.xml (original) +++ struts/shale/trunk/tiger/nbproject/project.xml Wed Jan 25 12:09:24 2006 @@ -1,88 +1,88 @@ -?xml version=1.0 encoding=UTF-8? -project xmlns=http://www.netbeans.org/ns/project/1; -typeorg.netbeans.modules.ant.freeform/type -configuration -general-data xmlns=http://www.netbeans.org/ns/freeform-project/1; -!-- Do not use Project Properties customizer when editing this file manually. -- -nameShale Tiger Extensions/name -properties/ -folders -source-folder -labelConfiguration Files/label -typejava/type -locationsrc/conf/location -/source-folder -source-folder -labelJava Sources/label -typejava/type -locationsrc/java/location -/source-folder -source-folder -labelTest Sources/label -typejava/type -locationsrc/test/location -/source-folder -/folders -ide-actions -action name=build -targetcompile/target -/action -action name=clean -targetclean/target -/action -action name=javadoc -targetdocs/target -/action -action name=test -targettest/target -/action -action name=rebuild -targetclean/target -targetcompile/target -/action -/ide-actions -export -typefolder/type -locationtarget/classes/location -build-targetcompile/build-target -/export -view -items -source-folder style=packages -labelConfiguration Files/label -locationsrc/conf/location -/source-folder -source
svn commit: r372318 - /struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/package.html
Author: craigmcc Date: Wed Jan 25 13:31:53 2006 New Revision: 372318 URL: http://svn.apache.org/viewcvs?rev=372318view=rev Log: Update the implementation status comment. Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/package.html Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/package.html URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/package.html?rev=372318r1=372317r2=372318view=diff == --- struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/package.html (original) +++ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/register/package.html Wed Jan 25 13:31:53 2006 @@ -77,7 +77,7 @@ pAPI STATUS: Experimental./p -pIMPLEMENTATION STATUS: Not yet implemented./p +pIMPLEMENTATION STATUS: Implemented, only lightly tested./p @since 1.0.1 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r372388 - /struts/shale/trunk/xdocs/api-stability.xml
Author: craigmcc Date: Wed Jan 25 17:09:16 2006 New Revision: 372388 URL: http://svn.apache.org/viewcvs?rev=372388view=rev Log: Update the API Stability matrix with the new packages in shale-tiger.jar. Modified: struts/shale/trunk/xdocs/api-stability.xml Modified: struts/shale/trunk/xdocs/api-stability.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/xdocs/api-stability.xml?rev=372388r1=372387r2=372388view=diff == --- struts/shale/trunk/xdocs/api-stability.xml (original) +++ struts/shale/trunk/xdocs/api-stability.xml Wed Jan 25 17:09:16 2006 @@ -280,12 +280,101 @@ JUnit test cases/td /tr tr + tda href=shale-test/apidocs/org/apache/shale/test/htmlunit/package-summary.html + org.apache.shale.test.htmlunit/a/td + tdApplication/td + tdEvolving/td + tdUse these classes as base classes for your own + system integration tests using JUnit and HtmlUnit/td +/tr +tr tda href=shale-test/apidocs/org/apache/shale/test/mock/package-summary.html org.apache.shale.test.mock/a/td tdApplication/td tdEvolving/td tdUse these classes in your JUnit test cases to simulate container behavior/td +/tr + /tbody +/table + + /subsection + + a name=stability-tiger/ + subsection name=Packages Delivered in shale-tiger.jar + +table border=1 + thead +tr + th width=30%Package Name/th + th width=10%Target/th + th width=10%Stability/th + th width=50%Comments/th +/tr + /thead + tbody +tr + tda href=shale-tiger/apidocs/org/apache/shale/tiger/config/package-summary.html + org.apache.shale.tiger.config/a/td + tdFramework/td + tdDeveloping/td + td---/td +/tr +tr + tda href=shale-tiger/apidocs/org/apache/shale/tiger/faces/package-summary.html + org.apache.shale.tiger.faces/a/td + tdFramework/td + tdDeveloping/td + td---/td +/tr +tr + tda href=shale-tiger/apidocs/org/apache/shale/tiger/managed/package-summary.html + org.apache.shale.tiger.managed/a/td + tdApplication/td + tdDeveloping/td + tdAnnotations for the emAnnotated Managed Beans/em feature/td +/tr +tr + tda href=shale-tiger/apidocs/org/apache/shale/tiger/managed/config/package-summary.html + org.apache.shale.tiger.managed.config/a/td + tdFramework/td + tdDeveloping/td + td---/td +/tr +tr + tda href=shale-tiger/apidocs/org/apache/shale/tiger/managed/rules/package-summary.html + org.apache.shale.tiger.managed.rules/a/td + tdFramework/td + tdDeveloping/td + td---/td +/tr +tr + tda href=shale-tiger/apidocs/org/apache/shale/tiger/register/package-summary.html + org.apache.shale.tiger.register/a/td + tdApplication/td + tdDeveloping/td + tdAnnotations for the emAnnotated Component Registration/em feature/td +/tr +tr + tda href=shale-tiger/apidocs/org/apache/shale/tiger/resources/package-summary.html + org.apache.shale.tiger.resources/a/td + tdFramework/td + tdDeveloping/td + td---/td +/tr +tr + tda href=shale-tiger/apidocs/org/apache/shale/tiger/view/package-summary.html + org.apache.shale.tiger.view/a/td + tdApplication/td + tdDeveloping/td + tdAnnotations for the emAnnotated View Controller/em feature/td +/tr +tr + tda href=shale-tiger/apidocs/org/apache/shale/tiger/view/faces/package-summary.html + org.apache.shale.tiger.view.faces/a/td + tdFramework/td + tdDeveloping/td + td---/td /tr /tbody /table - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r372395 - /struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/symbols/RegistrationForm.java
Author: craigmcc Date: Wed Jan 25 17:55:40 2006 New Revision: 372395 URL: http://svn.apache.org/viewcvs?rev=372395view=rev Log: Fix a JDK 1.5 dependency that snuck in to the Use Cases example app. Modified: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/symbols/RegistrationForm.java Modified: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/symbols/RegistrationForm.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/symbols/RegistrationForm.java?rev=372395r1=372394r2=372395view=diff == --- struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/symbols/RegistrationForm.java (original) +++ struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/symbols/RegistrationForm.java Wed Jan 25 17:55:40 2006 @@ -41,7 +41,7 @@ FacesContext context = FacesContext.getCurrentInstance(); String init = (String) ((Map) getBean(param)).get(init); -boolean isInit = Boolean.parseBoolean(init); +boolean isInit = Boolean.valueOf(init).booleanValue(); if (isInit) { BasicPerson person = new BasicPerson(); person.setFirstName(Gary); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r372396 - /struts/shale/trunk/default.properties
Author: craigmcc Date: Wed Jan 25 17:57:34 2006 New Revision: 372396 URL: http://svn.apache.org/viewcvs?rev=372396view=rev Log: Follow the Maven convention for development versions, even for the Ant script. Modified: struts/shale/trunk/default.properties Modified: struts/shale/trunk/default.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/default.properties?rev=372396r1=372395r2=372396view=diff == --- struts/shale/trunk/default.properties (original) +++ struts/shale/trunk/default.properties Wed Jan 25 17:57:34 2006 @@ -22,7 +22,7 @@ # Version Identifier to append to artifact filenames, and embed in # JavaDoc comments -project.version=1.0.1-dev +project.version=1.0.1-SNAPSHOT # Location in which state saving should take place (client or server) state.saving=client - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r372438 - /struts/shale/trunk/build.xml
Author: craigmcc Date: Wed Jan 25 20:54:54 2006 New Revision: 372438 URL: http://svn.apache.org/viewcvs?rev=372438view=rev Log: Fix a typo that caused shale-tiger.jar not to be included in the nightly builds. Modified: struts/shale/trunk/build.xml Modified: struts/shale/trunk/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/build.xml?rev=372438r1=372437r2=372438view=diff == --- struts/shale/trunk/build.xml (original) +++ struts/shale/trunk/build.xml Wed Jan 25 20:54:54 2006 @@ -765,7 +765,7 @@ !-- Subtarget of release for JDK 1.5 library artifacts -- - targetname=release.15.libraries if=jk15.present + targetname=release.15.libraries if=jdk15.present !-- Copy tiger artifacts -- copy todir=${target.dir}/dist - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r372078 - in /struts/shale/trunk/mailreader: build.xml default.properties ext/ lib/ src/conf/MANIFEST.MF src/java/org/apache/shale/examples/mailreader/ApplicationListener.java src/systest/
Author: craigmcc Date: Tue Jan 24 18:23:41 2006 New Revision: 372078 URL: http://svn.apache.org/viewcvs?rev=372078view=rev Log: Update the build script for the Shale MailReader Example to one based on the (new) blank project template. The application compiles and runs; need to tweak some stylistic things and write a few unit tests before publishing it. Added: struts/shale/trunk/mailreader/default.properties (with props) struts/shale/trunk/mailreader/ext/ struts/shale/trunk/mailreader/lib/ struts/shale/trunk/mailreader/src/conf/MANIFEST.MF struts/shale/trunk/mailreader/src/systest/ struts/shale/trunk/mailreader/src/test/ Modified: struts/shale/trunk/mailreader/build.xml struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/ApplicationListener.java Modified: struts/shale/trunk/mailreader/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/build.xml?rev=372078r1=372077r2=372078view=diff == --- struts/shale/trunk/mailreader/build.xml (original) +++ struts/shale/trunk/mailreader/build.xml Tue Jan 24 18:23:41 2006 @@ -1,6 +1,6 @@ !-- - Copyright 2002,2004-2005 The Apache Software Foundation. + Copyright 2006 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. @@ -19,7 +19,7 @@ -- -project name=Shale-Based MailReader Example default=compile basedir=. +project name=Shale MailReader Example default=compile basedir=. !-- = Initialize Property Values -- @@ -27,97 +27,93 @@ !-- Initialize property values -- property file=build.properties/ - property file=../build.properties/ - property file=../../build.properties/ - property file=../../../build.properties/ - property file=${user.home}/build.properties/ - - - !-- Dependency home directory defaults -- - property name=chain.home value=/usr/local/commons-chain-1.0/ - property name=jsf.home value=/usr/local/jsf-1_1_01/ - property name=jstl.home value=/usr/local/jakarta-taglibs-standard-1.1.2/ - property name=junit.home value=/usr/local/junit-3.8.1/ - property name=server.home value=/usr/local/jakarta-tomcat-5.0.28/ - - - !-- Dependency library defaults -- - property name=commons-beanutils.jar - value=${jsf.home}/lib/commons-beanutils.jar/ - property name=commons-chain.jar - value=${chain.home}/commons-chain-1.0.jar/ - property name=commons-collections.jar - value=${jsf.home}/lib/commons-collections.jar/ - property name=commons-digester.jar - value=${jsf.home}/lib/commons-digester.jar/ - property name=commons-logging.jar - value=${jsf.home}/lib/commons-logging.jar/ - property name=jsf-api.jar value=${jsf.home}/lib/jsf-api.jar/ - property name=jsf-impl.jar value=${jsf.home}/lib/jsf-impl.jar/ - property name=jsp-api.jar value=${server.home}/common/lib/jsp-api.jar/ - property name=jstl.jar value=${jstl.home}/lib/jstl.jar/ - property name=junit.jarvalue=${junit.home}/junit.jar/ - property name=mailreader.jar value=${basedir}/../../../core/trunk/struts-examples/mailreader/target/lib/struts-mailreader.jar/ - property name=servlet-api.jar value=${server.home}/common/lib/servlet-api.jar/ - property name=shale.jar value=${basedir}/../core-library/target/lib/shale.jar/ - property name=standard.jar value=${jstl.home}/lib/standard.jar/ + property file=default.properties/ + + + !-- Search classpath for setting conditional processing flags -- + path id=search.classpath +filesetdir=${lib.dir} + includes=**/*.jar/ + /path !-- Conditional Processing Flags -- - available property=jsfri.present -classname=com.sun.faces.RIConstants -classpath=${jsf-impl.jar}/ - available property=myfaces.present - classname=net.sourceforge.myfaces.config.MyfacesConfig -classpath=${jsf-impl.jar}/ - - !-- Build Defaults -- - property name=build.home value=${basedir}/target/ - property name=dist.home value=${basedir}/dist/ - property name=context.pathvalue=struts-shale-mailreader/ - property name=project.namevalue=Struts-Shale MailReader/ - property name=project.package value=org.apache.shale.examples/mailreader/ - property name=project.version value=0.1-dev/ - - - !-- Compile Defaults -- - property name=compile.debug value=true/ - property name=compile.deprecation value=false/ - property name=compile.optimize
svn commit: r372087 - in /struts/shale/trunk/mailreader/src: java/org/apache/shale/examples/mailreader/ web/WEB-INF/
Author: craigmcc Date: Tue Jan 24 19:38:42 2006 New Revision: 372087 URL: http://svn.apache.org/viewcvs?rev=372087view=rev Log: Cosmetic changes only, except for a couple of places where we eliminate direct dependencies on Commons BeanUtils. Modified: struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/ApplicationListener.java struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/BaseViewController.java struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/Index.java struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/Logon.java struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/MainMenu.java struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/Registration.java struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/State.java struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/Subscription.java struts/shale/trunk/mailreader/src/web/WEB-INF/database.xml struts/shale/trunk/mailreader/src/web/WEB-INF/faces-config.xml struts/shale/trunk/mailreader/src/web/WEB-INF/web.xml Modified: struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/ApplicationListener.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/ApplicationListener.java?rev=372087r1=372086r2=372087view=diff == --- struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/ApplicationListener.java (original) +++ struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/ApplicationListener.java Tue Jan 24 19:38:42 2006 @@ -12,6 +12,8 @@ * 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. + * + * $Id$ */ package org.apache.shale.examples.mailreader; @@ -49,14 +51,12 @@ * container. This is for demonstration purposes only - you should * strongNOT/strong assume that files written here will survive a restart * of your servlet container./p - * - * $Id$ */ public final class ApplicationListener implements ServletContextListener { -// - Manifest Constants +// -- Manifest Constants /** @@ -73,7 +73,7 @@ public static final String PROTOCOLS_KEY = protocols; -// - Instance Variables +// -- Instance Variables /** Modified: struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/BaseViewController.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/BaseViewController.java?rev=372087r1=372086r2=372087view=diff == --- struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/BaseViewController.java (original) +++ struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/BaseViewController.java Tue Jan 24 19:38:42 2006 @@ -12,6 +12,8 @@ * 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. + * + * $Id$ */ package org.apache.shale.examples.mailreader; @@ -24,8 +26,6 @@ /** * pConvenience abstract base codeViewController/code * for the Mail Reader example application./p - * - * $Id$ */ public abstract class BaseViewController extends AbstractViewController { Modified: struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/Index.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/Index.java?rev=372087r1=372086r2=372087view=diff == --- struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/Index.java (original) +++ struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader/Index.java Tue Jan 24 19:38:42 2006 @@ -12,14 +12,14 @@ * 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. + * + * $Id$ */ package org.apache.shale.examples.mailreader; /** * pcodeViewController/code for the codeindex/code page./p - * - * $Id$ */ public class Index extends BaseViewController { Modified: struts/shale/trunk/mailreader/src/java/org/apache/shale/examples/mailreader
svn commit: r372089 - in /struts/shale/trunk/mailreader/src/web: index.jsp logon.jsp mainMenu.jsp registration.jsp subscription.jsp
Author: craigmcc Date: Tue Jan 24 19:42:10 2006 New Revision: 372089 URL: http://svn.apache.org/viewcvs?rev=372089view=rev Log: Cosmetic changes only. Modified: struts/shale/trunk/mailreader/src/web/index.jsp struts/shale/trunk/mailreader/src/web/logon.jsp struts/shale/trunk/mailreader/src/web/mainMenu.jsp struts/shale/trunk/mailreader/src/web/registration.jsp struts/shale/trunk/mailreader/src/web/subscription.jsp Modified: struts/shale/trunk/mailreader/src/web/index.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/index.jsp?rev=372089r1=372088r2=372089view=diff == --- struts/shale/trunk/mailreader/src/web/index.jsp (original) +++ struts/shale/trunk/mailreader/src/web/index.jsp Tue Jan 24 19:42:10 2006 @@ -18,6 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. + $Id$ -- Modified: struts/shale/trunk/mailreader/src/web/logon.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/logon.jsp?rev=372089r1=372088r2=372089view=diff == --- struts/shale/trunk/mailreader/src/web/logon.jsp (original) +++ struts/shale/trunk/mailreader/src/web/logon.jsp Tue Jan 24 19:42:10 2006 @@ -18,6 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. + $Id$ -- Modified: struts/shale/trunk/mailreader/src/web/mainMenu.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/mainMenu.jsp?rev=372089r1=372088r2=372089view=diff == --- struts/shale/trunk/mailreader/src/web/mainMenu.jsp (original) +++ struts/shale/trunk/mailreader/src/web/mainMenu.jsp Tue Jan 24 19:42:10 2006 @@ -18,6 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. + $Id$ -- Modified: struts/shale/trunk/mailreader/src/web/registration.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/registration.jsp?rev=372089r1=372088r2=372089view=diff == --- struts/shale/trunk/mailreader/src/web/registration.jsp (original) +++ struts/shale/trunk/mailreader/src/web/registration.jsp Tue Jan 24 19:42:10 2006 @@ -18,6 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. + $Id$ -- f:view Modified: struts/shale/trunk/mailreader/src/web/subscription.jsp URL: http://svn.apache.org/viewcvs/struts/shale/trunk/mailreader/src/web/subscription.jsp?rev=372089r1=372088r2=372089view=diff == --- struts/shale/trunk/mailreader/src/web/subscription.jsp (original) +++ struts/shale/trunk/mailreader/src/web/subscription.jsp Tue Jan 24 19:42:10 2006 @@ -18,6 +18,7 @@ See the License for the specific language governing permissions and limitations under the License. + $Id$ -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r372093 - /struts/shale/trunk/build.xml
Author: craigmcc Date: Tue Jan 24 19:51:07 2006 New Revision: 372093 URL: http://svn.apache.org/viewcvs?rev=372093view=rev Log: Add the Shale MailReader Example to the set of example webapps that are published as part of a release. Modified: struts/shale/trunk/build.xml Modified: struts/shale/trunk/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/build.xml?rev=372093r1=372092r2=372093view=diff == --- struts/shale/trunk/build.xml (original) +++ struts/shale/trunk/build.xml Tue Jan 24 19:51:07 2006 @@ -709,6 +709,18 @@ excludes=lib/**/ /copy +!-- Copy mailreader artifacts -- +mkdirdir=${target.dir}/mailreader/ +mkdirdir=${target.dir}/mailreader/ext/ +mkdirdir=${target.dir}/mailreader/lib/ +copy todir=${target.dir}/mailreader + filesetdir=mailreader + includes=*.xml *.txt default.properties src/** xdocs/** + excludes=**/.svn/ + filesetdir=mailreader/dist/ + includes=docs/**/ +/copy + !-- Copy test-framework artifacts -- mkdirdir=${target.dir}/test-framework/ copy todir=${target.dir}/test-framework @@ -744,6 +756,9 @@ file=blank/dist/shale-blank-${project.version}.war/ copy todir=${dist.dir} + file=mailreader/dist/shale-mailreader-${project.version}.war/ + +copy todir=${dist.dir} file=use-cases/dist/shale-usecases-${project.version}.war/ /target @@ -866,6 +881,10 @@ echo message=Executing ${target} on module blank/ ant dir=${basedir}/blank + target=${target}/ + +echo message=Executing ${target} on module mailreader/ +ant dir=${basedir}/mailreader target=${target}/ echo message=Executing ${target} on module use-cases/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r372097 - /struts/shale/trunk/build.xml
Author: craigmcc Date: Tue Jan 24 20:03:46 2006 New Revision: 372097 URL: http://svn.apache.org/viewcvs?rev=372097view=rev Log: Add starter kit directory structures for creating a new project based on Shale, using the Shale Blank Starter App structure as a guideline. Modified: struts/shale/trunk/build.xml Modified: struts/shale/trunk/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/build.xml?rev=372097r1=372096r2=372097view=diff == --- struts/shale/trunk/build.xml (original) +++ struts/shale/trunk/build.xml Tue Jan 24 20:03:46 2006 @@ -813,6 +813,31 @@ /target + !-- Subtarget of 'release' for a starter project directory structure -- + targetname=release.starter + +!-- Set up a starter kit project directory structure -- +mkdir dir=${target.dir}/shale-starter/ +copy todir=${target.dir}/shale-starter + fileset dir=blank +includes=*.xml default.properties ext lib *.txt src/** +excludes=**/.svn/ +/copy + +!-- Publish as a tar.gz and as a zip -- +tar tarfile=${dist.dir}/shale-starter-${project.version}.tar.gz + basedir=${target.dir} + compression=gzip + includes=shale-starter/** + longfile=gnu/ + +zip zipfile=${dist.dir}/shale-starter-${project.version}.zip + basedir=${target.dir} + includes=shale-starter/**/ + + /target + + targetname=release depends=clean-release, dist.libraries, @@ -823,7 +848,8 @@ release.15.sources, release.14.webapps, release.15.webapps, - release.dependencies + release.dependencies, + release.starter description=Construct release artifacts !-- Construct archive files -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r371824 - in /struts/shale/trunk: blank/build.xml blank/xdocs/ blank/xdocs/navigation.xml build.xml use-cases/build.xml use-cases/ext/ use-cases/lib/
Author: craigmcc Date: Mon Jan 23 21:34:42 2006 New Revision: 371824 URL: http://svn.apache.org/viewcvs?rev=371824view=rev Log: Refine the artifacts created by the global release target to be of three types: * shale-framework-VVV.{tar.gz,zip} - All sources and javadocs, plus the binaries of the Shale provided libraries, for version or nightly build VV. * shale-dependencies-.{tar.gz,zip} - A snapshot of the dependencies downloaded by the ant download-dependencies command, suitable for unpacking in the top level directory of a Shale framework release. * shale--.war - Executable web application archive for appication that can be dropped in to a servet container. Initially, two applications (blank and use-cases) are supported. Added: struts/shale/trunk/blank/xdocs/ struts/shale/trunk/blank/xdocs/navigation.xml (with props) struts/shale/trunk/use-cases/ext/ struts/shale/trunk/use-cases/lib/ Modified: struts/shale/trunk/blank/build.xml struts/shale/trunk/build.xml struts/shale/trunk/use-cases/build.xml Modified: struts/shale/trunk/blank/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/blank/build.xml?rev=371824r1=371823r2=371824view=diff == --- struts/shale/trunk/blank/build.xml (original) +++ struts/shale/trunk/blank/build.xml Mon Jan 23 21:34:42 2006 @@ -34,8 +34,6 @@ path id=search.classpath filesetdir=${lib.dir} includes=**/*.jar/ -filesetdir=${shale.dir}/dist - includes=**/*.jar/ /path Added: struts/shale/trunk/blank/xdocs/navigation.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/blank/xdocs/navigation.xml?rev=371824view=auto == --- struts/shale/trunk/blank/xdocs/navigation.xml (added) +++ struts/shale/trunk/blank/xdocs/navigation.xml Mon Jan 23 21:34:42 2006 @@ -0,0 +1,37 @@ +?xml version=1.0 encoding=ISO-8859-1? +project name=Struts Framework + href=http://struts.apache.org; +image=/images/struts.gif + +titleShale Blank Starter App/title + body + +menu name=Quick Links +item name=Struts href=../../index.html/ +item name=Shale href=../index.html/ +item name=JavaServer Faces href=http://java.sun.com/j2ee/javaserverfaces/ +item name=Struts-Faces Integration Library href=../../struts-faces/index.html/ +/menu + +menu name=Sub-Project Documentation +item name=Overview href=../projects-overview.html + item name=Core Library href=../shale-core/index.html/ + item name=Test Framework href=../shale-test/index.html/ + item name=Clay Pluginhref=../shale-clay/index.html/ + item name=Use Cases href=../shale-usecases/index.html/ + item name=Mailreader href=../shale-mailreader/index.html/ + item name=Tiles Integration href=../shale-tiles/index.html/ + item name=Spring Integration href=../shale-spring/index.html/ + item name=Tiger Extensions href=../shale-tiger/index.html/ + item name=Core Library Tests href=../shale-core-test/index.html/ +/item +/menu + + /body +/project + + + + + + Propchange: struts/shale/trunk/blank/xdocs/navigation.xml -- svn:eol-style = native Propchange: struts/shale/trunk/blank/xdocs/navigation.xml -- svn:keywords = Date Author Id Revision HeadURL Modified: struts/shale/trunk/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/build.xml?rev=371824r1=371823r2=371824view=diff == --- struts/shale/trunk/build.xml (original) +++ struts/shale/trunk/build.xml Mon Jan 23 21:34:42 2006 @@ -356,7 +356,30 @@ /target + targetname=dist.libraries + description=Execute 'dist' on all library modules + +antcall target=execute.libraries + param name=target +value=dist/ +/antcall + + /target + + + targetname=dist.examples + description=Execute 'dist' on all example modules + +antcall target=execute.examples + param name=target +value=dist/ +/antcall + + /target + + targetname=dist + depends=dist.libraries,release.14.libraries,release.15.libraries,dist.examples description=Execute 'dist' on all modules antcall target=execute @@ -608,17 +631,41 @@ /target - !-- Subtarget of release for JDK 1.4 artifacts -- - targetname=release.14 - -echo message
svn commit: r371850 - /struts/shale/trunk/test-framework/build.xml
Author: craigmcc Date: Mon Jan 23 23:23:04 2006 New Revision: 371850 URL: http://svn.apache.org/viewcvs?rev=371850view=rev Log: Support a convenience base class for HtmlUnit based system integration tests. To avoid disruptions, this class is only compiled if the appropriate property (htmlunit.home) is defined to point at the HtmlUnit 1.6 or later release. Modified: struts/shale/trunk/test-framework/build.xml Modified: struts/shale/trunk/test-framework/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/build.xml?rev=371850r1=371849r2=371850view=diff == --- struts/shale/trunk/test-framework/build.xml (original) +++ struts/shale/trunk/test-framework/build.xml Mon Jan 23 23:23:04 2006 @@ -43,6 +43,9 @@ !-- Conditional Processing Flags -- + available property=htmlunit.present + classname=com.gargoylesoftware.htmlunit.Assert + classpathref=compile.classpath/ available property=jsfri.present classname=com.sun.faces.RIConstants classpath=${jsf-impl.jar}/ @@ -76,22 +79,15 @@ pathelement location=${servlet-api.jar}/ pathelement location=${shale-core.jar}/ pathelement location=${build.home}/classes/ +pathelement location=${junit.jar}/ +fileset dir=${htmlunit.home}/lib + includes=htmlunit*.jar commons-httpclient*.jar/ /path !-- Test Classpath -- path id=test.classpath -pathelement location=${commons-beanutils.jar}/ -pathelement location=${commons-collections.jar}/ -pathelement location=${commons-digester.jar}/ -pathelement location=${commons-logging.jar}/ -pathelement location=${commons-validator.jar}/ -pathelement location=${jsf-api.jar}/ -pathelement location=${jsp-api.jar}/ -pathelement location=${junit.jar}/ -pathelement location=${servlet-api.jar}/ -pathelement location=${shale-core.jar}/ -pathelement location=${build.home}/classes/ +path refid=compile.classpath/ pathelement location=${build.home}/test-classes/ /path @@ -112,11 +108,12 @@ filter token=package value=${project.package}/ filter token=statevalue=${systest.state.saving}/ filter token=version value=${project.version}/ -echo message=jsf-api.jar =${jsf-api.jar}/ -echo message=jsf-impl.jar = ${jsf-impl.jar}/ -echo message=shale-core.jar = ${shale-core.jar}/ -echo message=jsfri.present = ${jsfri.present}/ -echo message=myfaces.present= ${myfaces.present}/ +echo message=jsf-api.jar = ${jsf-api.jar}/ +echo message=jsf-impl.jar = ${jsf-impl.jar}/ +echo message=shale-core.jar = ${shale-core.jar}/ +echo message=htmlunit.present = ${htmlunit.present}/ +echo message=jsfri.present =${jsfri.present}/ +echo message=myfaces.present= ${myfaces.present}/ /target @@ -163,6 +160,8 @@ source=${platform.source} target=${platform.target} classpath refid=compile.classpath / + excludename=org/apache/shale/test/htmlunit/** +unless=htmlunit.present/ /javac !-- Copy non-Java Sources -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r371851 - in /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/htmlunit: ./ AbstractHtmlUnitTestCase.java
Author: craigmcc Date: Mon Jan 23 23:23:43 2006 New Revision: 371851 URL: http://svn.apache.org/viewcvs?rev=371851view=rev Log: Add the convenience base class mentioned in the previous commit for test-framework/build.xml. Added: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/htmlunit/ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java (with props) Added: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java?rev=371851view=auto == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java (added) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/htmlunit/AbstractHtmlUnitTestCase.java Mon Jan 23 23:23:43 2006 @@ -0,0 +1,305 @@ +/* + * Copyright 2006 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. + * + * $Id$ + */ + +package org.apache.shale.test.htmlunit; + +import com.gargoylesoftware.htmlunit.ElementNotFoundException; +import com.gargoylesoftware.htmlunit.WebClient; +import com.gargoylesoftware.htmlunit.html.HtmlAnchor; +import com.gargoylesoftware.htmlunit.html.HtmlBody; +import com.gargoylesoftware.htmlunit.html.HtmlElement; +import com.gargoylesoftware.htmlunit.html.HtmlForm; +import com.gargoylesoftware.htmlunit.html.HtmlHead; +import com.gargoylesoftware.htmlunit.html.HtmlPage; +import com.gargoylesoftware.htmlunit.html.HtmlSubmitInput; +import java.io.IOException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; +import junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; +import org.apache.commons.httpclient.Cookie; +import org.apache.commons.httpclient.HttpState; + + + +/** + * pAbstract base class for system integration tests based on HtmlUnit. + * These tests will expect a system property named codeurl/code to be + * present, which will define the URL (including the context path, but + * without a trailing slash) of the application to be tested./p + */ + +public abstract class AbstractHtmlUnitTestCase extends TestCase { + + +// Constructors + + +/** + * pConstruct a new instance of this test case./p + * + * @param name Name of the new test case + */ +public AbstractHtmlUnitTestCase(String name) { + +super(name); + +} + + +// -- Instance Variables + + +/** + * pThe HTTP state information for this test case./p + */ +protected HttpState httpState = null; + + +/** + * pThe most recently retrieved page from the server./p + */ +protected HtmlPage page = null; + + +/** + * pThe calculated URL for the installed systest web application. + * This value is based on a system property named codeurl/code, + * which must be defined as part of the command line that executes + * each test case./p + */ +protected URL url = null; + + +/** + * pThe web client for this test case./p + */ +protected WebClient webClient = null; + + +// -- Test Setup Methods + + +/** + * pSet up the instance variables required for this test case./p + */ +public void setUp() throws Exception { + +// Calculate the URL for the installed systest web application +String url = System.getProperty(url); +this.url = new URL(url + /); + +// Initialize HtmlUnit constructs for this test case +webClient = new WebClient(); +httpState = webClient.getWebConnection().getStateForUrl(url(/)); + +} + + +/** + * pReturn the set of tests included in this test suite./p + */ +public static Test suite() { + +return (new TestSuite(AbstractHtmlUnitTestCase.class)); + +} + + +/** + * pTear down instance variables required by this test case./p + */ +public void tearDown() { + +httpState = null; +page = null; +url = null; +webClient = null
svn commit: r371852 - in /struts/shale/trunk/blank: ./ src/systest/ src/systest/org/ src/systest/org/apache/ src/systest/org/apache/shale/ src/systest/org/apache/shale/blank/ src/systest/org/apache/sh
Author: craigmcc Date: Mon Jan 23 23:25:10 2006 New Revision: 371852 URL: http://svn.apache.org/viewcvs?rev=371852view=rev Log: Add a simple system integration test, using the new support in the Shale Test Framework. Added: struts/shale/trunk/blank/src/systest/ struts/shale/trunk/blank/src/systest/org/ struts/shale/trunk/blank/src/systest/org/apache/ struts/shale/trunk/blank/src/systest/org/apache/shale/ struts/shale/trunk/blank/src/systest/org/apache/shale/blank/ struts/shale/trunk/blank/src/systest/org/apache/shale/blank/systest/ struts/shale/trunk/blank/src/systest/org/apache/shale/blank/systest/WelcomeTestCase.java (with props) Modified: struts/shale/trunk/blank/build.xml struts/shale/trunk/blank/default.properties struts/shale/trunk/blank/src/web/WEB-INF/web.xml struts/shale/trunk/blank/src/web/welcome.jsp Modified: struts/shale/trunk/blank/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/blank/build.xml?rev=371852r1=371851r2=371852view=diff == --- struts/shale/trunk/blank/build.xml (original) +++ struts/shale/trunk/blank/build.xml Mon Jan 23 23:25:10 2006 @@ -100,6 +100,22 @@ /path + !-- System Integration Test Classpath -- + path id=systest.classpath +path refid=compile.classpath/ +filesetdir=${htmlunit.dir}/lib + includes=*.jar/ +filesetdir=${lib.dir} + includes=**/junit.jar/ +filesetdir=${ext.dir} + includes=**/junit.jar/ +filesetdir=${shale.dir}/dist + includes=shale-test.jar/ +pathelement location=${build.sys.dir}/ +pathelement location=${build.web.dir}/WEB-INF/classes/ + /path + + !-- Maintenance Targets -- @@ -426,6 +442,58 @@ filesetdir=${build.test.dir} includes=**/*TestCase.class/ /batchtest +/junit + + /target + + + !-- === System Integration Tests -- + + + target name=systest.compile + +mkdir dir=${build.sys.dir}/ + +!-- Compile Java Sources -- +javac srcdir=${src.sys.dir} + destdir=${build.sys.dir} + debug=${compile.debug} + deprecation=${compile.deprecation} + optimize=${compile.optimize} +source=${project.source} +target=${project.target} + classpath refid=systest.classpath / +/javac + +!-- Copy non-Java Sources -- +copytodir=${build.sys.dir} + fileset dir=${src.sys.dir} +exclude name=**/*.java/ + /fileset +/copy + + /target + + + target name=systest depends=systest.compile + description=Execute system integration tests + +junit fork=yes + printSummary=yes +haltonerror=yes + haltonfailure=yes + + classpath refid=systest.classpath/ + formatter type=plain +usefile=false/ + sysproperty key=url + value=${htmlunit.url}/ + + batchtest +filesetdir=${build.sys.dir} + includes=**/*TestCase.class/ + /batchtest + /junit /target Modified: struts/shale/trunk/blank/default.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/blank/default.properties?rev=371852r1=371851r2=371852view=diff == --- struts/shale/trunk/blank/default.properties (original) +++ struts/shale/trunk/blank/default.properties Mon Jan 23 23:25:10 2006 @@ -97,6 +97,7 @@ src.dir=${basedir}/src src.conf.dir=${src.dir}/conf src.java.dir=${src.dir}/java +src.sys.dir=${src.dir}/systest src.test.dir=${src.dir}/test src.web.dir=${src.dir}/web test.dir=${basedir}/test @@ -144,5 +145,19 @@ # The password of a Tomcat user that has the manager role catalina.password=tomcat + + +# -- +# (Optional) System Integration Test Packages +# -- + + +# The full pathname to the HtmlUnit (version 1.6 or later) binary distribution +# from http://sourceforge.net +htmlunit.dir=/usr/local/htmlunit-1.6 + + +# the full URL to the application to be tested +htmlunit.url=http://localhost:8080/${project.path} Added: struts/shale/trunk/blank/src/systest/org/apache/shale/blank/systest/WelcomeTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/blank/src/systest/org/apache/shale/blank/systest/WelcomeTestCase.java?rev=371852view=auto
svn commit: r370367 - in /struts/shale/trunk/core-library/src: java/org/apache/shale/remoting/ java/org/apache/shale/remoting/impl/ test/org/apache/shale/remoting/ test/org/apache/shale/remoting/impl/
Author: craigmcc Date: Wed Jan 18 20:24:50 2006 New Revision: 370367 URL: http://svn.apache.org/viewcvs?rev=370367view=rev Log: Add a helper class (XhtmlHelper) for use by renderers that want to leverage the Shale remoting facilities for accessing remote resources without having to worry about what FacesServlet is mapped to, or what mappings were configured for the remoting package. To support this feature, the Mapping interface was expanded to support an additional mapping (resourceId -- URL) so that this concept could be generalized into a Mapping implementation. Added: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/XhtmlHelper.java (with props) struts/shale/trunk/core-library/src/test/org/apache/shale/remoting/XhtmlHelperTestCase.java (with props) Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Bundle.properties struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mapping.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mechanism.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MappingImpl.java struts/shale/trunk/core-library/src/test/org/apache/shale/remoting/impl/MappingImplTestCase.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Bundle.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Bundle.properties?rev=370367r1=370366r2=370367view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Bundle.properties (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Bundle.properties Wed Jan 18 20:24:50 2006 @@ -5,3 +5,7 @@ mimeType.exception=Exception occurred checking MIME type mapping resource.exception=Exception occurred retrieving URL for a resource resource.refuse=Refusing access to restricted resource +xhtml.noMappings=The Mappings instance for this application has not yet been configured -- check your server logs to ensure there were no startup exceptions +xhtml.noMechanism=The resource mechanism you have specified is null +xhtml.noResourceId=The resource identifier you have specified is null +xhtml.noServletMapping=The Mappings instance is not configured with the servlet mapping(s) for javax.facesl.webapp.FacesServlet -- check your web.xml file to make sure this servlet is declared and mapped Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mapping.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mapping.java?rev=370367r1=370366r2=370367view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mapping.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mapping.java Wed Jan 18 20:24:50 2006 @@ -91,6 +91,16 @@ /** + * pMap the specified resource identifier to a complete URL that may + * be used to request this resource from the server./p + * + * @param context codeFacesContext/code for the current request + * @param resourceId Resource identifier to be mapped + */ + public String mapResourceId(FacesContext context, String resourceId); + + + /** * pIf the specified view identifier matches the pattern specified by * this [EMAIL PROTECTED] Mapping}, return the corresponding resource identifier * that should be passed on to our [EMAIL PROTECTED] Processor}. If the specified Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mechanism.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mechanism.java?rev=370367r1=370366r2=370367view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mechanism.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mechanism.java Wed Jan 18 20:24:50 2006 @@ -32,7 +32,35 @@ /** * pPrivate constructor to disable creation of new instances./p */ -private Mechanism() { } +private Mechanism(String description) { + +this.description = description; + +} + + +// -- Instance Variables + + +/** + * pThe description of this mechanism./p + */ +private String description = null; + + +// -- Public Methods + + +/** + * pReturn a string representation of this mechansim./p + */ +public String toString() { + +return this.description
svn commit: r369939 - /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java
Author: craigmcc Date: Tue Jan 17 13:54:58 2006 New Revision: 369939 URL: http://svn.apache.org/viewcvs?rev=369939view=rev Log: Make the createConverter() methods return null (per spec) if no matching registered converter can be found. Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java?rev=369939r1=369938r2=369939view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java Tue Jan 17 13:54:58 2006 @@ -100,6 +100,7 @@ addConverter(Long.TYPE, javax.faces.convert.LongConverter); addConverter(Short.class, javax.faces.convert.ShortConverter); addConverter(Short.TYPE, javax.faces.convert.ShortConverter); + } @@ -316,6 +317,9 @@ public Converter createConverter(String converterId) { String converterClass = (String) converters.get(converterId); +if (converterClass == null) { +return null; +} try { Class clazz = Class.forName(converterClass); return ((Converter) clazz.newInstance()); @@ -329,6 +333,9 @@ public Converter createConverter(Class targetClass) { String converterClass = (String) converters1.get(targetClass); +if (converterClass == null) { +return null; +} try { Class clazz = Class.forName(converterClass); return ((Converter) clazz.newInstance()); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r369940 - in /struts/shale/trunk/core-library/src/java/org/apache/shale: resources/Bundle.properties util/ConverterHelper.java
Author: craigmcc Date: Tue Jan 17 13:55:55 2006 New Revision: 369940 URL: http://svn.apache.org/viewcvs?rev=369940view=rev Log: Throw an informative ConverterException if conversion is requested for a type that has no by-type converter registered. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties?rev=369940r1=369939r2=369940view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties Tue Jan 17 13:55:55 2006 @@ -60,3 +60,6 @@ tiles.dispatchingToTile=Dispatching to tile {0} tiles.dispatchingToViewHandler=Dispatching {0} to the default view handler +# org.apache.shale.util.ConverterHelper +convHelper.noConverter=You have requested a conversion for type {0}, but there is no by-type converter registered for this type + Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java?rev=369940r1=369939r2=369940view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java Tue Jan 17 13:55:55 2006 @@ -34,6 +34,17 @@ public class ConverterHelper { +// Static Variables + + +/** + * pMessages for this class./p + */ +private static Messages messages = +new Messages(org.apache.shale.resources.Bundle, + ConverterHelper.class.getClassLoader()); + + // -- Public Methods @@ -88,11 +99,18 @@ */ private Converter converter(FacesContext context, Class type) { +Converter converter = null; try { -return context.getApplication().createConverter(type); +converter = context.getApplication().createConverter(type); } catch (FacesException e) { throw new ConverterException(e); } +if (converter == null) { +throw new ConverterException(messages.getMessage(convHelper.noConverter, + context.getViewRoot().getLocale(), + new Object[] { type.getName() })); +} +return converter; } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r369991 - in /struts/shale/trunk/core-library/src/java/org/apache/shale: resources/Bundle.properties util/ConverterHelper.java util/PropertyHelper.java
Author: craigmcc Date: Tue Jan 17 16:56:48 2006 New Revision: 369991 URL: http://svn.apache.org/viewcvs?rev=369991view=rev Log: Clean up some logic errors surfaced by writing some unit tests using these two helper classes. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java struts/shale/trunk/core-library/src/java/org/apache/shale/util/PropertyHelper.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties?rev=369991r1=369990r2=369991view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties Tue Jan 17 16:56:48 2006 @@ -61,5 +61,6 @@ tiles.dispatchingToViewHandler=Dispatching {0} to the default view handler # org.apache.shale.util.ConverterHelper +convHelper.missing=You have requested a converter, but the type specified is null convHelper.noConverter=You have requested a conversion for type {0}, but there is no by-type converter registered for this type Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java?rev=369991r1=369990r2=369991view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java Tue Jan 17 16:56:48 2006 @@ -61,6 +61,9 @@ */ public Object asObject(FacesContext context, Class type, String value) { +if (String.class == type) { +return value; +} return converter(context, type).getAsObject(context, context.getViewRoot(), value); } @@ -79,6 +82,11 @@ */ public String asString(FacesContext context, Class type, Object value) { +if (value == null) { +return null; +} else if ((String.class == type) (value instanceof String)) { +return (String) value; +} return converter(context, type).getAsString(context, context.getViewRoot(), value); } @@ -98,6 +106,11 @@ * registered for the specified type */ private Converter converter(FacesContext context, Class type) { + +if (type == null) { +throw new ConverterException(messages.getMessage(convHelper.missing, + context.getViewRoot().getLocale())); +} Converter converter = null; try { Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/util/PropertyHelper.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/util/PropertyHelper.java?rev=369991r1=369990r2=369991view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/util/PropertyHelper.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/util/PropertyHelper.java Tue Jan 17 16:56:48 2006 @@ -165,7 +165,7 @@ BeanInfo beanInfo = null; try { -Introspector.getBeanInfo(bean.getClass()); +beanInfo = Introspector.getBeanInfo(bean.getClass()); } catch (IntrospectionException e) { throw new EvaluationException(e); } @@ -178,7 +178,6 @@ if (name.equals(descriptors[i].getName())) { return descriptors[i]; } -return descriptors[i]; } throw new PropertyNotFoundException(name); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r369992 - in /struts/shale/trunk/tiger: nbproject/private/ src/java/org/apache/shale/tiger/faces/ src/test/org/apache/shale/tiger/config/ src/test/org/apache/shale/tiger/faces/
Author: craigmcc Date: Tue Jan 17 16:58:12 2006 New Revision: 369992 URL: http://svn.apache.org/viewcvs?rev=369992view=rev Log: In VariableResolverImpl, remove direct dependency on Commons BeanUtils by using the new helper methods for property access and conversion. As a side effect of this change, also change the unit tests that specified properties of type java.sql.Date, since JSF does not supply a standard converter for this, while BeanUtils did. Modified: struts/shale/trunk/tiger/nbproject/private/private.xml struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/FacesConfigParserTestCase.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-4.xml struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-5.xml struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/VariableResolverImpl4TestCase.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/VariableResolverImpl5TestCase.java Modified: struts/shale/trunk/tiger/nbproject/private/private.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/nbproject/private/private.xml?rev=369992r1=369991r2=369992view=diff == --- struts/shale/trunk/tiger/nbproject/private/private.xml (original) +++ struts/shale/trunk/tiger/nbproject/private/private.xml Tue Jan 17 16:58:12 2006 @@ -1,4 +1,4 @@ -?xml version=1.0 encoding=UTF-8? -project-private xmlns=http://www.netbeans.org/ns/project-private/1; -editor-bookmarks xmlns=http://www.netbeans.org/ns/editor-bookmarks/1/ -/project-private +?xml version=1.0 encoding=UTF-8? +project-private xmlns=http://www.netbeans.org/ns/project-private/1; +editor-bookmarks xmlns=http://www.netbeans.org/ns/editor-bookmarks/1/ +/project-private Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java?rev=369992r1=369991r2=369992view=diff == --- struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java (original) +++ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java Tue Jan 17 16:58:12 2006 @@ -23,12 +23,9 @@ import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.faces.el.EvaluationException; +import javax.faces.el.PropertyNotFoundException; import javax.faces.el.ValueBinding; import javax.faces.el.VariableResolver; -import org.apache.commons.beanutils.BeanUtils; -import org.apache.commons.beanutils.ConversionException; -import org.apache.commons.beanutils.ConvertUtils; -import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.shale.tiger.config.FacesConfigConfig; @@ -40,7 +37,9 @@ import org.apache.shale.tiger.managed.config.ManagedPropertyConfig; import org.apache.shale.tiger.managed.config.MapEntriesConfig; import org.apache.shale.tiger.managed.config.MapEntryConfig; +import org.apache.shale.util.ConverterHelper; import org.apache.shale.util.Messages; +import org.apache.shale.util.PropertyHelper; /** * pImplementation of codeVariableResolver/code that delegates @@ -101,6 +100,12 @@ /** + * pHelper bean for performing conversions./p + */ +private ConverterHelper convHelper = new ConverterHelper(); + + +/** * pLog instance for this class./p */ private transient Log log = null; @@ -119,6 +124,13 @@ private VariableResolver original = null; +/** + * pHelper bean for accessing properties./p + */ +private PropertyHelper propHelper = new PropertyHelper(); + + + // --- VariableResolver Methods @@ -193,60 +205,6 @@ /** - * pConvert the specified value to the specified type./p - * - * @param context codeFacesContext/code for the current request - * @param type Type to which the value should be converted, or - * codenull/code to leave it as a string - * @param value Value to be converted - * - * @exception EvaluationException if an evaluation error occurs - */ -private Object convert(FacesContext context, Class type, String value) { - -// If the type is not specified, return the value unchanged -if (type == null) { -return value; -} - -// Handle primitive type conversions explicitly -try { -if ((type == Boolean.TYPE) || (type == Boolean.class)) { -return Boolean.valueOf(value); -} else if ((type == Byte.TYPE) || (type == Byte.class
svn commit: r369613 - in /struts/shale/trunk/tiger/src: java/org/apache/shale/tiger/faces/ test/org/apache/shale/tiger/config/ test/org/apache/shale/tiger/faces/
Author: craigmcc Date: Mon Jan 16 16:19:49 2006 New Revision: 369613 URL: http://svn.apache.org/viewcvs?rev=369613view=rev Log: Improve the annotated managed beans implementation by adding partial support for list-entries elements. Currently, this works only for lists, but not (as the JSF spec requires) for arrays. Still no support for map-entries elements yet. Added: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/TestBean4.java (with props) struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-4.xml (with props) struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/VariableResolverImpl4TestCase.java (with props) Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/FacesConfigParserTestCase.java Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties?rev=369613r1=369612r2=369613view=diff == --- struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties (original) +++ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties Mon Jan 16 16:19:49 2006 @@ -19,6 +19,16 @@ lifecycle.initialized=Starting up Shale Tiger extensions # VariableHandlerImpl +convert.exception=Attempting to convert a value of {0} to type {1} has resulted in a ConversionException +convert.format=Attempting to convert a value of {0} to type {1} has resultined in a NumberFormatException +list.access=A list entries definition specifies a value type class {0} that does not have a public zero-arguments constructor +list.array=A list entries definition specifies a value type class {0} that is an array, which is not currently supported +list.class=A list entries definition specifies a value type class {0} that cannot be found +list.get=An attempt to retrieve a property named {0} from a managed bean named {1} has resulted in an exception +list.instantiate=A list entries definition specified a value type class {0} that was successfully loaded, but no instance can be created +list.list=A list entries definition specifies a type class {0} that is not an implementation of java.util.List +list.listProperty=A property named {0} on a managed bean named {1} has type {2} that does not implement java.util.List +list.get=An attempt to set a property named {0} on a managed bean named {1} has resulted in an exception variable.access=Managed bean definition {0} specifies a managed bean class {1} that does not have a public zero-arguments constructor variable.class=Managed bean definition {0} specifies a managed bean class {1} that cannot be found variable.evaluate=Managed bean definition {0} specifies a managed property {1} whose value expression {2} threw an exception when evaluated Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java?rev=369613r1=369612r2=369613view=diff == --- struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java (original) +++ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java Mon Jan 16 16:19:49 2006 @@ -16,19 +16,27 @@ package org.apache.shale.tiger.faces; +import java.util.ArrayList; +import java.util.List; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.faces.el.EvaluationException; import javax.faces.el.ValueBinding; import javax.faces.el.VariableResolver; import org.apache.commons.beanutils.BeanUtils; +import org.apache.commons.beanutils.ConversionException; +import org.apache.commons.beanutils.ConvertUtils; +import org.apache.commons.beanutils.PropertyUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.shale.tiger.config.FacesConfigConfig; import org.apache.shale.tiger.managed.Bean; import org.apache.shale.tiger.managed.Value; +import org.apache.shale.tiger.managed.config.ListEntriesConfig; +import org.apache.shale.tiger.managed.config.ListEntryConfig; import org.apache.shale.tiger.managed.config.ManagedBeanConfig; import org.apache.shale.tiger.managed.config.ManagedPropertyConfig; +import org.apache.shale.tiger.managed.config.MapEntriesConfig; import org.apache.shale.util.Messages; /** @@ -62,11 +70,9 @@ * pFIXME - Incomplete implemetnation of standard managed beans * functionality in the following areas:/p
svn commit: r369641 - in /struts/shale/trunk/tiger/src: java/org/apache/shale/tiger/faces/ test/org/apache/shale/tiger/config/ test/org/apache/shale/tiger/faces/
Author: craigmcc Date: Mon Jan 16 18:50:54 2006 New Revision: 369641 URL: http://svn.apache.org/viewcvs?rev=369641view=rev Log: Add support for map-entries elements as well. Now just need to finish up on array support for list-entries and do a bit of cleanup. Added: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/TestBean5.java (with props) struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-5.xml (with props) struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/faces/VariableResolverImpl5TestCase.java (with props) Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/FacesConfigParserTestCase.java Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties?rev=369641r1=369640r2=369641view=diff == --- struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties (original) +++ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/Bundle.properties Mon Jan 16 18:50:54 2006 @@ -28,7 +28,13 @@ list.instantiate=A list entries definition specified a value type class {0} that was successfully loaded, but no instance can be created list.list=A list entries definition specifies a type class {0} that is not an implementation of java.util.List list.listProperty=A property named {0} on a managed bean named {1} has type {2} that does not implement java.util.List -list.get=An attempt to set a property named {0} on a managed bean named {1} has resulted in an exception +list.set=An attempt to set a property named {0} on a managed bean named {1} has resulted in an exception +map.get=An attempt to retrieve a property named {0} from a managed bean named {1} has resulted in an exception +map.keyClass=A map entries definition specifies a key type class {0} that cannot be found +map.map=A map entries definition specifies a type class {0} that is not an implementation of java.util.Map +map.mapProperty=A property named {0} on a managed bean named {1} has type {2} that does not implement java.util.Map +map.set=An attempt to set a property named {0} on a managed bean named {1} has resulted in an exception +map.valueClass=A map entries definition specifies a value type class {0} that cannot be found variable.access=Managed bean definition {0} specifies a managed bean class {1} that does not have a public zero-arguments constructor variable.class=Managed bean definition {0} specifies a managed bean class {1} that cannot be found variable.evaluate=Managed bean definition {0} specifies a managed property {1} whose value expression {2} threw an exception when evaluated Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java?rev=369641r1=369640r2=369641view=diff == --- struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java (original) +++ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/faces/VariableResolverImpl.java Mon Jan 16 18:50:54 2006 @@ -17,7 +17,9 @@ package org.apache.shale.tiger.faces; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; import javax.faces.context.ExternalContext; import javax.faces.context.FacesContext; import javax.faces.el.EvaluationException; @@ -37,6 +39,7 @@ import org.apache.shale.tiger.managed.config.ManagedBeanConfig; import org.apache.shale.tiger.managed.config.ManagedPropertyConfig; import org.apache.shale.tiger.managed.config.MapEntriesConfig; +import org.apache.shale.tiger.managed.config.MapEntryConfig; import org.apache.shale.util.Messages; /** @@ -72,7 +75,6 @@ * ul * liPartial support for list entries on managed beans and managed properties. * It currently works for lists, but not for arrays./li - * liSupport for map entries on managed beans and managed properties./li * /ul * * pstrongIMPLEMENTATION NOTE/strong - There is no codefaces-config.xml/code @@ -265,7 +267,6 @@ Object instance = instance(context, mb); // Configure properties as necessary -// FIXME - map entries are not supported on beans for (ManagedPropertyConfig mp : mb.getProperties().values()) { property(context, mb, mp, instance); } @@ -284,7 +285,16 @@ } // Configure map entries as necessary -// FIXME +MapEntriesConfig
svn commit: r369703 - /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java
Author: craigmcc Date: Mon Jan 16 23:07:46 2006 New Revision: 369703 URL: http://svn.apache.org/viewcvs?rev=369703view=rev Log: Implement support for by-type converters (as well as by-id). Preregister all the standard by-type and by-id converters that a standard JSF implementation does. Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java?rev=369703r1=369702r2=369703view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockApplication.java Mon Jan 16 23:07:46 2006 @@ -58,6 +58,7 @@ setActionListener(new MockActionListener()); components = new HashMap(); converters = new HashMap(); +converters1 = new HashMap(); setDefaultLocale(Locale.getDefault()); setDefaultRenderKitId(RenderKitFactory.HTML_BASIC_RENDER_KIT); setNavigationHandler(new MockNavigationHandler()); @@ -68,6 +69,37 @@ setVariableResolver(new MockVariableResolver()); setViewHandler(new MockViewHandler()); +// Register the standard by-id converters +addConverter(javax.faces.BigDecimal, javax.faces.convert.BigDecimalConverter); +addConverter(javax.faces.BigInteger, javax.faces.convert.BigIntegerConverter); +addConverter(javax.faces.Boolean, javax.faces.convert.BooleanConverter); +addConverter(javax.faces.Byte, javax.faces.convert.ByteConverter); +addConverter(javax.faces.Character, javax.faces.convert.CharacterConverter); +addConverter(javax.faces.DateTime, javax.faces.convert.DateTimeConverter); +addConverter(javax.faces.Double, javax.faces.convert.DoubleConverter); +addConverter(javax.faces.Float, javax.faces.convert.FloatConverter); +addConverter(javax.faces.Integer, javax.faces.Convert.IntegerConverter); +addConverter(javax.faces.Long, javax.faces.convert.LongConverter); +addConverter(javax.faces.Number, javax.faces.convert.NumberConverter); +addConverter(javax.faces.Short, javax.faces.convert.ShortConverter); + +// Register the standard by-type converters +addConverter(Boolean.class, javax.faces.convert.BooleanConverter); +addConverter(Boolean.TYPE, javax.faces.convert.BooleanConverter); +addConverter(Byte.class, javax.faces.convert.ByteConverter); +addConverter(Byte.TYPE, javax.faces.convert.ByteConverter); +addConverter(Character.class, javax.faces.convert.CharacterConverter); +addConverter(Character.TYPE, javax.faces.convert.CharacterConverter); +addConverter(Double.class, javax.faces.convert.DoubleConverter); +addConverter(Double.TYPE, javax.faces.convert.DoubleConverter); +addConverter(Float.class, javax.faces.convert.FloatConverter); +addConverter(Float.TYPE, javax.faces.convert.FloatConverter); +addConverter(Integer.class, javax.faces.convert.IntegerConverter); +addConverter(Integer.TYPE, javax.faces.convert.IntegerConverter); +addConverter(Long.class, javax.faces.convert.LongConverter); +addConverter(Long.TYPE, javax.faces.convert.LongConverter); +addConverter(Short.class, javax.faces.convert.ShortConverter); +addConverter(Short.TYPE, javax.faces.convert.ShortConverter); } @@ -79,7 +111,8 @@ private ActionListener actionListener = null; private Map components = null; -private Map converters = null; +private Map converters = null; // By id +private Map converters1 = null; // By type private Locale defaultLocale = null; private String defaultRenderKitId = null; private String messageBundle = null; @@ -275,7 +308,7 @@ public void addConverter(Class targetClass, String converterClass) { -throw new UnsupportedOperationException(); +converters1.put(targetClass, converterClass); } @@ -295,7 +328,13 @@ public Converter createConverter(Class targetClass) { -throw new UnsupportedOperationException(); +String converterClass = (String) converters1.get(targetClass); +try { +Class clazz = Class.forName(converterClass); +return ((Converter) clazz.newInstance()); +} catch (Exception e) { +throw new FacesException(e
svn commit: r369704 - in /struts/shale/trunk/core-library/src/java/org/apache/shale/util: ConverterHelper.java PropertyHelper.java
Author: craigmcc Date: Mon Jan 16 23:12:46 2006 New Revision: 369704 URL: http://svn.apache.org/viewcvs?rev=369704view=rev Log: Add JSF-friendly helper beans to access property values and converters, so that Shale code does not need to depend on commons-beanutils directly for these purposes (although it currently inherits a transitive dependency by virtue of the fact that it uses Commons Digester to parse configuration files). Added: struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java (with props) struts/shale/trunk/core-library/src/java/org/apache/shale/util/PropertyHelper.java (with props) Added: struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java?rev=369704view=auto == --- struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java (added) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java Mon Jan 16 23:12:46 2006 @@ -0,0 +1,100 @@ +/* + * Copyright 2006 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. + */ + +package org.apache.shale.util; + +import javax.faces.FacesException; +import javax.faces.context.FacesContext; +import javax.faces.convert.Converter; +import javax.faces.convert.ConverterException; + +/** + * pHelper class to provide access to by-type JavaServer Faces + * codeConverter/code capabilities. This implementation is stateless + * and maintains no cached information, so instances may be freely created + * and destroyed with no side effects./p + * + * $Id$ + * + * @since 1.0.1 + */ +public class ConverterHelper { + + +// -- Public Methods + + +/** + * pUse the registered by-type codeConverter/code to convert the + * specified String value to a corresponding Object value./p + * + * @param context codeFacesContext/code for the current request + * @param type Type to which this value should be converted + * (used to select the appropriate by-type converter) + * @param value Value to be converted + * + * @exception ConverterException if a conversion error occurs + */ +public Object asObject(FacesContext context, Class type, String value) { + +return converter(context, type).getAsObject(context, context.getViewRoot(), value); + +} + + +/** + * pUse the registered by-type codeConverter/code to convert the + * specified Object value to a corresponding String value./p + * + * @param context codeFacesContext/code for the current request + * @param type Type from which this value should be converted + * (used to select the appropriate by-type converter) + * @param value Value to be converted + * + * @exception ConverterException if a conversion error occurs + */ +public String asString(FacesContext context, Class type, Object value) { + +return converter(context, type).getAsString(context, context.getViewRoot(), value); + +} + + +// - Private Methods + + +/** + * pReturn an appropriate codeConverter/code instance for the + * specified type./p + * + * @param context codeFacesContext/code for the current request + * @param type Type for which to retrieve a codeConverter/code + * + * @exception ConverterException if no codeConverter/code has been + * registered for the specified type + */ +private Converter converter(FacesContext context, Class type) { + +try { +return context.getApplication().createConverter(type); +} catch (FacesException e) { +throw new ConverterException(e); +} + +} + + +} Propchange: struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java -- svn:eol-style = native Propchange: struts/shale/trunk/core-library/src/java/org/apache/shale/util/ConverterHelper.java -- svn:keywords = Date Author Id Revision HeadURL Added: struts/shale/trunk/core-library/src/java/org/apache
svn commit: r369370 - in /struts/shale/trunk/core-library/src/java/org/apache/shale: application/ component/ faces/ remote/ util/ validator/ view/faces/
Author: craigmcc Date: Sun Jan 15 22:27:27 2006 New Revision: 369370 URL: http://svn.apache.org/viewcvs?rev=369370view=rev Log: Clean up a bunch of PMD nags. The remaining ones about unused imports are bogus, because PMD does not consider [EMAIL PROTECTED] Foo} in a Javadoc comment to be a legitimate reason to import class Foo. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/application/AbstractRegExpFilter.java struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java struts/shale/trunk/core-library/src/java/org/apache/shale/remote/RemoteCommand.java struts/shale/trunk/core-library/src/java/org/apache/shale/util/LoadBundle.java struts/shale/trunk/core-library/src/java/org/apache/shale/validator/CommonsValidator.java struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/application/AbstractRegExpFilter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/application/AbstractRegExpFilter.java?rev=369370r1=369369r2=369370view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/application/AbstractRegExpFilter.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/application/AbstractRegExpFilter.java Sun Jan 15 22:27:27 2006 @@ -227,7 +227,7 @@ */ protected void accept(ShaleWebContext context) throws Exception { -; +// No action required } @@ -325,7 +325,7 @@ try { type = st.nextToken(); } catch (IOException e) { -; // Can not happen +// Can not happen } if (type == StreamTokenizer.TT_EOF) { break; Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java?rev=369370r1=369369r2=369370view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/component/ValidatorScript.java Sun Jan 15 22:27:27 2006 @@ -289,7 +289,6 @@ * @param context The FacesContext for this request */ public void encodeBegin(FacesContext context) throws IOException { - String id = getClientId(context); ResponseWriter writer = context.getResponseWriter(); validators.clear(); Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java?rev=369370r1=369369r2=369370view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java Sun Jan 15 22:27:27 2006 @@ -386,24 +386,6 @@ /** - * pReturn the JSF codeLifecycle/code instance for this - * web application./p - */ -private Lifecycle getLifecycle() { - -String lifecycleId = - context.getInitParameter(javax.faces.LIFECYCLE_ID); -if (lifecycleId == null) { -lifecycleId = LifecycleFactory.DEFAULT_LIFECYCLE; -} -LifecycleFactory factory = (LifecycleFactory) - FactoryFinder.getFactory(FactoryFinder.LIFECYCLE_FACTORY); -return factory.getLifecycle(lifecycleId); - -} - - -/** * pCreate and return the [EMAIL PROTECTED] ViewControllerMapper} instance * we will use for this application * Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remote/RemoteCommand.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remote/RemoteCommand.java?rev=369370r1=369369r2=369370view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remote/RemoteCommand.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remote/RemoteCommand.java Sun Jan 15 22:27:27 2006 @@ -300,7 +300,7 @@ try { type = st.nextToken(); } catch (IOException e) { -; // Can not happen +// Can not happen } if (type == StreamTokenizer.TT_EOF
svn commit: r369120 - /struts/shale/trunk/core-library/build.xml
Author: craigmcc Date: Sat Jan 14 16:02:56 2006 New Revision: 369120 URL: http://svn.apache.org/viewcvs?rev=369120view=rev Log: Do not copy package.html files, which eliminates warnings from javadoc generation. Modified: struts/shale/trunk/core-library/build.xml Modified: struts/shale/trunk/core-library/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/build.xml?rev=369120r1=369119r2=369120view=diff == --- struts/shale/trunk/core-library/build.xml (original) +++ struts/shale/trunk/core-library/build.xml Sat Jan 14 16:02:56 2006 @@ -248,6 +248,7 @@ copytodir=${build.home}/classes fileset dir=src/java exclude name=**/*.java/ +exclude name=**/package.html/ exclude name=org/apache/shale/spring/** unless=spring.present/ exclude name=org/apache/shale/tiles/** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r369152 - in /struts/shale/trunk/core-library/src: java/org/apache/shale/view/ java/org/apache/shale/view/faces/ test/org/apache/shale/view/faces/
Author: craigmcc Date: Sat Jan 14 17:27:25 2006 New Revision: 369152 URL: http://svn.apache.org/viewcvs?rev=369152view=rev Log: Second stage of refactoring for issue [38185]. Callbacks for a ViewController are now delegated to an instance of ViewControllerCallbacks. The standard implementation of this class simply casts to ViewController and calls through (functionally equivalent to the previous behavior). However, this enables the Shale Tiger Extensions version of ViewControllerCallbacks to support calling arbitrary methods identified via an annotation. Added: struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewControllerCallbacks.java struts/shale/trunk/core-library/src/test/org/apache/shale/view/faces/ struts/shale/trunk/core-library/src/test/org/apache/shale/view/faces/CallbacksFactoryTestCase.java struts/shale/trunk/core-library/src/test/org/apache/shale/view/faces/TestViewController.java struts/shale/trunk/core-library/src/test/org/apache/shale/view/faces/ViewControllerCallbacksTestCase.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewPhaseListener.java struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewViewHandler.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java?rev=369152r1=369151r2=369152view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java Sat Jan 14 17:27:25 2006 @@ -16,6 +16,7 @@ package org.apache.shale.view; + /** * pManifest constants related to Shale view support./p */ @@ -36,12 +37,29 @@ /** * pApplication scope attribute under which the + * codeViewControllerCallbacks/code instance for this application + * is stored./p + */ +public static final String VIEW_CALLBACKS = + org.apache.shale.view.VIEW_CALLBACKS; + + +/** + * pApplication scope attribute under which the * [EMAIL PROTECTED] ViewControllerMapper} for translating view identifiers * to class names of the corresponding [EMAIL PROTECTED] ViewController} * is stored./p */ public static final String VIEW_MAPPER = org.apache.shale.view.VIEW_MAPPER; + + +/** + * pRequest scope attribute under which a codeBoolean.TRUE/code + * flag is stored if this request is a postback./p + */ +public static final String VIEW_POSTBACK = + org.apache.shale.view.VIEW_POSTBACK; /** Added: struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java?rev=369152view=auto == --- struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java (added) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java Sat Jan 14 17:27:25 2006 @@ -0,0 +1,102 @@ +/* + * Copyright 2006 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. + */ + +package org.apache.shale.view.faces; + +import javax.faces.FacesException; + +/** + * pFactory for callback handler instances./p + * + * $Id$ + * + * @since 1.0.1 + */ +public class CallbacksFactory { + + +// Constructors + + +/** + * pPrivate constructor to prevent arbitrary object creation./p + */ +public CallbacksFactory() { +} + + +// -- Static Methods + + +/** + * pReturn a suitable instance of this factory./p. + */ +public static CallbacksFactory getInstance() { +return new CallbacksFactory(); +} + + +// -- Public Methods + + +/** + * pReturn a suitable
svn commit: r369163 - in /struts/shale/trunk/tiger: ./ src/java/org/apache/shale/tiger/view/ src/java/org/apache/shale/tiger/view/faces/ src/test/org/apache/shale/tiger/view/ src/test/org/apache/shale
Author: craigmcc Date: Sat Jan 14 18:25:29 2006 New Revision: 369163 URL: http://svn.apache.org/viewcvs?rev=369163view=rev Log: Fully implement view controller callbacks via annotations (instead of requiring a backing bean to implement ViewController) when running on a Java SE 5 or later platform. These features are enabled automatically by virtue of including shale-tiger.jar with your web application -- no special configuration is required. Added: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/faces/ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/faces/ViewControllerCallbacks2.java struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/faces/package.html struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/CallbacksFactoryTestCase.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/TestViewController.java struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/view/faces/ViewControllerCallbacks2TestCase.java Modified: struts/shale/trunk/tiger/build.xml struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Destroy.java struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Init.java struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Prerender.java struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/package.html Modified: struts/shale/trunk/tiger/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/build.xml?rev=369163r1=369162r2=369163view=diff == --- struts/shale/trunk/tiger/build.xml (original) +++ struts/shale/trunk/tiger/build.xml Sat Jan 14 18:25:29 2006 @@ -176,6 +176,7 @@ copytodir=${build.home}/classes fileset dir=src/java exclude name=**/*.java/ +exclude name=**/package.html/ /fileset /copy Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Destroy.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Destroy.java?rev=369163r1=369162r2=369163view=diff == --- struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Destroy.java (original) +++ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Destroy.java Sat Jan 14 18:25:29 2006 @@ -22,7 +22,7 @@ import java.lang.annotation.Target; /** - * pMethoid-level annotation indicating that the decorated method should + * pMethod-level annotation indicating that the decorated method should * have the semantics of * codeorg.apache.shale.view.ViewController.destroy()/code, * even if it is named differently./p Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Init.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Init.java?rev=369163r1=369162r2=369163view=diff == --- struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Init.java (original) +++ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Init.java Sat Jan 14 18:25:29 2006 @@ -22,7 +22,7 @@ import java.lang.annotation.Target; /** - * pMethoid-level annotation indicating that the decorated method should + * pMethod-level annotation indicating that the decorated method should * have the semantics of * codeorg.apache.shale.view.ViewController.init()/code, * even if it is named differently./p Modified: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Prerender.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Prerender.java?rev=369163r1=369162r2=369163view=diff == --- struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Prerender.java (original) +++ struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/Prerender.java Sat Jan 14 18:25:29 2006 @@ -22,7 +22,7 @@ import java.lang.annotation.Target; /** - * pMethoid-level annotation indicating that the decorated method should + * pMethod-level annotation indicating that the decorated method should * have the semantics of * codeorg.apache.shale.view.ViewController.prerender()/code, * even if it is named differently./p Added: struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/faces/ViewControllerCallbacks2.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/java/org/apache/shale/tiger/view/faces/ViewControllerCallbacks2.java?rev=369163view=auto == --- struts/shale/trunk/tiger/src/java
svn commit: r369184 - in /struts/shale/trunk: core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java tiger/nbproject/project.xml xdocs/features-tiger-extensions.xml xdocs/using.xml
Author: craigmcc Date: Sat Jan 14 23:25:47 2006 New Revision: 369184 URL: http://svn.apache.org/viewcvs?rev=369184view=rev Log: Document the current state of the Shale Tiger Extensions. Also, fix a couple of typos in other areas. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java struts/shale/trunk/tiger/nbproject/project.xml struts/shale/trunk/xdocs/features-tiger-extensions.xml struts/shale/trunk/xdocs/using.xml Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java?rev=369184r1=369183r2=369184view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/CallbacksFactory.java Sat Jan 14 23:25:47 2006 @@ -60,7 +60,7 @@ ClassLoader cl = getApplicationClassLoader(); Class clazz = null; try { -clazz = cl.loadClass(org.apache.shale.tiger.view.faces.ViewControllerCallbacks); +clazz = cl.loadClass(org.apache.shale.tiger.view.faces.ViewControllerCallbacks2); } catch (ClassNotFoundException e) { ; } Modified: struts/shale/trunk/tiger/nbproject/project.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/nbproject/project.xml?rev=369184r1=369183r2=369184view=diff == --- struts/shale/trunk/tiger/nbproject/project.xml (original) +++ struts/shale/trunk/tiger/nbproject/project.xml Sat Jan 14 23:25:47 2006 @@ -8,17 +8,17 @@ properties/ folders source-folder -labelsrc/conf/label +labelConfiguration Files/label typejava/type locationsrc/conf/location /source-folder source-folder -labelsrc/java/label +labelJava Sources/label typejava/type locationsrc/java/location /source-folder source-folder -labelsrc/test/label +labelTest Sources/label typejava/type locationsrc/test/location /source-folder @@ -49,15 +49,15 @@ view items source-folder style=packages -labelsrc/conf/label +labelConfiguration Files/label locationsrc/conf/location /source-folder source-folder style=packages -labelsrc/java/label +labelJava Sources/label locationsrc/java/location /source-folder source-folder style=packages -labelsrc/test/label +labelTest Sources/label locationsrc/test/location /source-folder source-file Modified: struts/shale/trunk/xdocs/features-tiger-extensions.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/xdocs/features-tiger-extensions.xml?rev=369184r1=369183r2=369184view=diff == --- struts/shale/trunk/xdocs/features-tiger-extensions.xml (original) +++ struts/shale/trunk/xdocs/features-tiger-extensions.xml Sat Jan 14 23:25:47 2006 @@ -10,7 +10,188 @@ section name=Shale Tiger Extensions a name=tiger/ - pFIXME - Describe tiger feature./p + a name=tiger-introduction/ + subsection name=Introduction + +pAre you running your web container on a Java SE 5 (code named +Tiger) or later JVM? If so, you can take advantage of several +Shale features that are enabled by this underlying platform:/p +ul + liThe ability to declare managed bean configuration + with annotations, rather than requiring configuration + in a codefaces-config.xml/code resource./li + liThe ability of a backing bean to receive + a href=features-view-controller.htmlView Controller/a + event callbacks to arbitrary methods declared with annotations, + rather than requiring the backing bean to implement the + codeViewController/code interface and provide methods + with the names defined by this interface./li +/ul + +pThese features are enabled automatically if you include +codeshale-tiger.jar/code in your web application./p
svn commit: r367346 - /struts/site/trunk/xdocs/index.xml
Author: craigmcc Date: Mon Jan 9 09:33:32 2006 New Revision: 367346 URL: http://svn.apache.org/viewcvs?rev=367346view=rev Log: Make the paragraph about choosing a framework for new applications a bit more even handed :-). Modified: struts/site/trunk/xdocs/index.xml Modified: struts/site/trunk/xdocs/index.xml URL: http://svn.apache.org/viewcvs/struts/site/trunk/xdocs/index.xml?rev=367346r1=367345r2=367346view=diff == --- struts/site/trunk/xdocs/index.xml (original) +++ struts/site/trunk/xdocs/index.xml Mon Jan 9 09:33:32 2006 @@ -67,8 +67,12 @@ /p p - If you are starting a new project, you might want to consider our Shale Framework. - Some people feel that JSF and Shale is the quickest way to write new Java web applications. + If you are starting a new project, you might want to consider our Shale +Framework. Some people feel that JSF and Shale is the quickest way to +write new Java web applications. Others, however, prefer the URL +mapping style of a request framework. No matter what your preference +is, we offer an actively developed framework for you. If you are not +sure which to use, go ahead and try them both out. /p p - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r367132 - in /struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces: ./ package.html
Author: craigmcc Date: Sun Jan 8 15:55:19 2006 New Revision: 367132 URL: http://svn.apache.org/viewcvs?rev=367132view=rev Log: [38185] Add a new org.apache.shale.view.faces package directory in preparation for refactoring work. Added: struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/package.html (with props) Added: struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/package.html URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/package.html?rev=367132view=auto == --- struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/package.html (added) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/package.html Sun Jan 8 15:55:19 2006 @@ -0,0 +1,24 @@ +!-- + * Copyright 2006 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. +-- + +!-- $Id$ -- + +body + +pThis package contains integration for the Shale view controller facilities +with standard JavaServer Faces extension points./p + +/body Propchange: struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/package.html -- svn:eol-style = native Propchange: struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/package.html -- svn:keywords = Date Author Id Revision HeadURL - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r367148 - in /struts/shale/trunk: clay-plugin/src/java/org/apache/shale/clay/faces/ core-library/src/conf/ core-library/src/java/org/apache/shale/component/ core-library/src/java/org/apach
Author: craigmcc Date: Sun Jan 8 17:01:56 2006 New Revision: 367148 URL: http://svn.apache.org/viewcvs?rev=367148view=rev Log: [38185] Basic refactoring ov ShalePhaseListener and ShaleViewHandler into the org.apache.shale.view hierarchy, along with the view-related constants that used to be in ShaleConstants. Added: struts/shale/trunk/core-library/src/java/org/apache/shale/view/Constants.java (with props) struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewPhaseListener.java - copied, changed from r367129, struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePhaseListener.java struts/shale/trunk/core-library/src/java/org/apache/shale/view/faces/ViewViewHandler.java - copied, changed from r367129, struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java Removed: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShalePhaseListener.java struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/faces/ClayViewHandler.java struts/shale/trunk/core-library/src/conf/faces-config.xml struts/shale/trunk/core-library/src/java/org/apache/shale/component/Subview.java struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleConstants.java struts/shale/trunk/xdocs/api-stability.xml Modified: struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/faces/ClayViewHandler.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/faces/ClayViewHandler.java?rev=367148r1=367147r2=367148view=diff == --- struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/faces/ClayViewHandler.java (original) +++ struts/shale/trunk/clay-plugin/src/java/org/apache/shale/clay/faces/ClayViewHandler.java Sun Jan 8 17:01:56 2006 @@ -36,6 +36,7 @@ import org.apache.shale.clay.component.Clay; import org.apache.shale.clay.config.Globals; import org.apache.shale.faces.ShaleConstants; +import org.apache.shale.view.Constants; import org.apache.shale.view.ViewController; import org.apache.shale.view.ViewControllerMapper; import org.apache.shale.view.impl.DefaultViewControllerMapper; @@ -425,7 +426,7 @@ if (mapper == null) { mapper = (ViewControllerMapper) context.getExternalContext().getApplicationMap(). - get(ShaleConstants.VIEW_MAPPER); + get(Constants.VIEW_MAPPER); if (mapper == null) mapper = new DefaultViewControllerMapper(); Modified: struts/shale/trunk/core-library/src/conf/faces-config.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/conf/faces-config.xml?rev=367148r1=367147r2=367148view=diff == --- struts/shale/trunk/core-library/src/conf/faces-config.xml (original) +++ struts/shale/trunk/core-library/src/conf/faces-config.xml Sun Jan 8 17:01:56 2006 @@ -32,7 +32,7 @@ faces-config - !-- Custom JSF Lifecycle and Evaluator Objects -- + !-- Custom JSF Application Objects -- application navigation-handler org.apache.shale.dialog.faces.DialogNavigationHandler @@ -44,16 +44,17 @@ org.apache.shale.faces.ShaleVariableResolver /variable-resolver view-handler - org.apache.shale.faces.ShaleViewHandler + org.apache.shale.view.faces.ViewViewHandler /view-handler /application - !-- Custom JSF PhaseListener Objects -- - !-- Loaded from shale-remoting.jar now + !-- Custom JSF Lifecycle Objects -- lifecycle + phase-listenerorg.apache.shale.view.faces.ViewPhaseListener/phase-listener + !-- Loaded from shale-remoting.jar now phase-listenerorg.apache.shale.remoting.faces.RemotingPhaseListener/phase-listener - /lifecycle -- + /lifecycle !-- Custom Components -- component Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/component/Subview.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/component/Subview.java?rev=367148r1=367147r2=367148view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/component/Subview.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/component/Subview.java Sun Jan 8 17:01:56 2006 @@ -26,8 +26,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.shale.faces.ShaleConstants; import org.apache.shale.util.Messages; +import org.apache.shale.view.Constants; import org.apache.shale.view.ViewController
svn commit: r367198 - in /struts/shale/trunk/core-library/src: java/org/apache/shale/remoting/ java/org/apache/shale/remoting/faces/ java/org/apache/shale/remoting/impl/ java/org/apache/shale/view/ te
Author: craigmcc Date: Sun Jan 8 20:53:40 2006 New Revision: 367198 URL: http://svn.apache.org/viewcvs?rev=367198view=rev Log: [38190] Make remoting support for mapping to a method binding work with the JSF 1.1 RI, as well as with MyFaces. It turns out there is a bug in the Restore View phase functionality in the RI ... mapping the view identifier to the specified or default suffix is not performed. This is worked around by having the mapResourceId() method of MappingImpl skip any suffix that the FacesServlet is mapped to to be trimmed. Also had to work around a separate limitation of the RI's RenderKit impl ... the createResponseWriter() method would *only* create a response writer for content type text/html. Now, ResponseFactory will create an implementation of its own for requested content types other than text/html. Added: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/BasicResponseWriter.java (with props) Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mapping.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mappings.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/ResponseFactory.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/AbstractResourceProcessor.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/ChainProcessor.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/ClassResourceProcessor.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MappingImpl.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MappingsImpl.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/WebResourceProcessor.java struts/shale/trunk/core-library/src/java/org/apache/shale/view/ViewController.java struts/shale/trunk/core-library/src/test/org/apache/shale/remoting/impl/MappingImplTestCase.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mapping.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mapping.java?rev=367198r1=367197r2=367198view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mapping.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mapping.java Sun Jan 8 20:53:40 2006 @@ -25,13 +25,29 @@ public interface Mapping { - /** - * pReturn a description of the mechanism used to return the response - * from this processor. This value strongmay/strong be interpreted, - * for example, by a JavaServer Faces component that wishes to calculate - * an appropriate URL for a component specific resource that is packaged - * in a particular manner./p - */ +/** + * pReturn the [EMAIL PROTECTED] Mappings} instance this [EMAIL PROTECTED] Mapping} instance + * is associated with./p + */ +public Mappings getMappings(); + + +/** + * pSet the [EMAIL PROTECTED] Mappings} instance this [EMAIL PROTECTED] Mapping} instance + * is associated with./p + * + * @param mappings The new [EMAIL PROTECTED] Mappings} instance + */ +public void setMappings(Mappings mappings); + + +/** + * pReturn a description of the mechanism used to return the response + * from this processor. This value strongmay/strong be interpreted, + * for example, by a JavaServer Faces component that wishes to calculate + * an appropriate URL for a component specific resource that is packaged + * in a particular manner./p + */ public Mechanism getMechanism(); Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mappings.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mappings.java?rev=367198r1=367197r2=367198view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mappings.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Mappings.java Sun Jan 8 20:53:40 2006 @@ -39,6 +39,13 @@ /** + * pReturn the extension that will replace the codeFacesServlet/code + * extension pattern, if codeFacesServlet/code is extension mapped./p + */ +public String getExtension(); + + +/** * pReturn the [EMAIL PROTECTED] Mapping}, if any, for the specified matching * codepattern/code. If there is no such [EMAIL PROTECTED] Mapping
svn commit: r367218 - in /struts/shale/trunk/core-library/src/java/org/apache/shale: faces/ShaleApplicationFilter.java remoting/Bundle.properties remoting/faces/RemotingPhaseListener.java
Author: craigmcc Date: Sun Jan 8 22:14:12 2006 New Revision: 367218 URL: http://svn.apache.org/viewcvs?rev=367218view=rev Log: [38190] Finish the fix, by actually parsing /WEB-INF/web.xml to see what URL patterns FacesServlet is mapped to, rather than wimping out and hard coding an assumption of just *.faces. The mapping information is actually useful generally, so store it in the Mappings instance that is placed into application scope. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/Bundle.properties struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces/RemotingPhaseListener.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java?rev=367218r1=367217r2=367218view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleApplicationFilter.java Sun Jan 8 22:14:12 2006 @@ -164,13 +164,6 @@ org.apache.shale.view.VIEW_CONTROLLER_MAPPER; -/** - * pThe codeLog/code instance for this class./p - */ -private static final Log log = - LogFactory.getLog(ShaleApplicationFilter.class); - - // -- Instance Variables @@ -187,6 +180,12 @@ /** + * pThe codeLog/code instance for this class./p + */ +private transient Log log = null; + + +/** * pMessage resources for this class./p */ private static Messages messages = @@ -202,7 +201,9 @@ */ public void destroy() { -log.info(messages.getMessage(filter.finalizing)); +if (log().isInfoEnabled()) { +log().info(messages.getMessage(filter.finalizing)); +} // Execute the destroy command in the shale catalog (if any) Command command = catalog.getCommand(COMMAND_DESTROY); @@ -211,7 +212,9 @@ try { command.execute(webContext); } catch (Exception e) { -log.error(messages.getMessage(filter.destroyException), e); +if (log().isErrorEnabled()) { + log().error(messages.getMessage(filter.destroyException), e); +} } } @@ -301,7 +304,9 @@ */ public void init(FilterConfig config) throws ServletException { -log.info(messages.getMessage(filter.initializing)); +if (log().isInfoEnabled()) { +log().info(messages.getMessage(filter.initializing)); +} context = config.getServletContext(); context.setAttribute(Constants.VIEW_MAPPER, @@ -323,7 +328,9 @@ try { command.execute(webContext); } catch (Exception e) { -log.error(messages.getMessage(filter.initException), e); +if (log().isErrorEnabled()) { +log().error(messages.getMessage(filter.initException), e); +} throw new ServletException(e); } } @@ -353,18 +360,18 @@ // Create a new catalog (if necessary) if (catalog == null) { -if (log.isDebugEnabled()) { -log.debug(messages.getMessage(filter.creatingCatalog, - new Object[] { CATALOG_NAME })); +if (log().isDebugEnabled()) { +log().debug(messages.getMessage(filter.creatingCatalog, +new Object[] { CATALOG_NAME })); } catalog = new CatalogBase(); CatalogFactory.getInstance().addCatalog(CATALOG_NAME, catalog); } // Configure this catalog based on our default resource -if (log.isDebugEnabled()) { -log.debug(messages.getMessage(filter.parsingResource, - new Object[] { RESOURCE_NAME })); +if (log().isDebugEnabled()) { +log().debug(messages.getMessage(filter.parsingResource, +new Object[] { RESOURCE_NAME })); } ConfigParser parser = new ConfigParser(); URL url = this.getClass().getClassLoader().getResource(RESOURCE_NAME); @@ -432,6 +439,19 @@ (messages.getMessage(filter.vcmInstantiate, new Object[] { className }), e); } + +} + + +/** + * pReturn the codeLog/code instance to use, creating one if needed./p + */ +private Log log() { + +if (this.log == null
svn commit: r366984 - in /struts/shale/trunk/core-library/src: java/org/apache/shale/dialog/faces/ java/org/apache/shale/remoting/ java/org/apache/shale/remoting/impl/ java/org/apache/shale/resources/
Author: craigmcc Date: Sat Jan 7 20:47:04 2006 New Revision: 366984 URL: http://svn.apache.org/viewcvs?rev=366984view=rev Log: Implement a new remoting Processor that maps a request for a resource id like /foo/bar to a Commons Chain command named foo.bar in a catalog named remoting. This Processor is not configured by default. Added: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/ChainContext.java (with props) struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/ChainProcessor.java (with props) struts/shale/trunk/core-library/src/test/org/apache/shale/remoting/impl/ChainProcessorCommand.java (with props) struts/shale/trunk/core-library/src/test/org/apache/shale/remoting/impl/ChainProcessorTestCase.java (with props) Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/faces/DialogNavigationHandler.java struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/package.html struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/faces/DialogNavigationHandler.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/faces/DialogNavigationHandler.java?rev=366984r1=366983r2=366984view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/faces/DialogNavigationHandler.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/faces/DialogNavigationHandler.java Sat Jan 7 20:47:04 2006 @@ -36,6 +36,7 @@ import org.apache.shale.dialog.Transition; import org.apache.shale.dialog.ViewState; import org.apache.shale.dialog.impl.StatusImpl; +import org.apache.shale.util.Messages; /** * pAn implementation of codeNavigationHandler/code that provides @@ -126,6 +127,13 @@ public static final Class[] SIGNATURE = new Class[0]; +/** + * pLocalized messages for this class./p + */ +private static final Messages messages = +new Messages(org.apache.shale.resources.Bundle); + + // -- Instance Variables @@ -199,11 +207,14 @@ // Postprocess based on the nature of the current state Dialog dialog = getDialog(context, position.getDialogName()); if (dialog == null) { -throw new IllegalArgumentException(position.toString()); +throw new IllegalArgumentException(messages.getMessage(dialog.noDialog, + new Object[] { position.getDialogName() })); } State state = dialog.findState(position.getStateName()); if (state == null) { -throw new IllegalArgumentException(position.toString()); +throw new IllegalArgumentException(messages.getMessage(dialog.noState, + new Object[] { position.getStateName(), + position.getDialogName() })); } postprocess(context, status, state, outcome); @@ -252,6 +263,9 @@ * * @param context codeFacesContext/code for the current request * @param dialogName Name of the requested dialog + * + * @exception IllegalStateException if dialog configuration metadata + * has not yet been processed */ private Dialog getDialog(FacesContext context, String dialogName) { @@ -261,7 +275,7 @@ Map map = (Map) context.getExternalContext().getApplicationMap().get(Globals.DIALOGS); if (map == null) { -return null; +throw new IllegalStateException(messages.getMessage(dialog.unconfigured)); } return (Dialog) map.get(dialogName); @@ -323,6 +337,9 @@ * @param status Current [EMAIL PROTECTED] Status} for this user * @param state The [EMAIL PROTECTED] State} we retrieved based on the [EMAIL PROTECTED] Status} * @param outcome Original outcome from handler + * + * @exception IllegalArgumentException if the current state is not + * a ViewState */ private void postprocess(FacesContext context, Status status, State state, String outcome) { @@ -336,7 +353,9 @@ State nextState = transition(status, state, outcome); preprocess(context, status, nextState, outcome); } else { -throw new IllegalArgumentException(state.toString()); +throw new IllegalArgumentException(messages.getMessage(dialog.noPostProcess, + new Object[] { state.getName(), + state.getClass().getName() })); } } @@ -351,6 +370,9 @@ * @param
svn commit: r366429 - in /struts/shale/trunk/core-library/src/java/org/apache/shale: faces/ShaleViewHandler.java resources/Bundle.properties
Author: craigmcc Date: Thu Jan 5 20:54:44 2006 New Revision: 366429 URL: http://svn.apache.org/viewcvs?rev=366429view=rev Log: Use VariableResolver instead of creating a value binding to instantiate ViewController instances. This avoids problems caused by an implementation of ViewControllerMapper that might create view identifiers that are not legal EL variable identifiers. Also, per suggestion from Laurie Harper on the dev list, explicty catch and report evaluation exceptions caused by this instantiation, to give the developer a better shot at diagnosing what happened. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java?rev=366429r1=366428r2=366429view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/faces/ShaleViewHandler.java Thu Jan 5 20:54:44 2006 @@ -26,7 +26,9 @@ import javax.faces.application.ViewHandler; import javax.faces.component.UIViewRoot; import javax.faces.context.FacesContext; +import javax.faces.el.EvaluationException; import javax.faces.el.ValueBinding; +import javax.faces.el.VariableResolver; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -223,11 +225,11 @@ // Retrieve an existing instance, or one created and configured by // the managed bean facility -ValueBinding vb = -context.getApplication().createValueBinding(#{ + viewName + }); ViewController vc = null; +VariableResolver vr = +context.getApplication().getVariableResolver(); try { -Object vcObject = vb.getValue(context); +Object vcObject = vr.resolveVariable(context, viewName); if (vcObject == null) { log.warn(messages.getMessage(view.noViewController, new Object[] { viewId, viewName })); @@ -237,6 +239,10 @@ } catch (ClassCastException e) { log.warn(messages.getMessage(view.notViewController, new Object[] { viewId, viewName })); +return; +} catch (EvaluationException e) { +log.warn(messages.getMessage(view.evalException, + new Object[] { viewId, viewName }), e); return; } Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties?rev=366429r1=366428r2=366429view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/resources/Bundle.properties Thu Jan 5 20:54:44 2006 @@ -29,6 +29,7 @@ filter.vcmInstantiate=ViewControllerMapper class {0} instance cannot be instantiated # org.apache.shale.application.ShaleViewHandler +view.evalException=Evaluation exception creating a managed bean named {1} for viewId {0} view.notViewController=Bean for viewId {0} under name {1} is not a ViewController view.noViewController=No ViewController for viewId {0} found under name {1} view.noViewControllerMapper=No ViewControllerMapper has been configured for this application - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r366441 - in /struts/shale/trunk: core-library/build.xml core-library/src/conf/faces-config.xml core-library/src/java/org/apache/shale/remoting/faces-config.xml use-cases/build.xml
Author: craigmcc Date: Thu Jan 5 22:57:59 2006 New Revision: 366441 URL: http://svn.apache.org/viewcvs?rev=366441view=rev Log: Split out the org.apache.shale.remoting package into its own JAR file (shale-remoting.jar), because it is completely self contained and not reliant on other Shale functionality. The only dependencies are JDK, JSF, commons logging, and Servlet. Added: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces-config.xml (with props) Modified: struts/shale/trunk/core-library/build.xml struts/shale/trunk/core-library/src/conf/faces-config.xml struts/shale/trunk/use-cases/build.xml Modified: struts/shale/trunk/core-library/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/build.xml?rev=366441r1=366440r2=366441view=diff == --- struts/shale/trunk/core-library/build.xml (original) +++ struts/shale/trunk/core-library/build.xml Thu Jan 5 22:57:59 2006 @@ -195,6 +195,13 @@ filter token=version value=${project.version}/ /filterset /copy +copy tofile=${build.home}/conf/MANIFEST.MF-remoting + file=src/conf/MANIFEST.MF + filterset +filter token=package value=${project.package}.remoting/ +filter token=version value=${project.version}/ + /filterset +/copy copy tofile=${build.home}/conf/MANIFEST.MF-spring file=src/conf/MANIFEST.MF filterset @@ -276,8 +283,24 @@ jar jarfile=${build.home}/lib/shale-core.jar basedir=${build.home}/classes manifest=${build.home}/conf/MANIFEST.MF-core - excludes=org/apache/shale/spring/** org/apache/shale/tiles/** **/package.html/ + excludes=org/apache/shale/remoting/** org/apache/shale/spring/** org/apache/shale/tiles/** **/package.html/ + + /target + + targetname=library-remoting depends=compile + description=Package Remoting support library +mkdirdir=${build.home}/shale-remoting/ +mkdirdir=${build.home}/shale-remoting/META-INF/ +copy todir=${build.home}/shale-remoting/META-INF + file=src/java/org/apache/shale/remoting/faces-config.xml/ +jar jarfile=${build.home}/lib/shale-remoting.jar + manifest=${build.home}/conf/MANIFEST.MF-remoting + filesetdir=${build.home}/shale-remoting/ + filesetdir=${build.home}/classes + includes=org/apache/shale/remoting/** META-INF/*.txt + excludes=**/faces-config.xml **/package.html/ +/jar /target @@ -296,6 +319,7 @@ /jar /target + targetname=library-tiles depends=compile if=tiles.present description=Package Tiles integration library mkdirdir=${build.home}/shale-tiles/ @@ -312,7 +336,7 @@ /target - targetname=library depends=library-core, library-spring, library-tiles + targetname=library depends=library-core, library-remoting, library-spring, library-tiles description=Package all libraries/ Modified: struts/shale/trunk/core-library/src/conf/faces-config.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/conf/faces-config.xml?rev=366441r1=366440r2=366441view=diff == --- struts/shale/trunk/core-library/src/conf/faces-config.xml (original) +++ struts/shale/trunk/core-library/src/conf/faces-config.xml Thu Jan 5 22:57:59 2006 @@ -49,9 +49,11 @@ /application !-- Custom JSF PhaseListener Objects -- + !-- Loaded from shale-remoting.jar now lifecycle phase-listenerorg.apache.shale.remoting.faces.RemotingPhaseListener/phase-listener /lifecycle + -- !-- Custom Components -- component Added: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces-config.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces-config.xml?rev=366441view=auto == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces-config.xml (added) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/faces-config.xml Thu Jan 5 22:57:59 2006 @@ -0,0 +1,40 @@ +?xml version=1.0? + + +!DOCTYPE faces-config PUBLIC + -//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.1//EN + http://java.sun.com/dtd/web-facesconfig_1_1.dtd; + + +!-- + + Copyright 2006 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
svn commit: r365807 - in /struts/shale/trunk/core-library: build.xml src/java/org/apache/shale/remoting/package.html
Author: craigmcc Date: Tue Jan 3 19:10:27 2006 New Revision: 365807 URL: http://svn.apache.org/viewcvs?rev=365807view=rev Log: Make it possible to set the log levels for org.apache.shale classes when unit tests are running, for example: ant -Dtest.level=trace test Also, correct a typo on retrieving response writers and streams. Modified: struts/shale/trunk/core-library/build.xml struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/package.html Modified: struts/shale/trunk/core-library/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/build.xml?rev=365807r1=365806r2=365807view=diff == --- struts/shale/trunk/core-library/build.xml (original) +++ struts/shale/trunk/core-library/build.xml Tue Jan 3 19:10:27 2006 @@ -58,6 +58,9 @@ property name=test.haltonerrorvalue=true/ property name=test.haltonfailure value=true/ property name=test.runner value=junit.textui.TestRunner/ + property name=test.factory value=org.apache.commons.logging.impl.LogFactoryImpl/ + property name=test.log value=org.apache.commons.logging.impl.SimpleLog/ + property name=test.level value=error/ !-- Compile Classpath -- @@ -428,6 +431,12 @@ printSummary=no jvmargvalue=-enableassertions:org.apache.shale.../ + sysproperty key=org.apache.commons.logging.LogFactory + value=${test.factory}/ + sysproperty key=org.apache.commons.logging.Log + value=${test.log}/ + sysproperty key=org.apache.commons.logging.simplelog.log.org.apache.shale + value=${test.level}/ sysproperty key=documentRoot value=${build.home}/test-classes/ classpath refid=test.classpath/ Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/package.html URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/package.html?rev=365807r1=365806r2=365807view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/package.html (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/package.html Tue Jan 3 19:10:27 2006 @@ -91,7 +91,7 @@ and use its methods, just as a codeRenderer/code would: blockquotepre FacesContext context = FacesContext.getCurrentInstance(); -ResponseWriter writer = (new ResponseFactory()).createResponseWriter(context, text/xml); +ResponseWriter writer = (new ResponseFactory()).getResponseWriter(context, text/xml); writer.startDocument(); ... writer.endDocument(); @@ -101,7 +101,7 @@ and use its methods: blockquotepre FacesContext context = FacesContext.getCurrentInstance(); -ResponseStream stream = (new ResponseFactory()).createResponseStream(context, image/gif); +ResponseStream stream = (new ResponseFactory()).getResponseStream(context, image/gif); stream.write(...); ... stream.close(); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r365809 - in /struts/shale/trunk/use-cases/src: java/org/apache/shale/usecases/remoting/ java/org/apache/shale/usecases/remoting/Business.java java/org/apache/shale/usecases/view/Bundle.pr
Author: craigmcc Date: Tue Jan 3 19:21:24 2006 New Revision: 365809 URL: http://svn.apache.org/viewcvs?rev=365809view=rev Log: Add examples using the new-style remoting APIs to use method bindings to call business logic methods. Added: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/remoting/ struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/remoting/Business.java (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/remoting/Business.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/remoting/Business.java?rev=365809view=auto == --- struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/remoting/Business.java (added) +++ struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/remoting/Business.java Tue Jan 3 19:21:24 2006 @@ -0,0 +1,142 @@ +/* + * Copyright 2006 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. + */ + +package org.apache.shale.usecases.remoting; + +import java.io.IOException; +import javax.faces.context.FacesContext; +import javax.faces.context.ResponseWriter; +import javax.faces.model.SelectItem; +import org.apache.shale.remoting.faces.ResponseFactory; +import org.apache.shale.usecases.view.Domains; +import org.apache.shale.view.AbstractFacesBean; + +/** + * pRemotely executable business logic methods that complete the entire + * response./p + * + * $Id$ + */ +public class Business extends AbstractFacesBean { + + +// -- Public Methods + + +/** + * pReturn the set of reported categories./p + */ +public void listCategories() throws IOException { + +FacesContext context = FacesContext.getCurrentInstance(); +selectItems(context, supportedCategories(context)); + +} + + +/** + * pReturn the set of reported locales./p + */ +public void listLocales() throws IOException { + +FacesContext context = FacesContext.getCurrentInstance(); +selectItems(context, supportedLocales(context)); + +} + + + +// --- Protected Methods + + +/** + * pRender an XML document containing the specified selection items + * as the response to this request./p + * + * @param context codeFacesContext/code for the current request + * @param items Selection items to be rendered + */ +protected void selectItems(FacesContext context, SelectItem items[]) throws IOException { + +ResponseWriter writer = +(new ResponseFactory()).getResponseWriter(context, text/xml); + +// Generate the response content +writer.startDocument(); +writer.startElement(items, null); +writer.write(\n); +for (int i = 0; i items.length; i++) { +writer.startElement(item, null); +writer.write(\n); +Object value = items[i].getValue(); +if (value != null) { +writer.startElement(value, null); +writer.writeText(value, null); +writer.endElement(value); +writer.write(\n); +} +String label = items[i].getLabel(); +if (label != null) { +writer.startElement(label, null); +writer.writeText(label, null); +writer.endElement(label); +writer.write(\n); +} +String description = items[i].getLabel(); +if (description != null) { +writer.startElement(description, null); +writer.writeText(description, null); +writer.endElement(description); +writer.write(\n); +} +writer.endElement(item); +writer.write(\n); +} +writer.endElement(items); +writer.write(\n); + +context.responseComplete(); + +} + + +/** + * pReturn the set of legal supported categories./p + * + * @param context codeFacesContext/code for the current request
svn commit: r365442 [2/2] - in /struts/shale/trunk/core-library/src: conf/ java/org/apache/shale/remoting/ java/org/apache/shale/remoting/faces/ java/org/apache/shale/remoting/impl/ test/org/apache/sh
Propchange: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java -- svn:eol-style = native Propchange: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/MethodBindingProcessor.java -- svn:keywords = Date Author Id Revision HeadURL Added: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/WebResourceProcessor.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/WebResourceProcessor.java?rev=365442view=auto == --- struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/WebResourceProcessor.java (added) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/WebResourceProcessor.java Mon Jan 2 13:29:19 2006 @@ -0,0 +1,112 @@ +/* + * Copyright 2005-2006 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. + */ + +package org.apache.shale.remoting.impl; + +import java.lang.reflect.Method; +import java.net.URL; +import java.util.Date; +import java.util.ResourceBundle; +import javax.faces.FacesException; +import javax.faces.context.FacesContext; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.apache.shale.remoting.Processor; + +/** + * pImplementation of [EMAIL PROTECTED] Processor} which serves resources from the + * web application's static resources. View identifiers shoud be a fully + * qualified path, beginning with a slash (/) character (for example, + * code/org/apache/shale/remoting/MyResource.css/code)./p + */ +public class WebResourceProcessor extends AbstractResourceProcessor { + + +// Constructors + + +// -- Instance Variables + + +/** + * pcodeResourceBundle/code containing our localized messages./p + */ +private ResourceBundle bundle = ResourceBundle.getBundle(org.apache.shale.remoting.Bundle); + + +/** + * pLog instance for this class./p + */ +private static Log log = LogFactory.getLog(WebResourceProcessor.class); + + +// -- Properties + + + +// Abstract Methods + + +/** [EMAIL PROTECTED] */ +protected URL getResourceURL(FacesContext context, String resourceId) { + +// Disallow access to resources in reserved directories +String resourceIdUpper = resourceId.toUpperCase(); +if (resourceIdUpper.startsWith(/WEB-INF) || resourceIdUpper.startsWith(/META-INF)) { +if (log.isWarnEnabled()) { +log.warn(bundle.getString(resource.refuse)); +log.warn(resourceId); +} +return null; +} + +// Disallow access to JSP and JSP fragment sources +if(resourceIdUpper.endsWith(.JSP) || resourceIdUpper.endsWith(.JSPF)) { +if (log.isWarnEnabled()) { +log.warn(bundle.getString(resource.refuse)); +log.warn(resourceId); +} +return null; +} + +// Call getResource() on the ServletContext or PortletContext instance +Object ctxt = context.getExternalContext().getContext(); +try { +Method method = +ctxt.getClass().getMethod(getResource, + new Class[] { String.class }); +URL url = (URL) method.invoke(ctxt, new Object[] { resourceId }); +if (log.isDebugEnabled()) { +log.debug(getResource( + resourceId + ) -- + url); +} +return url; +} catch (Exception e) { +if (log.isErrorEnabled()) { +log.error(bundle.getString(resource.exception), e); +log.error(resourceId); +} +return null; +} + +} + + + +// - Private Methods + + + +} Propchange: struts/shale/trunk/core-library/src/java/org/apache/shale/remoting/impl/WebResourceProcessor.java
svn commit: r360451 - in /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock: MockRenderKit.java MockResponseWriter.java
Author: craigmcc Date: Sat Dec 31 13:34:57 2005 New Revision: 360451 URL: http://svn.apache.org/viewcvs?rev=360451view=rev Log: Make MockRenderKit.createResponseWriter() functional. Added: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java (with props) Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKit.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKit.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKit.java?rev=360451r1=360450r2=360451view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKit.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKit.java Sat Dec 31 13:34:57 2005 @@ -84,7 +84,7 @@ String contentTypeList, String characterEncoding) { - throw new UnsupportedOperationException(); + return new MockResponseWriter(writer, contentTypeList, characterEncoding); } Added: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java?rev=360451view=auto == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java (added) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockResponseWriter.java Sat Dec 31 13:34:57 2005 @@ -0,0 +1,319 @@ +/* + * Copyright 2005-2006 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. + */ + +package org.apache.shale.test.mock; + +import java.io.IOException; +import java.io.Writer; +import javax.faces.component.UIComponent; +import javax.faces.context.ResponseWriter; + +/** + * pMock implementation of codejavax.faces.context.ResponseWriter./p + */ +public class MockResponseWriter extends ResponseWriter { + + +// Constructors + + +public MockResponseWriter(Writer writer, String contentType, String characterEncoding) { +this.writer = writer; +this.contentType = contentType; +this.characterEncoding = characterEncoding; +} + + +// -- Instance Variables + + +private String characterEncoding = null; +private String contentType = text/html; +private boolean open = false; // Is an element currently open? +private Writer writer = null; + + +// - Mock Object Methods + + + +// -- ResponseWriter Methods + + +public ResponseWriter cloneWithWriter(Writer writer) { +return new MockResponseWriter(writer, contentType, characterEncoding); +} + + +public void endDocument() throws IOException { +finish(); +writer.flush(); +} + + +public void endElement(String name) throws IOException { +if (open) { +writer.write(/); +finish(); +} else { +writer.write(/); +writer.write(name); +writer.write(); +} +} + + +public String getCharacterEncoding() { +return this.characterEncoding; +} + + +public String getContentType() { +return this.contentType; +} + + +public void flush() throws IOException { +finish(); +} + + +public void startDocument() throws IOException { +; // Do nothing +} + + +public void startElement(String name, UIComponent component) throws IOException { +if (name == null) { +throw new NullPointerException(); +} +finish(); +writer.write(''); +writer.write(name); +open = true; +} + + +public void writeAttribute(String name, Object value, String property) throws IOException { +if ((name == null) || (value == null)) { +throw new NullPointerException(); +} +if (!open
svn commit: r360216 - in /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock: MockHttpServletResponse.java MockPrintWriter.java MockServletOutputStream.java
Author: craigmcc Date: Fri Dec 30 17:58:55 2005 New Revision: 360216 URL: http://svn.apache.org/viewcvs?rev=360216view=rev Log: Add support for creating mock output stream and print writer implementations that buffer the bytes or characters that are written, allowing test cases to retrieve and validate this information later. Added: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrintWriter.java (with props) struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockServletOutputStream.java (with props) Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockHttpServletResponse.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockHttpServletResponse.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockHttpServletResponse.java?rev=360216r1=360215r2=360216view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockHttpServletResponse.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockHttpServletResponse.java Fri Dec 30 17:58:55 2005 @@ -16,6 +16,8 @@ package org.apache.shale.test.mock; +import java.io.ByteArrayOutputStream; +import java.io.CharArrayWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.Locale; @@ -45,11 +47,40 @@ // - Mock Object Methods +/** + * pSet the codeServletOutputStream/code to be returned by a call to + * codegetOutputStream()/code./p + * + * @param stream The codeServletOutputStream/code instance to use + * + * @deprecated Let the codegetOutputStream()/code method create and + * return an instance of codeMockServletOutputStream/code for you + */ +public void setOutputStream(ServletOutputStream stream) { +this.stream = stream; +} + + +/** + * pSet the codePrintWriter/code to be returned by a call to + * codegetWriter()/code./p + * + * @param writer The codePrintWriter/code instance to use + * + * @deprecated Let the codegetWriter()/code method create and return + * an instance of codeMockPrintWriter/code for you + */ +public void setWriter(PrintWriter writer) { +this.writer = writer; +} + + // -- Instance Variables private String encoding = ISO-8859-1; private String contentType = text/html; +private ServletOutputStream stream = null; private PrintWriter writer = null; @@ -215,17 +246,27 @@ public ServletOutputStream getOutputStream() throws IOException { -throw new UnsupportedOperationException(); +if (stream == null) { +if (writer != null) { +throw new IllegalStateException(Cannot call getOutputStream() after getWriter() has been called); +} +stream = new MockServletOutputStream(new ByteArrayOutputStream()); +} +return stream; } -public void setWriter(PrintWriter writer) { - this.writer = writer; -} - public PrintWriter getWriter() throws IOException { + +if (writer == null) { +if (stream != null) { +throw new IllegalStateException(Cannot call getWriter() after getOutputStream() was called); +} +writer = new MockPrintWriter(new CharArrayWriter()); +} return writer; + } Added: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrintWriter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrintWriter.java?rev=360216view=auto == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrintWriter.java (added) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrintWriter.java Fri Dec 30 17:58:55 2005 @@ -0,0 +1,85 @@ +/* + * + * Copyright 2004 The Apache Software Foundation. + * + * Licensed under the Apache License, Version 2.0 (the License); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an AS IS BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.shale.test.mock; + +import java.io.CharArrayWriter; +import
svn commit: r360222 - /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockMethodBinding.java
Author: craigmcc Date: Fri Dec 30 18:56:03 2005 New Revision: 360222 URL: http://svn.apache.org/viewcvs?rev=360222view=rev Log: Improve error reporting when the value binding expression part of a method binding fails to locate a corresponding bean. Previously, this just threw a NullPointerException; now it throws EvaluationException with an explanatory error message. Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockMethodBinding.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockMethodBinding.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockMethodBinding.java?rev=360222r1=360221r2=360222view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockMethodBinding.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockMethodBinding.java Fri Dec 30 18:56:03 2005 @@ -91,6 +91,10 @@ throw new NullPointerException(); } Object base = vb.getValue(context); +if (base == null) { +throw new EvaluationException(Cannot find object via expression \ + + vb.getExpressionString() + \); +} Method method = method(base); try { return (method.invoke(base, params)); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r360254 - in /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock: MockPrintWriter.java MockRenderKit.java
Author: craigmcc Date: Fri Dec 30 22:43:36 2005 New Revision: 360254 URL: http://svn.apache.org/viewcvs?rev=360254view=rev Log: Implement MockRenderKit.createResponseStream(). Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrintWriter.java struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKit.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrintWriter.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrintWriter.java?rev=360254r1=360253r2=360254view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrintWriter.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockPrintWriter.java Fri Dec 30 22:43:36 2005 @@ -36,7 +36,7 @@ /** * pReturn a default instance./p * - * @writer Temporary buffer storage for us to use + * @param writer Temporary buffer storage for us to use */ public MockPrintWriter(CharArrayWriter writer) { super(writer); Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKit.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKit.java?rev=360254r1=360253r2=360254view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKit.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockRenderKit.java Fri Dec 30 22:43:36 2005 @@ -16,6 +16,7 @@ package org.apache.shale.test.mock; +import java.io.IOException; import java.io.OutputStream; import java.io.Writer; import java.util.HashMap; @@ -90,7 +91,31 @@ public ResponseStream createResponseStream(OutputStream out) { -throw new UnsupportedOperationException(); +final OutputStream stream = out; +return new ResponseStream() { + +public void close() throws IOException { +stream.close(); +} + +public void flush() throws IOException { +stream.flush(); +} + +public void write(byte b[]) throws IOException { +stream.write(b); +} + +public void write(byte b[], int off, int len) throws IOException { +stream.write(b, off, len); +} + +public void write(int b) throws IOException { +stream.write(b); +} + +}; + } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r359096 - /struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_fr.properties
Author: craigmcc Date: Mon Dec 26 12:35:16 2005 New Revision: 359096 URL: http://svn.apache.org/viewcvs?rev=359096view=rev Log: [37972] Correct translation error in French resources. Submitted by: Alexandre Poitras [EMAIL PROTECTED] Modified: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_fr.properties Modified: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_fr.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_fr.properties?rev=359096r1=359095r2=359096view=diff == --- struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_fr.properties (original) +++ struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_fr.properties Mon Dec 26 12:35:16 2005 @@ -115,7 +115,7 @@ usecases.locale=Sélectionner le Langage usecases.locales=Énumérer les Locales (Accès à distance) usecases.logoff=Se Déconnecter -usecases.logon=Dialogue de Déconnexion +usecases.logon=Dialogue de Connexion usecases.primary=Cas d'Utilisation Principaux usecases.states=Énumérer les Noms d'États (Accès à distance) usecases.subview=Traitement de Sous-Vues - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r359099 - in /struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view: Bundle.properties Bundle_de.properties
Author: craigmcc Date: Mon Dec 26 12:50:02 2005 New Revision: 359099 URL: http://svn.apache.org/viewcvs?rev=359099view=rev Log: [38016] Finish up German translations for use cases example. Submitted by: Matthias Wessendorf mailings AT mattias.wessendorf.de Modified: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle.properties struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_de.properties Modified: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle.properties?rev=359099r1=359098r2=359099view=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 Mon Dec 26 12:50:02 2005 @@ -74,9 +74,6 @@ profile.title.1=User Profile (Page 1 of 3) profile.title.2=User Profile (Page 2 of 3) profile.title.3=User Profile (Page 3 of 3) -logon.unconfirmed=The username you specified has not been confirmed yet. \ - To confirm it, please reply to the email message that was sent to your \ - specified email address. profile.username=Username is required when creating a profile # Miscellaneous Prompts Modified: struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_de.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_de.properties?rev=359099r1=359098r2=359099view=diff == --- struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_de.properties (original) +++ struts/shale/trunk/use-cases/src/java/org/apache/shale/usecases/view/Bundle_de.properties Mon Dec 26 12:50:02 2005 @@ -21,6 +21,18 @@ category.1=Java category.2=Musik +# Ajax Code Completion Example +ajax.completion.title=Ajax Code Completion Beispiel +ajax.completion.prompt=Geben Sie einen US Bundesstaat ein: +ajax.completion.finish=Beenden +ajax.completion.submit=Senden + +# JNDI Test Labels +jndi.test.title=JNDI Test Titel +jndi.test.expected=Erwartet: +jndi.test.actual=Aktuell: +jndi.test.finish=Beenden + # Miscellaneous Labels label.cancel=Abbrechen label.finish=Beenden @@ -49,6 +61,20 @@ Um ihn zu bestätigen, bitte das an die angegebene EMail-Adresse \ verschickte EMail beantworten. +# Edit Profile Labels and Messages +profile.confirm=Der gew�nschte Benutzername wurde noch nicht best�tigt. \ + Um Ihn zu best�tigen antworten Sie bitte auf die E-Mail, die an die \ + angegebene Adresse geschickt wurde. +profile.duplicate=Der Benutzername ist bereits belegt. Bitte w�hlen Sie einen anderen. +profile.incorrect=Falscher Benutzername oder falsches Passwort. Bitte versuchen Sie es erneut. +profile.mismatch=Die eingegebenen Passw�rter stimmen nicht �berein. Bitte versuchen Sie es erneut. +profile.password=Zum Anlegen eines Profils ben�tigen Sie ein Passwort +profile.title=Bitte melden Sie sich an, um die Beispielanwendung zu nutzen +profile.title.1=Benuterprofil (Seite 1 von 3) +profile.title.2=Benuterprofil (Seite 2 von 3) +profile.title.3=Benuterprofil (Seite 3 von 3) +profile.username=Zum Anlegen eines Profils ben�tigen Sie einen Benutzernamen + # Miscellaneous Prompts prompt.categories=Meldungs Kategorien: prompt.emailAddress=Email Addresse: @@ -58,6 +84,8 @@ prompt.password2=Passwort (bestätigen): prompt.remember=Automatisch anmelden: prompt.username=Benutzername: +prompt.creditCardNumber=Kreditkartennummer +prompt.expirationDate=Enddatum # Locale Selection Labels and Messages select.mismatch=Sie haben eine nicht unterstützte Sprache {0} ausgewählt, keine Änderung gemacht @@ -67,23 +95,61 @@ select.selected=Benutzer hat die Sprache {0} gewählt select.title=Sprache wählen +# Subview Prompts +subview.actual=Aktuell: +subview.continue=Weiter +subview.expected=Erwartet: +subview.finish=Beenden +subview.first.title=Subview Verarbeitung (Seite 1 von 2) +subview.second.title=Subview Verarbeitung (Seite 2 von 2) + # Use Cases Menu Messages +usecases.categories=Liste Kategorien (Remoting) +usecases.ajax=Ajax Interaktionen +usecases.completion=Code-Vervollst�ndigung (mit Standard JSF Komponenten) usecases.edit=Benutzer Profil ändern +usecases.java=Remoting Unterst�tzung (Java) +usecases.jndi=JNDI Zugriff mit Expressions +usecases.jsp=Remoting Support (JSP) usecases.locale=Sprache wählen +usecases.locales=Liste Locale-Objekte (Remoting) usecases.logoff=Abmelden usecases.logon=Anmelde Dialog +usecases.primary=Prim�rer Use Cases +usecases.states=Liste Namen der Bundesstaaten (Remoting) +usecases.subview=Subview Verarbeitung usecases.title=Shale Framework Use Cases +usecases.validator=Commons
svn commit: r357075 - /struts/shale/trunk/build.xml
Author: craigmcc Date: Thu Dec 15 13:51:53 2005 New Revision: 357075 URL: http://svn.apache.org/viewcvs?rev=357075view=rev Log: Incorporate the Shale Tiger Extensions module into the release target (and therefore the nightly builds) if it is executed with a JDK 1.5 or later compiler. Modified: struts/shale/trunk/build.xml Modified: struts/shale/trunk/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/build.xml?rev=357075r1=357074r2=357075view=diff == --- struts/shale/trunk/build.xml (original) +++ struts/shale/trunk/build.xml Thu Dec 15 13:51:53 2005 @@ -595,16 +595,21 @@ !-- == Release Targets == -- + available property=jdk15.present +classname=java.lang.annotation.Annotation/ + property name=target.dir value=target/ property name=dist.dir value=dist/ targetname=clean-release +echo message=jdk15.present=${jdk15.present}/ delete dir=${target.dir}/ delete dir=${dist.dir}/ /target - targetname=release depends=clean-release,dist - description=Construct release artifacts + + !-- Subtarget of release for JDK 1.4 artifacts -- + targetname=release.14 echo message=-- Create Release Artifacts For Version ${project.version} --/ @@ -681,6 +686,30 @@ includes=*.jar/ /copy + /target + + + !-- Subtarget of release for JDK 1.5 artifacts -- + targetname=release.15 if=jdk15.present + +!-- Copy tiger artifacts -- +mkdirdir=${target.dir}/tiger/ +copy todir=${target.dir}/tiger + filesetdir=tiger/dist + excludes=lib/**/ +/copy +copy todir=${target.dir}/dist + filesetdir=tiger/dist/lib + includes=*.jar/ +/copy + + /target + + + targetname=release + depends=clean-release,dist,release.14,release.15 + description=Construct release artifacts + !-- Construct archive files -- tar tarfile=${dist.dir}/struts-shale-${project.version}.tar.gz compression=gzip @@ -701,8 +730,8 @@ by other targets. -- - !-- Recursively execute ${target} across all modules -- - targetname=execute + !-- Recursively execute ${target} across JDK 1.4 library modules -- + targetname=execute.14.libraries echo message=Executing ${target} on module core-library/ ant dir=${basedir}/core-library @@ -716,11 +745,39 @@ ant dir=${basedir}/test-framework target=${target}/ + /target + + + !-- Recursively execute ${target} across JDK 1.5 library modules -- + targetname=execute.15.libraries if=jdk15.present + +echo message=Executing ${target} on module tiger/ +ant dir=${basedir}/tiger + target=${target}/ + + /target + + + !-- Recursively execute ${target} across JDK 1.4 example apps -- + targetname=execute.14.examples + echo message=Executing ${target} on module use-cases/ ant dir=${basedir}/use-cases target=${target}/ /target + + + !-- Recursively execute ${target} across JDK 1.5 example apps -- + targetname=execute.15.examples if=jdk15.present + + /target + + + !-- Recursively execute ${target} across all modules -- + targetname=execute + depends=execute.14.libraries,execute.15.libraries, + execute.14.examples,execute.15.examples/ /project - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r356434 [4/4] - in /struts/shale/trunk/tiger: ./ nbproject/ nbproject/private/ src/ src/conf/ src/java/ src/java/org/ src/java/org/apache/ src/java/org/apache/shale/ src/java/org/apache/sh
floatProperty. + */ +public float getFloatProperty() { + +return this.floatProperty; +} + +/** + * Setter for property floatProperty. + * @param floatProperty New value of property floatProperty. + */ +public void setFloatProperty(float floatProperty) { + +this.floatProperty = floatProperty; +} + +/** + * Holds value of property intProperty. + */ +@Value(-4) +private int intProperty = 4; + +/** + * Getter for property intProperty. + * @return Value of property intProperty. + */ +public int getIntProperty() { + +return this.intProperty; +} + +/** + * Setter for property intProperty. + * @param intProperty New value of property intProperty. + */ +public void setIntProperty(int intProperty) { + +this.intProperty = intProperty; +} + +/** + * Holds value of property longProperty. + */ +@Value(-5) +private long longProperty = (long) 5; + +/** + * Getter for property longProperty. + * @return Value of property longProperty. + */ +public long getLongProperty() { + +return this.longProperty; +} + +/** + * Setter for property longProperty. + * @param longProperty New value of property longProperty. + */ +public void setLongProperty(long longProperty) { + +this.longProperty = longProperty; +} + +/** + * Holds value of property shortProperty. + */ +@Value(-6) +private short shortProperty = (short) 6; + +/** + * Getter for property shortProperty. + * @return Value of property shortProperty. + */ +public short getShortProperty() { + +return this.shortProperty; +} + +/** + * Setter for property shortProperty. + * @param shortProperty New value of property shortProperty. + */ +public void setShortProperty(short shortProperty) { + +this.shortProperty = shortProperty; +} + +/** + * Holds value of property stringProperty. + */ +@Value(Annotated) +private String stringProperty = String; + +/** + * Getter for property stringProperty. + * @return Value of property stringProperty. + */ +public String getStringProperty() { + +return this.stringProperty; +} + +/** + * Setter for property stringProperty. + * @param stringProperty New value of property stringProperty. + */ +public void setStringProperty(String stringProperty) { + +this.stringProperty = stringProperty; +} + +} Added: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-0.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-0.xml?rev=356434view=auto == --- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-0.xml (added) +++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-0.xml Mon Dec 12 16:46:02 2005 @@ -0,0 +1,34 @@ +?xml version=1.0 encoding=UTF-8? + +!-- + + Copyright 2002,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. + + $Id: build.xml 54942 2004-10-16 22:39:25Z craigmcc $ + +-- + +!DOCTYPE faces-config PUBLIC + '-//Sun Microsystems, Inc.//DTD JavaServer Faces Config 1.0//EN' + 'http://java.sun.com/dtd/web-facesconfig_1_0.dtd' +faces-config + +managed-bean +managed-bean-namebean0/managed-bean-name + managed-bean-classorg.apache.shale.tiger.config.TestBean/managed-bean-class +managed-bean-scoperequest/managed-bean-scope +/managed-bean + +/faces-config Added: struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-1.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-1.xml?rev=356434view=auto == --- struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-1.xml (added) +++ struts/shale/trunk/tiger/src/test/org/apache/shale/tiger/config/test-config-1.xml Mon Dec 12 16:46:02 2005 @@ -0,0 +1,82 @@ +?xml version=1.0 encoding=UTF-8? + +!-- + + Copyright 2002,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
svn commit: r355873 - /struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/impl/DialogImpl.java
Author: craigmcc Date: Sat Dec 10 18:37:28 2005 New Revision: 355873 URL: http://svn.apache.org/viewcvs?rev=355873view=rev Log: Remove unneeded LogFactory and Log instances. As a side effect, this makes the DialogImpl class correctly Serializable. Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/impl/DialogImpl.java Modified: struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/impl/DialogImpl.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/impl/DialogImpl.java?rev=355873r1=355872r2=355873view=diff == --- struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/impl/DialogImpl.java (original) +++ struts/shale/trunk/core-library/src/java/org/apache/shale/dialog/impl/DialogImpl.java Sat Dec 10 18:37:28 2005 @@ -20,8 +20,6 @@ import java.util.Iterator; import java.util.Map; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.apache.shale.dialog.Dialog; import org.apache.shale.dialog.State; import org.apache.shale.dialog.Transition; @@ -35,13 +33,6 @@ // -- Instance Variables - - -/** - * pcodeLog/code instance for this instance./p - */ -protected final Log log = LogFactory.getLog(getClass()); - /** - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r355874 - in /struts/shale/trunk/core-library: build.xml src/test/org/apache/shale/dialog/config/ConfigurationParserTestCase.java src/test/org/apache/shale/dialog/faces/DialogNavigationHan
Author: craigmcc Date: Sat Dec 10 18:38:07 2005 New Revision: 355874 URL: http://svn.apache.org/viewcvs?rev=355874view=rev Log: Adapt test cases to the semantics change on the getResource() method of MockServletContext. Modified: struts/shale/trunk/core-library/build.xml struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/config/ConfigurationParserTestCase.java struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/faces/DialogNavigationHandlerTestCase.java Modified: struts/shale/trunk/core-library/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/build.xml?rev=355874r1=355873r2=355874view=diff == --- struts/shale/trunk/core-library/build.xml (original) +++ struts/shale/trunk/core-library/build.xml Sat Dec 10 18:38:07 2005 @@ -423,6 +423,8 @@ printSummary=no jvmargvalue=-enableassertions:org.apache.shale.../ + sysproperty key=documentRoot + value=${build.home}/test-classes/ classpath refid=test.classpath/ formatter type=plain usefile=false/ Modified: struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/config/ConfigurationParserTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/config/ConfigurationParserTestCase.java?rev=355874r1=355873r2=355874view=diff == --- struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/config/ConfigurationParserTestCase.java (original) +++ struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/config/ConfigurationParserTestCase.java Sat Dec 10 18:38:07 2005 @@ -16,6 +16,7 @@ package org.apache.shale.dialog.config; +import java.io.File; import java.util.Map; import junit.framework.Test; import junit.framework.TestSuite; @@ -54,6 +55,8 @@ super.setUp(); // Configure the test dialogs we will be using +servletContext.setDocumentRoot +(new File(System.getProperty(documentRoot))); servletContext.addInitParameter (Globals.CONFIGURATION_PARAM, /org/apache/shale/dialog/faces/dialog-config.xml); Modified: struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/faces/DialogNavigationHandlerTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/faces/DialogNavigationHandlerTestCase.java?rev=355874r1=355873r2=355874view=diff == --- struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/faces/DialogNavigationHandlerTestCase.java (original) +++ struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/faces/DialogNavigationHandlerTestCase.java Sat Dec 10 18:38:07 2005 @@ -16,6 +16,7 @@ package org.apache.shale.dialog.faces; +import java.io.File; import junit.framework.Test; import junit.framework.TestSuite; @@ -59,6 +60,8 @@ application.setNavigationHandler(nh); // Configure the test dialogs we will be using +servletContext.setDocumentRoot +(new File(System.getProperty(documentRoot))); servletContext.addInitParameter (Globals.CONFIGURATION_PARAM, /org/apache/shale/dialog/faces/dialog-config.xml); - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r355881 - in /struts/shale/trunk: clay-plugin/ clay-plugin/src/test/org/apache/shale/clay/config/ clay-plugin/src/test/org/apache/shale/clay/utils/ core-library/src/test/org/apache/shale/d
Author: craigmcc Date: Sat Dec 10 19:04:24 2005 New Revision: 355881 URL: http://svn.apache.org/viewcvs?rev=355881view=rev Log: Revise all the other affected test cases to reflect revised MockServletContext behavior as well. Modified: struts/shale/trunk/clay-plugin/build.xml struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/config/ConfigTestCase.java struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/utils/ClayAmalgamTestCase.java struts/shale/trunk/core-library/src/test/org/apache/shale/dialog/impl/ImplClassesTestCase.java Modified: struts/shale/trunk/clay-plugin/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/build.xml?rev=355881r1=355880r2=355881view=diff == --- struts/shale/trunk/clay-plugin/build.xml (original) +++ struts/shale/trunk/clay-plugin/build.xml Sat Dec 10 19:04:24 2005 @@ -286,6 +286,8 @@ classpath refid=test.classpath/ formatter type=plain usefile=false/ + sysproperty key=documentRoot + value=${build.home}/test-classes/ batchtest fork=yes fileset dir=${build.home}/test-classes includes=org/apache/shale/clay/**/*TestCase.class/ Modified: struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/config/ConfigTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/config/ConfigTestCase.java?rev=355881r1=355880r2=355881view=diff == --- struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/config/ConfigTestCase.java (original) +++ struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/config/ConfigTestCase.java Sat Dec 10 19:04:24 2005 @@ -15,6 +15,7 @@ */ package org.apache.shale.clay.config; +import java.io.File; import java.util.Iterator; import junit.framework.Test; @@ -120,11 +121,15 @@ public void setUp() { super.setUp(); +// Configure document root for tests +servletContext.setDocumentRoot +(new File(System.getProperty(documentRoot))); + //load the mock config data loadComponents(); loadConverters(); loadValidators(); - + // sets the default html template suffix .html servletContext.addInitParameter(Globals.CLAY_HTML_TEMPLATE_SUFFIX, .html); @@ -353,7 +358,7 @@ public void testCustomConfigFile() { //loads the default and the custom address config files -loadConfigFile(org/apache/shale/clay/config/address-config.xml); +loadConfigFile(/org/apache/shale/clay/config/address-config.xml); ComponentBean bean = standardConfigBean.getElement(agentAddressForm); assertNotNull(bean); @@ -373,9 +378,9 @@ public void testLoadHTMLFile() { //loads the default and the custom address config file -loadConfigFile(org/apache/shale/clay/config/address-config.xml); +loadConfigFile(/org/apache/shale/clay/config/address-config.xml); -ComponentBean bean = htmlTemplateConfigBean.getElement(org/apache/shale/clay/config/address.html); +ComponentBean bean = htmlTemplateConfigBean.getElement(/org/apache/shale/clay/config/address.html); assertNotNull(bean); Iterator ci = bean.getChildrenIterator(); @@ -391,7 +396,7 @@ public void testLoadXMLFile() { //loads the default and the custom address config file -loadConfigFile(org/apache/shale/clay/config/address-config.xml); +loadConfigFile(/org/apache/shale/clay/config/address-config.xml); ComponentBean bean = xmlTemplateConfigBean.getElement(org/apache/shale/clay/config/address.xml); assertNotNull(bean); @@ -764,7 +769,7 @@ public void testSymbolInheritance() { //loads the default and the custom address config files -loadConfigFile(org/apache/shale/clay/config/address-config.xml); +loadConfigFile(/org/apache/shale/clay/config/address-config.xml); // test vertical inheritance ComponentBean bean = standardConfigBean.getElement(baseSymbolLabel); Modified: struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/utils/ClayAmalgamTestCase.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/utils/ClayAmalgamTestCase.java?rev=355881r1=355880r2=355881view=diff == --- struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/utils/ClayAmalgamTestCase.java (original) +++ struts/shale/trunk/clay-plugin/src/test/org/apache/shale/clay/utils/ClayAmalgamTestCase.java Sat Dec 10 19:04:24 2005 @@ -16,6 +16,7 @@ package org.apache.shale.clay.utils; +import java.io.File; import
svn commit: r355884 - /struts/shale/trunk/use-cases/build.xml
Author: craigmcc Date: Sat Dec 10 19:13:45 2005 New Revision: 355884 URL: http://svn.apache.org/viewcvs?rev=355884view=rev Log: Simplify default project name a bit. Modified: struts/shale/trunk/use-cases/build.xml Modified: struts/shale/trunk/use-cases/build.xml URL: http://svn.apache.org/viewcvs/struts/shale/trunk/use-cases/build.xml?rev=355884r1=355883r2=355884view=diff == --- struts/shale/trunk/use-cases/build.xml (original) +++ struts/shale/trunk/use-cases/build.xml Sat Dec 10 19:13:45 2005 @@ -19,7 +19,7 @@ -- -project name=Shale-Based Use Cases Examples default=compile basedir=. +project name=Shale Use Cases Examples default=compile basedir=. !-- = Initialize Property Values -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r354237 - /struts/shale/trunk/default.properties
Author: craigmcc Date: Mon Dec 5 16:10:02 2005 New Revision: 354237 URL: http://svn.apache.org/viewcvs?rev=354237view=rev Log: Advance default build version to 1.0.1-dev. Modified: struts/shale/trunk/default.properties Modified: struts/shale/trunk/default.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/default.properties?rev=354237r1=354236r2=354237view=diff == --- struts/shale/trunk/default.properties (original) +++ struts/shale/trunk/default.properties Mon Dec 5 16:10:02 2005 @@ -22,7 +22,7 @@ # Version Identifier to append to artifact filenames, and embed in # JavaDoc comments -project.version=1.0.0 +project.version=1.0.1-dev # Location in which state saving should take place (client or server) state.saving=client - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r354239 - /struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockServletContext.java
Author: craigmcc Date: Mon Dec 5 16:15:23 2005 New Revision: 354239 URL: http://svn.apache.org/viewcvs?rev=354239view=rev Log: Properly implement getResource(), getResourceAsStream(), and getResourcePaths() in terms of the directory specified by the documentRoot property. This allows test cases that need access to webapp resources to function as expected. Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockServletContext.java Modified: struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockServletContext.java URL: http://svn.apache.org/viewcvs/struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockServletContext.java?rev=354239r1=354238r2=354239view=diff == --- struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockServletContext.java (original) +++ struts/shale/trunk/test-framework/src/java/org/apache/shale/test/mock/MockServletContext.java Mon Dec 5 16:15:23 2005 @@ -22,6 +22,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.Enumeration; +import java.util.HashSet; import java.util.Hashtable; import java.util.Set; @@ -34,6 +35,13 @@ /** * pMock implementation of codeServletContext/code./p * + * pstrongWARNING/strong - Before you can get meaningful results from + * calls to the codegetResource()/code, codegetResourceAsStream()/code, + * codegetResourcePaths()/code, or codegetRealPath()/code methods, + * you must configure the codedocumentRoot/code property, passing in a + * codeFile/code object pointing at a directory that simulates a + * web application structure./p + * * $Id$ */ @@ -168,19 +176,20 @@ public URL getResource(String path) throws MalformedURLException { -// Return a corresponding class loader resource -StringBuffer tmp = new StringBuffer(path); -if (tmp.charAt(0) == '/') - tmp.delete(0, 1); - -// Return a corresponding class loader resource -ClassLoader classloader = Thread.currentThread() -.getContextClassLoader(); -if (classloader == null) -classloader = this.getClass().getClassLoader(); - -URL url = classloader.getResource(tmp.toString()); -return url; +if (documentRoot != null) { +if (!path.startsWith(/)) { +throw new MalformedURLException(The specified path (' + +path + ') does not start with a '/' character); +} +File resolved = new File(documentRoot, path.substring(1)); +if (resolved.exists()) { +return resolved.toURL(); +} else { +return null; +} +} else { +return null; +} } @@ -202,7 +211,62 @@ public Set getResourcePaths(String path) { -throw new UnsupportedOperationException(); +if (documentRoot == null) { +return null; +} + +// Enforce the leading slash restriction +if (!path.startsWith(/)) { +throw new IllegalArgumentException(The specified path (' + +path + ') does not start with a '/' character); +} + +// Set up to do a recursive walk through our webapp resources +Set set = new HashSet(); +String match = null; +int trim = 0; +try { +match = documentRoot.toURL().toExternalForm(); +trim = match.length() - 1; +match += path.substring(1); +} catch (Exception e) { +match = ; +} + +// Perform a recursive walk through our resources +getResourcePaths(documentRoot, match, trim, set); +return set; + +} + + +private void getResourcePaths(File node, String match, int trim, Set set) { + +// Does this resource match? +String path = null; +try { +path = node.toURL().toExternalForm(); +} catch (Exception e) { +path = ; +} +if (path.startsWith(match)) { +set.add(path.substring(trim)); +} + +// Is this resource a directory? +if (!node.isDirectory()) { +return; +} + +// Recursively process directory contents +String files[] = node.list(); +if (files == null) { +return; +} +for (int i = 0; i files.length; i++) { +File subnode = new File(node, files[i]); +getResourcePaths(subnode, match, trim, set); +} } - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r351483 - /struts/shale/trunk/default.properties
Author: craigmcc Date: Thu Dec 1 13:42:19 2005 New Revision: 351483 URL: http://svn.apache.org/viewcvs?rev=351483view=rev Log: Flip the default version number for the 1.0.0 test release. Modified: struts/shale/trunk/default.properties Modified: struts/shale/trunk/default.properties URL: http://svn.apache.org/viewcvs/struts/shale/trunk/default.properties?rev=351483r1=351482r2=351483view=diff == --- struts/shale/trunk/default.properties (original) +++ struts/shale/trunk/default.properties Thu Dec 1 13:42:19 2005 @@ -22,7 +22,7 @@ # Version Identifier to append to artifact filenames, and embed in # JavaDoc comments -project.version=1.0.0-dev +project.version=1.0.0 # Location in which state saving should take place (client or server) state.saving=client - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
svn commit: r351486 - /struts/shale/tags/STRUTS-SHALE_1.0.0/
Author: craigmcc Date: Thu Dec 1 13:46:42 2005 New Revision: 351486 URL: http://svn.apache.org/viewcvs?rev=351486view=rev Log: Tag the 1.0.0 test build. Added: struts/shale/tags/STRUTS-SHALE_1.0.0/ - copied from r351483, struts/shale/trunk/ - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]