chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1357635 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server: impl/atompub/ impl/browser/ shared/
Date Thu, 05 Jul 2012 14:39:03 GMT
Author: fmui
Date: Thu Jul  5 14:39:02 2012
New Revision: 1357635

URL: http://svn.apache.org/viewvc?rev=1357635&view=rev
Log:
Server: allow filters to set a different base URL

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/Dispatcher.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java?rev=1357635&r1=1357634&r2=1357635&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
Thu Jul  5 14:39:02 2012
@@ -44,6 +44,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.server.NamespaceDefinitions;
 import org.apache.chemistry.opencmis.commons.server.ObjectInfo;
 import org.apache.chemistry.opencmis.commons.server.RenditionInfo;
+import org.apache.chemistry.opencmis.server.shared.Dispatcher;
 
 /**
  * This class contains operations used by all services.
@@ -85,6 +86,11 @@ public final class AtomPubUtils {
      * Compiles the base URL for links, collections and templates.
      */
     public static UrlBuilder compileBaseUrl(HttpServletRequest request, String repositoryId)
{
+        String baseUrl = (String) request.getAttribute(Dispatcher.BASE_URL_ATTRIBUTE);
+        if (baseUrl != null) {
+            return new UrlBuilder(baseUrl);
+        }
+        
         UrlBuilder url = new UrlBuilder(request.getScheme(), request.getServerName(), request.getServerPort(),
null);
 
         url.addPath(request.getContextPath());

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java?rev=1357635&r1=1357634&r2=1357635&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/browser/BrowserBindingUtils.java
Thu Jul  5 14:39:02 2012
@@ -67,6 +67,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.server.CallContext;
 import org.apache.chemistry.opencmis.commons.server.CmisService;
 import org.apache.chemistry.opencmis.server.impl.CallContextImpl;
+import org.apache.chemistry.opencmis.server.shared.Dispatcher;
 import org.apache.chemistry.opencmis.server.shared.HttpUtils;
 
 public class BrowserBindingUtils {
@@ -93,6 +94,11 @@ public class BrowserBindingUtils {
      * Compiles the base URL for links, collections and templates.
      */
     public static UrlBuilder compileBaseUrl(HttpServletRequest request) {
+        String baseUrl = (String) request.getAttribute(Dispatcher.BASE_URL_ATTRIBUTE);
+        if (baseUrl != null) {
+            return new UrlBuilder(baseUrl);
+        }
+
         UrlBuilder url = new UrlBuilder(request.getScheme(), request.getServerName(), request.getServerPort(),
null);
 
         url.addPath(request.getContextPath());

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/Dispatcher.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/Dispatcher.java?rev=1357635&r1=1357634&r2=1357635&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/Dispatcher.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/shared/Dispatcher.java
Thu Jul  5 14:39:02 2012
@@ -41,6 +41,8 @@ public class Dispatcher implements Seria
 
     private static final long serialVersionUID = 1L;
 
+    public static final String BASE_URL_ATTRIBUTE= "org.apache.chemistry.opencmis.baseurl";
+    
     public static final String METHOD_GET = "GET";
     public static final String METHOD_POST = "POST";
     public static final String METHOD_PUT = "PUT";



Mime
View raw message