AMP for Web Client WYSIWYG Textareas

cancel
Showing results for 
Search instead for 
Did you mean: 

AMP for Web Client WYSIWYG Textareas

resplin
Intermediate
0 0 2,316

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



Forge Projects


Introduction


This page describes an Alfresco Module Package that allows text properties to be edited using the TinyMCE WYSIWYG editor.

This AMP was not developed by Alfresco engineers but contributed by community members; it is therefore neither official nor does it come with any kind of guarantee. You are free to use it, however, for whatever you want.

This AMP does not use the TinyMCE instance included in Alfresco but comes with its own version (currently, 2.1.2).

Current version: 0.9
Requirements: Alfresco 2.1

Download link: Alfresco Forge


Installation


The AMP is installed like any other Alfresco Module Package. Download it from Alfresco Forge. After installing, start the server and take a look at the server log (in case of Tomcat this is catalina.out) to verify that the module was indeed loaded; you should see something like this:

13:04:35,260 User:System INFO  [repo.module.ModuleServiceImpl] Starting module 'org.alfrsco.module.WebClientTinyMCESupport' version 1.0.

Usage


In order to render a text property as a TinyMCE textarea, you have to configure the Web Client appropriately, by setting a component generator for your property in question. Here is an example: Suppose your model has a property (in an aspect or type) called my:summary which you want to edit using TinyMCE. Edit your Web Client configuration file to contain (within the aspect/type section):

<show-property name='kc:description' component-generator='TinyMCETextAreaGenerator'/>

That's it already!


Advanced usage


How to specify custom TinyMCE options


You can customize the TinyMCE options with which TinyMCE is initialized as follows: Edit your faces-config-custom.xml to something like:

<faces-config>

<managed-bean>
  <managed-bean-name>MyTinyMCETextAreaGenerator</managed-bean-name>
  <managed-bean-class>org.alfresco.module.WebClientTinyMCESupport.ui.TinyMCETextAreaGenerator</managed-bean-class>
  <managed-bean-scope>request</managed-bean-scope>
  <managed-property>
   <property-name>tinyMCEOptions</property-name>
   <value>
     </value>
  </managed-property>
</managed-bean>

</faces-config>

This makes MyTinyMCETextAreaGenerator; a customized generator which you can use, as above, in your Web Client configuration file. For instance:

<show-property name='kc:description' component-generator='MyTinyMCETextAreaGenerator'/>

Known issues


  • Currently, the AMP build script (file build.xml) might need minor tweaking in order build the AMP from source.
  • The 'Properties' sheet on the 'Details of …' page of a node shows the HTML code verbatim (i.e., you see all the tags). Maybe a preview should be shown instead?
  • The Link button does not show a browser for Alfresco nodes. (It is also not yet clear to me how something like this would work exactly.)

Contact


For further information on this AMP, refer to the Alfresco Forge set (see download link above).