Author: hlship
Date: Mon Jan 12 14:11:02 2009
New Revision: 733928
URL: http://svn.apache.org/viewvc?rev=733928&view=rev
Log:
TAP5-448: Assets should no longer attempt to generate relative URIs
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ClasspathAssetAliasManagerImpl.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ContextAssetFactory.java
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/TapestryModule.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ClasspathAssetAliasManagerImplTest.java
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ContextAssetFactoryTest.java
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ClasspathAssetAliasManagerImpl.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ClasspathAssetAliasManagerImpl.java?rev=733928&r1=733927&r2=733928&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ClasspathAssetAliasManagerImpl.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ClasspathAssetAliasManagerImpl.java
Mon Jan 12 14:11:02 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2009 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -27,8 +27,6 @@
{
private final Request request;
- private final RequestPathOptimizer optimizer;
-
/**
* Map from alias to path.
*/
@@ -49,12 +47,9 @@
*/
public ClasspathAssetAliasManagerImpl(Request request,
- RequestPathOptimizer optimizer,
-
Map<String, String> configuration)
{
this.request = request;
- this.optimizer = optimizer;
for (Map.Entry<String, String> e : configuration.entrySet())
{
@@ -90,13 +85,6 @@
public String toClientURL(String resourcePath)
{
- String path = toCompleteClientURI(resourcePath);
-
- return optimizer.optimizePath(path);
- }
-
- private String toCompleteClientURI(String resourcePath)
- {
StringBuilder builder = new StringBuilder(request.getContextPath());
builder.append(RequestConstants.ASSET_PATH_PREFIX);
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ContextAssetFactory.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ContextAssetFactory.java?rev=733928&r1=733927&r2=733928&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ContextAssetFactory.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/internal/services/ContextAssetFactory.java
Mon Jan 12 14:11:02 2009
@@ -32,22 +32,16 @@
{
private final Request request;
- private final Context context;
-
- private final RequestPathOptimizer optimizer;
-
private final String pathPrefix;
private final Resource rootResource;
- public ContextAssetFactory(Request request, Context context,
RequestPathOptimizer optimizer,
+ public ContextAssetFactory(Request request, Context context,
@Inject
@Symbol(SymbolConstants.APPLICATION_VERSION)
String applicationVersion)
{
this.request = request;
- this.context = context;
- this.optimizer = optimizer;
pathPrefix = RequestConstants.ASSET_PATH_PREFIX +
RequestConstants.APP_FOLDER
+ applicationVersion + "/";
@@ -57,7 +51,7 @@
public Asset createAsset(final Resource resource)
{
- final String contextPath = request.getContextPath() + pathPrefix +
resource.getPath();
+ final String completePath = request.getContextPath() + pathPrefix +
resource.getPath();
return new Asset()
{
@@ -68,7 +62,7 @@
public String toClientURL()
{
- return optimizer.optimizePath(contextPath);
+ return completePath;
}
/**
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=733928&r1=733927&r2=733928&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
Mon Jan 12 14:11:02 2009
@@ -99,8 +99,8 @@
/**
* We inject all sorts of common dependencies (including builders) into
the module itself (note: even though some of
* these service are defined by the module itself, that's ok because
services are always lazy proxies). This isn't
- * about efficiency (it may be slightly more efficient, but not in any
noticable way), it's about eliminating the need
- * to keep injecting these dependencies into invividual service builder
and contribution methods.
+ * about efficiency (it may be slightly more efficient, but not in any
noticable way), it's about eliminating the
+ * need to keep injecting these dependencies into invividual service
builder and contribution methods.
*/
public TapestryModule(PipelineBuilder pipelineBuilder,
@@ -297,9 +297,9 @@
* their values between requests</dd> <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>
<dt>Component </dt> <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>
<dt>Inject </dt> <dd>Used with the {...@link
+ * 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> <dt>Inject </dt> <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
@@ -307,17 +307,18 @@
* <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>SupportsInformalParameters </dt> <dd>Checks for the
annotation</dd> <dt>Meta </dt> <dd>Checks
- * for meta data and adds it to the component model</dd>
<dt>ApplicationState </dt> <dd>Converts fields that reference
- * application state objects <dt>UnclaimedField </dt> <dd>Identifies
unclaimed fields and resets them to null/0/false
- * at the end of the request</dd> <dt>RenderCommand </dt> <dd>Ensures all
components also implement {...@link
- * org.apache.tapestry5.runtime.RenderCommand}</dd> <dt>SetupRender,
BeginRender, etc. </dt> <dd>Correspond to
- * component render phases and annotations</dd>
<dt>InvokePostRenderCleanupOnResources </dt> <dd>Makes sure {...@link
- *
org.apache.tapestry5.internal.InternalComponentResources#postRenderCleanup()}
is invoked after a component finishes
- * rendering</dd> <dt>Secure</dt> <dd>Checks for the {...@link
org.apache.tapestry5.annotations.Secure} annotation</dd>
- * <dt>ContentType</dt> <dd>Checks for {...@link
org.apache.tapestry5.annotations.ContentType} annotation</dd>
- * <dt>GenerateAccessors</dt> <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> <dd>Checks for the {...@link
org.apache.tapestry5.annotations.Log} annotation</dd></dl>
+ * for meta data and adds it to the component model</dd>
<dt>ApplicationState </dt> <dd>Converts fields that
+ * reference application state objects <dt>UnclaimedField </dt>
<dd>Identifies unclaimed fields and resets them to
+ * null/0/false at the end of the request</dd> <dt>RenderCommand </dt>
<dd>Ensures all components also implement
+ * {...@link org.apache.tapestry5.runtime.RenderCommand}</dd>
<dt>SetupRender, BeginRender, etc. </dt> <dd>Correspond
+ * to component render phases and annotations</dd>
<dt>InvokePostRenderCleanupOnResources </dt> <dd>Makes sure
+ * {...@link
org.apache.tapestry5.internal.InternalComponentResources#postRenderCleanup()}
is invoked after a component
+ * finishes rendering</dd> <dt>Secure</dt> <dd>Checks for the {...@link
org.apache.tapestry5.annotations.Secure}
+ * annotation</dd> <dt>ContentType</dt> <dd>Checks for {...@link
org.apache.tapestry5.annotations.ContentType}
+ * annotation</dd> <dt>GenerateAccessors</dt> <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>
<dd>Checks for the {...@link
+ * org.apache.tapestry5.annotations.Log} annotation</dd></dl>
*/
public static void contributeComponentClassTransformWorker(
OrderedConfiguration<ComponentClassTransformWorker> configuration,
@@ -407,8 +408,8 @@
/**
* <dl> <dt>Annotation</dt> <dd>Checks for {...@link
org.apache.tapestry5.beaneditor.DataType} annotation</dd>
- * <dt>Default (ordered last)</dt> <dd>{...@link
org.apache.tapestry5.internal.services.DefaultDataTypeAnalyzer} service
- * ({...@link
#contributeDefaultDataTypeAnalyzer(org.apache.tapestry5.ioc.MappedConfiguration)}
})</dd> </dl>
+ * <dt>Default (ordered last)</dt> <dd>{...@link
org.apache.tapestry5.internal.services.DefaultDataTypeAnalyzer}
+ * service ({...@link
#contributeDefaultDataTypeAnalyzer(org.apache.tapestry5.ioc.MappedConfiguration)}
})</dd> </dl>
*/
public static void
contributeDataTypeAnalyzer(OrderedConfiguration<DataTypeAnalyzer> configuration,
@InjectService("DefaultDataTypeAnalyzer")
@@ -480,8 +481,8 @@
}
/**
- * Contributes the basic set of validators: <ul> <li>required</li>
<li>minlength</li> <li>maxlength</li> <li>min</li>
- * <li>max</li> <li>regexp</li> </ul>
+ * Contributes the basic set of validators: <ul> <li>required</li>
<li>minlength</li> <li>maxlength</li>
+ * <li>min</li> <li>max</li> <li>regexp</li> </ul>
*/
public static void
contributeFieldValidatorSource(MappedConfiguration<String, Validator>
configuration)
{
@@ -498,9 +499,9 @@
* Contributes the base set of injection providers: <dl> <dt>Default</dt>
<dd>based on {...@link
* MasterObjectProvider}</dd> <dt>Block</dt> <dd>injects fields of type
Block</dd> <dt>ComponentResources</dt>
* <dd>give component access to its resources</dd>
<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> <dt>Service</dt> <dd>ordered
last, for use when Inject is present and
- * nothing else works, matches field type against Tapestry IoC
services</dd> </dl>
+ * (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> <dt>Service</dt>
<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,
@@ -533,8 +534,8 @@
/**
* Contributes two object providers: <dl> <dt>Alias</dt> <dd> Searches by
type among {...@linkplain AliasContribution
* contributions} to the {...@link Alias} service</dd> <dt>Asset<dt> <dd>
Checks for the {...@link Path} annotation, and
- * injects an {...@link Asset}</dd> <dt>Service</dt> <dd>Injects based on
the {...@link Service} annotation, if present</dd>
- * </dl>
+ * injects an {...@link Asset}</dd> <dt>Service</dt> <dd>Injects based on
the {...@link Service} annotation, if
+ * present</dd> </dl>
*/
public static void
contributeMasterObjectProvider(OrderedConfiguration<ObjectProvider>
configuration,
@@ -607,10 +608,10 @@
/**
* 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>
- * <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}).
<dt>ErrorFilter</dt>
- * <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
+ * <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}).
+ * <dt>ErrorFilter</dt> <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). </dl>
*/
@@ -667,8 +668,8 @@
}
/**
- * Contributes the basic set of named translators: <ul> <li>string</li>
<li>byte</li> <li>integer</li> <li>long</li>
- * <li>float</li> <li>double</li> <li>short</li> </ul>
+ * Contributes the basic set of named translators: <ul> <li>string</li>
<li>byte</li> <li>integer</li>
+ * <li>long</li> <li>float</li> <li>double</li> <li>short</li> </ul>
*/
public static void contributeTranslatorSource(Configuration<Translator>
configuration)
{
@@ -685,13 +686,14 @@
/**
* Adds coercions: <ul> <li>String to {...@link
org.apache.tapestry5.SelectModel} <li>String to {...@link
* org.apache.tapestry5.corelib.data.InsertPosition} <li>Map to {...@link
org.apache.tapestry5.SelectModel}
- * <li>Collection to {...@link GridDataSource} <li>null to {...@link
org.apache.tapestry5.grid.GridDataSource} <li>String to
- * {...@link org.apache.tapestry5.corelib.data.GridPagerPosition} <li>List
to {...@link org.apache.tapestry5.SelectModel}
- * <li>{...@link org.apache.tapestry5.runtime.ComponentResourcesAware}
(typically, a component) to {...@link
- * org.apache.tapestry5.ComponentResources} <li>String to {...@link
org.apache.tapestry5.corelib.data.BlankOption} <li>
- * {...@link org.apache.tapestry5.ComponentResources} to {...@link
org.apache.tapestry5.PropertyOverrides} <li>String to
- * {...@link org.apache.tapestry5.Renderable} <li>{...@link
org.apache.tapestry5.Renderable} to {...@link
- * org.apache.tapestry5.Block} <li>String to {...@link
java.text.DateFormat}</ul>
+ * <li>Collection to {...@link GridDataSource} <li>null to {...@link
org.apache.tapestry5.grid.GridDataSource} <li>String
+ * to {...@link org.apache.tapestry5.corelib.data.GridPagerPosition}
<li>List to {...@link
+ * org.apache.tapestry5.SelectModel} <li>{...@link
org.apache.tapestry5.runtime.ComponentResourcesAware} (typically, a
+ * component) to {...@link org.apache.tapestry5.ComponentResources}
<li>String to {...@link
+ * org.apache.tapestry5.corelib.data.BlankOption} <li> {...@link
org.apache.tapestry5.ComponentResources} to {...@link
+ * org.apache.tapestry5.PropertyOverrides} <li>String to {...@link
org.apache.tapestry5.Renderable} <li>{...@link
+ * org.apache.tapestry5.Renderable} to {...@link
org.apache.tapestry5.Block} <li>String to {...@link
+ * java.text.DateFormat}</ul>
*/
public static void contributeTypeCoercer(Configuration<CoercionTuple>
configuration)
{
@@ -872,12 +874,12 @@
}
@Marker(ContextProvider.class)
- public AssetFactory buildContextAssetFactory(ApplicationGlobals globals,
RequestPathOptimizer optimizer,
+ public AssetFactory buildContextAssetFactory(ApplicationGlobals globals,
@Inject
@Symbol(SymbolConstants.APPLICATION_VERSION)
String applicationVersion)
{
- return new ContextAssetFactory(request, globals.getContext(),
optimizer, applicationVersion);
+ return new ContextAssetFactory(request, globals.getContext(),
applicationVersion);
}
/**
@@ -936,7 +938,8 @@
}
/**
- * Builds a proxy to the current {...@link
org.apache.tapestry5.RenderSupport} inside this thread's {...@link Environment}.
+ * Builds a proxy to the current {...@link
org.apache.tapestry5.RenderSupport} inside this thread's {...@link
+ * Environment}.
*/
public RenderSupport buildRenderSupport()
{
@@ -974,8 +977,8 @@
/**
* A chain of command for providing values for {...@link Inject}-ed fields
in component classes. The service's
- * configuration can be extended to allow for different automatic
injections (based on some combination of field type
- * and field name).
+ * configuration can be extended to allow for different automatic
injections (based on some combination of field
+ * type and field name).
*/
public InjectionProvider buildInjectionProvider(List<InjectionProvider>
configuration)
@@ -1334,14 +1337,14 @@
}
/**
- * Contributes handlers for the following types: <dl> <dt>Object</dt>
<dd>Failure case, added to provide a more useful
- * exception message</dd> <dt>{...@link Link}</dt> <dd>Sends a redirect to
the link (which is typically a page render
- * link)</dd> <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> <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> <dt>{...@link
org.apache.tapestry5.StreamResponse}</dt> <dd>The stream
- * response is sent as the actual reply.</dd> <dt>URL</dt> <dd>Sends a
redirect to a (presumably) external URL</dd>
- * </dl>
+ * Contributes handlers for the following types: <dl> <dt>Object</dt>
<dd>Failure case, added to provide a more
+ * useful exception message</dd> <dt>{...@link Link}</dt> <dd>Sends a
redirect to the link (which is typically a page
+ * render link)</dd> <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>
+ * <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> <dt>{...@link
org.apache.tapestry5.StreamResponse}</dt>
+ * <dd>The stream response is sent as the actual reply.</dd> <dt>URL</dt>
<dd>Sends a redirect to a (presumably)
+ * external URL</dd> </dl>
*/
public void contributeComponentEventResultProcessor(
@Traditional @ComponentInstanceProcessor
@@ -1380,12 +1383,12 @@
* exception message</dd> <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>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> <dt>{...@link org.apache.tapestry5.Link}</dt> <dd>Sends a
JSON response to redirect to the link</dd>
- * <dt>{...@link Class}</dt> <dd>Treats the class as a page class and
sends a redirect for a page render for that
- * page</dd> </dl>
+ * {...@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> <dt>{...@link
org.apache.tapestry5.Link}</dt> <dd>Sends a JSON response to redirect to
+ * the link</dd> <dt>{...@link Class}</dt> <dd>Treats the class as a page
class and sends a redirect for a page render
+ * for that page</dd> </dl>
*/
public static void contributeAjaxComponentEventResultProcessor(
@@ -1403,11 +1406,11 @@
/**
* The MasterDispatcher is a chain-of-command of individual Dispatchers,
each handling (like a servlet) a particular
- * kind of incoming request. <dl> <dt>RootPath</dt> <dd>Renders the start
page for the "/" request</dd> <dt>Asset</dt>
- * <dd>Provides access to classpath assets</dd> <dt>PageRender</dt>
<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> </dl>
+ * kind of incoming request. <dl> <dt>RootPath</dt> <dd>Renders the start
page for the "/" request</dd>
+ * <dt>Asset</dt> <dd>Provides access to classpath assets</dd>
<dt>PageRender</dt> <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> </dl>
*/
public static void
contributeMasterDispatcher(OrderedConfiguration<Dispatcher> configuration)
{
@@ -1471,14 +1474,14 @@
/**
- * 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> <dt>DocumentLinker</dt> <dd>Provides {...@link
org.apache.tapestry5.internal.services.DocumentLinker}
- * <dt>RenderSupport</dt> <dd>Provides {...@link
org.apache.tapestry5.RenderSupport}</dd> <dt>ClientBehaviorSupport</dt>
- * <dd>Provides {...@link
org.apache.tapestry5.internal.services.ClientBehaviorSupport}</dd>
<dt>Heartbeat</dt>
- * <dd>Provides {...@link org.apache.tapestry5.services.Heartbeat}</dd>
<dt>DefaultValidationDecorator</dt> <dd>Provides
- * {...@link org.apache.tapestry5.ValidationDecorator} (as an instance of
{...@link org.apache.tapestry5.internal.DefaultValidationDecorator})</dd>
- * </dl>
+ * 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> <dt>DocumentLinker</dt> <dd>Provides
{...@link org.apache.tapestry5.internal.services.DocumentLinker}
+ * <dt>RenderSupport</dt> <dd>Provides {...@link
org.apache.tapestry5.RenderSupport}</dd>
+ * <dt>ClientBehaviorSupport</dt> <dd>Provides {...@link
org.apache.tapestry5.internal.services.ClientBehaviorSupport}</dd>
+ * <dt>Heartbeat</dt> <dd>Provides {...@link
org.apache.tapestry5.services.Heartbeat}</dd>
+ * <dt>DefaultValidationDecorator</dt> <dd>Provides {...@link
org.apache.tapestry5.ValidationDecorator} (as an instance
+ * of {...@link
org.apache.tapestry5.internal.DefaultValidationDecorator})</dd> </dl>
*/
public void
contributeMarkupRenderer(OrderedConfiguration<MarkupRendererFilter>
configuration,
@@ -1739,9 +1742,9 @@
}
/**
- * Contributes several strategies: <dl> <dt>session <dd>Values are stored
in the {...@link Session} <dt>flash <dd>Values
- * are stored in the {...@link Session}, until the next request (for the
page) <dt>client <dd>Values are encoded into
- * URLs (or hidden form fields) </dl>
+ * Contributes several strategies: <dl> <dt>session <dd>Values are stored
in the {...@link Session} <dt>flash
+ * <dd>Values are stored in the {...@link Session}, until the next request
(for the page) <dt>client <dd>Values are
+ * encoded into URLs (or hidden form fields) </dl>
*/
public void contributePersistentFieldManager(MappedConfiguration<String,
PersistentFieldStrategy> configuration,
@@ -1808,9 +1811,9 @@
/**
- * Configures the extensions that will require a digest to be downloaded
via the asset dispatcher. Most resources are
- * "safe", they don't require a digest. For unsafe resources, the digest
is incorporated into the URL to ensure that
- * the client side isn't just "fishing".
+ * Configures the extensions that will require a digest to be downloaded
via the asset dispatcher. Most resources
+ * are "safe", they don't require a digest. For unsafe resources, the
digest is incorporated into the URL to ensure
+ * that the client side isn't just "fishing".
* <p/>
* The extensions must be all lower case.
* <p/>
@@ -1988,10 +1991,10 @@
/**
* Contributes filters: <dl> <dt>Ajax</dt> <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> <dt>Secure</dt> <dd>Sends
a redirect if an non-secure request
- * accesses a secure page</dd></dl>
+ * 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> <dt>Secure</dt>
+ * <dd>Sends a redirect if an non-secure request accesses a secure
page</dd></dl>
*/
public void
contributeComponentEventRequestHandler(OrderedConfiguration<ComponentEventRequestFilter>
configuration,
final
RequestSecurityManager requestSecurityManager,
@@ -2113,8 +2116,8 @@
}
/**
- * Identifies String, Number and Boolean as immutable objects, a catch-all
handler for Object (that understands {...@link
- * org.apache.tapestry5.annotations.ImmutableSessionPersistedObject}, and
handlers for {...@link
+ * Identifies String, Number and Boolean as immutable objects, a catch-all
handler for Object (that understands
+ * {...@link
org.apache.tapestry5.annotations.ImmutableSessionPersistedObject}, and handlers
for {...@link
* org.apache.tapestry5.OptimizedSessionPersistedObject} and {...@link
org.apache.tapestry5.OptimizedApplicationStateObject}.
*
* @since 5.1.0.0
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java?rev=733928&r1=733927&r2=733928&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/integration/IntegrationTests.java
Mon Jan 12 14:11:02 2009
@@ -32,7 +32,7 @@
* Note: If these tests fail with BindException when starting Jetty, it could
be Skype. At least on my system, Skype is
* listening on localhost:80.
*/
-...@suppresswarnings({"JavaDoc"})
+...@suppresswarnings({ "JavaDoc" })
@Test(timeOut = 50000, sequential = true)
public class IntegrationTests extends AbstractIntegrationTestSuite
{
@@ -201,7 +201,7 @@
{
start("InstanceMixin");
- final String[] dates = {"Jun 13, 1999", "Jul 15, 2001", "Dec 4, 2005"};
+ final String[] dates = { "Jun 13, 1999", "Jul 15, 2001", "Dec 4, 2005"
};
for (String date : dates)
{
@@ -652,7 +652,7 @@
// The lack of a leading slash indicates that the path was optimized,
see TAPESTRY-1502
- assertAttribute("//i...@class='t-sort-icon']/@src",
"assets/UNKNOWN/tapestry/corelib/components/sort-asc.png");
+ assertAttribute("//i...@class='t-sort-icon']/@src",
"/assets/UNKNOWN/tapestry/corelib/components/sort-asc.png");
assertAttribute("//i...@class='t-sort-icon']/@alt", "[Asc]");
clickAndWait("link=1");
@@ -661,7 +661,8 @@
clickAndWait("link=Title");
- assertAttribute("//i...@class='t-sort-icon']/@src",
"assets/UNKNOWN/tapestry/corelib/components/sort-desc.png");
+ assertAttribute("//i...@class='t-sort-icon']/@src",
+
"/assets/UNKNOWN/tapestry/corelib/components/sort-desc.png");
assertAttribute("//i...@class='t-sort-icon']/@alt", "[Desc]");
clickAndWait("link=reset the Grid");
@@ -822,8 +823,8 @@
// The lack of a leading slash indicates that the path was optimized,
see TAPESTRY-1502
- assertAttributeSeries("//script[%d]/@src", 1,
"assets/UNKNOWN/scriptaculous/prototype.js",
- "assets/UNKNOWN/scriptaculous/scriptaculous.js");
+ assertAttributeSeries("//script[%d]/@src", 1,
"/assets/UNKNOWN/scriptaculous/prototype.js",
+
"/assets/UNKNOWN/scriptaculous/scriptaculous.js");
clickAndWait("link=Clear Data");
@@ -1380,7 +1381,7 @@
{
start("Disabled Fields");
- String[] paths = new String[] {"//inp...@id='textfield']",
+ String[] paths = new String[] { "//inp...@id='textfield']",
"//inp...@id='passwordfield']",
@@ -1404,7 +1405,7 @@
"//sele...@id='palette']",
- "//inp...@id='submit']"};
+ "//inp...@id='submit']" };
for (String path : paths)
{
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ClasspathAssetAliasManagerImplTest.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ClasspathAssetAliasManagerImplTest.java?rev=733928&r1=733927&r2=733928&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ClasspathAssetAliasManagerImplTest.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ClasspathAssetAliasManagerImplTest.java
Mon Jan 12 14:11:02 2009
@@ -1,4 +1,4 @@
-// Copyright 2006, 2007 The Apache Software Foundation
+// Copyright 2006, 2007, 2009 The Apache Software Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -43,18 +43,15 @@
public void to_client_url(String resourcePath, String expectedClientURL)
{
Request request = mockRequest();
- RequestPathOptimizer optimizer = mockRequestPathOptimizer();
train_getContextPath(request, "/ctx");
- train_optimizePath(optimizer, "/ctx" +
RequestConstants.ASSET_PATH_PREFIX + expectedClientURL, OPTIMIZED);
-
-
replay();
- ClasspathAssetAliasManager manager = new
ClasspathAssetAliasManagerImpl(request, optimizer, configuration());
+ ClasspathAssetAliasManager manager = new
ClasspathAssetAliasManagerImpl(request, configuration());
- assertEquals(manager.toClientURL(resourcePath), OPTIMIZED);
+ assertEquals(manager.toClientURL(resourcePath),
+ "/ctx" + RequestConstants.ASSET_PATH_PREFIX +
expectedClientURL);
verify();
}
@@ -72,7 +69,7 @@
@Test(dataProvider = "to_resource_path_data")
public void to_resource_path(String clientURL, String expectedResourcePath)
{
- ClasspathAssetAliasManager manager = new
ClasspathAssetAliasManagerImpl(null, null, configuration());
+ ClasspathAssetAliasManager manager = new
ClasspathAssetAliasManagerImpl(null, configuration());
assertEquals(manager.toResourcePath(clientURL), expectedResourcePath);
}
Modified:
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ContextAssetFactoryTest.java
URL:
http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ContextAssetFactoryTest.java?rev=733928&r1=733927&r2=733928&view=diff
==============================================================================
---
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ContextAssetFactoryTest.java
(original)
+++
tapestry/tapestry5/trunk/tapestry-core/src/test/java/org/apache/tapestry5/internal/services/ContextAssetFactoryTest.java
Mon Jan 12 14:11:02 2009
@@ -33,7 +33,7 @@
replay();
- AssetFactory factory = new ContextAssetFactory(request, context, null,
"1.2.3");
+ AssetFactory factory = new ContextAssetFactory(request, context,
"1.2.3");
assertEquals(factory.getRootResource().toString(), "context:/");
@@ -45,28 +45,24 @@
{
Context context = mockContext();
Request request = mockRequest();
- RequestPathOptimizer optimizer = mockRequestPathOptimizer();
Resource r = new ContextResource(context, "foo/Bar.txt");
train_getContextPath(request, "/context");
- train_optimizePath(optimizer, "/context/assets/app/4.5.6/foo/Bar.txt",
"/opt/path1");
- train_optimizePath(optimizer, "/context/assets/app/4.5.6/foo/Bar.txt",
"/opt/path2");
-
replay();
- AssetFactory factory = new ContextAssetFactory(request, context,
optimizer, "4.5.6");
+ AssetFactory factory = new ContextAssetFactory(request, context,
"4.5.6");
Asset asset = factory.createAsset(r);
assertSame(asset.getResource(), r);
- assertEquals(asset.toClientURL(), "/opt/path1");
+ assertEquals(asset.toClientURL(),
"/context/assets/app/4.5.6/foo/Bar.txt");
// In real life, toString() is the same as toClientURL(), but we're
testing
// that the optimize method is getting called, basically.
- assertEquals(asset.toString(), "/opt/path2");
+ assertEquals(asset.toString(),
"/context/assets/app/4.5.6/foo/Bar.txt");
verify();
}