svn commit: r596845 - in /lenya/trunk/src/modules/fckeditor: java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java resources/javascript/fckloader.js usecases/fckeditor.jx

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: rfrovarp
Date: Tue Nov 20 14:05:25 2007
New Revision: 596845

URL: http://svn.apache.org/viewvc?rev=596845&view=rev
Log:
Make FCKeditor work outside of the root context. Should also now work through proxies. Fixes 43750 for FCK.

Modified:
    lenya/trunk/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java
    lenya/trunk/src/modules/fckeditor/resources/javascript/fckloader.js
    lenya/trunk/src/modules/fckeditor/usecases/fckeditor.jx

Modified: lenya/trunk/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java?rev=596845&r1=596844&r2=596845&view=diff
==============================================================================
--- lenya/trunk/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java (original)
+++ lenya/trunk/src/modules/fckeditor/java/src/org/apache/lenya/cms/editors/fckeditor/Fckeditor.java Tue Nov 20 14:05:25 2007
@@ -41,7 +41,10 @@
 import org.apache.excalibur.source.Source;
 import org.apache.excalibur.source.SourceResolver;
 import org.apache.lenya.cms.linking.LinkConverter;
+import org.apache.lenya.cms.linking.LinkRewriter;
+import org.apache.lenya.cms.linking.OutgoingLinkRewriter;
 import org.apache.lenya.cms.publication.ResourceType;
+import org.apache.lenya.cms.publication.URLInformation;
 import org.apache.lenya.cms.usecase.DocumentUsecase;
 import org.apache.lenya.cms.usecase.UsecaseException;
 import org.apache.lenya.cms.usecase.xml.UsecaseErrorHandler;
@@ -79,9 +82,13 @@
 
         Request request = ContextHelper.getRequest(this.context);
         String requesturi = request.getRequestURI();
-        String host = "http://" + request.getServerName() + ":" + request.getServerPort();
-        setParameter("host", host);
         setParameter("requesturi", requesturi);
+        URLInformation info = new URLInformation(getSourceURL());
+        String pubId = info.getPublicationId();
+        LinkRewriter rewriter = new OutgoingLinkRewriter(this.manager, getSession(),
+                    getSourceURL(), request.isSecure(), false, false);
+        
+        setParameter("proxyUrl",rewriter.rewrite("/" + pubId));
     }
 
     /**

Modified: lenya/trunk/src/modules/fckeditor/resources/javascript/fckloader.js
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/fckeditor/resources/javascript/fckloader.js?rev=596845&r1=596844&r2=596845&view=diff
==============================================================================
--- lenya/trunk/src/modules/fckeditor/resources/javascript/fckloader.js (original)
+++ lenya/trunk/src/modules/fckeditor/resources/javascript/fckloader.js Tue Nov 20 14:05:25 2007
@@ -18,13 +18,13 @@
 function fckloader(requesturi, contextPath)
 {
   var oFCKeditor = new FCKeditor( 'content' ) ;
-  oFCKeditor.BasePath	= '/' + contextPath + '/modules/fckeditor/fckeditor/' ;
+  oFCKeditor.BasePath	= contextPath + '/modules/fckeditor/fckeditor/' ;
   oFCKeditor.Width="800";
   oFCKeditor.Height="700";
   oFCKeditor.Config[ "FullPage" ] = true ;
   oFCKeditor.Config[ "ProcessHTMLEntities" ] = true ;
   oFCKeditor.Config[ "ProcessNumericEntities" ] = true ;
-  oFCKeditor.Config["CustomConfigurationsPath"] = "/" + contextPath + "/modules/fckeditor/javascript/fckconfig.js"  ;
+  oFCKeditor.Config["CustomConfigurationsPath"] = contextPath + "/modules/fckeditor/javascript/fckconfig.js"  ;
   oFCKeditor.ToolbarSet = 'Lenya' ;
 // the current API does not support this anymore. there is a plugin for that job now.
 // with an extra html page, this function could probably be restored easily, which would be

Modified: lenya/trunk/src/modules/fckeditor/usecases/fckeditor.jx
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/fckeditor/usecases/fckeditor.jx?rev=596845&r1=596844&r2=596845&view=diff
==============================================================================
--- lenya/trunk/src/modules/fckeditor/usecases/fckeditor.jx (original)
+++ lenya/trunk/src/modules/fckeditor/usecases/fckeditor.jx Tue Nov 20 14:05:25 2007
@@ -34,7 +34,7 @@
   <script type="text/javascript" src="/${pubId}/modules/editors/javascript/org.apache.lenya.editors.js">&#160;</script> 
   <script type="text/javascript">
     function loadfckloader() {
-      fckloader('${usecase.getParameter('requesturi')}', '${pubId}');
+      fckloader('${usecase.getParameter('requesturi')}', '${usecase.getParameter('proxyUrl')}');
     }
 
     if(typeof window.addEventListener != 'undefined') {
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.