You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2008/02/05 20:14:20 UTC
svn commit: r618751 - in /tapestry/tapestry5/trunk: ./ src/site/
src/site/apt/dev/ support/ tapestry-core/src/main/java/org/apache/tapestry/
tapestry-core/src/main/java/org/apache/tapestry/corelib/components/
tapestry-core/src/main/java/org/apache/tape...
Author: hlship
Date: Tue Feb 5 11:14:05 2008
New Revision: 618751
URL: http://svn.apache.org/viewvc?rev=618751&view=rev
Log:
TAPESTRY-2076: Component report should break out as one class per page and include examples
Added:
tapestry/tapestry5/trunk/src/site/apt/dev/bible.apt
tapestry/tapestry5/trunk/support/idea-settings.jar (with props)
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/renderers/ComponentResourcesRenderer.java
- copied, changed from r617192, tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentResourcesRenderer.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/renderers/EventContextRenderer.java
- copied, changed from r617866, tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/EventContextRenderer.java
Removed:
tapestry/tapestry5/trunk/intellij-settings.jar
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentResourcesRenderer.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/EventContextRenderer.java
Modified:
tapestry/tapestry5/trunk/src/site/apt/dev/checklist.apt
tapestry/tapestry5/trunk/src/site/apt/dev/env.apt
tapestry/tapestry5/trunk/src/site/site.xml
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ComponentResourcesCommon.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/bindings/AssetBindingFactory.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AbstractIncludeAssetWorker.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetInjectionProvider.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetObjectProvider.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetSourceImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentDefaultProviderImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ContextValueEncoderImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageRenderSupportImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ValueEncoderSourceImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/AssetSource.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ClassTransformation.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentDefaultProvider.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentSource.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/Dispatcher.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ObjectRenderer.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ValueEncoderSource.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/TapestryTestCase.java
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanDisplay.xdoc
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.xdoc
tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/PageLink.xdoc
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetInjectionProviderTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetObjectProviderTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetSourceImplTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentDefaultProviderImplTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ContextValueEncoderImplTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageRenderSupportImplTest.java
Added: tapestry/tapestry5/trunk/src/site/apt/dev/bible.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/dev/bible.apt?rev=618751&view=auto
==============================================================================
--- tapestry/tapestry5/trunk/src/site/apt/dev/bible.apt (added)
+++ tapestry/tapestry5/trunk/src/site/apt/dev/bible.apt Tue Feb 5 11:14:05 2008
@@ -0,0 +1,216 @@
+ ----
+ Tapestry Developer's Bible
+ ----
+
+Tapestry Developer's Bible
+
+ This is a semi-random outpouring of thoughts related to being a Tapestry committer.
+
+IDE
+
+ <<IntelliJ>>. It's a free license for all committers and it's just better. You'll love it after the
+ first couple of days fumbling because you're so used to Eclipse bending you over and doing unspeakable things.
+
+ There are shared code formatting settings in <<<support/idea-settings.jar>>>. This will prevent
+ unexpected conflicts due to formatting.
+
+Copyrights
+
+ All source files should have a copyright comment on top, except where such a comment
+ would interfere with its behavior. For example, component template files omit the comment.
+
+ The year on the copyright should be updated as a file changes. As you are reviewing your changes
+ before checking them in, try to check the coyright date, and add the current year to the list if not
+ present.
+
+Commit Messages
+
+ Always provide a commit message. I generally try to work off the JIRA, so my commit message is often:
+
+----
+TAPESTRY-1234: Make the Foo Widget more Ajax-tastic!
+----
+
+ It is <<very important>> to include the JIRA issue id in the commit. This is used in many places:
+ JIRA links issues to the SVN commits for that issue (very handy for seeing what changed
+ as part of a bug fix). Bamboo (the continuous integration server) does something similar.
+
+JIRA Procedures
+
+ All Tapestry committers should be registerred with JIRA and part of the tapestry-developers JIRA group.
+
+ I work the following JIRA list:
+ {{{https://issues.apache.org/jira/secure/IssueNavigator.jspa?mode=hide&requestId=12311597}JIRA Work Queue}}.
+
+
+ Ideally, we would always work top priortity to low priority. I (Howard) sometimes jump out of order,
+ if there's something cool to work on that fits in an available time slot. Alternately, you are always
+ allowed to change the priority of a bug before or as you work it.
+
+* Starting work
+
+ When you start to work on an issue, make sure it is <<assigned to you>> and use the <<start progress>>
+ option.
+
+ I often add comments about the state of the fix, or the challenges. This often spurs the Issue's adder to
+ provide more details.
+
+ I often update the issue description to make it more legible and more precise, i.e., "NPE in CheckUpdates"
+ might become "NullPointerException when checking for updates to file that have been deleted". Verbose is good.
+
+* Closing bugs
+
+ Is it a bug fix without tests? <<No.>> In some cases, I write bugs to provide an issue is not valid and leave
+ the tests in place. A good plan is to write a test that fails then work the code until the test passes.
+ I'm also surprised by how often code works in a unit test but fails unexpectedly in an integration test.
+ As the G-Man says, <"Expect unforseen consequences">.
+
+ When you check in a fix, you should <<close>> the issue and make sure the <<fix release>> is correct.
+
+ We're playing fast and loose -- a better procedure would be to mark the bug resolved and verify
+ the fix before closing it. That's ok, we have a community to double check our work :-).
+
+ For anything non-trivial, wait for the Bamboo server to build. It catches a lot of things ... such as
+ files that were not added to SVN. And even IntelliJ has a bit of trouble with wildly refactored code.
+ Bamboo will catch all that.
+
+* Invalid issues and duplicates
+
+ Always provide comments about <why> an issue is invalid (<"A Ruby implementation of Tapestry is out of scope for the project.">),
+ or at least, a link to the duplicate issues.
+
+ Close the issue but <<make sure the fix release is blank>>. Otherwise, the issue <<will be listed
+ in the release notes>>, which we don't want.
+
+
+Public vs. Private/Internal
+
+ This is a real big deal. As long as code is in the internal package, we have a high degree of carte-blanche
+ to change it. As soon as code is public, we become handcuffed to backwards compatibility.
+
+ <<Interfaces are public, implementations are private>>. You can see this is the bulk of the code, where
+ org.apache.tapestry.services is almost all interfaces and the implementations are
+ in org.apache.tapestry.internal.services.
+
+ Many more services have both the interface and the implementation in org.apache.tapestry.internal.services.
+
+ We absolutely <<do not>> want to make Page or ComponentPageElement public. You will often see
+ public service facades that take a page name as a method parameter,
+ and convert it to a page instance before invoking methods
+ on internal services.
+
+Evolving Components
+
+ We do not have a specific plan for this yet. Future Tapestry 5 will add features to allow clean renames
+ of parameters, and a way to deprecated and eventually remove components.
+
+Code Style
+
+ Yes, I (Howard) use leading underscores for field names. I just prefer that to prefixing with <<<this.>>>, you don't
+ have to do so, but try to make your code blend in when modifying existing source.
+
+ Long ago, Tapestry code use the regrettable "leading-I-on-interfaces" style. Don't do that. Everythings an interface.
+
+ I prefer braces on a new line (and thus, open braces lined up with close braces), so that's what the default
+ code formatting is set up for. I sometimes omit braces for trivial if statements, such as <<<return;>>>. I use a lot
+ of vertical whitespace to break methods into logical sections.
+
+ We're coding Java, not Pascal; I'd much rather see a few checks early on with quick returns or exceptions than
+ have ten-levels deep block nesting just so a method can have a single return statement. In other words, <else
+ considered harmful>. Low code complexity is
+ better, more readable, more maintainable code.
+
+ I don't bother alphabetizing things, because I have an IDE that lets me jump around easily.
+
+ <<Final is the new private.>> Final fields are great for multi-threaded code. Especially when creating
+ service implementations with dependencies, store that dependencies into final fields. Once we're all running
+ on 100 core workstations, you'll thank me. Seriously, Java's memory model is seriously twisted stuff, and
+ assigning to a non-final field from a constructor opens up a tiny window of non-thread safety.
+
+Comments
+
+ Comments are overwhelmingly important. Try to capture the <why> of a class or method. Add lots
+ of links, to code that will be invoked by the method, to related methods or classes, and so forth.
+
+ Comment the <interfaces> and don't get worked up on the <implementations>. Javadoc does a perfectly
+ good job of copying interface comments to implementations, so this falls under the <Dont Repeat Yourself>
+ guideline.
+
+ Be very careful about documenting what methods can accept null, and what methods may return null.
+
+Class and Method Naming Conventions
+
+ Naming things is hard. Names that make sense to one person won't to another.
+
+ That being said, I've tried to be somewhat consistent with naming. Not perfectly.
+
+ [Factory, Creator]
+ A factory class creates new objects. Methods will often be prefixed with "create"
+ or "new". Don't expect a Factory to cache anything, it just creates new things.
+
+ [Source]
+ A source is a level up from a Factory. It <may> combine multiple factories together.
+ It <usually> will cache the result. Method are often prefixed with "get".
+
+ [Find vs. Get]
+ For methods: A "find" prefix indicates that a non-match is valid and null may be returned.
+ A "get" prefix indicates that a non-match is invalid and an exception will be thrown
+ in that case (and null will never be returned).
+
+ [Contribution]
+ A data object usually associated with a Tapestry IoC service's configuration.
+
+ [Filter]
+ Part of a pipeline, where there's an associated main interface,
+ and the Filter wraps around that main interface. Each main interface
+ method is duplicated in the Filter, with an extra parameter used
+ to chain the interface.
+
+ [Manager]
+ Often a wrapper around a service configuration, it provides access
+ to the contributed values (possibly after some transformation).
+
+ [To]
+ A method prefix that indicates a conversion or coersion from one type to another.
+
+ [Worker]
+ An object that peforms a specific job. Workers will be stateless, but will be passed
+ a stateful object to perform some operation upon.
+
+ [Builder]
+ An object whose job is to create other objects, typically in the context of
+ creating a core service implementation for a Tapestry IoC service (such as PipelineBuilder
+ or ChainBuilder).
+
+ [Support]
+ An object that provides supporting operations to other objects; this is a kind of "loose aggregation".
+
+ [Parameters]
+ An data object that holds a number of related values that would otherwise be seperate
+ parameter values to a method. This tends to streamline code (especially when using
+ a Filter interface) and allows the parameters to be changed without changing the method signature.
+
+ [Strategy]
+ An object that "plugs into" some other code, allowing certain decisions to be deferred
+ to the Strategy. Often a Strategy is selected based on the type of some object
+ being operated upon.
+
+ [Context]
+ Captures some stateful information that may be passed around between stateless services.
+
+ [Constants]
+ A non-instantiable class that contains public static fields that are referenced in multiple places.
+
+ [Hub]
+ An object that allows listeners to be registered. Often includes a method prefixed with "trigger"
+ that will send notifications to listeners.
+
+toString()
+
+ Objects that are exposed to user code should generally implement a meaningful toString() method.
+ And that method should be tested.
+
+
+
+
+
Modified: tapestry/tapestry5/trunk/src/site/apt/dev/checklist.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/dev/checklist.apt?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/src/site/apt/dev/checklist.apt (original)
+++ tapestry/tapestry5/trunk/src/site/apt/dev/checklist.apt Tue Feb 5 11:14:05 2008
@@ -176,6 +176,7 @@
> cd ~hlship/public_html/tapestry-ibiblio-rsynch-repository/
> rsync -av * /www/people.apache.org/repo/m2-ibiblio-rsync-repository
----
+
The aritfacts copied to m2-ibiblio-rsync-repository will (eventually) by copied to the central Maven ibiblio repository, where they will be
visible to every Maven user.
Modified: tapestry/tapestry5/trunk/src/site/apt/dev/env.apt
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/apt/dev/env.apt?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/src/site/apt/dev/env.apt (original)
+++ tapestry/tapestry5/trunk/src/site/apt/dev/env.apt Tue Feb 5 11:14:05 2008
@@ -8,16 +8,17 @@
Effectively, you should have the following tools:
- * Maven 2.0.7
+ * Maven 2.0.8
* Ant 1.7.0
- * Eclipse 3.3.0
+ * IDEA IntelliJ
+
+ []
+
+ IntelliJ is available to all Tapestry committers under their generous open-source policy. This is one of the
+ perks of being invited as a committer.
- * Eclipse Maven Plugin (install from http://m2eclipse.codehaus.org/) version 0.0.11
-
- * Version 0.0.11 is mandatory! Things will not work without it.
-
Builds
Tapestry 5 is built by Maven 2.
Modified: tapestry/tapestry5/trunk/src/site/site.xml
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/src/site/site.xml?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/src/site/site.xml (original)
+++ tapestry/tapestry5/trunk/src/site/site.xml Tue Feb 5 11:14:05 2008
@@ -75,6 +75,7 @@
<menu name="Developer Info">
<item name="Environment" href="dev/env.html"/>
<item name="Release Checklist" href="dev/checklist.html"/>
+ <item name="Bible" href="dev/bible.html"/>
</menu>
<menu ref="reports"/>
Added: tapestry/tapestry5/trunk/support/idea-settings.jar
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/support/idea-settings.jar?rev=618751&view=auto
==============================================================================
Binary file - no diff available.
Propchange: tapestry/tapestry5/trunk/support/idea-settings.jar
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ComponentResourcesCommon.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ComponentResourcesCommon.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ComponentResourcesCommon.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/ComponentResourcesCommon.java Tue Feb 5 11:14:05 2008
@@ -50,7 +50,7 @@
* <p/>
* This value is often used to obtain an equivalent component instance in a later request.
*
- * @see ComponentSource
+ * @see org.apache.tapestry.services.ComponentSource#getComponent(String)
*/
String getCompleteId();
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/RadioGroup.java Tue Feb 5 11:14:05 2008
@@ -66,9 +66,6 @@
private Environment _environment;
@Inject
- private ValueEncoderSource _valueEncoderSource;
-
- @Inject
private Request _request;
@Environmental
@@ -88,7 +85,7 @@
final ValueEncoder defaultEncoder()
{
- return _valueEncoderSource.getEncoderForParameter("value", _resources);
+ return _defaultProvider.defaultValueEncoder("value", _resources);
}
private static class Setup implements ComponentAction<RadioGroup>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/corelib/components/Select.java Tue Feb 5 11:14:05 2008
@@ -24,10 +24,7 @@
import org.apache.tapestry.internal.TapestryInternalUtils;
import org.apache.tapestry.internal.util.SelectModelRenderer;
import org.apache.tapestry.ioc.annotations.Inject;
-import org.apache.tapestry.services.FieldValidatorDefaultSource;
-import org.apache.tapestry.services.Request;
-import org.apache.tapestry.services.ValueEncoderFactory;
-import org.apache.tapestry.services.ValueEncoderSource;
+import org.apache.tapestry.services.*;
import org.apache.tapestry.util.EnumSelectModel;
import java.util.Locale;
@@ -69,6 +66,9 @@
private ValueEncoder _encoder;
@Inject
+ private ComponentDefaultProvider _defaultProvider;
+
+ @Inject
private FieldValidatorDefaultSource _fieldValidatorDefaultSource;
@Inject
@@ -105,9 +105,6 @@
private Object _value;
@Inject
- private ValueEncoderSource _valueEncoderSource;
-
- @Inject
private FieldValidationSupport _fieldValidationSupport;
@SuppressWarnings("unused")
@@ -163,7 +160,7 @@
@SuppressWarnings("unchecked")
ValueEncoder defaultEncoder()
{
- return _valueEncoderSource.getEncoderForParameter("value", _resources);
+ return _defaultProvider.defaultValueEncoder("value", _resources);
}
@SuppressWarnings("unchecked")
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/bindings/AssetBindingFactory.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/bindings/AssetBindingFactory.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/bindings/AssetBindingFactory.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/bindings/AssetBindingFactory.java Tue Feb 5 11:14:05 2008
@@ -90,7 +90,7 @@
{
Resource baseResource = container.getBaseResource();
- Asset asset = _source.findAsset(baseResource, expression, container.getLocale());
+ Asset asset = _source.getAsset(baseResource, expression, container.getLocale());
return new AssetBinding(description, asset, location);
}
Copied: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/renderers/ComponentResourcesRenderer.java (from r617192, tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentResourcesRenderer.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/renderers/ComponentResourcesRenderer.java?p2=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/renderers/ComponentResourcesRenderer.java&p1=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentResourcesRenderer.java&r1=617192&r2=618751&rev=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentResourcesRenderer.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/renderers/ComponentResourcesRenderer.java Tue Feb 5 11:14:05 2008
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package org.apache.tapestry.internal.services;
+package org.apache.tapestry.internal.renderers;
import org.apache.tapestry.ComponentResources;
import org.apache.tapestry.MarkupWriter;
Copied: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/renderers/EventContextRenderer.java (from r617866, tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/EventContextRenderer.java)
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/renderers/EventContextRenderer.java?p2=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/renderers/EventContextRenderer.java&p1=tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/EventContextRenderer.java&r1=617866&r2=618751&rev=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/EventContextRenderer.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/renderers/EventContextRenderer.java Tue Feb 5 11:14:05 2008
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-package org.apache.tapestry.internal.services;
+package org.apache.tapestry.internal.renderers;
import org.apache.tapestry.EventContext;
import org.apache.tapestry.MarkupWriter;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AbstractIncludeAssetWorker.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AbstractIncludeAssetWorker.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AbstractIncludeAssetWorker.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AbstractIncludeAssetWorker.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -72,7 +72,7 @@
for (String assetPath : paths)
{
- Asset asset = _assetSource.findAsset(model.getBaseResource(), assetPath, locale);
+ Asset asset = _assetSource.getAsset(model.getBaseResource(), assetPath, locale);
handleAsset(asset);
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetInjectionProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetInjectionProvider.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetInjectionProvider.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetInjectionProvider.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -57,7 +57,7 @@
String resourcesFieldName = transformation.getResourcesFieldName();
- String statement = format("%s = (%s) %s.findAsset(%s, \"%s\", %s.getLocale());", fieldName, fieldType.getName(),
+ String statement = format("%s = (%s) %s.getAsset(%s, \"%s\", %s.getLocale());", fieldName, fieldType.getName(),
sourceFieldName, baseResourceFieldName, expanded, resourcesFieldName);
transformation.extendConstructor(statement);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetObjectProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetObjectProvider.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetObjectProvider.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetObjectProvider.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -63,7 +63,7 @@
String expanded = _symbolSource.expandSymbols(path.value());
- Asset asset = _source.findAsset(null, expanded, null);
+ Asset asset = _source.getAsset(null, expanded, null);
return _typeCoercer.coerce(asset, objectType);
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetSourceImpl.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetSourceImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/AssetSourceImpl.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2008 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.
@@ -69,10 +69,10 @@
public Asset getClasspathAsset(String path, Locale locale)
{
- return findAsset(null, path, locale);
+ return getAsset(null, path, locale);
}
- public Asset findAsset(Resource baseResource, String path, Locale locale)
+ public Asset getAsset(Resource baseResource, String path, Locale locale)
{
notBlank(path, "path");
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentDefaultProviderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentDefaultProviderImpl.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentDefaultProviderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ComponentDefaultProviderImpl.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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,12 +17,16 @@
import org.apache.tapestry.Binding;
import org.apache.tapestry.ComponentResources;
import org.apache.tapestry.TapestryConstants;
+import org.apache.tapestry.ValueEncoder;
import org.apache.tapestry.internal.TapestryInternalUtils;
import org.apache.tapestry.ioc.Messages;
+import static org.apache.tapestry.ioc.internal.util.Defense.notBlank;
+import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
import org.apache.tapestry.ioc.services.PropertyAccess;
import org.apache.tapestry.runtime.Component;
import org.apache.tapestry.services.BindingSource;
import org.apache.tapestry.services.ComponentDefaultProvider;
+import org.apache.tapestry.services.ValueEncoderSource;
public class ComponentDefaultProviderImpl implements ComponentDefaultProvider
{
@@ -30,14 +34,20 @@
private final BindingSource _bindingSource;
- public ComponentDefaultProviderImpl(PropertyAccess propertyAccess, BindingSource bindingSource)
+ private final ValueEncoderSource _valueEncoderSource;
+
+ public ComponentDefaultProviderImpl(PropertyAccess propertyAccess, BindingSource bindingSource,
+ ValueEncoderSource valueEncoderSource)
{
_propertyAccess = propertyAccess;
_bindingSource = bindingSource;
+ _valueEncoderSource = valueEncoderSource;
}
public String defaultLabel(ComponentResources resources)
{
+ notNull(resources, "resources");
+
String componentId = resources.getId();
String key = componentId + "-label";
@@ -48,11 +58,14 @@
return TapestryInternalUtils.toUserPresentable(componentId);
}
- public Binding defaultBinding(String parameterName, ComponentResources componentResources)
+ public Binding defaultBinding(String parameterName, ComponentResources resources)
{
- String componentId = componentResources.getId();
+ notBlank(parameterName, "parameterName");
+ notNull(resources, "resources");
- Component container = componentResources.getContainer();
+ String componentId = resources.getId();
+
+ Component container = resources.getContainer();
// Only provide a default binding if the container actually contains the property.
// This sets up an error condition for when the parameter is not bound, and
@@ -61,12 +74,24 @@
if (_propertyAccess.getAdapter(container).getPropertyAdapter(componentId) == null)
return null;
- ComponentResources containerResources = componentResources.getContainerResources();
+ ComponentResources containerResources = resources.getContainerResources();
return _bindingSource.newBinding(
"default " + parameterName,
containerResources,
TapestryConstants.PROP_BINDING_PREFIX,
componentId);
+ }
+
+ public ValueEncoder defaultValueEncoder(String parameterName, ComponentResources resources)
+ {
+ notBlank(parameterName, "parameterName");
+ notNull(resources, "resources");
+
+ Class parameterType = resources.getBoundType(parameterName);
+
+ if (parameterType == null) return null;
+
+ return _valueEncoderSource.getValueEncoder(parameterType);
}
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ContextValueEncoderImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ContextValueEncoderImpl.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ContextValueEncoderImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ContextValueEncoderImpl.java Tue Feb 5 11:14:05 2008
@@ -32,7 +32,7 @@
{
Defense.notNull(value, "value");
- ValueEncoder encoder = _valueEncoderSource.getEncoderForType(value.getClass());
+ ValueEncoder encoder = _valueEncoderSource.getValueEncoder(value.getClass());
return encoder.toClient(value);
}
@@ -42,7 +42,7 @@
{
Defense.notNull(requiredType, "requiredType");
- ValueEncoder<T> encoder = _valueEncoderSource.getEncoderForType(requiredType);
+ ValueEncoder<T> encoder = _valueEncoderSource.getValueEncoder(requiredType);
return encoder.toValue(clientValue);
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageRenderSupportImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageRenderSupportImpl.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageRenderSupportImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/PageRenderSupportImpl.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2008 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.
@@ -86,7 +86,7 @@
{
String expanded = _symbolSource.expandSymbols(path);
- Asset asset = _assetSource.findAsset(null, expanded, null);
+ Asset asset = _assetSource.getAsset(null, expanded, null);
_builder.addScriptLink(asset.toClientURL());
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ValueEncoderSourceImpl.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ValueEncoderSourceImpl.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ValueEncoderSourceImpl.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/internal/services/ValueEncoderSourceImpl.java Tue Feb 5 11:14:05 2008
@@ -14,13 +14,10 @@
package org.apache.tapestry.internal.services;
-import org.apache.tapestry.ComponentResources;
import org.apache.tapestry.ValueEncoder;
import org.apache.tapestry.internal.events.InvalidationListener;
import org.apache.tapestry.ioc.internal.util.CollectionFactory;
import org.apache.tapestry.ioc.internal.util.Defense;
-import static org.apache.tapestry.ioc.internal.util.Defense.notBlank;
-import static org.apache.tapestry.ioc.internal.util.Defense.notNull;
import org.apache.tapestry.ioc.util.StrategyRegistry;
import org.apache.tapestry.services.ValueEncoderFactory;
import org.apache.tapestry.services.ValueEncoderSource;
@@ -38,21 +35,8 @@
_registry = StrategyRegistry.newInstance(ValueEncoderFactory.class, configuration);
}
- @SuppressWarnings("unchecked")
- public ValueEncoder getEncoderForParameter(String parameterName, ComponentResources resources)
- {
- notBlank(parameterName, "parameterName");
- notNull(resources, "resources");
-
- Class parameterType = resources.getBoundType(parameterName);
-
- if (parameterType == null) return null;
-
- return getEncoderForType(parameterType);
- }
-
@SuppressWarnings({"unchecked"})
- public <T> ValueEncoder<T> getEncoderForType(Class<T> type)
+ public <T> ValueEncoder<T> getValueEncoder(Class<T> type)
{
Defense.notNull(type, "type");
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/AssetSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/AssetSource.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/AssetSource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/AssetSource.java Tue Feb 5 11:14:05 2008
@@ -43,8 +43,9 @@
* @param path relative to the base resource
* @param locale locale to localize the final resource to, or null for the thread's current locale
* @return the asset
+ * @throws RuntimeException if the asset can not be found
*/
- Asset findAsset(Resource baseResource, String path, Locale locale);
+ Asset getAsset(Resource baseResource, String path, Locale locale);
/**
* Convienience for finding assets on the classpath.
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ClassTransformation.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ClassTransformation.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ClassTransformation.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ClassTransformation.java Tue Feb 5 11:14:05 2008
@@ -39,7 +39,7 @@
* <p/>
* Instances of this class are not designed to be thread safe, access to an instance should be restricted to a single
* thread. In fact, the design of this type is to allow stateless singletons in multiple threads to work on
- * thread-specific data (within the ClassTransformation). *
+ * thread-specific data (within the ClassTransformation).
* <p/>
* The majority of methods concern the <em>declared</em> members (field and methods) of a specific class, rather than
* any fields or methods inherited from a base class.
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentDefaultProvider.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentDefaultProvider.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentDefaultProvider.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentDefaultProvider.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -14,14 +14,11 @@
package org.apache.tapestry.services;
-import org.apache.tapestry.Binding;
-import org.apache.tapestry.ComponentResources;
-import org.apache.tapestry.ComponentResourcesCommon;
-import org.apache.tapestry.Field;
+import org.apache.tapestry.*;
/**
* A service that can be injected into a component to provide common defaults for various
- * parameters.
+ * types of parameters.
*/
public interface ComponentDefaultProvider
{
@@ -44,4 +41,14 @@
* @return the binding, or null if the container does not have a matching property
*/
Binding defaultBinding(String parameterName, ComponentResources resources);
+
+ /**
+ * Gets or creates a value encoder based on the <em>type</em> of the named parameter. ValueEncoders are cached based on type.
+ *
+ * @param parameterName the name of the parameter whose type is used to locate a {@link org.apache.tapestry.services.ValueEncoderFactory}
+ * @param resources the resources of the component, from which parameter and its type are extracted
+ * @return the value encoder, or null if the type of the parameter is not known
+ */
+ ValueEncoder defaultValueEncoder(String parameterName, ComponentResources resources);
+
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentSource.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentSource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ComponentSource.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2008 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -19,7 +19,7 @@
/**
* Used by classes that need to retrieve a component by its complete id, or a page by its logical
- * page name or root component class. The complete id is the FQCN of the containing page, a colon,
+ * page name or root component class. The complete id is the logical name of the containing page, a colon,
* and the nested component id. It may also just be the page name (for the root component of a
* page).
*/
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/Dispatcher.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/Dispatcher.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/Dispatcher.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/Dispatcher.java Tue Feb 5 11:14:05 2008
@@ -20,10 +20,7 @@
* A dispatcher is responsible for recognizing an incoming request. Dispatchers form an ordered chain of command, with
* each dispatcher responsible for recognizing requests that it can process.
*
- * @see org.apache.tapestry.services.TapestryModule#contributeMasterDispatcher(org.apache.tapestry.ioc.OrderedConfiguration,
- * ClasspathAssetAliasManager, org.apache.tapestry.internal.services.ResourceCache,
- * org.apache.tapestry.internal.services.ResourceStreamer, PageRenderRequestHandler, ComponentEventRequestHandler ,
- * ComponentClassResolver, String)
+ * @see org.apache.tapestry.services.TapestryModule#contributeMasterDispatcher(org.apache.tapestry.ioc.OrderedConfiguration, ClasspathAssetAliasManager, org.apache.tapestry.internal.services.ResourceCache, org.apache.tapestry.internal.services.ResourceStreamer, PageRenderRequestHandler, ComponentEventRequestHandler, ComponentClassResolver, ContextValueEncoder, String)
*/
public interface Dispatcher
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ObjectRenderer.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ObjectRenderer.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ObjectRenderer.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ObjectRenderer.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -18,7 +18,7 @@
/**
* A strategy interface used for converting an object into markup that describes that object. This
- * is primarily used in terms of an {@link ExceptionReporter} page.
+ * is primarily used in terms of an {@link org.apache.tapestry.services.ExceptionReporter} page.
*/
public interface ObjectRenderer<T>
{
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/TapestryModule.java Tue Feb 5 11:14:05 2008
@@ -26,8 +26,7 @@
import org.apache.tapestry.internal.events.InvalidationListener;
import org.apache.tapestry.internal.grid.CollectionGridDataSource;
import org.apache.tapestry.internal.grid.NullDataSource;
-import org.apache.tapestry.internal.renderers.ListRenderer;
-import org.apache.tapestry.internal.renderers.ObjectArrayRenderer;
+import org.apache.tapestry.internal.renderers.*;
import org.apache.tapestry.internal.services.*;
import org.apache.tapestry.internal.structure.PageResourcesSource;
import org.apache.tapestry.internal.structure.PageResourcesSourceImpl;
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ValueEncoderSource.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ValueEncoderSource.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ValueEncoderSource.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/services/ValueEncoderSource.java Tue Feb 5 11:14:05 2008
@@ -23,19 +23,10 @@
public interface ValueEncoderSource
{
/**
- * Gets or creates a value encoder based on the <em>type</em> of the named parameter. ValueEncoders are cached based on type.
- *
- * @param parameterName the name of the parameter whose type is used to locate a {@link org.apache.tapestry.services.ValueEncoderFactory}
- * @param resources the resources of the component, from which parameter and its type are extracted
- * @return the value encoder, or null if the type of the parameter is not known
- */
- ValueEncoder getEncoderForParameter(String parameterName, ComponentResources resources);
-
- /**
* Gets or creates a value encoder for the indicated type. ValueEncoders are cached.
*
* @param type type of value to be encoded and decoded
* @return the value encoder
*/
- <T> ValueEncoder<T> getEncoderForType(Class<T> type);
+ <T> ValueEncoder<T> getValueEncoder(Class<T> type);
}
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/TapestryTestCase.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/TapestryTestCase.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/TapestryTestCase.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry/test/TapestryTestCase.java Tue Feb 5 11:14:05 2008
@@ -392,9 +392,9 @@
transformation.extendMethod(eq(signature), codeEq(join(body)));
}
- protected final void train_findAsset(AssetSource source, Resource root, String path, Locale locale, Asset asset)
+ protected final void train_getAsset(AssetSource source, Resource root, String path, Locale locale, Asset asset)
{
- expect(source.findAsset(root, path, locale)).andReturn(asset);
+ expect(source.getAsset(root, path, locale)).andReturn(asset);
}
protected final void train_findFieldsWithAnnotation(ClassTransformation transformation,
@@ -1024,9 +1024,9 @@
expect(valueEncoder.toClient(value)).andReturn(encoded);
}
- protected final void train_getEncoderForType(ValueEncoderSource source, Class type, ValueEncoder valueEncoder)
+ protected final void train_getValueEncoder(ValueEncoderSource source, Class type, ValueEncoder valueEncoder)
{
- expect(source.getEncoderForType(type)).andReturn(valueEncoder).atLeastOnce();
+ expect(source.getValueEncoder(type)).andReturn(valueEncoder).atLeastOnce();
}
protected final void train_toValue(ValueEncoder valueEncoder, String clientValue, Object value)
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanDisplay.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanDisplay.xdoc?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanDisplay.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/BeanDisplay.xdoc Tue Feb 5 11:14:05 2008
@@ -154,7 +154,7 @@
<p>
Please refer to the
<a href="PageLink.html">PageLink</a>
- component documentation for an alternate way to manage _user field.
+ component documentation for an alternate way to manage the _user field.
</p>
</section>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.xdoc?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/Grid.xdoc Tue Feb 5 11:14:05 2008
@@ -256,6 +256,52 @@
</p>
+ <subsection name="CSS">
+
+ <p>The Grid component is designed to be customized via CSS. As it renders <th>, <tr> and
+ <td> elements,
+ it generates CSS class attributes for each element. You can then add customized CSS rules, even
+ overriding the Tapestry defaults,
+ to present the Grid as desired.
+ </p>
+
+ <dl>
+ <dt><em>propertyId</em>-header
+ </dt>
+ <dd>Added to <th> elements to allow customization of a particular column's header.</dd>
+
+ <dt><em>propertyId</em>-cell
+ </dt>
+ <dd>Added to <td> elements to allow customization of a particular column's data cells.</dd>
+
+ <dt>t-first</dt>
+ <dd>Added to the first <th> and the first <tr> of the <tbody> (the data portion of
+ the table).
+ </dd>
+
+ <dt>t-last</dt>
+ <dd>Added to the last <th> and the last <tr>.</dd>
+
+ <dt>t-sort-column-ascending</dt>
+ <dd>Added to the <th> and all corresponding <td> elements for the column that is the
+ current sort column (if any,
+ for ascending sort).
+ </dd>
+
+ <dt>t-sort-column-descending</dt>
+ <dd>As with t-soft-column-ascending, but for a descending sort.</dd>
+
+ </dl>
+
+ <p>
+ The added CSS classes can get quite verbose; the Grid's lean parameter allows the first two CSS
+ class attribute values
+ (the two related to the property for a column) to be omitted. Even in lean mode, the other
+ CSS class attribute values are rendered.
+ </p>
+
+ </subsection>
+
</section>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/PageLink.xdoc
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/PageLink.xdoc?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/PageLink.xdoc (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/resources/org/apache/tapestry/corelib/components/PageLink.xdoc Tue Feb 5 11:14:05 2008
@@ -78,7 +78,7 @@
Rendering out the User object, using a
<a href="BeanDisplay.html">BeanDisplay</a>
component, is easy, and the template doesn't have to know or
- care about the context, it just reads the user property.
+ care about the page activation context; it just reads the user property.
</p>
</subsection>
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetInjectionProviderTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetInjectionProviderTest.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetInjectionProviderTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetInjectionProviderTest.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -83,7 +83,7 @@
// tests for that.
ct
- .extendConstructor("myField = (java.lang.Object) as.findAsset(br, \"foo.gif\", rez.getLocale());");
+ .extendConstructor("myField = (java.lang.Object) as.getAsset(br, \"foo.gif\", rez.getLocale());");
ct.makeReadOnly(fieldName);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetObjectProviderTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetObjectProviderTest.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetObjectProviderTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetObjectProviderTest.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -64,7 +64,7 @@
train_getAnnotation(annotationProvider, Path.class, pathAnnotation);
train_value(pathAnnotation, path);
train_expandSymbols(symbolSource, path, expanded);
- train_findAsset(source, null, expanded, null, asset);
+ train_getAsset(source, null, expanded, null, asset);
train_coerce(typeCoercer, asset, Asset.class, asset);
replay();
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetSourceImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetSourceImplTest.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetSourceImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/AssetSourceImplTest.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2008 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.
@@ -55,11 +55,11 @@
// First try creates it:
- assertSame(source.findAsset(_baseResource, "SimpleComponent.properties", Locale.UK), asset);
+ assertSame(source.getAsset(_baseResource, "SimpleComponent.properties", Locale.UK), asset);
// Second try shows that it is cached
- assertSame(source.findAsset(_baseResource, "SimpleComponent.properties", Locale.UK), asset);
+ assertSame(source.getAsset(_baseResource, "SimpleComponent.properties", Locale.UK), asset);
verify();
}
@@ -142,14 +142,14 @@
AssetSource source = new AssetSourceImpl(threadLocale, configuration);
- assertSame(source.findAsset(
+ assertSame(source.getAsset(
_baseResource,
"classpath:org/apache/tapestry/internal/services/SimpleComponent.properties",
Locale.UK), asset);
// Check that a leading slash is not a problem:
- assertSame(source.findAsset(
+ assertSame(source.getAsset(
_baseResource,
"classpath:/org/apache/tapestry/internal/services/SimpleComponent.properties",
Locale.UK), asset);
@@ -170,7 +170,7 @@
try
{
- source.findAsset(
+ source.getAsset(
_baseResource,
"classpath:org/apache/tapestry/internal/services/SimpleComponent.properties",
Locale.UK);
@@ -199,7 +199,7 @@
try
{
- source.findAsset(_baseResource, "DoesNotExist.properties", Locale.UK);
+ source.getAsset(_baseResource, "DoesNotExist.properties", Locale.UK);
unreachable();
}
catch (RuntimeException ex)
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentDefaultProviderImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentDefaultProviderImplTest.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentDefaultProviderImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ComponentDefaultProviderImplTest.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -48,7 +48,7 @@
replay();
- ComponentDefaultProvider provider = new ComponentDefaultProviderImpl(null, null);
+ ComponentDefaultProvider provider = new ComponentDefaultProviderImpl(null, null, null);
assertSame(provider.defaultLabel(resources), message);
@@ -72,7 +72,7 @@
replay();
- ComponentDefaultProvider provider = new ComponentDefaultProviderImpl(null, null);
+ ComponentDefaultProvider provider = new ComponentDefaultProviderImpl(null, null, null);
assertEquals(provider.defaultLabel(resources), "My Field");
@@ -100,7 +100,7 @@
replay();
- ComponentDefaultProvider source = new ComponentDefaultProviderImpl(access, bindingSource);
+ ComponentDefaultProvider source = new ComponentDefaultProviderImpl(access, bindingSource, null);
assertNull(source.defaultBinding(parameterName, resources));
@@ -141,7 +141,7 @@
replay();
- ComponentDefaultProvider source = new ComponentDefaultProviderImpl(access, bindingSource);
+ ComponentDefaultProvider source = new ComponentDefaultProviderImpl(access, bindingSource, null);
assertSame(source.defaultBinding(parameterName, resources), binding);
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ContextValueEncoderImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ContextValueEncoderImplTest.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ContextValueEncoderImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/ContextValueEncoderImplTest.java Tue Feb 5 11:14:05 2008
@@ -32,7 +32,7 @@
String encoded = "twentythree";
- train_getEncoderForType(source, Long.class, valueEncoder);
+ train_getValueEncoder(source, Long.class, valueEncoder);
train_toClient(valueEncoder, value, encoded);
replay();
@@ -55,7 +55,7 @@
String clientValue = "twentythree";
- train_getEncoderForType(source, Long.class, valueEncoder);
+ train_getValueEncoder(source, Long.class, valueEncoder);
train_toValue(valueEncoder, clientValue, value);
replay();
Modified: tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageRenderSupportImplTest.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageRenderSupportImplTest.java?rev=618751&r1=618750&r2=618751&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageRenderSupportImplTest.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry/internal/services/PageRenderSupportImplTest.java Tue Feb 5 11:14:05 2008
@@ -1,4 +1,4 @@
-// Copyright 2007 The Apache Software Foundation
+// Copyright 2007, 2008 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.
@@ -61,7 +61,7 @@
SymbolSource symbolSource = mockSymbolSource();
train_expandSymbols(symbolSource, CORE_ASSET_PATH_UNEXPANDED, CORE_ASSET_PATH);
- train_findAsset(assetSource, null, CORE_ASSET_PATH, null, coreAsset);
+ train_getAsset(assetSource, null, CORE_ASSET_PATH, null, coreAsset);
train_toClientURL(coreAsset, CORE_ASSET_URL);
builder.addScriptLink(CORE_ASSET_URL);
@@ -108,7 +108,7 @@
train_expandSymbols(source, path, expanded);
- train_findAsset(assetSource, null, expanded, null, asset);
+ train_getAsset(assetSource, null, expanded, null, asset);
train_toClientURL(asset, ASSET_URL);
builder.addScriptLink(ASSET_URL);
Re: svn commit: r618751 - in /tapestry/tapestry5/trunk: ./ src/site/ src/site/apt/dev/ support/ tapestry-core/src/main/java/org/apache/tapestry/ tapestry-core/src/main/java/org/apache/tapestry/corelib/components/ tapestry-core/src/main/java/org/apache/tape...
Posted by Robert Zeigler <ro...@scazdl.org>.
> +* Closing bugs
> +
> + Is it a bug fix without tests? <<No.>> In some cases, I write
> bugs to provide an issue is not valid and leave
>
Pretty sure you meant:
"In some cases I write tests to prove an issues is not valid..."
I hope you don't write bugs to provide an issue. ;)
Robert
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org