You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ja...@apache.org on 2007/09/28 13:28:30 UTC

svn commit: r580311 - /lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java

Author: jann
Date: Fri Sep 28 04:28:30 2007
New Revision: 580311

URL: http://svn.apache.org/viewvc?rev=580311&view=rev
Log:
the context prefix is needed. Otherwise this only works within the ROOT context

Modified:
    lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java

Modified: lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java
URL: http://svn.apache.org/viewvc/lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java?rev=580311&r1=580310&r2=580311&view=diff
==============================================================================
--- lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java (original)
+++ lenya/branches/branch_1_2_x_shibboleth/src/java/org/apache/lenya/cms/publication/util/OutgoingLinkRewriter.java Fri Sep 28 04:28:30 2007
@@ -23,6 +23,7 @@
 import org.apache.avalon.framework.service.ServiceSelector;
 import org.apache.cocoon.environment.Context;
 import org.apache.cocoon.environment.ObjectModelHelper;
+import org.apache.cocoon.environment.Request;
 import org.apache.lenya.ac.AccessControllerResolver;
 import org.apache.lenya.ac.Policy;
 import org.apache.lenya.ac.PolicyManager;
@@ -67,7 +68,9 @@
             ContextUtility contextUtil = null;
             try {
                 contextUtil = (ContextUtility) this.manager.lookup(ContextUtility.ROLE);
+                Request request = ObjectModelHelper.getRequest(contextUtil.getObjectModel());
                 Context context = ObjectModelHelper.getContext(contextUtil.getObjectModel());
+                String contextPath = request.getContextPath();
                 String servletContextPath = context.getRealPath("");
                 Publication pub = PublicationFactory.getPublication(pubId, servletContextPath);
 
@@ -77,6 +80,8 @@
                     Proxy proxy = pub.getProxy(doc, isSslProtected(webappUrl));
                     if (proxy != null) {
                         proxyUrl = proxy.getURL(doc);
+                    } else {
+                    		webappUrl = contextPath + webappUrl;
                     }
                 }
 



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@lenya.apache.org
For additional commands, e-mail: commits-help@lenya.apache.org