svn commit: r1188655 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/internal/transform/ test/java/org/apache/tapestry5/integration/app1/ test/java/org/apache/tapestry
Author: robertdzeigler Date: Tue Oct 25 13:42:33 2011 New Revision: 1188655 URL: http://svn.apache.org/viewvc?rev=1188655view=rev Log: TAP5-1663: The @BindParameter annotation should support inherited parameters Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/BindParameterWorker.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BindParameterDemo.java tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/BindParameterDemo.tml Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/BindParameterWorker.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/BindParameterWorker.java?rev=1188655r1=1188654r2=1188655view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/BindParameterWorker.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/BindParameterWorker.java Tue Oct 25 13:42:33 2011 @@ -1,4 +1,4 @@ -// Copyright 2009, 2010 The Apache Software Foundation +// Copyright 2009, 2010, 2011 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. @@ -26,6 +26,7 @@ import org.apache.tapestry5.ioc.services import org.apache.tapestry5.ioc.util.AvailableValues; import org.apache.tapestry5.ioc.util.UnknownValueException; import org.apache.tapestry5.model.ComponentModel; +import org.apache.tapestry5.model.EmbeddedComponentModel; import org.apache.tapestry5.model.MutableComponentModel; import org.apache.tapestry5.plastic.*; import org.apache.tapestry5.services.transform.ComponentClassTransformWorker2; @@ -71,7 +72,12 @@ public class BindParameterWorker impleme { if (conduit == null) { -conduit = containerResources.getParameterConduit(containerParameterName); +// if the parameter is not a formal parameter then it must be a published parameter +if (containerResources.getComponentModel().isFormalParameter(containerParameterName)) +conduit = containerResources.getParameterConduit(containerParameterName); +else + conduit = getEmbeddedComponentResourcesForPublishedParameter(containerResources, containerParameterName) + .getParameterConduit(containerParameterName); } return conduit; @@ -184,9 +190,12 @@ public class BindParameterWorker impleme { if (model.isFormalParameter(name)) return name; + +if(isPublishedParameter(model, name)) + return name; } - -String message = String.format(Containing component %s does not contain a formal parameter %s %s., + +String message = String.format(Containing component %s does not contain a formal parameter or a published parameter %s %s., model.getComponentClassName(), @@ -194,7 +203,78 @@ public class BindParameterWorker impleme InternalUtils.joinSorted(guesses)); -throw new UnknownValueException(message, new AvailableValues(Formal parameters, model -.getDeclaredParameterNames())); +ListString formalAndPublishedParameters = CollectionFactory.newList(model.getParameterNames()); +formalAndPublishedParameters.addAll(getPublishedParameters(model)); + +throw new UnknownValueException(message, new AvailableValues(Formal and published parameters, formalAndPublishedParameters)); +} + +/** + * Returns true if the parameter with the given parameterName is a published parameter + * of any of the embedded components for the component with the given model. + */ +private boolean isPublishedParameter(ComponentModel model, String parameterName) + { + for (String embeddedComponentId : model.getEmbeddedComponentIds()) + { + EmbeddedComponentModel embeddedComponentModel = model + .getEmbeddedComponentModel(embeddedComponentId); + if (embeddedComponentModel.getPublishedParameters().contains(parameterName)) return true; + } + + return false; + } + +private ListString getPublishedParameters(ComponentModel model) +{ + ListString publishedParameters = CollectionFactory.newList(); + for (String
svn commit: r1186612 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js test/java/org/apache/tapestry5/integration/app1/FormTests.jav
Author: robertdzeigler Date: Thu Oct 20 04:48:26 2011 New Revision: 1186612 URL: http://svn.apache.org/viewvc?rev=1186612view=rev Log: TAP5-1408: datefield popup does not have option to cancel. Fix and properly test for issue where selecting a month from the month menu would prematurely close the datepicker. Previous version of the test was checking the visibility too quickly so the picker was still visible for the test even though it would disappear a few milliseconds later. Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js?rev=1186612r1=1186611r2=1186612view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js Thu Oct 20 04:48:26 2011 @@ -328,7 +328,7 @@ DatePicker.prototype.create = function ( var insideDatePicker = null; var parent = targ.parentNode; while (parent != null) { -if (parent.className == 'datePicker'/* || parent.className == 'labelPopup'*/) { +if (parent.className == 'datePicker' || parent.className == 'labelPopup') { insideDatePicker = parent; break; } Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java?rev=1186612r1=1186611r2=1186612view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java Thu Oct 20 04:48:26 2011 @@ -345,6 +345,13 @@ public class FormTests extends TapestryC click(css=div.labelPopup a); waitForCondition(!selenium.isElementPresent('css=div.labelPopup'), PAGE_LOAD_TIMEOUT); +//It's basically impossible to express wait until the popup doesn't disappear +//Instead, we take advantage of knowing that the datepicker disappears with this bug /almost/ +//immediately after picking the month label, so we sleep the test for a few seconds to provide +//ammple time for the bug to manifest. +try { +Thread.sleep(1500); +} catch (Exception e){/*Ignore the interrupted exception */} assertTrue(isVisible(css=div.datePicker)); }
svn commit: r1171593 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/corelib/components/ main/java/org/apache/tapestry5/internal/services/ main/resources/org/apache/ta
Author: robertdzeigler Date: Fri Sep 16 14:35:20 2011 New Revision: 1171593 URL: http://svn.apache.org/viewvc?rev=1171593view=rev Log: TAP5-1652: template expansion no longer trims whitespace off the right side of the expansion TAP5-1633: Hardcoded value for Dismiss All in AlertManager Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Alerts.properties tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/expansions_with_whitespace.tml Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/t5-alerts.js tapestry/tapestry5/trunk/tapestry-core/src/test/app1/MapExpressionInExpansions.tml tapestry/tapestry5/trunk/tapestry-core/src/test/groovy/org/apache/tapestry5/integration/app1/AlertsTests.groovy tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/TemplateParserImplTest.java tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/AlertsDemo.tml Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java?rev=1171593r1=1171592r2=1171593view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Alerts.java Fri Sep 16 14:35:20 2011 @@ -20,8 +20,10 @@ import org.apache.tapestry5.MarkupWriter import org.apache.tapestry5.alerts.Alert; import org.apache.tapestry5.alerts.AlertStorage; import org.apache.tapestry5.annotations.Environmental; +import org.apache.tapestry5.annotations.Parameter; import org.apache.tapestry5.annotations.RequestParameter; import org.apache.tapestry5.annotations.SessionState; +import org.apache.tapestry5.BindingConstants; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.json.JSONObject; import org.apache.tapestry5.services.javascript.InitializationPriority; @@ -37,6 +39,10 @@ import org.apache.tapestry5.services.jav */ public class Alerts implements ClientElement { + +@Parameter(value=message:dismiss-label, defaultPrefix=BindingConstants.LITERAL) +private String dismissText; + @Inject private ComponentResources resources; @@ -61,7 +67,8 @@ public class Alerts implements ClientEle writer.end(); JSONObject spec = new JSONObject(id, clientId, -dismissURL, resources.createEventLink(dismiss).toURI()); +dismissURL, resources.createEventLink(dismiss).toURI(), +dismissText, dismissText); javaScriptSupport.addInitializerCall(InitializationPriority.EARLY, alertManager, spec); Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java?rev=1171593r1=1171592r2=1171593view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java Fri Sep 16 14:35:20 2011 @@ -133,7 +133,6 @@ public class SaxTemplateParser private static final char EXPANSION_STRING_DELIMITTER='\''; private static final char OPEN_BRACE='{'; private static final char CLOSE_BRACE='}'; -//private static final Pattern EXPANSION_PATTERN = Pattern.compile(\\$\\{\\); private static final SetString MUST_BE_ROOT = CollectionFactory.newSet(extend, container); @@ -1157,7 +1156,7 @@ public class SaxTemplateParser //can't just assign to startx=matcher.start(1) + expressionEnd + 1; } else { -tokenAccumulator.add(new ExpansionToken(expression, textStartLocation)); +tokenAccumulator.add(new ExpansionToken(expression.trim(), textStartLocation)); startx = matcher.end(); } Added: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Alerts.properties URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src
svn commit: r1164595 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js test/java/org/apache/tapestry5/integration/app1/FormTests.jav
Author: robertdzeigler Date: Fri Sep 2 15:56:07 2011 New Revision: 1164595 URL: http://svn.apache.org/viewvc?rev=1164595view=rev Log: TAP5-1408: datefield popup does not have option to cancel Resolve issue with original fix where selecting a month from the month dropdown would close the datepicker. Thanks to bkopelove for tracking down the issue and providing a fix. Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js?rev=1164595r1=1164594r2=1164595view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js Fri Sep 2 15:56:07 2011 @@ -328,7 +328,7 @@ DatePicker.prototype.create = function ( var insideDatePicker = null; var parent = targ.parentNode; while (parent != null) { -if (parent.className == 'datePicker') { +if (parent.className == 'datePicker'/* || parent.className == 'labelPopup'*/) { insideDatePicker = parent; break; } Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java?rev=1164595r1=1164594r2=1164595view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java Fri Sep 2 15:56:07 2011 @@ -274,8 +274,8 @@ public class FormTests extends TapestryC waitForCondition(selectedGoneCondition, PAGE_LOAD_TIMEOUT); click(xpath=//td[text()='28']); -String pickerGoneCondition = !selenium.isVisible('css=div.datePicker'); -waitForCondition(pickerGoneCondition, PAGE_LOAD_TIMEOUT); +String pickerGoneSelector=css=div.datePicker; +waitForInvisible(pickerGoneSelector); assertFieldValue(asteroidImpact, 6/28/2035); @@ -290,7 +290,7 @@ public class FormTests extends TapestryC click(id=asteroidImpact-trigger); waitForCSSSelectedElementToAppear(div.datePicker); click(css=button.todayButton); -waitForCondition(pickerGoneCondition, PAGE_LOAD_TIMEOUT); +waitForInvisible(pickerGoneSelector); String value = getValue(asteroidImpact); assertFieldValue(asteroidImpact, new SimpleDateFormat(M/d/).format(new Date())); @@ -306,21 +306,21 @@ public class FormTests extends TapestryC //#1 click(css=button.todayButton); -waitForCondition(pickerGoneCondition, PAGE_LOAD_TIMEOUT); +waitForInvisible(pickerGoneSelector); assertFieldValue(asteroidImpact, value); //#4... click(id=asteroidImpact-trigger); waitForCSSSelectedElementToAppear(div.datePicker); click(css=button.noneButton); -waitForCondition(pickerGoneCondition, PAGE_LOAD_TIMEOUT); +waitForInvisible(pickerGoneSelector); assertFieldValue(asteroidImpact, ); click(id=asteroidImpact-trigger); waitForCSSSelectedElementToAppear(div.datePicker); assertFalse(isElementPresent(css=td.selected)); click(css=button.noneButton); -waitForCondition(pickerGoneCondition, PAGE_LOAD_TIMEOUT); +waitForInvisible(pickerGoneSelector); assertFieldValue(asteroidImpact, ); } @@ -335,7 +335,17 @@ public class FormTests extends TapestryC waitForCSSSelectedElementToAppear(div.datePicker); click(id=asteroidImpact); -waitForCondition(!selenium.isVisible('css=div.datePicker'), PAGE_LOAD_TIMEOUT); +waitForInvisible(css=div.datePicker); + +//also make sure that clicking the month label /doesn't/ close the picker +click(id=asteroidImpact-trigger); +waitForCSSSelectedElementToAppear(div.datePicker); +click(css=a.topLabel); +waitForCSSSelectedElementToAppear(div.labelPopup); +click(css=div.labelPopup a); + +waitForCondition(!selenium.isElementPresent('css=div.labelPopup'), PAGE_LOAD_TIMEOUT); +assertTrue(isVisible(css=div.datePicker
svn commit: r1163619 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/corelib/components/ main/java/org/apache/tapestry5/internal/services/ test/app1/ test/java/org/apa
Author: robertdzeigler Date: Wed Aug 31 13:42:51 2011 New Revision: 1163619 URL: http://svn.apache.org/viewvc?rev=1163619view=rev Log: TAP5-1620: Tml parsing expression error TAP5-1448: Example for org.apache.tapestry5.corelib.components.Errors uses invalid xml Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ExpressionInJsFunction.tml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ExpressionInJsFunction.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc?rev=1163619r1=1163618r2=1163619view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.xdoc Wed Aug 31 13:42:51 2011 @@ -15,7 +15,7 @@ t:form -t:errors +t:errors/ t:label for=search/ t:textfield t:id=search/ @@ -36,4 +36,4 @@ /section /body -/document \ No newline at end of file +/document Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java?rev=1163619r1=1163618r2=1163619view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java Wed Aug 31 13:42:51 2011 @@ -130,6 +130,10 @@ public class SaxTemplateParser // but invalid expansion. private static final Pattern EXPANSION_PATTERN = Pattern.compile(\\$\\{\\s*(((?!\\$\\{).)*)\\s*}); +private static final char EXPANSION_STRING_DELIMITTER='\''; +private static final char OPEN_BRACE='{'; +private static final char CLOSE_BRACE='}'; +//private static final Pattern EXPANSION_PATTERN = Pattern.compile(\\$\\{\\); private static final SetString MUST_BE_ROOT = CollectionFactory.newSet(extend, container); @@ -1090,7 +1094,6 @@ public class SaxTemplateParser // TAPESTRY-2028 means that the whitespace has likely been stripped out // of the text // already anyway. - while (matcher.find()) { int matchStart = matcher.start(); @@ -1098,19 +1101,66 @@ public class SaxTemplateParser if (matchStart != startx) { String prefix = text.substring(startx, matchStart); - tokenAccumulator.add(new TextToken(prefix, textStartLocation)); } // Group 1 includes the real text of the expansion, with whitespace // around the // expression (but inside the curly braces) excluded. - +// But note that we run into a problem. The original +// EXPANSION_PATTERN used a reluctant quantifier to match the +// smallest instance of ${} possible. But if you have ${'}'} or +// ${{'key': 'value'}} (maps, cf TAP5-1605) then you run into issues +// b/c the expansion becomes {'key': 'value' which is wrong. +// A fix to use greedy matching with negative lookahead to prevent +// ${...}...${...} all matching a single expansion is close, but +// has issues when an expansion is used inside a javascript function +// (see TAP5-1620). The solution is to use the greedy +// EXPANSION_PATTERN as before to bound the search for a single +// expansion, then check for {} consistency, ignoring opening and +// closing braces that occur within '' (the property expression +// language doesn't support for strings). That should include: +// 'This string has a } in it' and 'This string has a { in it.' +// Note also that the property expression language doesn't support +// escaping the string character ('), so we don't
svn commit: r1157117 - in /tapestry/tapestry5/trunk: ./ tapestry-core/src/test/app1/ tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/ tapestry-core/src/test/java/org/apache/tapestry5
Author: robertdzeigler Date: Fri Aug 12 14:16:03 2011 New Revision: 1157117 URL: http://svn.apache.org/viewvc?rev=1157117view=rev Log: Fix inadvertent commit of build.gradle. Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormFragmentExplicitVisibleBoundsDemo.tml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormFragmentExplicitVisibleBoundsDemo.java Modified: tapestry/tapestry5/trunk/build.gradle tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java Modified: tapestry/tapestry5/trunk/build.gradle URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/build.gradle?rev=1157117r1=1157116r2=1157117view=diff == --- tapestry/tapestry5/trunk/build.gradle (original) +++ tapestry/tapestry5/trunk/build.gradle Fri Aug 12 14:16:03 2011 @@ -88,7 +88,7 @@ subprojects { } ideaModule { -//scopes.PROVIDED.plus += configurations.provided + scopes.PROVIDED.plus += configurations.provided } dependencies { Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormFragmentExplicitVisibleBoundsDemo.tml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormFragmentExplicitVisibleBoundsDemo.tml?rev=1157117view=auto == --- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormFragmentExplicitVisibleBoundsDemo.tml (added) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormFragmentExplicitVisibleBoundsDemo.tml Fri Aug 12 14:16:03 2011 @@ -0,0 +1,12 @@ +html t:type=Border xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; xmlns:p=tapestry:parameter +t:form +div id=tab1 +t:formfragment + +/t:formfragment +/div +div id=tab2 + +/div +/t:form +/html Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java?rev=1157117r1=1157116r2=1157117view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java Fri Aug 12 14:16:03 2011 @@ -102,6 +102,14 @@ public class AjaxTests extends TapestryC assertFalse(isElementPresent(innertext2)); assertTrue(isElementPresent(outertext2)); } + +@Test +public void explicit_visible_bounds() +{ +openLinks(Form Fragment Explicit Visible Bounds Demo); + + +} @Test public void form_injector() Added: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormFragmentExplicitVisibleBoundsDemo.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormFragmentExplicitVisibleBoundsDemo.java?rev=1157117view=auto == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormFragmentExplicitVisibleBoundsDemo.java (added) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormFragmentExplicitVisibleBoundsDemo.java Fri Aug 12 14:16:03 2011 @@ -0,0 +1,24 @@ +// Copyright 2011 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.tapestry5.integration.app1.pages; + +/** + * Demos the use of explicit bounds for checking visibility of a form fragment for form submission processing. + * By default, a FormFragment searches to make sure the containing form is visible via isDeepVisible. If + * no intermediate parent elements are invisible, the fragment is considered visible. However, there are times when + * that behavior is not desired; some element other than form should be used as the stopping point for determining + * visibility. This page demonstrates that use case. + */ +public class
svn commit: r1157120 - in /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1: AjaxTests.java pages/FormFragmentExplicitVisibleBoundsDemo.java
Author: robertdzeigler Date: Fri Aug 12 14:23:26 2011 New Revision: 1157120 URL: http://svn.apache.org/viewvc?rev=1157120view=rev Log: Undo botched portions of prior commit. Removed: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormFragmentExplicitVisibleBoundsDemo.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java?rev=1157120r1=1157119r2=1157120view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java Fri Aug 12 14:23:26 2011 @@ -104,14 +104,6 @@ public class AjaxTests extends TapestryC } @Test -public void explicit_visible_bounds() -{ -openLinks(Form Fragment Explicit Visible Bounds Demo); - - -} - -@Test public void form_injector() { openLinks(FormInjector Demo);
svn commit: r1156971 - in /tapestry/tapestry5/trunk: ./ tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ tapestry-core/src/test/app1/ tapestry-core/src/test/java/org/apache/tapestry
Author: robertdzeigler Date: Fri Aug 12 05:50:43 2011 New Revision: 1156971 URL: http://svn.apache.org/viewvc?rev=1156971view=rev Log: TAP5-1605: Template parsing of expansions can't handle map expressions Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/MapExpressionInExpansions.tml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MapExpressionInExpansions.java tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/expansions_with_maps.tml - copied, changed from r1155574, tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/internal/services/multiple_expansions_on_one_line.tml Modified: tapestry/tapestry5/trunk/build.gradle tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/TemplateParserImplTest.java Modified: tapestry/tapestry5/trunk/build.gradle URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/build.gradle?rev=1156971r1=1156970r2=1156971view=diff == --- tapestry/tapestry5/trunk/build.gradle (original) +++ tapestry/tapestry5/trunk/build.gradle Fri Aug 12 05:50:43 2011 @@ -88,7 +88,7 @@ subprojects { } ideaModule { -scopes.PROVIDED.plus += configurations.provided +//scopes.PROVIDED.plus += configurations.provided } dependencies { Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java?rev=1156971r1=1156970r2=1156971view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/SaxTemplateParser.java Fri Aug 12 05:50:43 2011 @@ -129,7 +129,7 @@ public class SaxTemplateParser // expansions on the same text line into a single large // but invalid expansion. -private static final Pattern EXPANSION_PATTERN = Pattern.compile(\\$\\{\\s*(.*?)\\s*}); +private static final Pattern EXPANSION_PATTERN = Pattern.compile(\\$\\{\\s*(((?!\\$\\{).)*)\\s*}); private static final SetString MUST_BE_ROOT = CollectionFactory.newSet(extend, container); Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/MapExpressionInExpansions.tml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/MapExpressionInExpansions.tml?rev=1156971view=auto == --- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/MapExpressionInExpansions.tml (added) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/MapExpressionInExpansions.tml Fri Aug 12 05:50:43 2011 @@ -0,0 +1,9 @@ +html t:type=border xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; xmlns:p=tapestry:parameter +h1Map Expression in Template Expansion Demo/h1 + +ul +liEmpty Map: span id=emptymap${echoMap({})}/span/li +liString Keys Map: span id=stringmap${echoMap({'A':1})}/span/li +liNumber Keys Map: span id=numberkeysmap${echoMap({1: 'one'})}/span/li +/ul +/html Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java?rev=1156971r1=1156970r2=1156971view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java Fri Aug 12 05:50:43 2011 @@ -126,6 +126,16 @@ public class CoreBehaviorsTests extends assertTextPresent([value provided by a template expansion]); } +@Test +public void maps_in_expansions() throws Exception +{ +openLinks(Map Expressions in Expansions Demo); + +assertText(emptymap, {}); +assertText(stringmap, {A:1}); +assertText(numberkeysmap, {1:one}); +} + /** * {@link
svn commit: r1151673 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/resources/org/apache/tapestry5/datepicker_106/js/ test/java/org/apache/tapestry5/integration/app1/ test/java/org/apache/tape
Author: robertdzeigler Date: Wed Jul 27 23:46:17 2011 New Revision: 1151673 URL: http://svn.apache.org/viewvc?rev=1151673view=rev Log: TAP5-1408: datefield - cannot select same day in different month TAP5-1409: datefield popup does not have option to cancel Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/FormTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DateFieldDemo.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js?rev=1151673r1=1151672r2=1151673view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/datepicker_106/js/datepicker.js Wed Jul 27 23:46:17 2011 @@ -1,691 +1,738 @@ -/*\ -| Date Picker 1.06 | -|-| -| Created by Erik Arvidsson | -| (http://webfx.eae.net/contact.html#erik) | -| For WebFX (http://webfx.eae.net/) | -|-| -|A DOM based Date Picker | -|-| -| Copyright (c) 1999, 2002, 2002, 2003, 2004, 2006 Erik Arvidsson | -|-| -| 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. | -|-| -| Dependencies: datepicker.css Date picker style declarations| -|-| -| 2002-02-10 | Changed _update method to only update the text nodes instead | -|| rewriting the entire table. Also added support for mouse wheel | -|| in IE6.| -| 2002-01-14 | Cleaned up for 1.0 public version | -| 2002-01-15 | Replace all innerHTML calls with DOM1 methods | -| 2002-01-18 | Minor IE6 bug that occured when dragging the mouse | -| 2002-01-19 | Added a popup that is shown when the user clicks on the month. | -|| This allows navigation to 6 adjacent months. | -| 2002-04-10 | Fixed a bug that occured in the popup when a date was selected | -|| that caused surroundung months to overflow | -|| This had the effect that one could get two October months | -|| listed.| -| 2002-09-06 | I had missed one place were window was used instead of | -|| doc.parentWindow | -| 2003-08-28 | Added support for ensurin no date overflow when changing | -|| months.| -| 2004-01-10 | Adding type on the buttons to ensure they are not submit | -|| buttons. Minor CSS change for CSS2 | -| 2006-05-28 | Changed license to Apache Software License 2.0.| -|-| -| Created 2001-10-?? | All changes are in the log above. | Updated 2006-05-28 | -\*/ - -// The DatePicker constructor -// oDate : Date Optional
svn commit: r1138332 - in /tapestry/tapestry5/branches/maint-5-2/tapestry-core/src: main/resources/org/apache/tapestry5/ test/app1/ test/conf/ test/java/org/apache/tapestry5/integration/app1/ test/jav
Author: robertdzeigler Date: Wed Jun 22 08:14:45 2011 New Revision: 1138332 URL: http://svn.apache.org/viewvc?rev=1138332view=rev Log: TAP5-1551: FormFragment change visibility/hide and remove event listeners should call event.stop() to prevent container fragments from also being hidden Added: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/app1/NestedFormFragment.tml tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/NestedFormFragment.java Modified: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/conf/testng-limited.xml tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/AjaxTests.java tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java Modified: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js?rev=1138332r1=1138331r2=1138332view=diff == --- tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js (original) +++ tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js Wed Jun 22 08:14:45 2011 @@ -1243,6 +1243,9 @@ Tapestry.Initializer = { } element.observe(Tapestry.CHANGE_VISIBILITY_EVENT, function(event) { +//since events propogate up, you have you call event.stop() here to prevent hiding +//container formFragments. +event.stop(); var makeVisible = event.memo.visible; if (makeVisible == element.visible()) @@ -1251,7 +1254,8 @@ Tapestry.Initializer = { runAnimation(makeVisible); }); - element.observe(Tapestry.HIDE_AND_REMOVE_EVENT, function() { + element.observe(Tapestry.HIDE_AND_REMOVE_EVENT, function(event) { +event.stop(); var effect = runAnimation(false); effect.options.afterFinish = function() { @@ -2213,4 +2217,4 @@ Tapestry.onDOMLoaded(Tapestry.onDomLoade /* Ajax code needs to know to do nothing after the window is unloaded. */ Event.observe(window, beforeunload, function() { Tapestry.windowUnloaded = true; -}); \ No newline at end of file +}); Added: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/app1/NestedFormFragment.tml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/app1/NestedFormFragment.tml?rev=1138332view=auto == --- tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/app1/NestedFormFragment.tml (added) +++ tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/app1/NestedFormFragment.tml Wed Jun 22 08:14:45 2011 @@ -0,0 +1,23 @@ +t:border xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; + xmlns:p=tapestry:parameter + +!-- note that since we won't be submitting the form, we can just bind visible parameters to literal values -- +t:form +div t:type=formfragment t:id=outerhide visible=true +span id=outertext1Outer Text/span +div t:type=formfragment t:id=innerhide visible=true +span id=innertext1Inner Text/span +t:checkbox t:id=innertrigger1 value=true t:mixins=triggerfragment fragment=innerhide/ +/div +/div + +div t:type=formfragment t:id=outerremove visible=true +span id=outertext2Outer Text/span +div t:type=formfragment t:id=innerremove visible=true +span id=innertext2Inner Text/span +t:checkbox t:id=innertrigger2 value=true/ +/div +/div + +/t:form +/t:border Modified: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/conf/testng-limited.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/conf/testng-limited.xml?rev=1138332r1=1138331r2=1138332view=diff == --- tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/conf/testng-limited.xml (original) +++ tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/conf/testng-limited.xml Wed Jun 22 08:14:45 2011 @@ -7,9 +7,14 @@ test name=Limited Integration Tests parameter name=tapestry.web-app-folder value=src/test/app1/ +!-- packages package name
svn commit: r1138333 - in /tapestry/tapestry5/branches/maint-5-2/tapestry-core/src: main/resources/org/apache/tapestry5/tapestry.js test/conf/testng-limited.xml
Author: robertdzeigler Date: Wed Jun 22 08:21:48 2011 New Revision: 1138333 URL: http://svn.apache.org/viewvc?rev=1138333view=rev Log: Formatting fix in tapestry.js; restore testng-limited.xml to prior state. Modified: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/conf/testng-limited.xml Modified: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js?rev=1138333r1=1138332r2=1138333view=diff == --- tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js (original) +++ tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js Wed Jun 22 08:21:48 2011 @@ -1243,9 +1243,9 @@ Tapestry.Initializer = { } element.observe(Tapestry.CHANGE_VISIBILITY_EVENT, function(event) { -//since events propogate up, you have you call event.stop() here to prevent hiding -//container formFragments. -event.stop(); + //since events propogate up, you have you call event.stop() here to prevent hiding + //container formFragments. + event.stop(); var makeVisible = event.memo.visible; if (makeVisible == element.visible()) @@ -1255,7 +1255,7 @@ Tapestry.Initializer = { }); element.observe(Tapestry.HIDE_AND_REMOVE_EVENT, function(event) { -event.stop(); + event.stop(); var effect = runAnimation(false); effect.options.afterFinish = function() { Modified: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/conf/testng-limited.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/conf/testng-limited.xml?rev=1138333r1=1138332r2=1138333view=diff == --- tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/conf/testng-limited.xml (original) +++ tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/test/conf/testng-limited.xml Wed Jun 22 08:21:48 2011 @@ -7,14 +7,9 @@ test name=Limited Integration Tests parameter name=tapestry.web-app-folder value=src/test/app1/ -!-- packages package name=org.apache.tapestry5.integration.app1/ /packages --- -classes -class name=org.apache.tapestry5.integration.app1.AjaxTests/ -/classes /test /suite
svn commit: r1138650 - /tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java
Author: robertdzeigler Date: Wed Jun 22 21:52:31 2011 New Revision: 1138650 URL: http://svn.apache.org/viewvc?rev=1138650view=rev Log: TAP5-1546: TranslatorSource incorrectly annotated with @UsesConfiguration when it should now be @UsesMappedConfiguration (as of 5.2). Fixed for 5.2 maintenance. Previously fixed for trunk. Modified: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java Modified: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java?rev=1138650r1=1138649r2=1138650view=diff == --- tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java (original) +++ tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java Wed Jun 22 21:52:31 2011 @@ -31,7 +31,7 @@ import org.apache.tapestry5.ioc.util.Str * p * The contribution key must match the {@linkplain Translator#getType() translator type}. */ -@UsesConfiguration(Translator.class) +@UsesMappedConfiguration(key=Class.class, value=Translator.class) @SuppressWarnings(unchecked) public interface TranslatorSource {
svn commit: r1138651 - /tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java
Author: robertdzeigler Date: Wed Jun 22 21:54:24 2011 New Revision: 1138651 URL: http://svn.apache.org/viewvc?rev=1138651view=rev Log: TAP5-1546: TranslatorSource incorrectly annotated with @UsesConfiguration when it should now be @UsesMappedConfiguration (as of 5.2) Modified: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java Modified: tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java?rev=1138651r1=1138650r2=1138651view=diff == --- tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java (original) +++ tapestry/tapestry5/branches/maint-5-2/tapestry-core/src/main/java/org/apache/tapestry5/services/TranslatorSource.java Wed Jun 22 21:54:24 2011 @@ -15,7 +15,7 @@ package org.apache.tapestry5.services; import org.apache.tapestry5.Translator; -import org.apache.tapestry5.ioc.annotations.UsesConfiguration; +import org.apache.tapestry5.ioc.annotations.UsesMappedConfiguration; import org.apache.tapestry5.ioc.util.StrategyRegistry; /**
svn commit: r1099864 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/corelib/base/ test/app1/ test/java/org/apache/tapestry5/corelib/base/ test/java/org/apache/tapestr
Author: robertdzeigler Date: Thu May 5 16:31:50 2011 New Revision: 1099864 URL: http://svn.apache.org/viewvc?rev=1099864view=rev Log: TAP5-1496: Link components should support easily adding request parameters to the generated link Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/LinkQueryParameters.tml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/LinkQueryParameters.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractLink.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/corelib/base/AbstractLinkTest.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractLink.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractLink.java?rev=1099864r1=1099863r2=1099864view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractLink.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractLink.java Thu May 5 16:31:50 2011 @@ -1,4 +1,4 @@ -// Copyright 2007, 2008, 2009 The Apache Software Foundation +// Copyright 2007, 2008, 2009, 2011 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. @@ -22,6 +22,8 @@ import org.apache.tapestry5.dom.Element; import org.apache.tapestry5.ioc.annotations.Inject; import org.apache.tapestry5.services.javascript.JavaScriptSupport; +import java.util.Map; + /** * Provides base utilities for classes that generate clickable links. */ @@ -41,6 +43,14 @@ public abstract class AbstractLink imple @Parameter(false) private boolean disabled; +/** + * If specified, the parameters are added to the link as query parameters in key=value fashion. + * Both values will be coerced to string using value encoder. + * @since 5.3 + */ +@Parameter(allowNull = false) +private MapString, ? parameters; + @Inject private ComponentResources resources; @@ -84,6 +94,8 @@ public abstract class AbstractLink imple */ protected final void writeLink(MarkupWriter writer, Link link, Object... namesAndValues) { +addParameters(link); + element = writer.element(a, href, buildHref(link)); writer.attributes(namesAndValues); @@ -94,6 +106,21 @@ public abstract class AbstractLink imple } /** + * Adds any user-defined parameters as query parameters. + * @param link + */ +protected final void addParameters(Link link) +{ + if (!resources.isBound(parameters)) + return; + + for(Map.EntryString,? entry : parameters.entrySet()) + { + link.addParameterValue(entry.getKey(), entry.getValue()); + } +} + +/** * Returns the most recently rendered {@link org.apache.tapestry5.Link} for this component. Subclasses calculate * their link value as they render, and the value is valid until the end of the request, or the next time the same * component renders itself (if inside a loop). Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/LinkQueryParameters.tml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/LinkQueryParameters.tml?rev=1099864view=auto == --- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/LinkQueryParameters.tml (added) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/LinkQueryParameters.tml Thu May 5 16:31:50 2011 @@ -0,0 +1,30 @@ +html t:type=border xmlns:t=http://tapestry.apache.org/schema/tapestry_5_0_0.xsd; xmlns:p=tapestry:parameter +h1Link Query Parameter Demo/h1 + +ul +lia t:type=pagelink page=LinkQueryParametersPage Link With No Parameters/a/li +lia t:type=pagelink page=LinkQueryParameters parameters=emptyParametersPage Link With Explicitly Empty Parameters/a/li +lia t:type=pagelink page=LinkQueryParameters parameters=nonEmptyParametersPage Link With Parameters/a/li + +lia t:type=actionlinkAction Link With No Parameters/a/li +lia t:type=actionlink parameters=emptyParametersAction Link With Explicitly Empty Parameters/a/li +lia t:type=actionlink parameters=nonEmptyParametersAction Link With Parameters/a/li + +lia t:type=eventlink event=parameterCheckEvent Link
svn commit: r1100036 - in /tapestry/tapestry5/trunk: plastic/src/main/java/org/apache/tapestry5/plastic/ tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/ tapestry-core/src/main/java/o
Author: robertdzeigler Date: Fri May 6 03:26:02 2011 New Revision: 1100036 URL: http://svn.apache.org/viewvc?rev=1100036view=rev Log: TAP5-1495: Tapestry's property expression language should support map creation Fix minor typo in plastic documentation Clarify parameters parameter documentation in AbstractLink. Modified: tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/plastic/InstructionBuilder.java tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionParser.g tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/base/AbstractLink.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImpl.java tapestry/tapestry5/trunk/tapestry-core/src/test/app1/LinkQueryParameters.tml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/CoreBehaviorsTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/EchoBean.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PropertyConduitSourceImplTest.java Modified: tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/plastic/InstructionBuilder.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/plastic/InstructionBuilder.java?rev=1100036r1=1100035r2=1100036view=diff == --- tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/plastic/InstructionBuilder.java (original) +++ tapestry/tapestry5/trunk/plastic/src/main/java/org/apache/tapestry5/plastic/InstructionBuilder.java Fri May 6 03:26:02 2011 @@ -28,7 +28,7 @@ import java.lang.reflect.Method; * try/catch blocks}, is more like a DSL (domain specific language), and is based on callbacks. This looks better in * Groovy and will be more reasonable once JDK 1.8 closures are available; in the meantime, it means some deeply nested * inner classes, but helps ensure that correct bytecode is generated and helps to limit the amount of bookkeeping is - * necessary on the part of coce using InstructionBuilder. + * necessary on the part of code using InstructionBuilder. */ @SuppressWarnings(rawtypes) public interface InstructionBuilder Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g?rev=1100036r1=1100035r2=1100036view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionLexer.g Fri May 6 03:26:02 2011 @@ -1,4 +1,4 @@ -// Copyright 2008, 2010 The Apache Software Foundation +// Copyright 2008, 2010, 2011 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. @@ -53,7 +53,10 @@ RPAREN : ')'; LBRACKET: '['; RBRACKET: ']'; COMMA : ','; -BANG: '!'; +BANG : '!'; +LBRACE : '{'; +RBRACE : '}'; +COLON : ':'; fragment QUOTE : '\''; Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionParser.g URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionParser.g?rev=1100036r1=1100035r2=1100036view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionParser.g (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/antlr/org/apache/tapestry5/internal/antlr/PropertyExpressionParser.g Fri May 6 03:26:02 2011 @@ -1,4 +1,4 @@ -// Copyright 2008, 2009 The Apache Software Foundation +// Copyright 2008, 2009, 2011 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. @@ -30,6 +30,8 @@ tokens INVOKE; // A List (top level, or as method parameter) LIST; + //A Map (top level
svn commit: r889985 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/services/ test/app1/ test/app1/META-INF/ test/java/org/apache/tapestry5/integration/
Author: robertdzeigler Date: Sat Dec 12 21:37:21 2009 New Revision: 889985 URL: http://svn.apache.org/viewvc?rev=889985view=rev Log: TAP5-815: Asset dispatcher allows any file inside the webapp visible and downloadable Further improvements to thhe context assets regex. In addition to WEB-INF, files at or under META-INF are blocked, as are files ending in .tml. Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/META-INF/ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/META-INF/unavailable2.txt Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=889985r1=889984r2=889985view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java Sat Dec 12 21:37:21 2009 @@ -2935,7 +2935,7 @@ //at or below WEB-INF. //necessary since context assets are now handled via AssetDispatcher so that //they can be compressed, combined, etc. -String contextPathPattern = /(?!WEB-INF)([^/.]+/)*[^/]+$; +String contextPathPattern = /(?!(WEB-INF)|(META-INF))([^/.]+/)*[^/]+(?!\\.tml)$; regex.add(RequestConstants.CONTEXT_FOLDER + appVersion + contextPathPattern); } } Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml?rev=889985r1=889984r2=889985view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml Sat Dec 12 21:37:21 2009 @@ -5,4 +5,9 @@ a href=${asset:context:WEB-INF/}WEB-INF//a a href=${asset:classpath:/org/apache/tapestry5/integration/app1/pages/unavailablefile.txt}Unavailable File/a a href=${asset:classpath:/org/apache/tapestry5/integration/app1/pages/availablefile2.txt}Available File2/a +a href=${asset:context:META-INF}META-INF/a +a href=${asset:context:META-INF/}META-INF//a +a href=${asset:context:META-INF/unavailable2.txt}unavailable2.txt/a +a href=${asset:context:AssetProtectionDemo.tml}tml file/a +a href=${asset:context:music/MusicDetails.tml}nested tml file/a /html Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/META-INF/unavailable2.txt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/META-INF/unavailable2.txt?rev=889985view=auto == --- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/META-INF/unavailable2.txt (added) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/META-INF/unavailable2.txt Sat Dec 12 21:37:21 2009 @@ -0,0 +1 @@ +This file is in META-INF so it should not be available. \ No newline at end of file Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java?rev=889985r1=889984r2=889985view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java Sat Dec 12 21:37:21 2009 @@ -3293,7 +3293,7 @@ /** TAP5-815 */ @Test -public void testAssetProtection() +public void asset_protection() { //context resourcs should be available by default. start(Asset Protection Demo); @@ -3319,5 +3319,27 @@ start(Asset Protection Demo); clickAndWait(link=Available File2); assertTextPresent(This file should be available to clients.); + +start(Asset Protection Demo); +clickAndWait(link=META-INF); +assertTextPresent(HTTP ERROR: 404); + +start(Asset Protection Demo); +clickAndWait(link=META-INF/); +assertTextPresent(HTTP ERROR: 404); + +start(Asset
svn commit: r889842 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/services/ test/app1/ test/app1/WEB-INF/ test/java/org/apache/tapestry5/integration/ test/java/org/a
Author: robertdzeigler Date: Fri Dec 11 22:39:59 2009 New Revision: 889842 URL: http://svn.apache.org/viewvc?rev=889842view=rev Log: TAP5-815: Asset dispatcher allows any file inside the webapp visible and downloadable. Improve the regex used for opening the context to allow for all context content as long as it's outside of the WEB-INF. Improve the integration test to test for a greater variety of situations. Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/WEB-INF/unavailable.css tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/availablefile2.txt - copied unchanged from r889514, tapestry/tapestry5/trunk/tapestry-core/src/test/app1/availablefile.txt tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/unavailablefile.txt - copied unchanged from r889514, tapestry/tapestry5/trunk/tapestry-core/src/test/app1/unavailablefile.txt Removed: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/unavailablefile.txt Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=889842r1=889841r2=889842view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java Fri Dec 11 22:39:59 2009 @@ -2931,7 +2931,12 @@ if (contextAvailable) { -regex.add(RequestConstants.CONTEXT_FOLDER + appVersion + / + pathPattern); +//we allow everything underneath the context folder, as long as it's not +//at or below WEB-INF. +//necessary since context assets are now handled via AssetDispatcher so that +//they can be compressed, combined, etc. +String contextPathPattern = /(?!WEB-INF)([^/.]+/)*[^/]+$; +regex.add(RequestConstants.CONTEXT_FOLDER + appVersion + contextPathPattern); } } Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml?rev=889842r1=889841r2=889842view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml Fri Dec 11 22:39:59 2009 @@ -1,4 +1,8 @@ html t:type=Border xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; a href=${asset:context:availablefile.txt}Available File/a -a href=${asset:context:unavailablefile.txt}Unavailable File/a -/html \ No newline at end of file +a href=${asset:context:WEB-INF/unavailable.css}Unavailable CSS/a +a href=${asset:context:WEB-INF}WEB-INF/a +a href=${asset:context:WEB-INF/}WEB-INF//a +a href=${asset:classpath:/org/apache/tapestry5/integration/app1/pages/unavailablefile.txt}Unavailable File/a +a href=${asset:classpath:/org/apache/tapestry5/integration/app1/pages/availablefile2.txt}Available File2/a +/html Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/WEB-INF/unavailable.css URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/WEB-INF/unavailable.css?rev=889842view=auto == --- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/WEB-INF/unavailable.css (added) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/WEB-INF/unavailable.css Fri Dec 11 22:39:59 2009 @@ -0,0 +1,3 @@ +/*the originally contributed regex to open up context assets resulted in + * .css, .jpeg, etc. files in WEB-INF being accessible. This css file is just here for + * integration testing purposes to make sure that's not the case now.*/ \ No newline at end of file Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java?rev=889842r1=889841r2=889842view=diff
svn commit: r889405 - in /tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5: integration/IntegrationTests.java internal/services/AssetProtectionDispatcherTest.java urlrewriter/
Author: robertdzeigler Date: Thu Dec 10 20:16:52 2009 New Revision: 889405 URL: http://svn.apache.org/viewvc?rev=889405view=rev Log: TAP5-815: Asset dispatcher allows any file inside the webapp visible and downloadable Fix broken test and resolve code-style consistency issues. Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcherTest.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapperTest.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java?rev=889405r1=889404r2=889405view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java Thu Dec 10 20:16:52 2009 @@ -46,7 +46,8 @@ public static void main(String[] args) throws Exception { IntegrationTests it = new IntegrationTests(); it.setup(); -while(true) { +while(true) +{ Thread.sleep(1000); } } Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcherTest.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcherTest.java?rev=889405r1=889404r2=889405view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcherTest.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcherTest.java Thu Dec 10 20:16:52 2009 @@ -75,7 +75,7 @@ Response response = createMock(Response.class); expect(request.getPath()).andReturn(RequestConstants.ASSET_PATH_PREFIX + /cayenne.xml); expect(request.getPath()).andReturn(RequestConstants.ASSET_PATH_PREFIX + /org/apache/tapestry/default.css); -response.sendError(HttpServletResponse.SC_FORBIDDEN, /cayenne.xml); +response.sendError(HttpServletResponse.SC_NOT_FOUND, /cayenne.xml); ClasspathAssetAliasManager manager = createMock(ClasspathAssetAliasManager.class); expect(manager.toResourcePath(RequestConstants.ASSET_PATH_PREFIX + /cayenne.xml)).andReturn(/cayenne.xml); Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapperTest.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapperTest.java?rev=889405r1=889404r2=889405view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapperTest.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapperTest.java Thu Dec 10 20:16:52 2009 @@ -165,10 +165,12 @@ boolean exceptionRaised = false; -try { +try +{ new SimpleRequestWrapper(request, serverName, path); } -catch (RuntimeException e) { +catch (RuntimeException e) +{ exceptionRaised = true; } @@ -182,10 +184,12 @@ boolean exceptionRaised = false; -try { +try +{ new SimpleRequestWrapper(request, path); } -catch (RuntimeException e) { +catch (RuntimeException e) +{ exceptionRaised = true; }
svn commit: r889409 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/services/TapestryModule.java test/java/org/apache/tapestry5/integration/app1/services/AppModule.jav
Author: robertdzeigler Date: Thu Dec 10 20:21:14 2009 New Revision: 889409 URL: http://svn.apache.org/viewvc?rev=889409view=rev Log: TAP5-815: Asset dispatcher allows any file inside the webapp visible and downloadable More code-style fixes. Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=889409r1=889408r2=889409view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java Thu Dec 10 20:21:14 2009 @@ -2529,7 +2529,8 @@ //allow access to virtual assets. Critical for tapestry-combined js files. regex.add(virtual/ + pathPattern); -if (contextAvailable) { +if (contextAvailable) +{ regex.add(RequestConstants.CONTEXT_FOLDER + appVersion + / + pathPattern); } } Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java?rev=889409r1=889408r2=889409view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java Thu Dec 10 20:21:14 2009 @@ -261,7 +261,8 @@ public static void contributeWhitelistAuthorizer( ConfigurationString configuration, -@Symbol(SymbolConstants.APPLICATION_VERSION) String appVersion) { +@Symbol(SymbolConstants.APPLICATION_VERSION) String appVersion) +{ configuration.add(ctx/ + appVersion + /availablefile.txt); } }
svn commit: r889457 - in /tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src: main/java/org/apache/tapestry5/ main/java/org/apache/tapestry5/internal/services/ main/java/org/apache/tapestry5/se
Author: robertdzeigler Date: Thu Dec 10 23:01:25 2009 New Revision: 889457 URL: http://svn.apache.org/viewvc?rev=889457view=rev Log: TAP5-815: Asset dispatcher allows any file inside the webapp visible and downloadable Backport changes from trunk to 5.1: 404 returned instead or 403 for restricted assets; add a new integration test; fix AssetProtectionDispatcher unit test; open up sensible context assets by default. Added: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/app1/AssetProtectionDemo.tml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/app1/availablefile.txt tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/app1/unavailablefile.txt tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/AssetProtectionDemo.java Modified: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcherTest.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapperTest.java Modified: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java?rev=889457r1=889456r2=889457view=diff == --- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java (original) +++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java Thu Dec 10 23:01:25 2009 @@ -180,4 +180,13 @@ */ public static final String COMBINE_SCRIPTS = tapestry.combine-scripts; +/** + * Whether assets in the web application's context directory are available by default. + * If true (the default), tapestry will provide conributions to the appropriate services (RegexAuthorizer) to allow access + * to .js, .jpg, .jpeg, .png, .gif, and .css assets that reside within the application context. + * If false, no such contributions will be made, and access to those resources will be restricted + * without explicit user contributions. + */ + public static final String CONTEXT_ASSETS_AVAILABLE =tapestry.context-assets-available; + } Modified: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java?rev=889457r1=889456r2=889457view=diff == --- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java (original) +++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java Thu Dec 10 23:01:25 2009 @@ -77,7 +77,7 @@ if (auth.accessDenied(resourcePath)) { logger.debug(Denying access to + resourcePath); - response.sendError(HttpServletResponse.SC_FORBIDDEN,resourcePath); + response.sendError(HttpServletResponse.SC_NOT_FOUND,resourcePath); return true; } } Modified: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=889457r1=889456r2=889457view=diff == --- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/services
svn commit: r888946 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/ main/java/org/apache/tapestry5/internal/services/ main/java/org/apache/tapestry5/services/ test/ap
Author: robertdzeigler Date: Wed Dec 9 20:28:13 2009 New Revision: 888946 URL: http://svn.apache.org/viewvc?rev=888946view=rev Log: TAP5-815: Asset dispatcher allows any file inside the webapp visible and downloadable Return 404 instead of 403 for restricted paths; removes chenillekit contribution; adds default contribution for context assets; adds integration test. Added: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/AssetProtectionDemo.tml tapestry/tapestry5/trunk/tapestry-core/src/test/app1/availablefile.txt tapestry/tapestry5/trunk/tapestry-core/src/test/app1/unavailablefile.txt tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/AssetProtectionDemo.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java?rev=888946r1=888945r2=888946view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/SymbolConstants.java Wed Dec 9 20:28:13 2009 @@ -275,4 +275,13 @@ */ public static final String BLACKBIRD = tapestry.blackbird; +/** + * Whether assets in the web application's context directory are available by default. + * If true (the default), tapestry will provide conributions to the appropriate services (RegexAuthorizer) to allow access + * to .js, .jpg, .jpeg, .png, .gif, and .css assets that reside within the application context. + * If false, no such contributions will be made, and access to those resources will be restricted + * without explicit user contributions. + */ +public static final String CONTEXT_ASSETS_AVAILABLE =tapestry.context-assets-available; + } Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java?rev=888946r1=888945r2=888946view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java Wed Dec 9 20:28:13 2009 @@ -77,7 +77,7 @@ if (auth.accessDenied(resourcePath)) { logger.debug(Denying access to + resourcePath); - response.sendError(HttpServletResponse.SC_FORBIDDEN,resourcePath); +response.sendError(HttpServletResponse.SC_NOT_FOUND, resourcePath); return true; } } Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java?rev=888946r1=888945r2=888946view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java Wed Dec 9 20:28:13 2009 @@ -2113,6 +2113,8 @@ configuration.add(SymbolConstants.ENCODE_LOCALE_INTO_PATH, true); configuration.add(SymbolConstants.BLACKBIRD_ENABLED, false); + +configuration.add(SymbolConstants.CONTEXT_ASSETS_AVAILABLE, true); } @@ -2508,13 +2510,16 @@ public void contributeRegexAuthorizer(ConfigurationString regex, @Symbol(tapestry.scriptaculous.path) String scriptPath, @Symbol(tapestry.blackbird.path) String blackbirdPath
svn commit: r834151 - in /tapestry/tapestry5/trunk: src/site/apt/guide/ tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ tapestry-core/src/main/java/org/apache/tapestry5/services/ t
Author: robertdzeigler Date: Mon Nov 9 17:23:10 2009 New Revision: 834151 URL: http://svn.apache.org/viewvc?rev=834151view=rev Log: TAP5-815: Asset dispatcher allows any file inside the webapp visible and downloadable (5.2 branch) Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RegexAuthorizer.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/WhitelistAuthorizer.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/AssetPathAuthorizer.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcherTest.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RegexAuthorizerTest.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/WhitelistAuthorizerTest.java Modified: tapestry/tapestry5/trunk/src/site/apt/guide/assets.apt tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java Modified: tapestry/tapestry5/trunk/src/site/apt/guide/assets.apt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/guide/assets.apt?rev=834151r1=834150r2=834151view=diff == --- tapestry/tapestry5/trunk/src/site/apt/guide/assets.apt (original) +++ tapestry/tapestry5/trunk/src/site/apt/guide/assets.apt Mon Nov 9 17:23:10 2009 @@ -138,6 +138,31 @@ In addition, context assets will use the URL prefix /assets/ctx/app-version/. +Securing Assets + + Securing assets is an important consideration for any web application. Many assets, such as hibernate configuration + files, sit in the classpath and are exposable via the Asset service, which is not desirable. To protect these and + other sensitive assets, Tapestry provides the AssetProtectionDispatcher. This dispatcher sits in front of the + AssetDispatcher, the service responsible for streaming assets to the client, and watches for Asset requests. + When an asset request comes in, the protection dispatcher checks for authorization to view the file against a + contributed list of AssetPathAuthorizer implementations. Determination of whether the client can view the requested + resource is then made based on whether any of the contributed AssetPathAuthorizer implementations explicitly allowed + or denied access to the resource. + + Tapestry provides two AssetPathAuthorizer implemenations out of the box to which users may contribute: RegexAuthorizer + and WhitelistAuthorizer. RegexAuthorizer uses regular expressions to determine assets which are viewable by the + client; any assets that match one of its (contributed) regular expressions are authorized. Anything not matched is + passed through to the WhitelistAuthorizer. WhitelistAuthorizer uses an exact-matching whitelist. Anything matching + exactly one its contributions is allowed; all other asset requests are denied. The default tapestry configuration + contributes nothing to WhitelistAuthorizer (access will be denied to all asset requests passed through to it), and + explicitly allows access to css, jpg, jpeg, js, png, and gif files associated with tapestry (tapestry.js, blackbird + files, date picker files, etc.). The default contribution also enables access to the css, jpg, jpeg, js, png, and gif + files provided by the popular chenille-kit 3rd party library. The default configuration denies access to all other + assets. To enable access to your application's assets, either contribute a custom AssetPathAnalyzer, or contribute + appropriate regular expression or exact path contributions to RegexAuthorizer or WhitelistAuthorizer, respectively. + See TapestryModule.contribteRegexAuthorizer for examples. + + Performance Notes Assets are expected to be entirely static (not changing while the application is deployed). When Tapestry generates a URL @@ -146,4 +171,4 @@ asset. In addition, Tapestry will {{{compress.html}GZIP compress}} the content of all assets (if the asset - is compressable, and the client supports it). \ No newline at end of file + is compressable, and the client supports it). Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java?rev=834151view=auto
svn commit: r834167 - in /tapestry/tapestry5/branches/5.1.0.x-dev: src/site/apt/guide/ tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ tapestry-core/src/main/java/org/apache/tapest
Author: robertdzeigler Date: Mon Nov 9 18:26:48 2009 New Revision: 834167 URL: http://svn.apache.org/viewvc?rev=834167view=rev Log: TAP5-815: Asset dispatcher allows any file inside the webapp visible and downloadable (5.1 branch) Added: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RegexAuthorizer.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/WhitelistAuthorizer.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/services/AssetPathAuthorizer.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcherTest.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RegexAuthorizerTest.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/WhitelistAuthorizerTest.java Modified: tapestry/tapestry5/branches/5.1.0.x-dev/src/site/apt/guide/assets.apt tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java Modified: tapestry/tapestry5/branches/5.1.0.x-dev/src/site/apt/guide/assets.apt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/src/site/apt/guide/assets.apt?rev=834167r1=834166r2=834167view=diff == --- tapestry/tapestry5/branches/5.1.0.x-dev/src/site/apt/guide/assets.apt (original) +++ tapestry/tapestry5/branches/5.1.0.x-dev/src/site/apt/guide/assets.apt Mon Nov 9 18:26:48 2009 @@ -138,6 +138,31 @@ In addition, context assets will use the URL prefix /assets/ctx/app-version/. +Securing Assets + + Securing assets is an important consideration for any web application. Many assets, such as hibernate configuration + files, sit in the classpath and are exposable via the Asset service, which is not desirable. To protect these and + other sensitive assets, Tapestry provides the AssetProtectionDispatcher. This dispatcher sits in front of the + AssetDispatcher, the service responsible for streaming assets to the client, and watches for Asset requests. + When an asset request comes in, the protection dispatcher checks for authorization to view the file against a + contributed list of AssetPathAuthorizer implementations. Determination of whether the client can view the requested + resource is then made based on whether any of the contributed AssetPathAuthorizer implementations explicitly allowed + or denied access to the resource. + + Tapestry provides two AssetPathAuthorizer implemenations out of the box to which users may contribute: RegexAuthorizer + and WhitelistAuthorizer. RegexAuthorizer uses regular expressions to determine assets which are viewable by the + client; any assets that match one of its (contributed) regular expressions are authorized. Anything not matched is + passed through to the WhitelistAuthorizer. WhitelistAuthorizer uses an exact-matching whitelist. Anything matching + exactly one its contributions is allowed; all other asset requests are denied. The default tapestry configuration + contributes nothing to WhitelistAuthorizer (access will be denied to all asset requests passed through to it), and + explicitly allows access to css, jpg, jpeg, js, png, and gif files associated with tapestry (tapestry.js, blackbird + files, date picker files, etc.). The default contribution also enables access to the css, jpg, jpeg, js, png, and gif + files provided by the popular chenille-kit 3rd party library. The default configuration denies access to all other + assets. To enable access to your application's assets, either contribute a custom AssetPathAnalyzer, or contribute + appropriate regular expression or exact path contributions to RegexAuthorizer or WhitelistAuthorizer, respectively. + See TapestryModule.contribteRegexAuthorizer for examples. + + Performance Notes Assets are expected to be entirely static (not changing while the application is deployed). When Tapestry generates a URL @@ -146,4 +171,4 @@ asset. In addition, Tapestry will {{{compress.html}GZIP compress}} the content of all assets (if the asset - is compressable, and the client supports it). \ No newline at end of file + is compressable, and the client supports it). Added: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java URL: http://svn.apache.org
svn commit: r834180 - in /tapestry/tapestry5/branches/5.0: src/site/apt/guide/ tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ tapestry-core/src/main/java/org/apache/tapestry5/serv
Author: robertdzeigler Date: Mon Nov 9 19:28:32 2009 New Revision: 834180 URL: http://svn.apache.org/viewvc?rev=834180view=rev Log: TAP5-815: Asset dispatcher allows any file inside the webapp visible and downloadable (5.0 branch) Added: tapestry/tapestry5/branches/5.0/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java tapestry/tapestry5/branches/5.0/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/RegexAuthorizer.java tapestry/tapestry5/branches/5.0/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/WhitelistAuthorizer.java tapestry/tapestry5/branches/5.0/tapestry-core/src/main/java/org/apache/tapestry5/services/AssetPathAuthorizer.java tapestry/tapestry5/branches/5.0/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcherTest.java tapestry/tapestry5/branches/5.0/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/RegexAuthorizerTest.java tapestry/tapestry5/branches/5.0/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/WhitelistAuthorizerTest.java Modified: tapestry/tapestry5/branches/5.0/src/site/apt/guide/assets.apt tapestry/tapestry5/branches/5.0/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/branches/5.0/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java Modified: tapestry/tapestry5/branches/5.0/src/site/apt/guide/assets.apt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.0/src/site/apt/guide/assets.apt?rev=834180r1=834179r2=834180view=diff == --- tapestry/tapestry5/branches/5.0/src/site/apt/guide/assets.apt (original) +++ tapestry/tapestry5/branches/5.0/src/site/apt/guide/assets.apt Mon Nov 9 19:28:32 2009 @@ -98,4 +98,28 @@ Care should be taken to not create overlapping mappings, as the results would not be predictable. - \ No newline at end of file +Securing Assets + + Securing assets is an important consideration for any web application. Many assets, such as hibernate configuration + files, sit in the classpath and are exposable via the Asset service, which is not desirable. To protect these and + other sensitive assets, Tapestry provides the AssetProtectionDispatcher. This dispatcher sits in front of the + AssetDispatcher, the service responsible for streaming assets to the client, and watches for Asset requests. + When an asset request comes in, the protection dispatcher checks for authorization to view the file against a + contributed list of AssetPathAuthorizer implementations. Determination of whether the client can view the requested + resource is then made based on whether any of the contributed AssetPathAuthorizer implementations explicitly allowed + or denied access to the resource. + + Tapestry provides two AssetPathAuthorizer implemenations out of the box to which users may contribute: RegexAuthorizer + and WhitelistAuthorizer. RegexAuthorizer uses regular expressions to determine assets which are viewable by the + client; any assets that match one of its (contributed) regular expressions are authorized. Anything not matched is + passed through to the WhitelistAuthorizer. WhitelistAuthorizer uses an exact-matching whitelist. Anything matching + exactly one its contributions is allowed; all other asset requests are denied. The default tapestry configuration + contributes nothing to WhitelistAuthorizer (access will be denied to all asset requests passed through to it), and + explicitly allows access to css, jpg, jpeg, js, png, and gif files associated with tapestry (tapestry.js, blackbird + files, date picker files, etc.). The default contribution also enables access to the css, jpg, jpeg, js, png, and gif + files provided by the popular chenille-kit 3rd party library. The default configuration denies access to all other + assets. To enable access to your application's assets, either contribute a custom AssetPathAnalyzer, or contribute + appropriate regular expression or exact path contributions to RegexAuthorizer or WhitelistAuthorizer, respectively. + See TapestryModule.contribteRegexAuthorizer for examples. + + Added: tapestry/tapestry5/branches/5.0/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.0/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java?rev=834180view=auto == --- tapestry/tapestry5/branches/5.0/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/AssetProtectionDispatcher.java (added) +++ tapestry/tapestry5/branches/5.0/tapestry-core/src/main/java/org/apache/tapestry5/internal
svn commit: r795264 [3/3] - in /tapestry/tapestry5/trunk: src/site/apt/dev/ src/site/apt/guide/ tapestry-core/src/main/java/org/apache/tapestry5/annotations/ tapestry-core/src/main/java/org/apache/tap
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/MixinWorkerTest.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/MixinWorkerTest.java?rev=795264r1=795263r2=795264view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/MixinWorkerTest.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/MixinWorkerTest.java Fri Jul 17 22:53:30 2009 @@ -1,4 +1,4 @@ -// Copyright 2006, 2007, 2008 The Apache Software Foundation +// Copyright 2006, 2007, 2008, 2009 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. @@ -21,6 +21,7 @@ import org.apache.tapestry5.services.ComponentClassResolver; import org.apache.tapestry5.services.TransformConstants; import org.testng.annotations.Test; +import org.easymock.EasyMock; public class MixinWorkerTest extends InternalBaseTestCase { @@ -41,12 +42,13 @@ } @Test -public void field_with_explicit_type() +public void field_with_explicit_type_and_order() { ComponentClassResolver resolver = mockComponentClassResolver(); ClassTransformation transformation = mockClassTransformation(); MutableComponentModel model = mockMutableComponentModel(); -Mixin annotation = newMixin(Bar); +String[] order = {before:*}; +Mixin annotation = newMixin(Bar,order); train_findFieldsWithAnnotation(transformation, Mixin.class, fred); train_getFieldAnnotation(transformation, fred, Mixin.class, annotation); @@ -54,7 +56,7 @@ train_resolveMixinTypeToClassName(resolver, Bar, foo.bar.BazMixin); -model.addMixinClassName(foo.bar.BazMixin); +model.addMixinClassName(foo.bar.BazMixin,order); transformation.makeReadOnly(fred); @@ -75,18 +77,19 @@ } @Test -public void field_with_no_specific_mixin_type() +public void field_with_no_specific_mixin_type_or_order() { ComponentClassResolver resolver = mockComponentClassResolver(); ClassTransformation transformation = mockClassTransformation(); MutableComponentModel model = mockMutableComponentModel(); -Mixin annotation = newMixin(); +String[] order = new String[0]; +Mixin annotation = newMixin(,order); train_findFieldsWithAnnotation(transformation, Mixin.class, fred); train_getFieldAnnotation(transformation, fred, Mixin.class, annotation); train_getFieldType(transformation, fred, foo.bar.Baz); -model.addMixinClassName(foo.bar.Baz); +model.addMixinClassName(foo.bar.Baz,order); transformation.makeReadOnly(fred); @@ -113,12 +116,12 @@ expect(resolver.resolveMixinTypeToClassName(mixinType)).andReturn(mixinClassName); } -private Mixin newMixin(String value) +private Mixin newMixin(String value,String...order) { Mixin annotation = newMock(Mixin.class); expect(annotation.value()).andReturn(value); - +expect(annotation.order()).andReturn(order); return annotation; } } Added: tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/BindParameterComponentContainer.tml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/BindParameterComponentContainer.tml?rev=795264view=auto == --- tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/BindParameterComponentContainer.tml (added) +++ tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/components/BindParameterComponentContainer.tml Fri Jul 17 22:53:30 2009 @@ -0,0 +1,21 @@ +!-- + ~ Copyright 2009 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. + -- + +t:container xmlns:t=http://tapestry.apache.org/schema/tapestry_5_1_0.xsd; + +t:bindparametercomponent/ + +/t:container \ No newline at
svn commit: r795307 [2/2] - in /tapestry/tapestry5/trunk: tapestry-annotations/src/main/java/org/apache/tapestry5/beaneditor/ tapestry-annotations/src/main/java/org/apache/tapestry5/ioc/annotations/ t
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SessionState.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SessionState.java?rev=795307r1=795306r2=795307view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SessionState.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SessionState.java Sat Jul 18 04:06:58 2009 @@ -20,6 +20,9 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Target; +import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.*; +import org.apache.tapestry5.ioc.annotations.UseWith; + /** * Marker annotation for a field that is a emsession state object/em (SSO) as controlled by the {...@link * org.apache.tapestry5.services.ApplicationStateManager}. An SSO stored as global session object (i.e., in the {...@link @@ -41,6 +44,7 @@ @Target(FIELD) @Documented @Retention(RUNTIME) +...@usewith({COMPONENT,MIXIN,PAGE}) public @interface SessionState { /** Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SetupRender.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SetupRender.java?rev=795307r1=795306r2=795307view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SetupRender.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SetupRender.java Sat Jul 18 04:06:58 2009 @@ -1,4 +1,4 @@ -// Copyright 2006 The Apache Software Foundation +// Copyright 2006, 2009 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,6 +19,8 @@ import java.lang.annotation.Retention; import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Target; +import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.*; +import org.apache.tapestry5.ioc.annotations.UseWith; /** * Marker annotation for methods that should be executed during the SetupRender phase. Such methods may optionally take @@ -29,6 +31,7 @@ @Target(ElementType.METHOD) @Retention(RUNTIME) @Documented +...@usewith({COMPONENT,MIXIN,PAGE}) public @interface SetupRender { Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SupportsInformalParameters.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SupportsInformalParameters.java?rev=795307r1=795306r2=795307view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SupportsInformalParameters.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/SupportsInformalParameters.java Sat Jul 18 04:06:58 2009 @@ -1,4 +1,4 @@ -// Copyright 2006, 2007 The Apache Software Foundation +// Copyright 2006, 2007, 2009 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. @@ -15,6 +15,7 @@ package org.apache.tapestry5.annotations; import org.apache.tapestry5.model.ComponentModel; +import org.apache.tapestry5.ioc.annotations.UseWith; import java.lang.annotation.Documented; import static java.lang.annotation.ElementType.TYPE; @@ -23,6 +24,8 @@ import static java.lang.annotation.RetentionPolicy.RUNTIME; import java.lang.annotation.Target; +import static org.apache.tapestry5.ioc.annotations.AnnotationUseContext.*; + /** * Used to identify a component that can support informal parameters. By default, components do not support informal * parameters. @@ -33,6 +36,7 @@ @Retention(RUNTIME) @Documented @Inherited +...@usewith({COMPONENT,MIXIN}) public @interface SupportsInformalParameters { Modified: tapestry/tapestry5/trunk/tapestry-hibernate-core/src/main/java/org/apache/tapestry5/hibernate/annotations/CommitAfter.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-hibernate-core/src/main/java/org/apache/tapestry5/hibernate/annotations/CommitAfter.java?rev=795307r1=795306r2=795307view=diff == --- tapestry/tapestry5/trunk/tapestry-hibernate-core/src/main/java/org/apache/tapestry5/hibernate/annotations/CommitAfter.java (original) +++
svn commit: r790371 - /tapestry/tapestry5/branches/5.1.0.x-dev/
Author: robertdzeigler Date: Wed Jul 1 20:43:59 2009 New Revision: 790371 URL: http://svn.apache.org/viewvc?rev=790371view=rev Log: Create a branch for ongoing development/maintenance of the 5.1 release. Added: tapestry/tapestry5/branches/5.1.0.x-dev/ (props changed) - copied from r790370, tapestry/tapestry5/tags/releases/5.1.0.5/ Propchange: tapestry/tapestry5/branches/5.1.0.x-dev/ -- --- svn:ignore (added) +++ svn:ignore Wed Jul 1 20:43:59 2009 @@ -0,0 +1,5 @@ +bin +target +bin-test +temp-testng-customsuite.xml +*.iml *.ipr *.iws .classpath .project .settings Propchange: tapestry/tapestry5/branches/5.1.0.x-dev/ -- --- svn:mergeinfo (added) +++ svn:mergeinfo Wed Jul 1 20:43:59 2009 @@ -0,0 +1,4 @@ +/tapestry/tapestry5/branches/5.0:717929-719744,723395-728733 +/tapestry/tapestry5/branches/hlship-5.0-perf:726734-728728 +/tapestry/tapestry5/tags/releases/5.0.17:719745 +/tapestry/tapestry5/tags/releases/hlship-5.0-perf:726733
svn commit: r790375 - in /tapestry/tapestry5/branches/5.1.0.x-dev: ./ quickstart/ quickstart/src/main/resources/archetype-resources/ tapestry-annotations/ tapestry-component-report/ tapestry-core/ tap
Author: robertdzeigler Date: Wed Jul 1 20:59:24 2009 New Revision: 790375 URL: http://svn.apache.org/viewvc?rev=790375view=rev Log: Roll versions forward to 5.1.0.6-SNAPSHOT on the 5.1.0.x development branch. Modified: tapestry/tapestry5/branches/5.1.0.x-dev/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/quickstart/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/quickstart/src/main/resources/archetype-resources/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-annotations/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-component-report/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-core/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-hibernate-core/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-hibernate/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-ioc/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-spring/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-test/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-tutorial1/pom.xml tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-upload/pom.xml Modified: tapestry/tapestry5/branches/5.1.0.x-dev/pom.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/pom.xml?rev=790375r1=790374r2=790375view=diff == --- tapestry/tapestry5/branches/5.1.0.x-dev/pom.xml (original) +++ tapestry/tapestry5/branches/5.1.0.x-dev/pom.xml Wed Jul 1 20:59:24 2009 @@ -4,7 +4,7 @@ groupIdorg.apache.tapestry/groupId artifactIdtapestry-project/artifactId packagingpom/packaging -version5.1.0.5/version +version5.1.0.6-SNAPSHOT/version nameTapestry 5 Project/name descriptionMaster project for the modules of Tapestry 5./description inceptionYear2006/inceptionYear Modified: tapestry/tapestry5/branches/5.1.0.x-dev/quickstart/pom.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/quickstart/pom.xml?rev=790375r1=790374r2=790375view=diff == --- tapestry/tapestry5/branches/5.1.0.x-dev/quickstart/pom.xml (original) +++ tapestry/tapestry5/branches/5.1.0.x-dev/quickstart/pom.xml Wed Jul 1 20:59:24 2009 @@ -14,7 +14,7 @@ parent groupIdorg.apache.tapestry/groupId artifactIdtapestry-project/artifactId -version5.1.0.5/version +version5.1.0.6-SNAPSHOT/version /parent nameTapestry 5 Quickstart Archetype/name inceptionYear2007/inceptionYear Modified: tapestry/tapestry5/branches/5.1.0.x-dev/quickstart/src/main/resources/archetype-resources/pom.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/quickstart/src/main/resources/archetype-resources/pom.xml?rev=790375r1=790374r2=790375view=diff == --- tapestry/tapestry5/branches/5.1.0.x-dev/quickstart/src/main/resources/archetype-resources/pom.xml (original) +++ tapestry/tapestry5/branches/5.1.0.x-dev/quickstart/src/main/resources/archetype-resources/pom.xml Wed Jul 1 20:59:24 2009 @@ -135,6 +135,6 @@ /pluginRepositories properties -tapestry-release-version5.1.0.5/tapestry-release-version +tapestry-release-version5.1.0.6-SNAPSHOT/tapestry-release-version /properties /project Modified: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-annotations/pom.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-annotations/pom.xml?rev=790375r1=790374r2=790375view=diff == --- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-annotations/pom.xml (original) +++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-annotations/pom.xml Wed Jul 1 20:59:24 2009 @@ -9,7 +9,7 @@ parent groupIdorg.apache.tapestry/groupId artifactIdtapestry-project/artifactId -version5.1.0.5/version +version5.1.0.6-SNAPSHOT/version /parent nameTapestry Annotations/name description Modified: tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-component-report/pom.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-component-report/pom.xml?rev=790375r1=790374r2=790375view=diff == --- tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-component-report/pom.xml (original) +++ tapestry/tapestry5/branches/5.1.0.x-dev/tapestry-component-report/pom.xml Wed Jul 1 20:59:24 2009 @@ -12,7 +12,7 @@ parent groupIdorg.apache.tapestry/groupId artifactIdtapestry-project/artifactId -version5.1.0.5/version +version5.1.0.6-SNAPSHOT/version /parent inceptionYear2007/inceptionYear Modified: tapestry/tapestry5/branches/5.1.0.x-dev
svn commit: r788082 - in /tapestry/tapestry-site/trunk/src/site/xdoc: committers.xml index.xml
Author: robertdzeigler Date: Wed Jun 24 16:52:54 2009 New Revision: 788082 URL: http://svn.apache.org/viewvc?rev=788082view=rev Log: TAP5-756: Add ioko-tapestry-commons to the related projects list Modified: tapestry/tapestry-site/trunk/src/site/xdoc/committers.xml tapestry/tapestry-site/trunk/src/site/xdoc/index.xml Modified: tapestry/tapestry-site/trunk/src/site/xdoc/committers.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry-site/trunk/src/site/xdoc/committers.xml?rev=788082r1=788081r2=788082view=diff == --- tapestry/tapestry-site/trunk/src/site/xdoc/committers.xml (original) +++ tapestry/tapestry-site/trunk/src/site/xdoc/committers.xml Wed Jun 24 16:52:54 2009 @@ -80,6 +80,11 @@ tdMar 2006/td td/ /tr +tr +tdRobert Zeigler/td +tdNo/td +tdFeb. 2009/td +/tr /table /section /body Modified: tapestry/tapestry-site/trunk/src/site/xdoc/index.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry-site/trunk/src/site/xdoc/index.xml?rev=788082r1=788081r2=788082view=diff == --- tapestry/tapestry-site/trunk/src/site/xdoc/index.xml (original) +++ tapestry/tapestry-site/trunk/src/site/xdoc/index.xml Wed Jun 24 16:52:54 2009 @@ -315,6 +315,17 @@ Combination tree navigation and data grid, based on sstree. /td /tr +tr +td +a href=http://tapestry.formos.com/projects/ioko-tapestry-commons/;ioko-tapestry-commons/a +/td +td +Ben Gidley, et al. +/td +td +Provides components for caching, cache control, and simply SWF integration. +/td +/tr /table
svn commit: r787787 - in /tapestry/tapestry5/trunk/tapestry-core/src: main/java/org/apache/tapestry5/corelib/components/ main/resources/org/apache/tapestry5/ main/resources/org/apache/tapestry5/coreli
Author: robertdzeigler Date: Tue Jun 23 18:48:19 2009 New Revision: 787787 URL: http://svn.apache.org/viewvc?rev=787787view=rev Log: TAP5-749: The FormFragment and LinkSubmit components create a hidden field whose id ends with :hidden Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/LinkSubmit.java tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/linksubmit.js tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java?rev=787787r1=787786r2=787787view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/FormFragment.java Tue Jun 23 18:48:19 2009 @@ -186,7 +186,7 @@ name, Form.FORM_DATA, -id, clientId + :hidden, +id, clientId + -hidden, value, componentActions.getClientData() ); Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/LinkSubmit.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/LinkSubmit.java?rev=787787r1=787786r2=787787view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/LinkSubmit.java (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/LinkSubmit.java Tue Jun 23 18:48:19 2009 @@ -87,7 +87,7 @@ { this.clientId = clientId; -String hiddenFieldName = this.clientId + :hidden; +String hiddenFieldName = this.clientId + -hidden; if (request.getParameter(hiddenFieldName) != null) { Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/linksubmit.js URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/linksubmit.js?rev=787787r1=787786r2=787787view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/linksubmit.js (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/linksubmit.js Tue Jun 23 18:48:19 2009 @@ -25,7 +25,7 @@ createHidden : function() { var hidden = new Element(input, { type:hidden, -name: this.element.id + :hidden, +name: this.element.id + -hidden, value: this.element.id}); this.element.insert({after:hidden}); Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js?rev=787787r1=787786r2=787787view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js (original) +++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry5/tapestry.js Tue Jun 23 18:48:19 2009 @@ -1469,7 +1469,7 @@ $T(this.element).formFragment = this; -this.hidden = $(spec.element + :hidden); +this.hidden = $(spec.element + -hidden); this.showFunc = Tapestry.ElementEffect[spec.show] || Tapestry.ElementEffect.slidedown; this.hideFunc = Tapestry.ElementEffect[spec.hide] || Tapestry.ElementEffect.slideup; Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java?rev=787787r1=787786r2=787787view=diff == --- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java (original) +++ tapestry
svn commit: r787224 - in /tapestry/tapestry5/trunk: src/site/apt/guide/ tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/ tapestry-core/src/main/java/org/apache/tapestry5/internal/
Author: robertdzeigler Date: Mon Jun 22 12:42:56 2009 New Revision: 787224 URL: http://svn.apache.org/viewvc?rev=787224view=rev Log: TAP5-692: T5 should pick up validators to be applied to a field from the containing component's .properties file Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/EnvironmentMessages.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/MessagesConstraintGenerator.java tapestry/tapestry5/trunk/tapestry-core/src/test/app1/MessageConstraintGeneratorDemo.tml tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/Pet.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/data/PetType.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MessageConstraintGeneratorDemo.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/beaneditor/MessagesAnnotationConstraintGeneratorTest.java tapestry/tapestry5/trunk/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/MessageConstraintGeneratorDemo.properties Modified: tapestry/tapestry5/trunk/src/site/apt/guide/beaneditform.apt tapestry/tapestry5/trunk/src/site/apt/guide/validation.apt tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/ValidateAnnotationConstraintGenerator.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/FieldValidatorDefaultSourceImpl.java tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/Index.java Modified: tapestry/tapestry5/trunk/src/site/apt/guide/beaneditform.apt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/guide/beaneditform.apt?rev=787224r1=787223r2=787224view=diff == --- tapestry/tapestry5/trunk/src/site/apt/guide/beaneditform.apt (original) +++ tapestry/tapestry5/trunk/src/site/apt/guide/beaneditform.apt Mon Jun 22 12:42:56 2009 @@ -73,7 +73,9 @@ Default validation for fields is primary determined by property type. If desired, additional validation may be specified using the - {{{../apidocs/org/apache/tapestry5/beaneditor/Validate.html}Validate}} annotation. + {{{../apidocs/org/apache/tapestry5/beaneditor/Validate.html}Validate}} annotation. + + * As of 5.2, validation may also be specified via the containing component's property file, using a key in the form of propertyId-validate (eg: name-validate=required). * Property ordering Modified: tapestry/tapestry5/trunk/src/site/apt/guide/validation.apt URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/guide/validation.apt?rev=787224r1=787223r2=787224view=diff == --- tapestry/tapestry5/trunk/src/site/apt/guide/validation.apt (original) +++ tapestry/tapestry5/trunk/src/site/apt/guide/validation.apt Mon Jun 22 12:42:56 2009 @@ -239,7 +239,7 @@ This is nice and seamless; the same look and feel and behavior for both the built-in validators, and for errors generated based on application logic. -Centralizing Validation with @Validate +Centralizing Validation with @Validate and Property Files The {{{../apidocs/org/apache/tapestry5/beaneditor/Validate.html}Validate}} annotation can take the place of the validate parameter of TextField, PasswordField, TextArea and other components. When the validate parameter @@ -247,6 +247,9 @@ The annotation may be placed on the getter or setter method, or on the field itself. + Validation constraints can also be specified in the properties file of the containing page or component. + The key takes the form propertyId-validate. For example: username-validate=required,minlength=6. + Customizing Validation Messages Each validator (such as required or minlength) has a default message used (on the client side and the server side) Added: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/EnvironmentMessages.java URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/EnvironmentMessages.java?rev=787224view=auto == --- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/beaneditor/EnvironmentMessages.java (added) +++ tapestry/tapestry5/trunk/tapestry-core/src/main
svn commit: r745611 - /tapestry/tapestry5/trunk/pom.xml
Author: robertdzeigler Date: Wed Feb 18 18:58:44 2009 New Revision: 745611 URL: http://svn.apache.org/viewvc?rev=745611view=rev Log: Add Robert Zeigler as a T5 developer. Modified: tapestry/tapestry5/trunk/pom.xml Modified: tapestry/tapestry5/trunk/pom.xml URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/pom.xml?rev=745611r1=745610r2=745611view=diff == --- tapestry/tapestry5/trunk/pom.xml (original) +++ tapestry/tapestry5/trunk/pom.xml Wed Feb 18 18:58:44 2009 @@ -88,6 +88,14 @@ /roles timezone+1/timezone /developer + developer + idrobertdzeigler/id + nameRobert Zeigler/name + emailrobertdzeig...@apache.org/email + roles + roleDeveloper/role + /roles + timezone-6/timezone /developers ciManagement