You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2011/02/09 22:18:13 UTC
svn commit: r1069114 [1/2] - in /tapestry/tapestry5/trunk: ./
quickstart/src/main/resources/archetype-resources/src/main/java/services/
tapestry-annotations/ tapestry-core/
tapestry-core/src/main/java/org/apache/tapestry5/
tapestry-core/src/main/java/o...
Author: hlship
Date: Wed Feb 9 21:18:11 2011
New Revision: 1069114
URL: http://svn.apache.org/viewvc?rev=1069114&view=rev
Log:
Merge branch 'local' into trunk
Added:
tapestry/tapestry5/trunk/build.gradle
tapestry/tapestry5/trunk/settings.gradle
tapestry/tapestry5/trunk/tapestry-annotations/build.gradle
tapestry/tapestry5/trunk/tapestry-core/build.gradle
tapestry/tapestry5/trunk/tapestry-func/build.gradle
tapestry/tapestry5/trunk/tapestry-ioc/build.gradle
tapestry/tapestry5/trunk/tapestry-json/build.gradle
tapestry/tapestry5/trunk/tapestry-test/build.gradle
Removed:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/OptimizedApplicationStateObject.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/PrimaryKeyEncoder.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/ApplicationState.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/IncludeJavaScriptLibrary.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/annotations/IncludeStylesheet.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/OptimizedApplicationStateObjectAnalyzer.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/IncludeJavaScriptLibraryWorker.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/IncludeStylesheetWorker.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/util/PrimaryKeyEncoder2ValueEncoder.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/util/DefaultPrimaryKeyEncoder.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/util/PrimaryKeyEncoder2ValueEncoderTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/util/DefaultPrimaryKeyEncoderTest.java
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/IOCSymbols.java
Modified:
tapestry/tapestry5/trunk/.gitignore
tapestry/tapestry5/trunk/quickstart/src/main/resources/archetype-resources/src/main/java/services/AppModule.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ProgressiveDisplay.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Autocomplete.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentLocaleImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ApplicationStateWorker.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ParameterWorker.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptSupport.java
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DateFieldAjaxFormLoop.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ToDoList.tml
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/base/BaseComponent.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorBeanEditContext.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorDemo.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorOverride.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DateFieldAjaxFormLoop.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormInjectorDemo.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiBeanDemoResult.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiBeanEditDemo.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ShowBirthdayReminder.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ToDoList.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ViewRegistration.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/nested/ZoneDemo.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/services/AppModule.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app2/pages/TestPageForASO.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/PersistentLocaleImplTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/pages/MaybeStateHolder.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/transform/pages/StateHolder.java
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/IOCConstants.java
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/internal/services/PerthreadManagerImpl.java
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/ClassFabUtils.java
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/services/PerthreadManager.java
tapestry/tapestry5/trunk/tapestry-ioc/src/main/java/org/apache/tapestry5/ioc/test/IOCTestCase.java
tapestry/tapestry5/trunk/tapestry-ioc/src/test/java/org/apache/tapestry5/ioc/internal/services/PerthreadManagerImplTest.java
Modified: tapestry/tapestry5/trunk/.gitignore
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/.gitignore?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/.gitignore (original)
+++ tapestry/tapestry5/trunk/.gitignore Wed Feb 9 21:18:11 2011
@@ -7,4 +7,8 @@
*.iws
target
test-output
-temp-testng*.xml
\ No newline at end of file
+temp-testng*.xml
+build/
+.gradle
+*~
+\#*
\ No newline at end of file
Added: tapestry/tapestry5/trunk/build.gradle
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/build.gradle?rev=1069114&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/build.gradle (added)
+++ tapestry/tapestry5/trunk/build.gradle Wed Feb 9 21:18:11 2011
@@ -0,0 +1,69 @@
+description = "Apache Tapestry 5 Project"
+
+if (!project.hasProperty('deployUserName')) deployUserName = '*UNSET-USERNAME*'
+if (!project.hasProperty('deployPassword')) deployPassword = '*UNSET-PASSWORD*'
+
+
+jettyVersion = '7.0.0.v20091005'
+tomcatVersion = '6.0.30'
+testngVersion = '5.14.9'
+easymockVersion = '3.0'
+
+subprojects {
+ apply plugin: 'java'
+ apply plugin: 'groovy' // mostly for testing
+ apply plugin: 'eclipse'
+ apply plugin: 'maven'
+ apply plugin: 'project-report'
+
+ sourceCompatibility = '1.5'
+ targetCompatibility = '1.5'
+
+ version = '5.3.0-SNAPSHOT'
+
+ group = 'org.apache.tapestry'
+
+ repositories {
+ mavenCentral()
+
+ // All things JBoss/Javassist/Hibernate
+ mavenRepo urls: "https://repository.jboss.org/nexus/content/repositories/releases/"
+ }
+
+ configurations {
+ deployerJars
+ }
+
+ dependencies {
+ groovy "org.codehaus.groovy:groovy-all:1.7.4"
+
+ deployerJars "org.apache.maven.wagon:wagon-ftp:1.0-beta-2"
+ }
+
+ test {
+ useTestNG()
+
+ options.suites("src/test/conf/testng.xml")
+ }
+
+ task sourcesJar(type: Jar, dependsOn:classes) {
+ classifier = 'sources'
+ from sourceSets.main.allSource
+ }
+
+ artifacts {
+ archives sourcesJar
+ }
+
+
+ uploadArchives {
+ repositories.mavenDeployer {
+ configuration = configurations.deployerJars
+ // deployUserName and deployPassword should be specified in ~/.gradle/gradle.properties
+ snapshotRepository(url: "ftp://howardlewisship.com/snapshot-repository") {
+ authentication(userName: deployUserName, password: deployPassword)
+ }
+
+ }
+ }
+}
\ No newline at end of file
Modified: tapestry/tapestry5/trunk/quickstart/src/main/resources/archetype-resources/src/main/java/services/AppModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/quickstart/src/main/resources/archetype-resources/src/main/java/services/AppModule.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/quickstart/src/main/resources/archetype-resources/src/main/java/services/AppModule.java (original)
+++ tapestry/tapestry5/trunk/quickstart/src/main/resources/archetype-resources/src/main/java/services/AppModule.java Wed Feb 9 21:18:11 2011
@@ -51,6 +51,14 @@ public class AppModule
// header. If existing assets are changed, the version number should also
// change, to force the browser to download new versions.
configuration.add(SymbolConstants.APPLICATION_VERSION, "${version}");
+
+ // This is desirable in development, but again, is usually turned off
+ // by the time the application gets to production. The Blackbird console
+ // is very functionaly, but may be intimidating to users (who should not see
+ // it unless there are Ajax-oriented programming bugs). Regardless, when disabled
+ // a simple floating, fading message is displayed at the top of the page.
+
+ configuration.add(SymbolConstants.BLACKBIRD_ENABLED, "true");
}
Added: tapestry/tapestry5/trunk/settings.gradle
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/settings.gradle?rev=1069114&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/settings.gradle (added)
+++ tapestry/tapestry5/trunk/settings.gradle Wed Feb 9 21:18:11 2011
@@ -0,0 +1,4 @@
+include "tapestry-annotations", "tapestry-test", "tapestry-func", "tapestry-ioc", "tapestry-json", "tapestry-core"
+// TODO: tapestry-hibernate-core, tapestry-hibernate, tapestry-jmx, tapestry-upload, tapestry-spring, tapestry-beanvalidator
+// TODO (LATER): tapestry-component-report, quickstart
+
Added: tapestry/tapestry5/trunk/tapestry-annotations/build.gradle
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-annotations/build.gradle?rev=1069114&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-annotations/build.gradle (added)
+++ tapestry/tapestry5/trunk/tapestry-annotations/build.gradle Wed Feb 9 21:18:11 2011
@@ -0,0 +1,10 @@
+description = "Annotations used with Tapestry applications"
+
+// To avoid conflict with the Tapestry 4 tapestry-annotations, so both may be used at the same time
+baseName = 'tapestry5-annotations'
+
+configure(install.repositories.mavenInstaller) {
+ pom.project {
+ artifactId baseName
+ }
+}
\ No newline at end of file
Added: tapestry/tapestry5/trunk/tapestry-core/build.gradle
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/build.gradle?rev=1069114&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/build.gradle (added)
+++ tapestry/tapestry5/trunk/tapestry-core/build.gradle Wed Feb 9 21:18:11 2011
@@ -0,0 +1,14 @@
+description="Central module for Tapestry, containing all core services and components"
+
+dependencies {
+ compile project(':tapestry-ioc')
+ compile project(':tapestry-json')
+
+ testCompile project(':tapestry-test')
+
+ compile "commons-codec:commons-codec:1.3"
+ compile "javax.servlet:servlet-api:2.4"
+
+ compile "org.antlr:antlr-runtime:3.3", { transitive = false }
+
+}
\ No newline at end of file
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ProgressiveDisplay.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ProgressiveDisplay.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ProgressiveDisplay.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/ProgressiveDisplay.java Wed Feb 9 21:18:11 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.
@@ -27,7 +27,7 @@ import org.apache.tapestry5.TrackableCom
import org.apache.tapestry5.ajax.MultiZoneUpdate;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.Events;
-import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary;
+import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.SupportsInformalParameters;
import org.apache.tapestry5.dom.Element;
@@ -53,7 +53,7 @@ import org.apache.tapestry5.services.jav
* @since 5.1.0.1
*/
@SupportsInformalParameters
-@IncludeJavaScriptLibrary("ProgressiveDisplay.js")
+@Import(library = "ProgressiveDisplay.js")
@Events(EventConstants.PROGRESSIVE_DISPLAY)
@SuppressWarnings("all")
public class ProgressiveDisplay
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Autocomplete.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Autocomplete.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Autocomplete.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Autocomplete.java Wed Feb 9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2009, 2010 The Apache Software Foundation
+// Copyright 2007, 2008, 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.
@@ -17,11 +17,19 @@ package org.apache.tapestry5.corelib.mix
import java.util.Collections;
import java.util.List;
-import org.apache.tapestry5.*;
+import org.apache.tapestry5.Asset;
+import org.apache.tapestry5.BindingConstants;
+import org.apache.tapestry5.CSSClassConstants;
+import org.apache.tapestry5.ComponentEventCallback;
+import org.apache.tapestry5.ComponentResources;
+import org.apache.tapestry5.ContentType;
+import org.apache.tapestry5.EventConstants;
+import org.apache.tapestry5.Field;
+import org.apache.tapestry5.Link;
+import org.apache.tapestry5.MarkupWriter;
import org.apache.tapestry5.annotations.Environmental;
import org.apache.tapestry5.annotations.Events;
import org.apache.tapestry5.annotations.Import;
-import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary;
import org.apache.tapestry5.annotations.InjectContainer;
import org.apache.tapestry5.annotations.Parameter;
import org.apache.tapestry5.annotations.Path;
@@ -29,7 +37,6 @@ import org.apache.tapestry5.annotations.
import org.apache.tapestry5.internal.util.Holder;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.services.TypeCoercer;
-import org.apache.tapestry5.json.JSONArray;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.MarkupWriterFactory;
import org.apache.tapestry5.services.ResponseRenderer;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentLocaleImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentLocaleImpl.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentLocaleImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/PersistentLocaleImpl.java Wed Feb 9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2009, 2010 The Apache Software Foundation
+// Copyright 2007, 2008, 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.
@@ -21,15 +21,16 @@ import org.apache.tapestry5.SymbolConsta
import org.apache.tapestry5.internal.TapestryInternalUtils;
import org.apache.tapestry5.ioc.annotations.Symbol;
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
+import org.apache.tapestry5.ioc.services.PerThreadValue;
import org.apache.tapestry5.ioc.services.PerthreadManager;
import org.apache.tapestry5.services.PersistentLocale;
public class PersistentLocaleImpl implements PersistentLocale
{
- private final PerthreadManager perThreadManager;
-
private final String supportedLocales;
+ private final PerThreadValue<Locale> localeValue;
+
private final Set<String> localeNames = CollectionFactory.newSet();
public PersistentLocaleImpl(PerthreadManager perThreadManager,
@@ -37,9 +38,10 @@ public class PersistentLocaleImpl implem
@Symbol(SymbolConstants.SUPPORTED_LOCALES)
String supportedLocales)
{
- this.perThreadManager = perThreadManager;
this.supportedLocales = supportedLocales;
+ localeValue = perThreadManager.createValue();
+
for (String name : TapestryInternalUtils.splitAtCommas(supportedLocales))
{
localeNames.add(name.toLowerCase());
@@ -49,26 +51,26 @@ public class PersistentLocaleImpl implem
public void set(Locale locale)
{
assert locale != null;
+
if (!localeNames.contains(locale.toString().toLowerCase()))
{
String message = String
- .format(
- "Locale '%s' is not supported by this application. Supported locales are '%s'; this is configured via the %s symbol.",
+ .format("Locale '%s' is not supported by this application. Supported locales are '%s'; this is configured via the %s symbol.",
locale, supportedLocales, SymbolConstants.SUPPORTED_LOCALES);
throw new IllegalArgumentException(message);
}
- perThreadManager.put(this, locale);
+ localeValue.set(locale);
}
public Locale get()
{
- return (Locale) perThreadManager.get(this);
+ return localeValue.get();
}
public boolean isSet()
{
- return get() != null;
+ return localeValue.exists();
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ApplicationStateWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ApplicationStateWorker.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ApplicationStateWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ApplicationStateWorker.java Wed Feb 9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2007, 2008, 2010 The Apache Software Foundation
+// Copyright 2007, 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.
@@ -15,10 +15,7 @@
package org.apache.tapestry5.internal.transform;
import java.util.List;
-import java.util.Map;
-import java.util.TreeMap;
-import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.func.Predicate;
import org.apache.tapestry5.internal.services.ComponentClassCache;
@@ -48,30 +45,14 @@ public class ApplicationStateWorker impl
public void transform(ClassTransformation transformation, MutableComponentModel model)
{
- Map<TransformField, Boolean> fields = new TreeMap<TransformField, Boolean>();
-
- for (TransformField field : transformation.matchFieldsWithAnnotation(ApplicationState.class))
- {
- ApplicationState annotation = field.getAnnotation(ApplicationState.class);
-
- fields.put(field, annotation.create());
-
- field.claim(annotation);
- }
-
for (TransformField field : transformation.matchFieldsWithAnnotation(SessionState.class))
{
SessionState annotation = field.getAnnotation(SessionState.class);
- fields.put(field, annotation.create());
+ transform(transformation, field, annotation.create());
field.claim(annotation);
}
-
- for (Map.Entry<TransformField, Boolean> e : fields.entrySet())
- {
- transform(transformation, e.getKey(), e.getValue());
- }
}
@SuppressWarnings("unchecked")
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ParameterWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ParameterWorker.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ParameterWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/transform/ParameterWorker.java Wed Feb 9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007, 2008, 2009, 2010 The Apache Software Foundation
+// Copyright 2006, 2007, 2008, 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.
@@ -25,10 +25,24 @@ import org.apache.tapestry5.internal.bin
import org.apache.tapestry5.internal.services.ComponentClassCache;
import org.apache.tapestry5.ioc.internal.util.InternalUtils;
import org.apache.tapestry5.ioc.internal.util.TapestryException;
+import org.apache.tapestry5.ioc.services.PerThreadValue;
import org.apache.tapestry5.ioc.services.PerthreadManager;
import org.apache.tapestry5.ioc.services.TypeCoercer;
import org.apache.tapestry5.model.MutableComponentModel;
-import org.apache.tapestry5.services.*;
+import org.apache.tapestry5.services.BindingSource;
+import org.apache.tapestry5.services.ClassTransformation;
+import org.apache.tapestry5.services.ComponentClassTransformWorker;
+import org.apache.tapestry5.services.ComponentDefaultProvider;
+import org.apache.tapestry5.services.ComponentMethodAdvice;
+import org.apache.tapestry5.services.ComponentMethodInvocation;
+import org.apache.tapestry5.services.ComponentValueProvider;
+import org.apache.tapestry5.services.FieldAccess;
+import org.apache.tapestry5.services.MethodAccess;
+import org.apache.tapestry5.services.MethodInvocationResult;
+import org.apache.tapestry5.services.TransformConstants;
+import org.apache.tapestry5.services.TransformField;
+import org.apache.tapestry5.services.TransformMethod;
+import org.apache.tapestry5.services.TransformMethodSignature;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -230,10 +244,10 @@ public class ParameterWorker implements
{
final InternalComponentResources icr = (InternalComponentResources) resources;
- final String key = String.format("ParameterWorker:%s/%s", resources.getCompleteId(), parameterName);
-
final Class fieldType = classCache.forName(fieldTypeName);
+ final PerThreadValue<ParameterState> stateValue = perThreadManager.createValue();
+
// Rely on some code generation in the component to set the default binding from
// the field, or from a default method.
@@ -259,13 +273,13 @@ public class ParameterWorker implements
private ParameterState getState()
{
- ParameterState state = (ParameterState) perThreadManager.get(key);
+ ParameterState state = stateValue.get();
if (state == null)
{
state = new ParameterState();
state.value = defaultValue;
- perThreadManager.put(key, state);
+ stateValue.set(state);
}
return state;
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=1069114&r1=1069113&r2=1069114&view=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 Feb 9 21:18:11 2011
@@ -35,10 +35,44 @@ import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.apache.tapestry5.*;
+import org.apache.tapestry5.Asset;
+import org.apache.tapestry5.BindingConstants;
+import org.apache.tapestry5.Block;
+import org.apache.tapestry5.ComponentResources;
+import org.apache.tapestry5.EventContext;
+import org.apache.tapestry5.Field;
+import org.apache.tapestry5.FieldValidationSupport;
+import org.apache.tapestry5.FieldValidator;
+import org.apache.tapestry5.Link;
+import org.apache.tapestry5.MarkupWriter;
+import org.apache.tapestry5.MetaDataConstants;
+import org.apache.tapestry5.NullFieldStrategy;
+import org.apache.tapestry5.OptimizedSessionPersistedObject;
+import org.apache.tapestry5.PersistenceConstants;
+import org.apache.tapestry5.PropertyOverrides;
+import org.apache.tapestry5.RenderSupport;
+import org.apache.tapestry5.Renderable;
+import org.apache.tapestry5.SelectModel;
+import org.apache.tapestry5.StreamResponse;
+import org.apache.tapestry5.SymbolConstants;
+import org.apache.tapestry5.TapestryConstants;
+import org.apache.tapestry5.Translator;
+import org.apache.tapestry5.ValidationDecorator;
+import org.apache.tapestry5.Validator;
+import org.apache.tapestry5.VersionUtils;
import org.apache.tapestry5.ajax.MultiZoneUpdate;
-import org.apache.tapestry5.annotations.*;
+import org.apache.tapestry5.annotations.ActivationRequestParameter;
import org.apache.tapestry5.annotations.ContentType;
+import org.apache.tapestry5.annotations.HeartbeatDeferred;
+import org.apache.tapestry5.annotations.Import;
+import org.apache.tapestry5.annotations.Meta;
+import org.apache.tapestry5.annotations.PageAttached;
+import org.apache.tapestry5.annotations.PageDetached;
+import org.apache.tapestry5.annotations.PageLoaded;
+import org.apache.tapestry5.annotations.PageReset;
+import org.apache.tapestry5.annotations.Path;
+import org.apache.tapestry5.annotations.Secure;
+import org.apache.tapestry5.annotations.Service;
import org.apache.tapestry5.beaneditor.Validate;
import org.apache.tapestry5.corelib.ClientValidation;
import org.apache.tapestry5.corelib.LoopFormState;
@@ -59,7 +93,18 @@ import org.apache.tapestry5.internal.bea
import org.apache.tapestry5.internal.beaneditor.MessagesConstraintGenerator;
import org.apache.tapestry5.internal.beaneditor.PrimitiveFieldConstraintGenerator;
import org.apache.tapestry5.internal.beaneditor.ValidateAnnotationConstraintGenerator;
-import org.apache.tapestry5.internal.bindings.*;
+import org.apache.tapestry5.internal.bindings.AssetBindingFactory;
+import org.apache.tapestry5.internal.bindings.BlockBindingFactory;
+import org.apache.tapestry5.internal.bindings.ComponentBindingFactory;
+import org.apache.tapestry5.internal.bindings.ContextBindingFactory;
+import org.apache.tapestry5.internal.bindings.LiteralBindingFactory;
+import org.apache.tapestry5.internal.bindings.MessageBindingFactory;
+import org.apache.tapestry5.internal.bindings.NullFieldStrategyBindingFactory;
+import org.apache.tapestry5.internal.bindings.PropBindingFactory;
+import org.apache.tapestry5.internal.bindings.RenderVariableBindingFactory;
+import org.apache.tapestry5.internal.bindings.SymbolBindingFactory;
+import org.apache.tapestry5.internal.bindings.TranslateBindingFactory;
+import org.apache.tapestry5.internal.bindings.ValidateBindingFactory;
import org.apache.tapestry5.internal.grid.CollectionGridDataSource;
import org.apache.tapestry5.internal.grid.NullDataSource;
import org.apache.tapestry5.internal.gzip.GZipFilter;
@@ -89,18 +134,85 @@ import org.apache.tapestry5.internal.ser
import org.apache.tapestry5.internal.services.meta.MetaWorkerImpl;
import org.apache.tapestry5.internal.services.templates.DefaultTemplateLocator;
import org.apache.tapestry5.internal.services.templates.PageTemplateLocator;
-import org.apache.tapestry5.internal.transform.*;
+import org.apache.tapestry5.internal.transform.ActivationRequestParameterWorker;
+import org.apache.tapestry5.internal.transform.ApplicationStateWorker;
+import org.apache.tapestry5.internal.transform.BindParameterWorker;
+import org.apache.tapestry5.internal.transform.CachedWorker;
+import org.apache.tapestry5.internal.transform.ComponentWorker;
+import org.apache.tapestry5.internal.transform.DiscardAfterWorker;
+import org.apache.tapestry5.internal.transform.EnvironmentalWorker;
+import org.apache.tapestry5.internal.transform.HeartbeatDeferredWorker;
+import org.apache.tapestry5.internal.transform.ImportWorker;
+import org.apache.tapestry5.internal.transform.InjectComponentWorker;
+import org.apache.tapestry5.internal.transform.InjectContainerWorker;
+import org.apache.tapestry5.internal.transform.InjectNamedWorker;
+import org.apache.tapestry5.internal.transform.InjectPageWorker;
+import org.apache.tapestry5.internal.transform.InjectServiceWorker;
+import org.apache.tapestry5.internal.transform.InjectWorker;
+import org.apache.tapestry5.internal.transform.InvokePostRenderCleanupOnResourcesWorker;
+import org.apache.tapestry5.internal.transform.LogWorker;
+import org.apache.tapestry5.internal.transform.MixinAfterWorker;
+import org.apache.tapestry5.internal.transform.MixinWorker;
+import org.apache.tapestry5.internal.transform.OnEventWorker;
+import org.apache.tapestry5.internal.transform.PageActivationContextWorker;
+import org.apache.tapestry5.internal.transform.PageLifecycleAnnotationWorker;
+import org.apache.tapestry5.internal.transform.PageResetAnnotationWorker;
+import org.apache.tapestry5.internal.transform.ParameterWorker;
+import org.apache.tapestry5.internal.transform.PersistWorker;
+import org.apache.tapestry5.internal.transform.PropertyWorker;
+import org.apache.tapestry5.internal.transform.RenderCommandWorker;
+import org.apache.tapestry5.internal.transform.RenderPhaseMethodWorker;
+import org.apache.tapestry5.internal.transform.RetainWorker;
+import org.apache.tapestry5.internal.transform.SessionAttributeWorker;
+import org.apache.tapestry5.internal.transform.SupportsInformalParametersWorker;
+import org.apache.tapestry5.internal.transform.UnclaimedFieldWorker;
import org.apache.tapestry5.internal.translator.NumericTranslator;
import org.apache.tapestry5.internal.translator.NumericTranslatorSupport;
import org.apache.tapestry5.internal.translator.StringTranslator;
-import org.apache.tapestry5.internal.util.PrimaryKeyEncoder2ValueEncoder;
import org.apache.tapestry5.internal.util.RenderableAsBlock;
import org.apache.tapestry5.internal.util.StringRenderable;
import org.apache.tapestry5.internal.validator.ValidatorMacroImpl;
-import org.apache.tapestry5.ioc.*;
-import org.apache.tapestry5.ioc.annotations.*;
+import org.apache.tapestry5.ioc.AnnotationProvider;
+import org.apache.tapestry5.ioc.Configuration;
+import org.apache.tapestry5.ioc.Location;
+import org.apache.tapestry5.ioc.MappedConfiguration;
+import org.apache.tapestry5.ioc.Messages;
+import org.apache.tapestry5.ioc.MethodAdviceReceiver;
+import org.apache.tapestry5.ioc.ObjectLocator;
+import org.apache.tapestry5.ioc.ObjectProvider;
+import org.apache.tapestry5.ioc.OrderedConfiguration;
+import org.apache.tapestry5.ioc.Resource;
+import org.apache.tapestry5.ioc.ScopeConstants;
+import org.apache.tapestry5.ioc.ServiceBinder;
+import org.apache.tapestry5.ioc.annotations.Autobuild;
+import org.apache.tapestry5.ioc.annotations.Contribute;
+import org.apache.tapestry5.ioc.annotations.Inject;
+import org.apache.tapestry5.ioc.annotations.InjectService;
+import org.apache.tapestry5.ioc.annotations.IntermediateType;
+import org.apache.tapestry5.ioc.annotations.Local;
+import org.apache.tapestry5.ioc.annotations.Marker;
+import org.apache.tapestry5.ioc.annotations.Match;
+import org.apache.tapestry5.ioc.annotations.Primary;
+import org.apache.tapestry5.ioc.annotations.Scope;
+import org.apache.tapestry5.ioc.annotations.SubModule;
+import org.apache.tapestry5.ioc.annotations.Symbol;
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
-import org.apache.tapestry5.ioc.services.*;
+import org.apache.tapestry5.ioc.services.Builtin;
+import org.apache.tapestry5.ioc.services.ChainBuilder;
+import org.apache.tapestry5.ioc.services.ClassFactory;
+import org.apache.tapestry5.ioc.services.ClasspathURLConverter;
+import org.apache.tapestry5.ioc.services.Coercion;
+import org.apache.tapestry5.ioc.services.CoercionTuple;
+import org.apache.tapestry5.ioc.services.LazyAdvisor;
+import org.apache.tapestry5.ioc.services.MasterObjectProvider;
+import org.apache.tapestry5.ioc.services.PerthreadManager;
+import org.apache.tapestry5.ioc.services.PipelineBuilder;
+import org.apache.tapestry5.ioc.services.PropertyAccess;
+import org.apache.tapestry5.ioc.services.PropertyShadowBuilder;
+import org.apache.tapestry5.ioc.services.StrategyBuilder;
+import org.apache.tapestry5.ioc.services.SymbolSource;
+import org.apache.tapestry5.ioc.services.ThreadLocale;
+import org.apache.tapestry5.ioc.services.TypeCoercer;
import org.apache.tapestry5.ioc.util.AvailableValues;
import org.apache.tapestry5.ioc.util.IdAllocator;
import org.apache.tapestry5.ioc.util.StrategyRegistry;
@@ -524,31 +636,22 @@ public final class TapestryModule
* <dt>Persist</dt>
* <dd>Allows fields to store their their value persistently between requests</dd>
* <dt>Parameter</dt>
- * <dd>Identifies parameters based on the {@link org.apache.tapestry5.annotations.Parameter}
- * annotation</dd>
+ * <dd>Identifies parameters based on the {@link org.apache.tapestry5.annotations.Parameter} annotation</dd>
* <dt>Component</dt>
- * <dd>Defines embedded components based on the
- * {@link org.apache.tapestry5.annotations.Component} annotation</dd>
+ * <dd>Defines embedded components based on the {@link org.apache.tapestry5.annotations.Component} annotation</dd>
* <dt>Mixin</dt>
* <dd>Adds a mixin as part of a component's implementation</dd>
* <dt>Environment</dt>
- * <dd>Allows fields to contain values extracted from the
- * {@link org.apache.tapestry5.services.Environment} service</dd>
+ * <dd>Allows fields to contain values extracted from the {@link org.apache.tapestry5.services.Environment} service</dd>
* <dt>Inject</dt>
- * <dd>Used with the {@link org.apache.tapestry5.ioc.annotations.Inject} annotation, when a
- * value is supplied</dd>
+ * <dd>Used with the {@link org.apache.tapestry5.ioc.annotations.Inject} annotation, when a value is supplied</dd>
* <dt>InjectService</dt>
* <dd>Handles the {@link org.apache.tapestry5.ioc.annotations.InjectService} annotation</dd>
* <dt>InjectPage</dt>
- * <dd>Adds code to allow access to other pages via the
- * {@link org.apache.tapestry5.annotations.InjectPage} field annotation</dd>
+ * <dd>Adds code to allow access to other pages via the {@link org.apache.tapestry5.annotations.InjectPage} field
+ * annotation</dd>
* <dt>InjectBlock</dt>
* <dd>Allows a block from the template to be injected into a field</dd>
- * <dt>IncludeStylesheet</dt>
- * <dd>Supports the {@link org.apache.tapestry5.annotations.IncludeStylesheet} annotation</dd>
- * <dt>IncludeJavaScriptLibrary</dt>
- * <dd>Supports the {@link org.apache.tapestry5.annotations.IncludeJavaScriptLibrary} annotation
- * </dd>
* <dt>Import</dt>
* <dd>Supports the {@link Import} annotation</dd>
* <dt>SupportsInformalParameters</dt>
@@ -564,12 +667,10 @@ public final class TapestryModule
* <dt>RenderPhase</dt>
* <dd>Link in render phaes methods</dd>
* <dt>InvokePostRenderCleanupOnResources</dt>
- * <dd>Makes sure
- * {@link org.apache.tapestry5.internal.InternalComponentResources#postRenderCleanup()} is
- * invoked after a component finishes rendering</dd>
+ * <dd>Makes sure {@link org.apache.tapestry5.internal.InternalComponentResources#postRenderCleanup()} is invoked
+ * after a component finishes rendering</dd>
* <dt>GenerateAccessors</dt>
- * <dd>Generates accessor methods if {@link org.apache.tapestry5.annotations.Property}
- * annotation is present</dd>
+ * <dd>Generates accessor methods if {@link org.apache.tapestry5.annotations.Property} annotation is present</dd>
* <dt>Cached</dt>
* <dd>Checks for the {@link org.apache.tapestry5.annotations.Cached} annotation</dd>
* <dt>Log</dt>
@@ -637,9 +738,6 @@ public final class TapestryModule
configuration.addInstance("DiscardAfter", DiscardAfterWorker.class);
- configuration.addInstance("IncludeStylesheet", IncludeStylesheetWorker.class, "after:SetupRender");
- configuration
- .addInstance("IncludeJavaScriptLibrary", IncludeJavaScriptLibraryWorker.class, "after:SetupRender");
configuration.addInstance("Import", ImportWorker.class, "after:SetupRender");
configuration.add("InvokePostRenderCleanupOnResources", new InvokePostRenderCleanupOnResourcesWorker());
@@ -794,11 +892,10 @@ public final class TapestryModule
* <dt>CommonResources</dt>
* <dd>access to properties of resources (log, messages, etc.)</dd>
* <dt>Asset</dt>
- * <dd>injection of assets (triggered via {@link Path} annotation), with the path relative to
- * the component class</dd>
+ * <dd>injection of assets (triggered via {@link Path} annotation), with the path relative to the component class</dd>
* <dt>Service</dt>
- * <dd>ordered last, for use when Inject is present and nothing else works, matches field type
- * against Tapestry IoC services</dd>
+ * <dd>ordered last, for use when Inject is present and nothing else works, matches field type against Tapestry IoC
+ * services</dd>
* </dl>
*/
public static void contributeInjectionProvider(OrderedConfiguration<InjectionProvider> configuration,
@@ -861,11 +958,11 @@ public final class TapestryModule
/**
* <dl>
* <dt>StoreIntoGlobals</dt>
- * <dd>Stores the request and response into {@link org.apache.tapestry5.services.RequestGlobals}
- * at the start of the pipeline</dd>
+ * <dd>Stores the request and response into {@link org.apache.tapestry5.services.RequestGlobals} at the start of the
+ * pipeline</dd>
* <dt>IgnoredPaths</dt>
- * <dd>Identifies requests that are known (via the IgnoredPathsFilter service's configuration)
- * to be mapped to other applications</dd>
+ * <dd>Identifies requests that are known (via the IgnoredPathsFilter service's configuration) to be mapped to other
+ * applications</dd>
* <dt>GZip</dt>
* <dd>Handles GZIP compression of response streams (if supported by client)</dd>
*/
@@ -902,18 +999,17 @@ public final class TapestryModule
* Continues a number of filters into the RequestHandler service:
* <dl>
* <dt>StaticFiles</dt>
- * <dd>Checks to see if the request is for an actual file, if so, returns true to let the
- * servlet container process the request</dd>
+ * <dd>Checks to see if the request is for an actual file, if so, returns true to let the servlet container process
+ * the request</dd>
* <dt>CheckForUpdates</dt>
- * <dd>Periodically fires events that checks to see if the file system sources for any cached
- * data has changed (see {@link org.apache.tapestry5.internal.services.CheckForUpdatesFilter}).
+ * <dd>Periodically fires events that checks to see if the file system sources for any cached data has changed (see
+ * {@link org.apache.tapestry5.internal.services.CheckForUpdatesFilter}).
* <dt>ErrorFilter</dt>
- * <dd>Catches request errors and lets the
- * {@link org.apache.tapestry5.services.RequestExceptionHandler} handle them</dd>
+ * <dd>Catches request errors and lets the {@link org.apache.tapestry5.services.RequestExceptionHandler} handle them
+ * </dd>
* <dt>StoreIntoGlobals</dt>
- * <dd>Stores the request and response into the
- * {@link org.apache.tapestry5.services.RequestGlobals} service (this is repeated at the end of
- * the pipeline, in case any filter substitutes the request or response).
+ * <dd>Stores the request and response into the {@link org.apache.tapestry5.services.RequestGlobals} service (this
+ * is repeated at the end of the pipeline, in case any filter substitutes the request or response).
* </dl>
*/
public void contributeRequestHandler(OrderedConfiguration<RequestFilter> configuration, Context context,
@@ -1028,7 +1124,6 @@ public final class TapestryModule
* <li>String to {@link Renderable}
* <li>{@link Renderable} to {@link Block}
* <li>String to {@link DateFormat}
- * <li>{@link PrimaryKeyEncoder} to {@link ValueEncoder}
* <li>String to {@link Resource} (via {@link AssetSource#resourceForPath(String)})
* <li>{@link Renderable} to {@link RenderCommand}</li>
* <li>String to {@link LoopFormState}</li>
@@ -1173,9 +1268,6 @@ public final class TapestryModule
}
}));
- configuration.add(CoercionTuple.create(PrimaryKeyEncoder.class, ValueEncoder.class,
- new PrimaryKeyEncoder2ValueEncoder(coercer)));
-
configuration.add(CoercionTuple.create(Date.class, Calendar.class, new Coercion<Date, Calendar>()
{
public Calendar coerce(Date input)
@@ -1278,9 +1370,9 @@ public final class TapestryModule
* the chain is responsible for ordinary
* property names (and property paths).
* <p/>
- * This mechanism has been replaced in 5.1 with a more sophisticated parser based on ANTLR. See
- * <a href="https://issues.apache.org/jira/browse/TAP5-79">TAP5-79</a> for details. There are no
- * longer any built-in contributions to the configuration.
+ * This mechanism has been replaced in 5.1 with a more sophisticated parser based on ANTLR. See <a
+ * href="https://issues.apache.org/jira/browse/TAP5-79">TAP5-79</a> for details. There are no longer any built-in
+ * contributions to the configuration.
*
* @param configuration
* contributions of special factories for some constants, each
@@ -1348,8 +1440,7 @@ public final class TapestryModule
}
/**
- * Builds a proxy to the current {@link JavaScriptSupport} inside this thread's
- * {@link Environment}.
+ * Builds a proxy to the current {@link JavaScriptSupport} inside this thread's {@link Environment}.
*
* @since 5.2.0
*/
@@ -1359,8 +1450,7 @@ public final class TapestryModule
}
/**
- * Builds a proxy to the current {@link org.apache.tapestry5.services.ClientBehaviorSupport}
- * inside this
+ * Builds a proxy to the current {@link org.apache.tapestry5.services.ClientBehaviorSupport} inside this
* thread's {@link org.apache.tapestry5.services.Environment}.
*
* @since 5.1.0.1
@@ -1418,8 +1508,7 @@ public final class TapestryModule
}
/**
- * Initializes the application, using a pipeline of
- * {@link org.apache.tapestry5.services.ApplicationInitializer}s.
+ * Initializes the application, using a pipeline of {@link org.apache.tapestry5.services.ApplicationInitializer}s.
*/
@Marker(Primary.class)
public ApplicationInitializer buildApplicationInitializer(Logger logger,
@@ -1621,8 +1710,7 @@ public final class TapestryModule
/**
* The MarkupRenderer service is used to render a full page as markup.
- * Supports an ordered configuration of
- * {@link org.apache.tapestry5.services.MarkupRendererFilter}s.
+ * Supports an ordered configuration of {@link org.apache.tapestry5.services.MarkupRendererFilter}s.
*/
public MarkupRenderer buildMarkupRenderer(Logger logger, @Autobuild
MarkupRendererTerminator terminator, List<MarkupRendererFilter> configuration)
@@ -1634,11 +1722,10 @@ public final class TapestryModule
/**
* A wrapper around {@link org.apache.tapestry5.internal.services.PageRenderQueue} used for
* partial page renders.
- * Supports an ordered configuration of
- * {@link org.apache.tapestry5.services.PartialMarkupRendererFilter}s.
+ * Supports an ordered configuration of {@link org.apache.tapestry5.services.PartialMarkupRendererFilter}s.
*
- * @see #contributePartialMarkupRenderer(org.apache.tapestry5.ioc.OrderedConfiguration,
- * org.apache.tapestry5.Asset, org.apache.tapestry5.ioc.services.SymbolSource, AssetSource)
+ * @see #contributePartialMarkupRenderer(org.apache.tapestry5.ioc.OrderedConfiguration, org.apache.tapestry5.Asset,
+ * org.apache.tapestry5.ioc.services.SymbolSource, AssetSource)
*/
public PartialMarkupRenderer buildPartialMarkupRenderer(Logger logger,
List<PartialMarkupRendererFilter> configuration, @Autobuild
@@ -1675,8 +1762,7 @@ public final class TapestryModule
/**
* Builds the action request handler for Ajax requests, based on a
* {@linkplain org.apache.tapestry5.ioc.services.PipelineBuilder
- * pipeline} around
- * {@link org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler} . Filters on
+ * pipeline} around {@link org.apache.tapestry5.internal.services.AjaxComponentEventRequestHandler} . Filters on
* the
* request handler are supported here as well.
*/
@@ -1728,11 +1814,11 @@ public final class TapestryModule
* <dt>String</dt>
* <dd>Sends a page render redirect</dd>
* <dt>Class</dt>
- * <dd>Interpreted as the class name of a page, sends a page render render redirect (this is
- * more refactoring safe than the page name)</dd>
+ * <dd>Interpreted as the class name of a page, sends a page render render redirect (this is more refactoring safe
+ * than the page name)</dd>
* <dt>{@link Component}</dt>
- * <dd>A page's root component (though a non-root component will work, but will generate a
- * warning). A direct to the containing page is sent.</dd>
+ * <dd>A page's root component (though a non-root component will work, but will generate a warning). A direct to the
+ * containing page is sent.</dd>
* <dt>{@link org.apache.tapestry5.StreamResponse}</dt>
* <dd>The stream response is sent as the actual reply.</dd>
* <dt>URL</dt>
@@ -1788,16 +1874,13 @@ public final class TapestryModule
* <dt>{@link RenderCommand}</dt>
* <dd>Typically, a {@link org.apache.tapestry5.Block}</dd>
* <dt>{@link org.apache.tapestry5.annotations.Component}</dt>
- * <dd>Renders the component and its body (unless its a page, in which case a redirect JSON
- * response is sent)</dd>
- * <dt>{@link org.apache.tapestry5.json.JSONObject} or
- * {@link org.apache.tapestry5.json.JSONArray}</dt>
+ * <dd>Renders the component and its body (unless its a page, in which case a redirect JSON response is sent)</dd>
+ * <dt>{@link org.apache.tapestry5.json.JSONObject} or {@link org.apache.tapestry5.json.JSONArray}</dt>
* <dd>The JSONObject is returned as a text/javascript response</dd>
* <dt>{@link org.apache.tapestry5.StreamResponse}</dt>
* <dd>The stream response is sent as the actual response</dd>
* <dt>String</dt>
- * <dd>Interprets the value as a logical page name and sends a client response to redirect to
- * that page</dd>
+ * <dd>Interprets the value as a logical page name and sends a client response to redirect to that page</dd>
* <dt>{@link org.apache.tapestry5.Link}</dt>
* <dd>Sends a JSON response to redirect to the link</dd>
* <dt>{@link Class}</dt>
@@ -1806,10 +1889,9 @@ public final class TapestryModule
* <dd>Sends a single JSON response to update the content of multiple zones
* </dl>
* <p>
- * In most cases, when you want to support a new type, you should convert it to one of the
- * built-in supported types (such as {@link RenderCommand}. You can then inject the master
- * AjaxComponentEventResultProcessor (use the {@link Ajax} marker annotation) and delegate to
- * it.
+ * In most cases, when you want to support a new type, you should convert it to one of the built-in supported types
+ * (such as {@link RenderCommand}. You can then inject the master AjaxComponentEventResultProcessor (use the
+ * {@link Ajax} marker annotation) and delegate to it.
*/
@Contribute(ComponentEventResultProcessor.class)
@Ajax
@@ -1837,8 +1919,8 @@ public final class TapestryModule
* <dt>Asset</dt>
* <dd>Provides access to assets (context, classpath and virtual) via {@link AssetDispatcher}</dd>
* <dt>PageRender</dt>
- * <dd>Identifies the {@link org.apache.tapestry5.services.PageRenderRequestParameters} and
- * forwards onto {@link PageRenderRequestHandler}</dd>
+ * <dd>Identifies the {@link org.apache.tapestry5.services.PageRenderRequestParameters} and forwards onto
+ * {@link PageRenderRequestHandler}</dd>
* <dt>ComponentEvent</dt>
* <dd>Identifies the {@link ComponentEventRequestParameters} and forwards onto the
* {@link ComponentEventRequestHandler}</dd>
@@ -1869,9 +1951,9 @@ public final class TapestryModule
/**
* Contributes a default object renderer for type Object, plus specialized
- * renderers for {@link org.apache.tapestry5.services.Request},
- * {@link org.apache.tapestry5.ioc.Location}, {@link org.apache.tapestry5.ComponentResources},
- * {@link org.apache.tapestry5.EventContext}, {@link AvailableValues},
+ * renderers for {@link org.apache.tapestry5.services.Request}, {@link org.apache.tapestry5.ioc.Location},
+ * {@link org.apache.tapestry5.ComponentResources}, {@link org.apache.tapestry5.EventContext},
+ * {@link AvailableValues},
* List, and Object[].
*/
@SuppressWarnings("unchecked")
@@ -1908,8 +1990,8 @@ public final class TapestryModule
}
/**
- * Adds page render filters, each of which provides an
- * {@link org.apache.tapestry5.annotations.Environmental} service. Filters
+ * Adds page render filters, each of which provides an {@link org.apache.tapestry5.annotations.Environmental}
+ * service. Filters
* often provide {@link org.apache.tapestry5.annotations.Environmental} services needed by
* components as they render.
* <dl>
@@ -2486,8 +2568,7 @@ public final class TapestryModule
}
/**
- * Adds a listener to the
- * {@link org.apache.tapestry5.internal.services.ComponentInstantiatorSource} that clears the
+ * Adds a listener to the {@link org.apache.tapestry5.internal.services.ComponentInstantiatorSource} that clears the
* {@link PropertyAccess} and {@link TypeCoercer} caches on
* a class loader invalidation. In addition, forces the
* realization of {@link ComponentClassResolver} at startup.
@@ -2538,12 +2619,11 @@ public final class TapestryModule
* Contributes filters:
* <dl>
* <dt>Ajax</dt>
- * <dd>Determines if the request is Ajax oriented, and redirects to an alternative handler if so
- * </dd>
+ * <dd>Determines if the request is Ajax oriented, and redirects to an alternative handler if so</dd>
* <dt>ImmediateRender</dt>
* <dd>When {@linkplain SymbolConstants#SUPPRESS_REDIRECT_FROM_ACTION_REQUESTS
- * immediate action response rendering} is enabled, generates the markup response (instead of a
- * page redirect response, which is the normal behavior)</dd>
+ * immediate action response rendering} is enabled, generates the markup response (instead of a page redirect
+ * response, which is the normal behavior)</dd>
* <dt>Secure</dt>
* <dd>Sends a redirect if an non-secure request accesses a secure page</dd>
* </dl>
@@ -2686,8 +2766,7 @@ public final class TapestryModule
* Identifies String, Number and Boolean as immutable objects, a catch-all
* handler for Object (that understands
* the {@link org.apache.tapestry5.annotations.ImmutableSessionPersistedObject} annotation),
- * and handlers for {@link org.apache.tapestry5.OptimizedSessionPersistedObject} and
- * {@link org.apache.tapestry5.OptimizedApplicationStateObject}.
+ * and a handler for {@link org.apache.tapestry5.OptimizedSessionPersistedObject}.
*
* @since 5.1.0.0
*/
@@ -2709,7 +2788,6 @@ public final class TapestryModule
configuration.add(Boolean.class, immutable);
configuration.add(OptimizedSessionPersistedObject.class, new OptimizedSessionPersistedObjectAnalyzer());
- configuration.add(OptimizedApplicationStateObject.class, new OptimizedApplicationStateObjectAnalyzer());
}
/**
@@ -2894,8 +2972,7 @@ public final class TapestryModule
}
/**
- * Contributes "AppCatalog" as the Resource defined by
- * {@link SymbolConstants#APPLICATION_CATALOG}.
+ * Contributes "AppCatalog" as the Resource defined by {@link SymbolConstants#APPLICATION_CATALOG}.
*
* @since 5.2.0
*/
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptSupport.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptSupport.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptSupport.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/javascript/JavaScriptSupport.java Wed Feb 9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2010 The Apache Software Foundation
+// Copyright 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.
@@ -20,7 +20,6 @@ import org.apache.tapestry5.FieldFocusPr
import org.apache.tapestry5.RenderSupport;
import org.apache.tapestry5.SymbolConstants;
import org.apache.tapestry5.annotations.Environmental;
-import org.apache.tapestry5.annotations.IncludeJavaScriptLibrary;
import org.apache.tapestry5.json.JSONObject;
import org.apache.tapestry5.services.EnvironmentalShadowBuilder;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DateFieldAjaxFormLoop.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DateFieldAjaxFormLoop.tml?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DateFieldAjaxFormLoop.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/DateFieldAjaxFormLoop.tml Wed Feb 9 21:18:11 2011
@@ -1,20 +1,20 @@
<html t:type="border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <h1>DateField in AjaxFormLoop</h1>
+ <h1>DateField in AjaxFormLoop</h1>
- <t:form>
+ <t:form>
- <div t:type="ajaxformloop" t:id="loop" source="dateHolders" value="current" encoder="dateHolderConverter">
+ <div t:type="ajaxformloop" t:id="loop" source="dateHolders" value="current" encoder="dateHolderEncoder">
- <t:datefield value="current.date"/>
- <t:removerowlink>remove</t:removerowlink>
+ <t:datefield value="current.date"/>
+ <t:removerowlink>remove</t:removerowlink>
- </div>
+ </div>
- <p>
- <input type="submit" value="Go"/>
- </p>
- </t:form>
+ <p>
+ <input type="submit" value="Go"/>
+ </p>
+ </t:form>
</html>
\ No newline at end of file
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/FormInjectorDemo.tml Wed Feb 9 21:18:11 2011
@@ -1,36 +1,35 @@
<html t:type="Border" xmlns:t="http://tapestry.apache.org/schema/tapestry_5_0_0.xsd">
- <h1>FormInjector Demo (now including AjaxFormLoop)</h1>
+ <h1>FormInjector Demo (now including AjaxFormLoop)</h1>
- <t:form>
+ <t:form>
- <ul>
- <li t:id="loop" t:type="AjaxFormLoop" source="doubleItems" value="item" encoder="encoder"
- context="demoContextValue">
- <t:submitnotifier>
- <t:textfield t:id="value" value="item.value"/>
- <t:removerowlink>remove</t:removerowlink>
- </t:submitnotifier>
- <t:parameter name="addRow">
- <t:addrowlink>Add a row</t:addrowlink>
- </t:parameter>
- </li>
- </ul>
-
- <div class="t-beaneditor-row">
- <input type="submit" value="Sum up the values"/>
- </div>
-
- </t:form>
-
- <p>
- Current sum:
- <span id="sum">${sum}</span>
- </p>
+ <ul>
+ <li t:id="loop" t:type="AjaxFormLoop" source="doubleItems" value="item" encoder="doubleItemEncoder" context="demoContextValue">
+ <t:submitnotifier>
+ <t:textfield t:id="value" value="item.value"/>
+ <t:removerowlink>remove</t:removerowlink>
+ </t:submitnotifier>
+ <t:parameter name="addRow">
+ <t:addrowlink>Add a row</t:addrowlink>
+ </t:parameter>
+ </li>
+ </ul>
+
+ <div class="t-beaneditor-row">
+ <input type="submit" value="Sum up the values"/>
+ </div>
+
+ </t:form>
+
+ <p>
+ Current sum:
+ <span id="sum">${sum}</span>
+ </p>
- <h2>Data</h2>
+ <h2>Data</h2>
- <t:grid source="doubleItems"/>
+ <t:grid source="doubleItems"/>
</html>
\ No newline at end of file
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ToDoList.tml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ToDoList.tml?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ToDoList.tml (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/app1/ToDoList.tml Wed Feb 9 21:18:11 2011
@@ -11,7 +11,7 @@
<th> Title </th>
<th> Reorder </th>
</tr>
- <tr t:type="Loop" source="items" value="item" encoder="encoder">
+ <tr t:type="Loop" source="items" value="item" encoder="toDoItemEncoder">
<td>
<input t:type="TextField" t:id="title" value="item.title" size="30"
validate="required"/>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/TapestryCoreTestCase.java Wed Feb 9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2009 The Apache Software Foundation
+// Copyright 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.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// 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,
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/base/BaseComponent.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/base/BaseComponent.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/base/BaseComponent.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/base/BaseComponent.java Wed Feb 9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 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
+// 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,
@@ -14,13 +14,13 @@
package org.apache.tapestry5.integration.app1.base;
-import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.integration.app1.data.IncidentData;
public class BaseComponent
{
- @ApplicationState
+ @SessionState
@Property
private IncidentData incidentData;
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java Wed Feb 9 21:18:11 2011
@@ -4,7 +4,7 @@
// 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
+// 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,
@@ -14,7 +14,7 @@
package org.apache.tapestry5.integration.app1.components;
-import org.apache.tapestry5.annotations.IncludeStylesheet;
+import org.apache.tapestry5.annotations.Import;
import org.apache.tapestry5.ioc.annotations.Inject;
import org.apache.tapestry5.ioc.services.Builtin;
import org.apache.tapestry5.ioc.services.ClassFactory;
@@ -22,10 +22,11 @@ import org.apache.tapestry5.services.Com
import org.apache.tapestry5.services.Request;
/**
- * Here's a component with a template, including a t:body element. Really should rename this to "Layout" as that's the
+ * Here's a component with a template, including a t:body element. Really should rename this to "Layout" as that's the
* T5 naming.
*/
-@IncludeStylesheet({ "context:layout/style.css", "context:css/app.css" })
+@Import(stylesheet =
+{ "context:layout/style.css", "context:css/app.css" })
public class Border
{
@Inject
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorBeanEditContext.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorBeanEditContext.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorBeanEditContext.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorBeanEditContext.java Wed Feb 9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2008 The Apache Software Foundation
+// Copyright 2008, 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
+// 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,
@@ -14,8 +14,8 @@
package org.apache.tapestry5.integration.app1.pages;
-import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.Component;
+import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.corelib.components.BeanEditor;
import org.apache.tapestry5.corelib.components.Form;
import org.apache.tapestry5.integration.app1.data.RegistrationData;
@@ -25,13 +25,13 @@ public class BeanEditorBeanEditContext
@Component
private Form form;
- @Component(parameters = { "object=registrationData" })
+ @Component(parameters =
+ { "object=registrationData" })
private BeanEditor editor;
- @ApplicationState
+ @SessionState
private RegistrationData data;
-
public RegistrationData getRegistrationData()
{
return data;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorDemo.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorDemo.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorDemo.java Wed Feb 9 21:18:11 2011
@@ -1,4 +1,4 @@
-// Copyright 2007, 2010 The Apache Software Foundation
+// Copyright 2007, 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.
@@ -15,10 +15,10 @@
package org.apache.tapestry5.integration.app1.pages;
import org.apache.tapestry5.PersistenceConstants;
-import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.beaneditor.Validate;
import org.apache.tapestry5.corelib.ClientValidation;
import org.apache.tapestry5.corelib.components.BeanEditForm;
@@ -33,7 +33,7 @@ public class BeanEditorDemo
{ "clientValidation=prop:clientValidation" })
private BeanEditForm form;
- @ApplicationState
+ @SessionState
@Property
private RegistrationData registrationData;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorOverride.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorOverride.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorOverride.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/BeanEditorOverride.java Wed Feb 9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2008 The Apache Software Foundation
+// Copyright 2008, 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
+// 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,
@@ -14,8 +14,8 @@
package org.apache.tapestry5.integration.app1.pages;
-import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.Component;
+import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.corelib.components.BeanEditor;
import org.apache.tapestry5.corelib.components.Form;
import org.apache.tapestry5.integration.app1.data.RegistrationData;
@@ -25,10 +25,11 @@ public class BeanEditorOverride
@Component
private Form form;
- @Component(parameters = { "object=registrationData" })
+ @Component(parameters =
+ { "object=registrationData" })
private BeanEditor editor;
- @ApplicationState
+ @SessionState
private RegistrationData data;
public RegistrationData getRegistrationData()
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DateFieldAjaxFormLoop.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DateFieldAjaxFormLoop.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DateFieldAjaxFormLoop.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/DateFieldAjaxFormLoop.java Wed Feb 9 21:18:11 2011
@@ -1,10 +1,10 @@
-// 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.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// 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,
@@ -14,18 +14,18 @@
package org.apache.tapestry5.integration.app1.pages;
-import org.apache.tapestry5.PrimaryKeyEncoder;
-import org.apache.tapestry5.annotations.Persist;
-import org.apache.tapestry5.annotations.Property;
-import org.apache.tapestry5.integration.app1.data.DateHolder;
-import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
-import org.apache.tapestry5.util.DefaultPrimaryKeyEncoder;
-
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
+import org.apache.tapestry5.ValueEncoder;
+import org.apache.tapestry5.annotations.Persist;
+import org.apache.tapestry5.annotations.Property;
+import org.apache.tapestry5.func.F;
+import org.apache.tapestry5.integration.app1.data.DateHolder;
+import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
+
public class DateFieldAjaxFormLoop
{
@Persist
@@ -40,6 +40,24 @@ public class DateFieldAjaxFormLoop
database = CollectionFactory.newMap();
}
+ public ValueEncoder<DateHolder> getDateHolderEncoder()
+ {
+ return new ValueEncoder<DateHolder>()
+ {
+ public String toClient(DateHolder value)
+ {
+ return String.valueOf(value.getId());
+ }
+
+ public DateHolder toValue(String clientValue)
+ {
+ Integer key = new Integer(clientValue);
+
+ return database.get(key);
+ }
+
+ };
+ }
public List<DateHolder> getDateHolders()
{
@@ -56,19 +74,6 @@ public class DateFieldAjaxFormLoop
return result;
}
- public PrimaryKeyEncoder<Integer, DateHolder> getDateHolderConverter()
- {
- DefaultPrimaryKeyEncoder<Integer, DateHolder> result =
- new DefaultPrimaryKeyEncoder<Integer, DateHolder>(Integer.class);
-
- for (DateHolder dh : getDateHolders())
- {
- result.add(dh.getId(), dh);
- }
-
- return result;
- }
-
DateHolder onAddRowFromLoop()
{
DateHolder dh = new DateHolder();
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormInjectorDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormInjectorDemo.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormInjectorDemo.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/FormInjectorDemo.java Wed Feb 9 21:18:11 2011
@@ -1,10 +1,10 @@
-// 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.
// You may obtain a copy of the License at
//
-// http://www.apache.org/licenses/LICENSE-2.0
+// 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,
@@ -14,7 +14,13 @@
package org.apache.tapestry5.integration.app1.pages;
-import org.apache.tapestry5.PrimaryKeyEncoder;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.atomic.AtomicLong;
+
+import org.apache.tapestry5.ValueEncoder;
import org.apache.tapestry5.annotations.Log;
import org.apache.tapestry5.annotations.Persist;
import org.apache.tapestry5.annotations.Property;
@@ -22,12 +28,6 @@ import org.apache.tapestry5.integration.
import org.apache.tapestry5.ioc.internal.util.CollectionFactory;
import org.testng.Assert;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
-
public class FormInjectorDemo
{
private static final long DEMO_CONTEXT_VALUE = System.currentTimeMillis();
@@ -51,27 +51,21 @@ public class FormInjectorDemo
}
}
- public PrimaryKeyEncoder getEncoder()
+ public ValueEncoder<DoubleItem> getDoubleItemEncoder()
{
- return new PrimaryKeyEncoder<Long, DoubleItem>()
+ return new ValueEncoder<DoubleItem>()
{
- public Long toKey(DoubleItem value)
- {
- return value.getId();
- }
- public void prepareForKeys(List<Long> keys)
+ public DoubleItem toValue(String clientValue)
{
- }
+ Long key = new Long(clientValue);
- public DoubleItem toValue(Long key)
- {
return DB.get(key);
}
- public Class<Long> getKeyType()
+ public String toClient(DoubleItem value)
{
- return Long.class;
+ return String.valueOf(value.getId());
}
};
}
@@ -94,7 +88,7 @@ public class FormInjectorDemo
Object onAddRow(long context)
{
Assert.assertEquals(context, DEMO_CONTEXT_VALUE,
- "Context value provided to AjaxFormLoop must be provided to the event handler method.");
+ "Context value provided to AjaxFormLoop must be provided to the event handler method.");
DoubleItem item = new DoubleItem();
item.setId(ID_ALLOCATOR.incrementAndGet());
@@ -119,7 +113,6 @@ public class FormInjectorDemo
sum += item.getValue();
}
-
void onActionFromReset()
{
DB.clear();
@@ -133,6 +126,6 @@ public class FormInjectorDemo
void onActivate(String context)
{
Assert.assertEquals(context, "FakePageActivationContextValue",
- "Page activation context was not passed through correctly.");
+ "Page activation context was not passed through correctly.");
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiBeanDemoResult.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiBeanDemoResult.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiBeanDemoResult.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiBeanDemoResult.java Wed Feb 9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 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
+// 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,
@@ -14,16 +14,16 @@
package org.apache.tapestry5.integration.app1.pages;
-import org.apache.tapestry5.annotations.ApplicationState;
+import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.integration.app1.data.RolePath;
import org.apache.tapestry5.integration.app1.data.UserCredentials;
public class MultiBeanDemoResult
{
- @ApplicationState
+ @SessionState
private UserCredentials credentials;
- @ApplicationState
+ @SessionState
private RolePath rolePath;
public UserCredentials getCredentials()
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiBeanEditDemo.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiBeanEditDemo.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiBeanEditDemo.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/MultiBeanEditDemo.java Wed Feb 9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 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
+// 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,
@@ -14,19 +14,19 @@
package org.apache.tapestry5.integration.app1.pages;
-import org.apache.tapestry5.annotations.ApplicationState;
import org.apache.tapestry5.annotations.Component;
import org.apache.tapestry5.annotations.InjectPage;
+import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.corelib.components.Form;
import org.apache.tapestry5.integration.app1.data.RolePath;
import org.apache.tapestry5.integration.app1.data.UserCredentials;
public class MultiBeanEditDemo
{
- @ApplicationState
+ @SessionState
private UserCredentials credentials;
- @ApplicationState
+ @SessionState
private RolePath rolePath;
@InjectPage
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ShowBirthdayReminder.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ShowBirthdayReminder.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ShowBirthdayReminder.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ShowBirthdayReminder.java Wed Feb 9 21:18:11 2011
@@ -1,10 +1,10 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 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
+// 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,
@@ -14,12 +14,12 @@
package org.apache.tapestry5.integration.app1.pages;
-import org.apache.tapestry5.annotations.ApplicationState;
+import org.apache.tapestry5.annotations.SessionState;
import org.apache.tapestry5.integration.app1.data.BirthdayReminder;
public class ShowBirthdayReminder
{
- @ApplicationState
+ @SessionState
private BirthdayReminder reminder;
public BirthdayReminder getReminder()
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ToDoList.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ToDoList.java?rev=1069114&r1=1069113&r2=1069114&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ToDoList.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/pages/ToDoList.java Wed Feb 9 21:18:11 2011
@@ -4,7 +4,7 @@
// 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
+// 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,
@@ -14,31 +14,58 @@
package org.apache.tapestry5.integration.app1.pages;
-import org.apache.tapestry5.PrimaryKeyEncoder;
+import java.util.List;
+
+import org.apache.tapestry5.ValueEncoder;
import org.apache.tapestry5.annotations.Component;
+import org.apache.tapestry5.annotations.Property;
import org.apache.tapestry5.corelib.components.Form;
+import org.apache.tapestry5.func.F;
+import org.apache.tapestry5.func.Predicate;
import org.apache.tapestry5.integration.app1.data.ToDoItem;
import org.apache.tapestry5.integration.app1.services.ToDoDatabase;
import org.apache.tapestry5.ioc.annotations.Inject;
-import org.apache.tapestry5.util.DefaultPrimaryKeyEncoder;
-
-import java.util.List;
public class ToDoList
{
+ @Property
@Inject
private ToDoDatabase database;
- private ToDoItem item;
+ private List<ToDoItem> items;
- private DefaultPrimaryKeyEncoder<Long, ToDoItem> encoder;
+ private ToDoItem item;
@Component
private Form form;
+ public ValueEncoder<ToDoItem> getToDoItemEncoder()
+ {
+ return new ValueEncoder<ToDoItem>()
+ {
+ public ToDoItem toValue(String clientValue)
+ {
+ final long id = Long.parseLong(clientValue);
+
+ return F.flow(items).filter(new Predicate<ToDoItem>()
+ {
+ public boolean accept(ToDoItem element)
+ {
+ return element.getId() == id;
+ }
+ }).first();
+ }
+
+ public String toClient(ToDoItem value)
+ {
+ return String.valueOf(value.getId());
+ }
+ };
+ }
+
public List<ToDoItem> getItems()
{
- return encoder.getValues();
+ return items;
}
public ToDoItem getItem()
@@ -51,33 +78,16 @@ public class ToDoList
this.item = item;
}
- public ToDoDatabase getDatabase()
- {
- return database;
- }
-
- public PrimaryKeyEncoder getEncoder()
- {
- return encoder;
- }
-
void onPrepare()
{
- List<ToDoItem> items = database.findAll();
-
- encoder = new DefaultPrimaryKeyEncoder<Long, ToDoItem>(long.class);
-
- for (ToDoItem item : items)
- {
- encoder.add(item.getId(), item);
- }
+ items = database.findAll();
}
void onSuccess()
{
int order = 0;
- for (ToDoItem item : encoder.getValues())
+ for (ToDoItem item : items)
{
item.setOrder(order++);
database.update(item);
@@ -90,7 +100,7 @@ public class ToDoList
{
ToDoItem item = new ToDoItem();
item.setTitle("<New To Do>");
- item.setOrder(encoder.getValues().size());
+ item.setOrder(items.size());
database.add(item);
}