TinyMCE Resource

Name:
tinymce
Namespace:
http://www.wyona.org/yanel/resource/1.0
UniversalName
http://www.wyona.org/yanel/resource/1.0::tinymce
Description:
tinyMCE to edit xhtml
Java Class:
org.wyona.yanel.impl.resources.TinyMCEResource

Views

View IDMime typeType
DEFAULTtext/htmljelly
fix-wellformnesstext/htmljelly
donetext/htmljelly
canceltext/htmljelly
errortext/htmljelly

Request Parameter

NameExplanations
edit-path(deprecated, use map matcher and matcher-extension instead)a data repository path. points to the document you want to edit

Resource Configuration

NameExplanations
matcher-extensionis removed from the requested path to get the content path. E.g. '.tinymce-edit.html' (see: Map Matcher)

Map matcher

      <matcher pattern="**.tinymce-edit.html" rcpath="/tinymce.html.yanel-rc"/>
    

Examples

.yanel-rc Example

<?xml version="1.0"?>
<yanel:resource-config xmlns:yanel="http://www.wyona.org/yanel/rti/1.0">
  <yanel:rti name="tinymce" namespace="http://www.wyona.org/yanel/resource/1.0"/>
    <yanel:custom-config>
     <views>
      <view id="default" type="jelly">
        <template>rthtdocs:/tinymce.jelly</template>
        <xslt>/xslt/global.xsl</xslt>
        <mime-type>text/html</mime-type>
      </view>
      <view id="fix-wellformness" type="jelly">
        <template>rthtdocs:/tinymce-fix.jelly</template>
        <xslt>/xslt/global.xsl</xslt>
        <mime-type>text/html</mime-type>
      </view>
      <view id="done" type="jelly">
        <template>rthtdocs:/tinymce-status.jelly</template>
        <xslt>/xslt/global.xsl</xslt>
      </view>
      <view id="cancel" type="jelly">
        <template>rthtdocs:/tinymce-status.jelly</template>
        <xslt>/xslt/global.xsl</xslt>
      </view>
      <view id="error" type="jelly">
        <template>rthtdocs:/tinymce-status.jelly</template>
        <xslt>/xslt/global.xsl</xslt>
      </view>
    </views>
  </yanel:custom-config>
</yanel:resource-config>

Explanations

Once you registered the tinymce resource in yanel (add <resource-type src="$TINYMCE_RESOURCE_HOME" compile="true"/> to yanels resource-types.xml)
and added the above mentioned .yanel-rc to your realms resource-config (e.g. /usecases/tinymce.yanel-rc) repository
you can access tinymce via browser e.g. https://localhost:8443/yanel/$YOUR_REALM/usecases/tinymce.html?edit-path=/de/ueber.html.

you have to provide a request parameter "edith-path" in order to allow the tinymce resource to know which document to edit.

Menu Example

an example how to add this resource to the menu

Index: src/realms/yanel-website/src/java/org/wyona/yanel/servlet/menu/impl/YanelWebsiteMenu.java
===================================================================
--- src/realms/yanel-website/src/java/org/wyona/yanel/servlet/menu/impl/YanelWebsiteMenu.java	(revision 31673)
+++ src/realms/yanel-website/src/java/org/wyona/yanel/servlet/menu/impl/YanelWebsiteMenu.java	(working copy)
@@ -61,7 +61,15 @@
 
         sb.append("<ul><li>");
         sb.append("<div id=\"yaneltoolbar_menutitle\">Edit</div><ul>");
-        sb.append("<li class=\"haschild\">Open with&#160;&#160;&#160;<ul><li>Source editor</li><li>WYSIWYG editor</li></ul></li>");
+        sb.append("<li class=\"haschild\">Open with&#160;&#160;&#160;");
+        sb.append("<ul><li>Source editor</li>");
+        sb.append("<li>WYSIWYG editor</li>");
+        if (ResourceAttributeHelper.hasAttributeImplemented(resource, "Modifiable", "2")) {
+            sb.append("<li><a href=\"" + backToRealm + resource.getPath().substring(1) + "\">Edit page with tinyMCE&#160;&#160;&#160;</a></li>");
+        } else {
+            sb.append("<li><a>Edit page with tinyMCE&#160;&#160;&#160;</a></li>");
+        }
+        sb.append("</ul></li>");
 
         if (ResourceAttributeHelper.hasAttributeImplemented(resource, "Versionable", "2")) {
             RevisionInformation[] revisions = ((VersionableV2) resource).getRevisions();

Todo