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 2010/06/03 01:37:32 UTC

svn commit: r950828 - in /tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5: services/ urlrewriter/

Author: hlship
Date: Wed Jun  2 23:37:31 2010
New Revision: 950828

URL: http://svn.apache.org/viewvc?rev=950828&view=rev
Log:
TAP5-1042: Mark URLRewriter and related classes as deprecated

Modified:
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/URLRewriter.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/RewriteRuleApplicability.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapper.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriteContext.java
    tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriterRule.java

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/URLRewriter.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/URLRewriter.java?rev=950828&r1=950827&r2=950828&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/URLRewriter.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/services/URLRewriter.java Wed Jun  2 23:37:31 2010
@@ -1,4 +1,4 @@
-// Copyright 2009 The Apache Software Foundation
+// Copyright 2009, 2010 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,6 +14,7 @@
 
 package org.apache.tapestry5.services;
 
+import org.apache.tapestry5.services.linktransform.LinkTransformer;
 import org.apache.tapestry5.urlrewriter.URLRewriteContext;
 
 
@@ -22,6 +23,7 @@ import org.apache.tapestry5.urlrewriter.
  *
  *
  * @since 5.1.0.2
+ * @deprecated Use {@link LinkTransformer} instead
  */
 public interface URLRewriter
 {

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/RewriteRuleApplicability.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/RewriteRuleApplicability.java?rev=950828&r1=950827&r2=950828&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/RewriteRuleApplicability.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/RewriteRuleApplicability.java Wed Jun  2 23:37:31 2010
@@ -1,10 +1,10 @@
-// Copyright 2009 The Apache Software Foundation
+// Copyright 2009, 2010 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
-//     http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,14 +14,19 @@
 
 package org.apache.tapestry5.urlrewriter;
 
+import org.apache.tapestry5.services.linktransform.LinkTransformer;
+
 /**
  * Defines the situations to which a URLRewriterRule will be applied (inbound, outbound, or both)
+ * 
+ * @deprecated Use {@link LinkTransformer} instead
  */
-public enum RewriteRuleApplicability {
-    /**contributed rule applies to inbound requests only*/
+public enum RewriteRuleApplicability
+{
+    /** contributed rule applies to inbound requests only */
     INBOUND,
-    /**contributed rule applies to "outbound" requests (link rewriting).*/
+    /** contributed rule applies to "outbound" requests (link rewriting). */
     OUTBOUND,
-    /**contributed rule applies to both inbound and outbound requests*/
+    /** contributed rule applies to both inbound and outbound requests */
     BOTH
 }

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapper.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapper.java?rev=950828&r1=950827&r2=950828&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapper.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/SimpleRequestWrapper.java Wed Jun  2 23:37:31 2010
@@ -1,10 +1,10 @@
-// Copyright 2009 The Apache Software Foundation
+// Copyright 2009, 2010 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
-//     http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,10 +16,14 @@ package org.apache.tapestry5.urlrewriter
 import org.apache.tapestry5.ioc.internal.util.Defense;
 import org.apache.tapestry5.services.DelegatingRequest;
 import org.apache.tapestry5.services.Request;
+import org.apache.tapestry5.services.linktransform.LinkTransformer;
 
 /**
  * Class that wraps a {@linkplain Request}. It delegates all methods except ones related to URL
  * rewriting.
+ * 
+ * @deprecated To be removed in 5.3.
+ * @see LinkTransformer
  */
 public class SimpleRequestWrapper extends DelegatingRequest
 {
@@ -40,7 +44,7 @@ public class SimpleRequestWrapper extend
      */
     public SimpleRequestWrapper(Request request, String serverName, String path)
     {
-        
+
         super(request);
         Defense.notNull(serverName, "serverName");
         Defense.notNull(path, "path");
@@ -59,10 +63,11 @@ public class SimpleRequestWrapper extend
      * @param path
      *            a {@link String}. It cannot be null.
      */
-    public SimpleRequestWrapper(Request request, String path) {
-        
+    public SimpleRequestWrapper(Request request, String path)
+    {
+
         super(request);
-        
+
         Defense.notNull(request, "request");
         final String serverName = request.getServerName();
         Defense.notNull(serverName, "serverName");
@@ -70,9 +75,9 @@ public class SimpleRequestWrapper extend
 
         this.serverName = serverName;
         this.path = path;
-        
+
     }
-    
+
     @Override
     public String getPath()
     {

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriteContext.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriteContext.java?rev=950828&r1=950827&r2=950828&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriteContext.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriteContext.java Wed Jun  2 23:37:31 2010
@@ -1,10 +1,10 @@
-// Copyright 2009 The Apache Software Foundation
+// Copyright 2009, 2010 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
-//     http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
@@ -16,22 +16,26 @@ package org.apache.tapestry5.urlrewriter
 
 import org.apache.tapestry5.services.PageRenderRequestParameters;
 import org.apache.tapestry5.services.ComponentEventRequestParameters;
+import org.apache.tapestry5.services.linktransform.LinkTransformer;
 
 /**
  * Context passed to the process method of URLRewriterRule implementations, providing additional
  * information that the rules might need to function.
+ * 
+ * @deprecated Use {@link LinkTransformer} instead
  */
-public interface URLRewriteContext {
+public interface URLRewriteContext
+{
 
     /**
-     *
      * @return true if the "process" method of URLRewriterRule is being called for an incoming request.
      */
     boolean isIncoming();
 
     /**
      * If the request being processed is processed in response to pagelink creation, the PageRenderRequestParameters
-     * associated with that creation will be available via this method.  Otherwise, this method returns null.
+     * associated with that creation will be available via this method. Otherwise, this method returns null.
+     * 
      * @return the PageRenderRequestParameters associated with the link creation for this request, or null
      */
     PageRenderRequestParameters getPageParameters();
@@ -40,6 +44,7 @@ public interface URLRewriteContext {
      * If the request being processed is processed in response to component event link creation, the
      * ComponentEVentRequestParameters associated with that creation will be available via this method.
      * Otherwise, this method returns null.
+     * 
      * @return the ComponentEventRequestParameters associated with the link creation for this request, or null
      */
     ComponentEventRequestParameters getComponentEventParameters();

Modified: tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriterRule.java
URL: http://svn.apache.org/viewvc/tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriterRule.java?rev=950828&r1=950827&r2=950828&view=diff
==============================================================================
--- tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriterRule.java (original)
+++ tapestry/tapestry5/trunk/tapestry-core/src/main/java/org/apache/tapestry5/urlrewriter/URLRewriterRule.java Wed Jun  2 23:37:31 2010
@@ -1,10 +1,10 @@
-// Copyright 2009 The Apache Software Foundation
+// Copyright 2009, 2010 The Apache Software Foundation
 //
 // Licensed under the Apache License, Version 2.0 (the "License");
 // you may not use this file except in compliance with the License.
 // You may obtain a copy of the License at
 //
-//     http://www.apache.org/licenses/LICENSE-2.0
+// http://www.apache.org/licenses/LICENSE-2.0
 //
 // Unless required by applicable law or agreed to in writing, software
 // distributed under the License is distributed on an "AS IS" BASIS,
@@ -14,9 +14,12 @@
 package org.apache.tapestry5.urlrewriter;
 
 import org.apache.tapestry5.services.Request;
+import org.apache.tapestry5.services.linktransform.LinkTransformer;
 
 /**
  * Defines an URL rewriting rule. It is executed before any Tapestry request processing is done.
+ * 
+ * @deprecated Use {@link LinkTransformer} instead
  */
 public interface URLRewriterRule
 {
@@ -30,7 +33,7 @@ public interface URLRewriterRule
      *            a {@link org.apache.tapestry5.services.Request}.
      * @return request a {@link org.apache.tapestry5.services.Request}.
      */
-    Request process(Request request,URLRewriteContext context);
+    Request process(Request request, URLRewriteContext context);
 
     RewriteRuleApplicability applicability();
 }