info.magnolia.module.fckeditor.dialogs
Class FckEditorDialog

java.lang.Object
  extended by info.magnolia.cms.gui.dialog.DialogControlImpl
      extended by info.magnolia.cms.gui.dialog.DialogBox
          extended by info.magnolia.module.fckeditor.dialogs.FckEditorDialog
All Implemented Interfaces:
DialogControl

public class FckEditorDialog
extends DialogBox

A Magnolia dialog for the universal usage and configuration of the fckeditor. Credits for FCKEditor: http://ckeditor.com

The fckEditor is mainly configured in javascript files. Those files are configured with the following attributes.

Where the default values are: To make life easier we provide some attributes to configure the control in the magnolia configuration instead within the javascript files.
css The css file to use. Default is /admindocroot/fckeditor/custom/css/magnoliaStandard.css  
height The height of the editor.  
width The width of the editor.  
tables The table editing features are available if true  
lists The list features are available if true  
aligment The aligment features are available if true  
images The image editing features including upload are available if true  
fileUpload The file upload features is enabled if true  
styles Defines the xml file defining the used styles. See http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Styles for details  
templates Defines the xml file defining the used templates. See http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Templates for details  
fonts A semicolon separated list of font names.  
fontSizes A semicolon separated list of font sizes  
colors A comma separated list of colors. hex values without #.  
source Show the source button  
showSpellChecker Show the spellchecker button  
spellChecker A spellchecker provider. Possible values are:
  • By default spell checking is not enabled. This amounts to an empty value.
  • ieSpell A spell checker for IE only.
  • SpellerPages Requires a separate php or perl setup.
  • WSC - Web Spell Checker provided by SpellChecker.net (free with advertisements)
  • SCAYT - "Spell Check as You Type" provided by SpellChecker.net (free with advertisements)

More information about the FCK spell checker feature can be found here Configuration_Options/SpellChecker and here Configuration/Spell_Checker

Version:
$Id$
Author:
bert schulzki, Fabrizio Giustina

Nested Class Summary
static class FckEditorDialog.SpellCheckerProviders
          The spell checker providers supported by fckEditor.
 
Field Summary
static String FCKEDIT_PATH
          The new .BasePath of the editor.
static String PARAM_CSS
           
static String PARAM_CSS_DEFAULT
           
static String PARAM_CUSTOM_CONFIGURATION_PATH
          This parameter defines the configuration script.
static String PARAM_CUSTOM_CONFIGURATION_PATH_DEFAULT
           
static String PARAM_FONT_SIZES
           
static String PARAM_FONT_SIZES_DEFAULT
           
static String PARAM_FONTS
           
static String PARAM_FONTS_DEFAULT
           
static String PARAM_HEIGHT
           
static String PARAM_HEIGHT_DEFAULT
           
static String PARAM_IMAGES
           
static String PARAM_IMAGES_DEFAULT
           
static String PARAM_JS_INIT_FILE
          This parameter defines the startup script.
static String PARAM_JS_INIT_FILE_DEFAULT
          Default values.
static String PARAM_SOURCE
           
static String PARAM_SOURCE_DEFAULT
           
static String PARAM_STYLES
           
static String PARAM_STYLES_DEFAULT
           
static String PARAM_TABLES
           
static String PARAM_TABLES_DEFAULT
           
static String PARAM_TEMPLATES
           
static String PARAM_TEMPLATES_DEFAULT
           
static String PARAM_WIDTH
           
static String PARAM_WIDTH_DEFAULT
           
 
Fields inherited from class info.magnolia.cms.gui.dialog.DialogBox
BOXTYPE_1COL, BOXTYPE_2COLS
 
Fields inherited from class info.magnolia.cms.gui.dialog.DialogControlImpl
DEFAULT_VALUE_PROPERTY, SESSION_ATTRIBUTENAME_DIALOGOBJECT, SESSION_ATTRIBUTENAME_DIALOGOBJECT_REMOVE, VALIDATION_PATTERN_PROPERTY, value
 
Constructor Summary
FckEditorDialog()
          Empty constructor should only be used by DialogFactory.
 
Method Summary
 String convertToView(String value)
           
 void drawHtml(Writer out)
          Actually draw the dialog content.
 String escapeJsValue(String src)
          Escapes the given String to make it javascript friendly.
 String getVarName()
           
 void init(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Content websiteNode, Content configNode)
          Initialize a Dialog.
 
Methods inherited from class info.magnolia.cms.gui.dialog.DialogBox
drawHtmlPost, drawHtmlPre, getBoxType, getHtmlDescription, setBoxType
 
Methods inherited from class info.magnolia.cms.gui.dialog.DialogControlImpl
addOption, addSub, clearWebsiteNode, drawHtmlPostSubs, drawHtmlPreSubs, drawSubs, getConfigValue, getConfigValue, getDescription, getId, getLabel, getMessage, getMessage, getMessages, getName, getOptions, getParent, getRequest, getResponse, getStorageNode, getSub, getSubs, getTopParent, getValidationPattern, getValue, getValues, getWebsiteNode, isRequired, readValue, readValues, removeSessionAttribute, setConfig, setConfig, setConfig, setDescription, setLabel, setName, setOptions, setRequired, setSaveInfo, setSessionAttribute, setTopParent, setValidationMessage, setValue, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FCKEDIT_PATH

public static final String FCKEDIT_PATH
The new .BasePath of the editor.

See Also:
Constant Field Values

PARAM_JS_INIT_FILE

public static final String PARAM_JS_INIT_FILE
This parameter defines the startup script. This parameter is searched in the dialog configuration.

See Also:
Constant Field Values

PARAM_CUSTOM_CONFIGURATION_PATH

public static final String PARAM_CUSTOM_CONFIGURATION_PATH
This parameter defines the configuration script.

See Also:
Constant Field Values

PARAM_CSS

public static final String PARAM_CSS
See Also:
Constant Field Values

PARAM_HEIGHT

public static final String PARAM_HEIGHT
See Also:
Constant Field Values

PARAM_WIDTH

public static final String PARAM_WIDTH
See Also:
Constant Field Values

PARAM_TABLES

public static final String PARAM_TABLES
See Also:
Constant Field Values

PARAM_IMAGES

public static final String PARAM_IMAGES
See Also:
Constant Field Values

PARAM_STYLES

public static final String PARAM_STYLES
See Also:
Constant Field Values

PARAM_TEMPLATES

public static final String PARAM_TEMPLATES
See Also:
Constant Field Values

PARAM_FONTS

public static final String PARAM_FONTS
See Also:
Constant Field Values

PARAM_FONT_SIZES

public static final String PARAM_FONT_SIZES
See Also:
Constant Field Values

PARAM_SOURCE

public static final String PARAM_SOURCE
See Also:
Constant Field Values

PARAM_JS_INIT_FILE_DEFAULT

public static final String PARAM_JS_INIT_FILE_DEFAULT
Default values.

See Also:
Constant Field Values

PARAM_CUSTOM_CONFIGURATION_PATH_DEFAULT

public static final String PARAM_CUSTOM_CONFIGURATION_PATH_DEFAULT
See Also:
Constant Field Values

PARAM_CSS_DEFAULT

public static final String PARAM_CSS_DEFAULT
See Also:
Constant Field Values

PARAM_HEIGHT_DEFAULT

public static final String PARAM_HEIGHT_DEFAULT
See Also:
Constant Field Values

PARAM_WIDTH_DEFAULT

public static final String PARAM_WIDTH_DEFAULT
See Also:
Constant Field Values

PARAM_TABLES_DEFAULT

public static final String PARAM_TABLES_DEFAULT
See Also:
Constant Field Values

PARAM_IMAGES_DEFAULT

public static final String PARAM_IMAGES_DEFAULT
See Also:
Constant Field Values

PARAM_STYLES_DEFAULT

public static final String PARAM_STYLES_DEFAULT
See Also:
Constant Field Values

PARAM_TEMPLATES_DEFAULT

public static final String PARAM_TEMPLATES_DEFAULT
See Also:
Constant Field Values

PARAM_FONTS_DEFAULT

public static final String PARAM_FONTS_DEFAULT
See Also:
Constant Field Values

PARAM_FONT_SIZES_DEFAULT

public static final String PARAM_FONT_SIZES_DEFAULT
See Also:
Constant Field Values

PARAM_SOURCE_DEFAULT

public static final String PARAM_SOURCE_DEFAULT
See Also:
Constant Field Values
Constructor Detail

FckEditorDialog

public FckEditorDialog()
Empty constructor should only be used by DialogFactory.

Method Detail

getVarName

public String getVarName()
Returns:
The name of the variable for the editor object

init

public void init(javax.servlet.http.HttpServletRequest request,
                 javax.servlet.http.HttpServletResponse response,
                 Content websiteNode,
                 Content configNode)
          throws javax.jcr.RepositoryException
Description copied from interface: DialogControl
Initialize a Dialog. This method is guaranteed to be called just after the control instantiation.

Specified by:
init in interface DialogControl
Overrides:
init in class DialogControlImpl
Parameters:
request - current HttpServletRequest
response - current HttpServletResponse
websiteNode - current website node
configNode - configuration node for the dialog
Throws:
javax.jcr.RepositoryException
See Also:
DialogControl.init(HttpServletRequest, HttpServletResponse, Content, Content)

drawHtml

public void drawHtml(Writer out)
              throws IOException
Description copied from interface: DialogControl
Actually draw the dialog content.

Specified by:
drawHtml in interface DialogControl
Overrides:
drawHtml in class DialogControlImpl
Parameters:
out - Writer
Throws:
IOException - exceptions thrown when writing to the Writer can be safely rethrown by the dialog
See Also:
DialogControl.drawHtml(Writer)

convertToView

public String convertToView(String value)
Parameters:
value -
Returns:

escapeJsValue

public String escapeJsValue(String src)
Escapes the given String to make it javascript friendly. (escaping single quotes, double quotes, new lines, backslashes, ...)

Parameters:
src -
Returns:
escaped js String
See Also:
StringEscapeUtils.escapeJavaScript(String)


Copyright © 2003–2014 Magnolia International Ltd.. All rights reserved.