[Yanel-dev] [Bug 7397] tinymce lookup inserts wrong path (img and links)

bugzilla at wyona.com bugzilla at wyona.com
Fri Jan 29 10:36:36 CET 2010


http://bugzilla.wyona.com/cgi-bin/bugzilla/show_bug.cgi?id=7397





------- Comment #5 from simon at 333.ch  2010-01-29 10:37 -------
maybe somthing like this:

### Eclipse Workspace Patch 1.0
#P yanel-untouched
Index: src/webapp/src/java/org/wyona/yanel/servlet/menu/impl/DefaultMenu.java
===================================================================
--- src/webapp/src/java/org/wyona/yanel/servlet/menu/impl/DefaultMenu.java     
(revision 47254)
+++ src/webapp/src/java/org/wyona/yanel/servlet/menu/impl/DefaultMenu.java     
(working copy)
@@ -1,6 +1,8 @@
 package org.wyona.yanel.servlet.menu.impl;

 import org.wyona.yanel.core.Resource;
+import org.wyona.yanel.core.ResourceManager;
+import org.wyona.yanel.core.Yanel;
 import org.wyona.yanel.core.api.attributes.VersionableV2;
 import org.wyona.yanel.core.api.attributes.WorkflowableV1;
 import org.wyona.yanel.core.attributes.versionable.RevisionInformation;
@@ -19,6 +21,8 @@

 import org.apache.log4j.Logger;

+import sun.reflect.ReflectionFactory.GetReflectionFactoryAction;
+
 /**
  *
  */
@@ -49,7 +53,15 @@
         sb.append("<ul>");
         if (ResourceAttributeHelper.hasAttributeImplemented(resource,
"Modifiable", "2")) {
             sb.append("<li><a href=\"" + backToRealm +
"usecases/xinha.html?edit-path=" + resource.getPath() + "\">Edit page with
Xinha&#160;&#160;&#160;</a></li>");
-            sb.append("<li><a href=\"" + backToRealm +
"usecases/tinymce.html?edit-path=" + resource.getPath() + "\">Edit page with
tinyMCE&#160;&#160;&#160;</a></li>");
+            //for backwardcompatibilit we have to check if the tinymce is
configured with a matcher-extension and if not provide the old path.
+            ResourceManager resourceManager =
Yanel.getInstance().getResourceManager();
+            Resource tinymce =
resourceManager.getResource(resource.getEnvironment(), resource.getRealm(),
"/usecases/tinymce.html");
+            String matcherExtension =
tinymce.getResourceConfigProperty("matcher-extension");
+            if (matcherExtension != null && matcherExtension.length() > 0) {
+                sb.append("<li><a href=\"" + backToRealm +
resource.getPath().substring(1) + ".tinymce-edit.html\">Edit page with
tinyMCE&#160;&#160;&#160;</a></li>");
+            } else {
+                sb.append("<li><a href=\"" + backToRealm +
"usecases/tinymce.html?edit-path=" + resource.getPath() + "\">Edit page with
tinyMCE&#160;&#160;&#160;</a></li>");
+            }
         } else {
             sb.append("<li><a>Edit page with
Xinha&#160;&#160;&#160;</a></li>");
             sb.append("<li>Edit page with tinyMCE&#160;&#160;&#160;</li>");


-- 
Configure bugmail: http://bugzilla.wyona.com/cgi-bin/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.


More information about the Yanel-development mailing list