You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lenya.apache.org by ne...@apache.org on 2007/11/02 22:31:02 UTC

svn commit: r591476 - in /lenya/trunk/src/modules/tinymce: sitemap.xmap xslt/page2edit.xsl

Author: nettings
Date: Fri Nov  2 14:31:01 2007
New Revision: 591476

URL: http://svn.apache.org/viewvc?rev=591476&view=rev
Log:
make tinymce work in non-root contexts.
the proxy transformer used to be applied twice (once in the pub sitemap,
once during tinymce post-processing).

Modified:
    lenya/trunk/src/modules/tinymce/sitemap.xmap
    lenya/trunk/src/modules/tinymce/xslt/page2edit.xsl

Modified: lenya/trunk/src/modules/tinymce/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/sitemap.xmap?rev=591476&r1=591475&r2=591476&view=diff
==============================================================================
--- lenya/trunk/src/modules/tinymce/sitemap.xmap (original)
+++ lenya/trunk/src/modules/tinymce/sitemap.xmap Fri Nov  2 14:31:01 2007
@@ -21,19 +21,6 @@
 
 <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
 
-  <map:resources>
-    <map:resource name="style-cms-page">
-      <map:transform type="i18n">      
-        <map:parameter name="locale" value="{request:locale}"/>
-      </map:transform>    
-      <map:transform src="fallback://lenya/xslt/util/page2xhtml.xsl">
-        <map:parameter name="publicationid" value="{page-envelope:publication-id}"/>
-      </map:transform>
-      <map:transform src="context://lenya/xslt/util/strip_namespaces.xsl"/>
-      <map:transform type="proxy"/>
-    </map:resource>
-  </map:resources>
-
   <map:pipelines>
 
     <map:pipeline internal-only="yes">
@@ -78,19 +65,22 @@
             <map:select type="resource-exists">
               <map:when test="fallback://lenya/modules/tinymce/resources/tinymce/jscripts/tiny_mce/langs/{request:locale}.js">
                 <map:transform src="fallback://lenya/modules/tinymce/xslt/page2edit.xsl">
-                  <map:parameter name="contextPath" value=""/>
+                  <!-- the proxy path is set manually, since the document has already been
+                       though the proxy transformer in the publication sitemap, and we can't
+                       use it again, as that would yield duplicate proxy paths. -->
+                  <map:parameter name="proxyPath" value="{proxy:}"/>
                   <map:parameter name="continuationId" value="{flow-continuation:id}"/>
                   <map:parameter name="usecaseName" value="{request-param:lenya.usecase}"/>
-                  <map:parameter name="publicationid" value="{page-envelope:publication-id}"/>
+                  <map:parameter name="publicationId" value="{page-envelope:publication-id}"/>
                   <map:parameter name="locale" value="{request:locale}"/>
                 </map:transform>
               </map:when>
               <map:otherwise>
                 <map:transform src="fallback://lenya/modules/tinymce/xslt/page2edit.xsl">
-                  <map:parameter name="contextPath" value=""/>
+                  <map:parameter name="proxyPath" value="{proxy:}"/>
                   <map:parameter name="continuationId" value="{flow-continuation:id}"/>
                   <map:parameter name="usecaseName" value="{request-param:lenya.usecase}"/>
-                  <map:parameter name="publicationid" value="{page-envelope:publication-id}"/>
+                  <map:parameter name="publicationId" value="{page-envelope:publication-id}"/>
                   <map:parameter name="locale" value="en"/>
                 </map:transform>
               </map:otherwise>
@@ -101,7 +91,7 @@
             <map:generate src="fallback://lenya/modules/tinymce/resources/misc/download.xml"/>
           </map:otherwise>
         </map:select>
-        <map:call resource="style-cms-page"/>
+
         <map:serialize type="xhtml"/>
       </map:match>
 

Modified: lenya/trunk/src/modules/tinymce/xslt/page2edit.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/tinymce/xslt/page2edit.xsl?rev=591476&r1=591475&r2=591476&view=diff
==============================================================================
--- lenya/trunk/src/modules/tinymce/xslt/page2edit.xsl (original)
+++ lenya/trunk/src/modules/tinymce/xslt/page2edit.xsl Fri Nov  2 14:31:01 2007
@@ -12,10 +12,10 @@
   textarea into the div#body tag.
 -->
 
-<xsl:param name="contextPath" select="'tinymce.ERROR'"/>
+<xsl:param name="proxyPath" select="'tinymce.ERROR'"/>
 <xsl:param name="continuationId" select="'tinymce.ERROR'"/>
 <xsl:param name="usecaseName" select="'tinymce.ERROR'"/>
-<xsl:param name="publicationid" />
+<xsl:param name="publicationId" select="'tinymce.ERROR'" />
 <xsl:param name="locale" select="'tinymce.ERROR'"/>
 
 
@@ -24,9 +24,9 @@
   the <tinymceWrapper/> is the document element set by the aggregator.
 -->
 <xsl:template match="tinymceWrapper">
-  <xsl:if test="$contextPath='tinymce.ERROR'">
+  <xsl:if test="$proxyPath='tinymce.ERROR'">
     <xsl:message terminate="yes">
-      <i18n:text>Missing contextPath parameter!</i18n:text>
+      <i18n:text>Missing proxyPath parameter!</i18n:text>
       <i18n:text>Check your tinymce sitemap.</i18n:text>
     </xsl:message>
   </xsl:if>
@@ -42,6 +42,12 @@
       <i18n:text>Check your tinymce sitemap.</i18n:text>
     </xsl:message>
   </xsl:if>
+  <xsl:if test="$publicationId='tinymce.ERROR'">
+    <xsl:message terminate="yes">
+      <i18n:text>Missing publicationId parameter!</i18n:text>
+      <i18n:text>Check your tinymce sitemap.</i18n:text>
+    </xsl:message>
+  </xsl:if>
   <xsl:if test="$locale='tinymce.ERROR'">
     <xsl:message terminate="yes">
       <i18n:text>Missing locale parameter!</i18n:text>
@@ -74,7 +80,7 @@
   </xsl:text>
   <script language="javascript" 
           type="text/javascript" 
-          src="/{$publicationid}/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js"
+          src="{$proxyPath}/{$publicationId}/modules/tinymce/tinymce/jscripts/tiny_mce/tiny_mce.js"
   >&#160;</script>
   <xsl:text>
   </xsl:text>
@@ -86,7 +92,7 @@
   </xsl:text>
   <script language="javascript" 
           type="text/javascript"
-          src="/{$publicationid}/modules/tinymce/javascript/tiny_config.js"
+          src="{$proxyPath}/{$publicationId}/modules/tinymce/javascript/tiny_config.js"
   >&#160;</script>
   <xsl:text>
   </xsl:text>
@@ -95,13 +101,13 @@
   </xsl:text>
   <script language="javascript" 
           type="text/javascript"
-          src="/{$publicationid}/modules/tinymce/javascript/tiny_valid_elements.js"
+          src="{$proxyPath}/{$publicationId}/modules/tinymce/javascript/tiny_valid_elements.js"
   >&#160;</script>
   <xsl:text>
   </xsl:text>
   <script language="javascript" 
           type="text/javascript" 
-          src="/{$publicationid}/modules/editors/javascript/org.apache.lenya.editors.js"
+          src="{$proxyPath}/{$publicationId}/modules/editors/javascript/org.apache.lenya.editors.js"
   >&#160;</script>
   <xsl:text>
   </xsl:text>
@@ -111,13 +117,13 @@
   </xsl:text>
   <script language="javascript" 
           type="text/javascript" 
-          src="/{$publicationid}/modules/editors/javascript/disablebackspace.js"
+          src="{$proxyPath}/{$publicationId}/modules/editors/javascript/disablebackspace.js"
   >&#160;</script>
   <xsl:text>
   </xsl:text>
   <script language="javascript" 
           type="text/javascript" 
-          src="/{$publicationid}/modules/tinymce/javascript/tiny_lenya_glue.js"
+          src="{$proxyPath}/{$publicationId}/modules/tinymce/javascript/tiny_lenya_glue.js"
   >&#160;</script>
   <xsl:text>
   </xsl:text>
@@ -145,7 +151,7 @@
        to the Lenya authoring GUI) to TinyMCE for true WYSIWYG editing */
 
     config['content_css'] = "</xsl:text>
-    <xsl:value-of select="$contextPath"/>
+    <xsl:value-of select="$proxyPath"/>
     <xsl:text>/modules/tinymce/css/editor_content.css</xsl:text>
     <xsl:for-each select="../xhtml:link[@rel='stylesheet' and not(contains(@href, '/lenya/css/'))]">
         <xsl:text>,</xsl:text>



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