0001: /*
0002: * Copyright (c) 2002-2003 by OpenSymphony
0003: * All rights reserved.
0004: */
0005: package com.opensymphony.webwork.components;
0006:
0007: import com.opensymphony.xwork.ActionContext;
0008: import com.opensymphony.xwork.util.OgnlValueStack;
0009:
0010: import javax.servlet.http.HttpServletRequest;
0011: import javax.servlet.http.HttpServletResponse;
0012: import java.util.Locale;
0013:
0014: /**
0015: * <!-- START SNIPPET: javadoc -->
0016: *
0017: * Create a Rich Text Editor based on FCK editor (www.fckeditor.net).
0018: *
0019: * <!-- END SNIPPET: javadoc -->
0020: *
0021: * <p/>
0022: *
0023: *
0024: * <pre>
0025: * <!-- START SNIPPET: example -->
0026: *
0027: * <ww:richtexteditor
0028: * toolbarCanCollapse="false"
0029: * width="700"
0030: * label="Description 1"
0031: * name="description1"
0032: * value="Some Content I keyed In In The Tag Itself"
0033: * />
0034: *
0035: *
0036: * <!-- END SNIPPET: example -->
0037: * </pre>
0038: *
0039: *
0040: * <!-- START SNIPPET: serversidebrowsing -->
0041: *
0042: * It is possible to have a rich text editor do server side browsing
0043: * when for example the image button is clicked. To integrate this functionality with
0044: * webwork, one need to defined the following action definition typically in xwork.xml
0045: *
0046: * <pre>
0047: * <package name="richtexteditor-browse" extends="webwork-default"
0048: * namespace="/webwork/richtexteditor/editor/filemanager/browser/default/connectors/jsp">
0049: * <action name="connector"
0050: * class="com.opensymphony.webwork.components.DefaultRichtexteditorConnector"
0051: * method="browse">
0052: * <result name="getFolders" type="richtexteditorGetFolders" />
0053: * <result name="getFoldersAndFiles" type="richtexteditorGetFoldersAndFiles" />
0054: * <result name="createFolder" type="richtexteditorCreateFolder" />
0055: * <result name="fileUpload" type="richtexteditorFileUpload" />
0056: * </action>
0057: * </package>
0058: * </pre>
0059: *
0060: * By default whenever a browse command is triggered (eg. by clicking on the 'image' button and then
0061: * 'browse server' button, the url '/webwork/static/richtexteditor/editor/filemanager/browser/default/browser.html?&Type=Image&Connector=connectors/jsp/connector.action'.
0062: * The page browser.html which comes with FCK Editor will trigger the url
0063: * '/webwork/richtexteditor/editor/filemanager/browser/default/connectors/jsp/connector.action' which will
0064: * caused the webwork's DefaultRichtexteditorConnector to be executed. The trigerring url could be
0065: * changed by altering the 'imageBrowseURL'. There 3 types of such related url, namely 'imageBrowseURL',
0066: * 'linkBrowseURL' and 'flashBrowseURL'. It is recomended that the default one being used. One could change the
0067: * Connector parameter instead. For example
0068: *
0069: * <pre>
0070: * /webwork/static/richtexteditor/editor/filemanager/browser/default/browser.html?
0071: * &Type=Image&Connector=connectors/jsp/connector.action
0072: * </pre>
0073: *
0074: * could be changed to
0075: *
0076: * <pre>
0077: * /webwork/static/richtexteditor/editor/filemanager/browser/default/browser.html?
0078: * &Type=Image&Connector=myLittlePath/myConnector.action
0079: * </pre>
0080: *
0081: * In this case the action will need to have a namespace of '/webwork/richtexteditor/editor/filemanager/browser/default/myLittlePath'
0082: * and action name of 'myConnector'
0083: *
0084: * <p/>
0085: *
0086: * By default the action method that needs to be defined in xwork.xml needs to be 'browse'. If this needs
0087: * to be something else say, myBrowse, the following could be used
0088: *
0089: * <pre>
0090: * public String myBrowse() {
0091: * browse();
0092: * }
0093: * </pre>
0094: *
0095: * <!-- END SNIPPET: serversidebrowsing -->
0096: *
0097: * <p/>
0098: *
0099: *
0100: * <!-- START SNIPPET: serversideuploading -->
0101: *
0102: * It is possible for the richtexteditor to do server side uploading as well. For example when clicking
0103: * on the 'Image' button and then the 'Upload' tab and then selecting a file from client local
0104: * machine and the clicking 'Send it to the server'. To integrate this functionality with
0105: * webwork, one need to defined the following action definition typically in xwork.xml
0106: *
0107: * <pre>
0108: * <package name="richtexteditor-upload" extends="webwork-default"
0109: * namespace="/webwork/richtexteditor/editor/filemanager/upload">
0110: * <action name="uploader"
0111: * class="com.opensymphony.webwork.components.DefaultRichtexteditorConnector"
0112: * method="upload">
0113: * <result name="richtexteditorFileUpload" />
0114: * </action>
0115: * </package>
0116: * </pre>
0117: *
0118: * By default whenever an upload command is triggered, a '/webwork/static/richtexteditor/editor/filemanager/upload/uploader.action?Type=Image'
0119: * will be issued. This could be changed by setting the imageUploadURL attribute of the tag.
0120: * When this link is issued, the webwork action will get executed. There's 3 such related upload url
0121: * namely, 'imageUploadURL', 'linkUploadURL' and 'flashUploadURL'. It is recomended that the default
0122: * one being used. However one could change the url, but need to include the Type parameter. For example
0123: *
0124: * <pre>
0125: * /webwork/static/richtexteditor/editor/filemanager/upload/uploader.action?Type=Image
0126: * </pre>
0127: *
0128: * could be changed to
0129: *
0130: * <pre>
0131: * /webwork/static/richtexteditor/editor/filemanager/upload/aDifferentUploader.action?Type=Image
0132: * </pre>
0133: *
0134: * In this case the action will need to have a namespace of '/webwork/static/richtexteditor/editor/filemanager/upload'
0135: * and action name of 'aDifferentUploader'
0136: *
0137: * By default the action method that needs to be defined in xwork.xml needs to be 'upload'. If this needs
0138: * to be something else say, myUpload, the following could be used
0139: *
0140: * <pre>
0141: * public String myUpload() {
0142: * upload();
0143: * }
0144: * </pre>
0145: *
0146: * <!-- END SNIPPET: serversideuploading -->
0147: *
0148: *
0149: * <!-- START SNIPPET: richtexteditoraction -->
0150: *
0151: * The webwork action that handles the server-side browsing and uploading needs to extends from
0152: * AbstractRichtexteditorConnector.
0153: *
0154: * There are four abstract methods need to be implemented, namely
0155: *
0156: * <p/>
0157: *
0158: * <pre>
0159: * protected abstract String calculateServerPath(String serverPath, String folderPath,
0160: * String type) throws Exception;
0161: * protected abstract Folder[] getFolders(String virtualFolderPath, String type)
0162: * throws Exception;
0163: * protected abstract FoldersAndFiles getFoldersAndFiles(String virtualFolderPath,
0164: * String type) throws Exception;
0165: * protected abstract CreateFolderResult createFolder(String virtualFolderPath,
0166: * String type, String newFolderName) throws Exception;
0167: * protected abstract FileUploadResult fileUpload(String virtualFolderPath,
0168: * String type, String filename, String contentType, java.io.File newFile)
0169: * throws Exception;
0170: * protected abstract void unknownCommand(String command, String virtualFolderPath,
0171: * String type, String filename, String contentType, java.io.File newFile)
0172: * throws Exception;
0173: * </pre>
0174: *
0175: * <!-- END SNIPPET: richtexteditoraction -->
0176: *
0177: *
0178: *
0179: * @author tm_jee
0180: * @version $Date: 2006-03-18 17:28:55 +0100 (Sat, 18 Mar 2006) $ $Id: RichTextEditor.java 2468 2006-03-18 16:28:55Z rgielen $
0181: * @see AbstractRichtexteditorConnector
0182: *
0183: * @ww.tag name="richtexteditor" tld-body-content="JSP" tld-tag-class="com.opensymphony.webwork.views.jsp.ui.RichTextEditorTag"
0184: * description="Render a rich text editor element"
0185: */
0186: public class RichTextEditor extends UIBean {
0187:
0188: final public static String TEMPLATE = "richtexteditor";
0189:
0190: private String checkBrowser;
0191: private String displayError;
0192: private String basePath = null;
0193: private String toolbarSet = null;
0194: private String width = null;
0195: private String height = null;
0196: private String customConfigurationsPath = null;
0197: private String editorAreaCSS = null;
0198: private String baseHref = null;
0199: private String skinPath = null;
0200: private String pluginsPath = null;
0201: private String fullPage = null;
0202: private String debug = null;
0203: private String autoDetectLanguage = null;
0204: private String defaultLanguage = null;
0205: private String contentLangDirection = null;
0206: private String enableXHTML = null;
0207: private String enableSourceXHTML = null;
0208: private String fillEmptyBlocks = null;
0209: private String formatSource = null;
0210: private String formatOutput = null;
0211: private String formatIndentator = null;
0212: private String geckoUseSPAN = null;
0213: private String startupFocus = null;
0214: private String forcePasteAsPlainText = null;
0215: private String forceSimpleAmpersand = null;
0216: private String tabSpaces = null;
0217: private String useBROnCarriageReturn = null;
0218: private String toolbarStartExpanded = null;
0219: private String toolbarCanCollapse = null;
0220: private String fontColors = null;
0221: private String fontNames = null;
0222: private String fontSizes = null;
0223: private String fontFormats = null;
0224: private String stylesXmlPath = null;
0225: private String templatesXmlPath = null;
0226: private String linkBrowserURL = null;
0227: private String imageBrowserURL = null;
0228: private String flashBrowserURL = null;
0229: private String linkUploadURL = null;
0230: private String imageUploadURL = null;
0231: private String flashUploadURL = null;
0232:
0233: private String allowImageBrowse;
0234: private String allowLinkBrowse;
0235: private String allowFlashBrowse;
0236: private String allowImageUpload;
0237: private String allowLinkUpload;
0238: private String allowFlashUpload;
0239: private String linkUploadAllowedExtension;
0240: private String linkUploadDeniedExtension;
0241: private String imageUploadAllowedExtension;
0242: private String imageUploadDeniedExtension;
0243: private String flashUploadAllowedExtension;
0244: private String flashUploadDeniedExtension;
0245: private String smileyPath;
0246: private String smileyImages;
0247:
0248: public RichTextEditor(OgnlValueStack stack,
0249: HttpServletRequest request, HttpServletResponse response) {
0250: super (stack, request, response);
0251: }
0252:
0253: protected String getDefaultTemplate() {
0254: return TEMPLATE;
0255: }
0256:
0257: protected void evaluateExtraParams() {
0258: super .evaluateExtraParams();
0259:
0260: // checkBrowser
0261: if (checkBrowser != null) {
0262: addParameter("checkBrowser",
0263: ((Boolean) findValue(checkBrowser, Boolean.class))
0264: .booleanValue() ? "true" : "false");
0265: }
0266:
0267: // displayError
0268: if (displayError != null) {
0269: addParameter("displayError",
0270: ((Boolean) findValue(displayError, Boolean.class))
0271: .booleanValue() ? "true" : "false");
0272: }
0273:
0274: // basePath
0275: if (basePath != null) {
0276: addParameter("basePath", findString(basePath));
0277: }
0278:
0279: // toolbarSet
0280: if (toolbarSet != null) {
0281: addParameter("toolbarSet", findString(toolbarSet));
0282: }
0283:
0284: // width
0285: if (width != null) {
0286: addParameter("width", findString(width));
0287: }
0288:
0289: // height
0290: if (height != null) {
0291: addParameter("height", findString(height));
0292: }
0293:
0294: // customConfigurationsPath
0295: if (customConfigurationsPath != null) {
0296: addParameter("customConfigurationsPath",
0297: findString(customConfigurationsPath));
0298: }
0299:
0300: // editorAreaCss
0301: if (editorAreaCSS != null) {
0302: addParameter("editorAreaCss", findString(editorAreaCSS));
0303: }
0304:
0305: // baseHref
0306: if (baseHref != null) {
0307: addParameter("baseHref", findString(baseHref));
0308: }
0309:
0310: // skinPath
0311: if (skinPath != null) {
0312: addParameter("skinPath", findString(skinPath));
0313: }
0314:
0315: // pluginsPath
0316: if (pluginsPath != null) {
0317: addParameter("pluginsPath", findString(pluginsPath));
0318: }
0319:
0320: // fullPage
0321: if (fullPage != null) {
0322: addParameter("fullPage", ((Boolean) findValue(fullPage,
0323: Boolean.class)).booleanValue() ? "true" : "false");
0324: }
0325:
0326: // debug
0327: if (debug != null) {
0328: addParameter("debug", ((Boolean) findValue(debug,
0329: Boolean.class)).booleanValue() ? "true" : "false");
0330: }
0331:
0332: // autoDetectLanguage
0333: if (autoDetectLanguage != null) {
0334: addParameter("autoDetectLanguage",
0335: ((Boolean) findValue(autoDetectLanguage,
0336: Boolean.class)).booleanValue() ? "true"
0337: : "false");
0338: } else {
0339: addParameter("autoDetectLanguage", "false"); // unless explicitly specified, else 'false' cause we need it this way so defaultLanguage will work
0340: }
0341:
0342: // defaultLanguage
0343: if (defaultLanguage != null) {
0344: addParameter("defaultLanguage", findString(defaultLanguage));
0345: } else {
0346: addParameter("defaultLanguage", getRichTextEditorJsLang());
0347: }
0348:
0349: // contentLangDirection
0350: if (contentLangDirection != null) {
0351: addParameter("contentLangDirection",
0352: findString(contentLangDirection));
0353: }
0354:
0355: // enableXHTML
0356: if (enableXHTML != null) {
0357: addParameter("enableXHTML",
0358: ((Boolean) findValue(enableXHTML, Boolean.class))
0359: .booleanValue() ? "true" : "false");
0360: }
0361:
0362: // enableSourceXHTML
0363: if (enableSourceXHTML != null) {
0364: addParameter("enableSourceXHTML",
0365: ((Boolean) findValue(enableSourceXHTML,
0366: Boolean.class)).booleanValue() ? "true"
0367: : "false");
0368: }
0369:
0370: // fillEmptyBlocks
0371: if (fillEmptyBlocks != null) {
0372: addParameter(
0373: "fillEmptyBlocks",
0374: ((Boolean) findValue(fillEmptyBlocks, Boolean.class))
0375: .booleanValue() ? "true" : "false");
0376: }
0377:
0378: // formatSource
0379: if (formatSource != null) {
0380: addParameter("formatSource",
0381: ((Boolean) findValue(formatSource, Boolean.class))
0382: .booleanValue() ? "true" : "false");
0383: }
0384:
0385: // formatOutput
0386: if (formatOutput != null) {
0387: addParameter("formatOutput",
0388: ((Boolean) findValue(formatOutput, Boolean.class))
0389: .booleanValue() ? "true" : "false");
0390: }
0391:
0392: // formatIndentator
0393: if (formatIndentator != null) {
0394: addParameter("formatIndentator",
0395: findString(formatIndentator));
0396: }
0397:
0398: // geckoUseSPAN
0399: if (geckoUseSPAN != null) {
0400: addParameter("geckoUseSPAN",
0401: ((Boolean) findValue(geckoUseSPAN, Boolean.class))
0402: .booleanValue() ? "true" : "false");
0403: }
0404:
0405: // startupFocus
0406: if (startupFocus != null) {
0407: addParameter("startupFocus",
0408: ((Boolean) findValue(startupFocus, Boolean.class))
0409: .booleanValue() ? "true" : "false");
0410: }
0411:
0412: // forcePasteAsPlainText
0413: if (forcePasteAsPlainText != null) {
0414: addParameter("forcePasteAsPlainText", ((Boolean) findValue(
0415: forcePasteAsPlainText, Boolean.class))
0416: .booleanValue() ? "true" : "false");
0417: }
0418:
0419: // forceSimpleAmpersand
0420: if (forceSimpleAmpersand != null) {
0421: addParameter("forceSimpleAmpersand", ((Boolean) findValue(
0422: forceSimpleAmpersand, Boolean.class))
0423: .booleanValue() ? "true" : "false");
0424: }
0425:
0426: // tabSpaces
0427: if (tabSpaces != null) {
0428: addParameter("tabSpaces", findString(tabSpaces));
0429: }
0430:
0431: // useBROnCarriageReturn
0432: if (useBROnCarriageReturn != null) {
0433: addParameter("useBROnCarriageReturn", ((Boolean) findValue(
0434: useBROnCarriageReturn, Boolean.class))
0435: .booleanValue() ? "true" : "false");
0436: }
0437:
0438: // toolbarStartExpanded
0439: if (toolbarStartExpanded != null) {
0440: addParameter("toolbarStartExpanded", ((Boolean) findValue(
0441: toolbarStartExpanded, Boolean.class))
0442: .booleanValue() ? "true" : "false");
0443: }
0444:
0445: // toolbarCanCollapse
0446: if (toolbarCanCollapse != null) {
0447: addParameter("toolbarCanCollapse",
0448: ((Boolean) findValue(toolbarCanCollapse,
0449: Boolean.class)).booleanValue() ? "true"
0450: : "false");
0451: }
0452:
0453: // fontColors
0454: if (fontColors != null) {
0455: addParameter("fontColors", findString(fontColors));
0456: }
0457:
0458: // fontNames
0459: if (fontNames != null) {
0460: addParameter("fontNames", findString(fontNames));
0461: }
0462:
0463: // fontSizes
0464: if (fontSizes != null) {
0465: addParameter("fontSizes", findString(fontSizes));
0466: }
0467:
0468: // fontFormats
0469: if (fontFormats != null) {
0470: addParameter("fontFormats", findString(fontFormats));
0471: }
0472:
0473: // stylesXmlPath
0474: if (stylesXmlPath != null) {
0475: addParameter("stylesXmlPath", findString(stylesXmlPath));
0476: }
0477:
0478: // template
0479: if (templatesXmlPath != null) {
0480: addParameter("templatesXmlPath",
0481: findString(templatesXmlPath));
0482: }
0483:
0484: // linkBrowserURL
0485: if (linkBrowserURL != null) {
0486: addParameter("linkBrowserURL", findString(linkBrowserURL));
0487: }
0488:
0489: // imageBrowserURL
0490: if (imageBrowserURL != null) {
0491: addParameter("imageBrowserURL", findString(imageBrowserURL));
0492: }
0493:
0494: // flashBrowserURL
0495: if (flashBrowserURL != null) {
0496: addParameter("flashBrowserURL", findString(flashBrowserURL));
0497: }
0498:
0499: // linkUploadURL
0500: if (linkUploadURL != null) {
0501: addParameter("linkUploadURL", findString(linkUploadURL));
0502: }
0503:
0504: // imageUploadURL
0505: if (imageUploadURL != null) {
0506: addParameter("imageUploadURL", findString(imageUploadURL));
0507: }
0508:
0509: // flashUploadURL
0510: if (flashUploadURL != null) {
0511: addParameter("flashUploadURL", findString(flashUploadURL));
0512: }
0513:
0514: // allowImageBrowse
0515: if (allowImageBrowse != null) {
0516: addParameter("allowImageBrowse", allowFlashBrowse);
0517: }
0518:
0519: // allowLinkBrowse
0520: if (allowLinkBrowse != null) {
0521: addParameter("allowLinkBrowse", allowLinkBrowse);
0522: }
0523:
0524: // allowFlashBrowse
0525: if (allowFlashBrowse != null) {
0526: addParameter("allowFlashBrowse", allowFlashBrowse);
0527: }
0528:
0529: // allowImageUpload
0530: if (allowImageUpload != null) {
0531: addParameter("allowImageUpload", allowImageUpload);
0532: }
0533:
0534: // allowLinkUpload
0535: if (allowLinkUpload != null) {
0536: addParameter("allowLinkUpload", allowLinkUpload);
0537: }
0538:
0539: // allowFlashUpload
0540: if (allowFlashUpload != null) {
0541: addParameter("allowFlashUpload", allowFlashUpload);
0542: }
0543:
0544: // linkUploadAllowedExtension
0545: if (linkUploadAllowedExtension != null) {
0546: addParameter("linkUploadAllowedExtension",
0547: linkUploadAllowedExtension);
0548: }
0549:
0550: // linkUploadDeniedExtension
0551: if (linkUploadDeniedExtension != null) {
0552: addParameter("linkUploadDeniedExtension",
0553: linkUploadDeniedExtension);
0554: }
0555:
0556: // imageUploadAllowedExtension
0557: if (imageUploadAllowedExtension != null) {
0558: addParameter("imageUploadAllowedExtension",
0559: imageUploadAllowedExtension);
0560: }
0561:
0562: // imageUploadDeniedExtension
0563: if (imageUploadDeniedExtension != null) {
0564: addParameter("imageUploadDeniedExtension",
0565: imageUploadDeniedExtension);
0566: }
0567:
0568: // flashUploadAllowedExtension
0569: if (flashUploadAllowedExtension != null) {
0570: addParameter("flashUploadAllowedExtension",
0571: flashUploadAllowedExtension);
0572: }
0573:
0574: // flashUploadDeniedExtension
0575: if (flashUploadDeniedExtension != null) {
0576: addParameter("flashUploadDeniedExtension",
0577: flashUploadDeniedExtension);
0578: }
0579:
0580: // smileyPath
0581: if (smileyPath != null) {
0582: addParameter("smileyPath", smileyPath);
0583: }
0584:
0585: // smileyImages
0586: if (smileyImages != null) {
0587: addParameter("smileyImages", smileyImages);
0588: }
0589: }
0590:
0591: protected String getRichTextEditorJsLang() {
0592: Locale locale = ActionContext.getContext().getLocale();
0593: return locale == null ? "enlll" : (locale.getLanguage()
0594: .toLowerCase());
0595: }
0596:
0597: public String getCheckBrowser() {
0598: return checkBrowser;
0599: }
0600:
0601: /**
0602: * Whether the rich text editor should check for browser compatibility when rendering its toolbar
0603: * @ww.tagattribute required="false" type="Boolean" default="true"
0604: */
0605: public void setCheckBrowser(String checkBrowser) {
0606: this .checkBrowser = checkBrowser;
0607: }
0608:
0609: public String getDisplayError() {
0610: return displayError;
0611: }
0612:
0613: /**
0614: * Whether should the rich text editor display error when it fails to render etc.
0615: * @ww.tagattribute required="false" type="Boolean" default="true"
0616: */
0617: public void setDisplayError(String displayError) {
0618: this .displayError = displayError;
0619: }
0620:
0621: public String getAutoDetectLanguage() {
0622: return autoDetectLanguage;
0623: }
0624:
0625: /**
0626: * Tells the editor to automatically detect the user language preferences to adapt its interface language. With Internet Explorer, the language configured in the Windows Control Panel is used. With Firefox, the browser language is used
0627: * @ww.tagattribute required="false" type="Boolean" default="true"
0628: */
0629: public void setAutoDetectLanguage(String autoDetectLanguage) {
0630: this .autoDetectLanguage = autoDetectLanguage;
0631: }
0632:
0633: public String getBaseHref() {
0634: return baseHref;
0635: }
0636:
0637: /**
0638: * Base URL used to resolve links (on images, links, styles, etc.). For example, if BaseHref is set to 'http://www.fredck.com', an image that points to "/images/Logo.gif" will be interpreted by the editor as "http://www.fredck.com/images/Logo.gif", without touching the "src" attribute of the image.
0639: * @ww.tagattribute required="false" type="String" default=" "
0640: */
0641: public void setBaseHref(String baseHref) {
0642: this .baseHref = baseHref;
0643: }
0644:
0645: public String getBasePath() {
0646: return basePath;
0647: }
0648:
0649: /**
0650: * Set the dir where the FCKeditor files reside on the server
0651: * @ww.tagattribute required="false" type="String" default="/webwork/static/richtexteditor/"
0652: */
0653: public void setBasePath(String basePath) {
0654: this .basePath = basePath;
0655: }
0656:
0657: public String getContentLangDirection() {
0658: return contentLangDirection;
0659: }
0660:
0661: /**
0662: * Sets the direction of the editor area contents. Either ltr or rtl
0663: * @ww.tagattribute required="false" type="String" default="ltr"
0664: */
0665: public void setContentLangDirection(String contentLangDirection) {
0666: this .contentLangDirection = contentLangDirection;
0667: }
0668:
0669: public String getCustomConfigurationsPath() {
0670: return customConfigurationsPath;
0671: }
0672:
0673: /**
0674: * Set the path of a custom file that can override some configurations. It is recommended to use absolute paths (starting with /), like /myfckconfig.js.
0675: * @ww.tagattribute required="false" type="String" default=" "
0676: */
0677: public void setCustomConfigurationsPath(
0678: String customConfigurationsPath) {
0679: this .customConfigurationsPath = customConfigurationsPath;
0680: }
0681:
0682: public String getDebug() {
0683: return debug;
0684: }
0685:
0686: /**
0687: * Enables the debug window to be shown when calling the FCKDebug.Output() function.
0688: * @ww.tagattribute required="false" type="Boolean" default="false"
0689: */
0690: public void setDebug(String debug) {
0691: this .debug = debug;
0692: }
0693:
0694: public String getDefaultLanguage() {
0695: return defaultLanguage;
0696: }
0697:
0698: /**
0699: * Sets the default language used for the editor's interface localization. The default language is used when the AutoDetectLanguage options is disabled or when the user language is not available.
0700: * @ww.tagattribute required="false" type="String" default="en"
0701: */
0702: public void setDefaultLanguage(String defaultLanguage) {
0703: this .defaultLanguage = defaultLanguage;
0704: }
0705:
0706: public String getEditorAreaCSS() {
0707: return editorAreaCSS;
0708: }
0709:
0710: /**
0711: * Set the CSS styles file to be used in the editing area. In this way you can point to a file that reflects your web site styles
0712: * @ww.tagattribute required="false" type="String" default="css/fck_editorarea.css"
0713: */
0714: public void setEditorAreaCSS(String editorAreaCSS) {
0715: this .editorAreaCSS = editorAreaCSS;
0716: }
0717:
0718: public String getEnableSourceXHTML() {
0719: return enableSourceXHTML;
0720: }
0721:
0722: /**
0723: * Tells the editor to process the HTML source to XHTML when switching from WYSIWYG to Source view
0724: * @ww.tagattribute required="false" type="String" default="true"
0725: */
0726: public void setEnableSourceXHTML(String enableSourceXHTML) {
0727: this .enableSourceXHTML = enableSourceXHTML;
0728: }
0729:
0730: public String getEnableXHTML() {
0731: return enableXHTML;
0732: }
0733:
0734: /**
0735: * Tells the editor to process the HTML source to XHTML on form post.
0736: * @ww.tagattribute required="false" type="String" default="true"
0737: */
0738: public void setEnableXHTML(String enableXHTML) {
0739: this .enableXHTML = enableXHTML;
0740: }
0741:
0742: public String getFillEmptyBlocks() {
0743: return fillEmptyBlocks;
0744: }
0745:
0746: /**
0747: * Block elements (like P, DIV, H1, PRE, etc...) are forced to have content (a &nbsp;).
0748: * Empty blocks are "collapsed" by while browsing, so a empty <p></p> is not visible.
0749: * While editing, the editor "expand" empty blocks so you can insert content inside then.
0750: * Setting this option to "true" results useful to reflect the same output when browsing and editing.
0751: * @ww.tagattribute required="false" type="String" default="true"
0752: */
0753: public void setFillEmptyBlocks(String fillEmptyBlocks) {
0754: this .fillEmptyBlocks = fillEmptyBlocks;
0755: }
0756:
0757: public String getFlashBrowserURL() {
0758: return flashBrowserURL;
0759: }
0760:
0761: /**
0762: * Sets the URL of the page called when the user clicks the 'Browse Server' button in the "Flash" dialog window. In this way, you can create your custom Flash Browser that is well integrated with your system.
0763: * @ww.tagattribute required="false" type="String" default="/webwork/static/ richtexteditor/ editor/filemanager/ browser/default/browser.html? Type=Flash& Connector=connectors/jsp/connector.action"
0764: */
0765: public void setFlashBrowserURL(String flashBrowserURL) {
0766: this .flashBrowserURL = flashBrowserURL;
0767: }
0768:
0769: public String getFlashUploadURL() {
0770: return flashUploadURL;
0771: }
0772:
0773: /**
0774: * Sets the URL of the upload handler called when the user clicks the 'Send it to server' button in the "Flash" dialog window. In this way, you can create your custom Flash Uploader that is well integrated with your system.
0775: * @ww.tagattribute required="false" type="string" default="/webwork/static/ richtexteditor/ editor/filemanager/ upload/uploader.action? Type=Flash"
0776: */
0777: public void setFlashUploadURL(String flashUploadURL) {
0778: this .flashUploadURL = flashUploadURL;
0779: }
0780:
0781: public String getFontColors() {
0782: return fontColors;
0783: }
0784:
0785: /**
0786: * Sets the colors that must be shown in the colors panels (in the toolbar).
0787: * @ww.tagattribute required="false" type="string" default="000000, 993300, 333300, 003300, 003366, 000080, 333399, 333333, 800000, FF6600, 808000, 808080, 008080, 0000FF, 666699, 808080, FF0000, FF9900, 99CC00, 339966, 33CCCC, 3366FF, 800080, 999999, FF00FF, FFCC00, FFFF00, 00FF00, 00FFFF, 00CCFF, 993366, C0C0C0, FF99CC, FFCC99, FFFF99, CCFFCC, CCFFFF, 99CCFF, CC99FF, FFFFFF"
0788: */
0789: public void setFontColors(String fontColors) {
0790: this .fontColors = fontColors;
0791: }
0792:
0793: public String getFontFormats() {
0794: return fontFormats;
0795: }
0796:
0797: /**
0798: * Sets the list of formats to be shown in the "Format" toolbar command.
0799: * @ww.tagattribute required="false" type="string" default="p; div; pre; address; h1; h2; h3; h4; h5; h6"
0800: */
0801: public void setFontFormats(String fontFormats) {
0802: this .fontFormats = fontFormats;
0803: }
0804:
0805: public String getFontNames() {
0806: return fontNames;
0807: }
0808:
0809: /**
0810: * Sets the list of fonts to be shown in the "Font" toolbar command.
0811: * @ww.tagattribute required="false" type="string" default="Arial; Comic Sans MS; Courier New; Tahoma; Times New Roman; Verdana"
0812: */
0813: public void setFontNames(String fontNames) {
0814: this .fontNames = fontNames;
0815: }
0816:
0817: public String getFontSizes() {
0818: return fontSizes;
0819: }
0820:
0821: /**
0822: * Sets the list of font sizes to be shown in the "Size" toolbar command.
0823: * @ww.tagattribute required="false" type="string" default="1/xx-small; 2/x-small; 3/small; 4/medium; 5/large; 6/x-large; 7/xx-large"
0824: */
0825: public void setFontSizes(String fontSizes) {
0826: this .fontSizes = fontSizes;
0827: }
0828:
0829: public String getForcePasteAsPlainText() {
0830: return forcePasteAsPlainText;
0831: }
0832:
0833: /**
0834: * Converts the clipboard contents to pure text on pasting operations
0835: * @ww.tagattribute required="false" type="boolean" default="false"
0836: */
0837: public void setForcePasteAsPlainText(String forcePasteAsPlainText) {
0838: this .forcePasteAsPlainText = forcePasteAsPlainText;
0839: }
0840:
0841: public String getForceSimpleAmpersand() {
0842: return forceSimpleAmpersand;
0843: }
0844:
0845: /**
0846: * Forces the ampersands (&) on tags attributes to not be converted to '&amp;' This conversion is a W3C requirement for XHTML, so it is recommended to leave this option to 'false'.
0847: * @ww.tagattribute required="false" type="boolean" default="false"
0848: */
0849: public void setForceSimpleAmpersand(String forceSimpleAmpersand) {
0850: this .forceSimpleAmpersand = forceSimpleAmpersand;
0851: }
0852:
0853: public String getFormatIndentator() {
0854: return formatIndentator;
0855: }
0856:
0857: /**
0858: * Sets the characters to be used when indenting the HTML source when formatting it. Useful values are a sequence of spaces (' ') or a tab char ('\t').
0859: * @ww.tagattribute required="false" type="boolean" default="' '"
0860: */
0861: public void setFormatIndentator(String formatIndentator) {
0862: this .formatIndentator = formatIndentator;
0863: }
0864:
0865: public String getFormatOutput() {
0866: return formatOutput;
0867: }
0868:
0869: /**
0870: * The output HTML generated by the editor will be processed and formatted.
0871: * @ww.tagattribute required="false" type="boolean" default="true"
0872: */
0873: public void setFormatOutput(String formatOutput) {
0874: this .formatOutput = formatOutput;
0875: }
0876:
0877: public String getFormatSource() {
0878: return formatSource;
0879: }
0880:
0881: /**
0882: * The HTML shown by the editor, while switching from WYSIWYG to Source views, will be processed and formatted
0883: * @ww.tagattribute required="false" type="boolean" default="true"
0884: */
0885: public void setFormatSource(String formatSource) {
0886: this .formatSource = formatSource;
0887: }
0888:
0889: public String getFullPage() {
0890: return fullPage;
0891: }
0892:
0893: /**
0894: * Enables full page editing (from <HTML> to </HTML>). It also enables the 'Page Properties' toolbar button.
0895: * @ww.tagattribute required="false" type="boolean" default="false"
0896: */
0897: public void setFullPage(String fullPage) {
0898: this .fullPage = fullPage;
0899: }
0900:
0901: public String getGeckoUseSPAN() {
0902: return geckoUseSPAN;
0903: }
0904:
0905: /**
0906: * Tells Gecko browsers to use SPAN instead of <B>, <I> and <U> for bold, italic an underline
0907: * @ww.tagattribute required="false" type="boolean" default="true"
0908: */
0909: public void setGeckoUseSPAN(String geckoUseSPAN) {
0910: this .geckoUseSPAN = geckoUseSPAN;
0911: }
0912:
0913: public String getHeight() {
0914: return height;
0915: }
0916:
0917: /**
0918: * Set the height of the rich text editor
0919: * @ww.tagattribute required="false" type="string" default="200"
0920: */
0921: public void setHeight(String height) {
0922: this .height = height;
0923: }
0924:
0925: public String getImageBrowserURL() {
0926: return imageBrowserURL;
0927: }
0928:
0929: /**
0930: * Sets the URL of the page called when the user clicks the 'Browse Server' button in the 'Image' dialog window. In this way, you can create your custom Image Browser that is well integrated with your system.
0931: * @ww.tagattribute required="false" type="string" default="/webwork/static/ richtexteditor/ editor/filemanager/ browser/default/browser.html? Type=Image& Connector=connectors/jsp/connector.action"
0932: */
0933: public void setImageBrowserURL(String imageBrowserURL) {
0934: this .imageBrowserURL = imageBrowserURL;
0935: }
0936:
0937: public String getImageUploadURL() {
0938: return imageUploadURL;
0939: }
0940:
0941: /**
0942: * Sets the URL of the upload handler called when the user clicks the 'Send it to server' button in the 'Image' dialog window. In this way, you can create your custom Image Uploader that is well integrated with your system.
0943: * @ww.tagattribute required="false" type="string" default="/webwork/static/ richtexteditor/ editor/filemanager/ upload/uploader.action? Type=Image"
0944: */
0945: public void setImageUploadURL(String imageUploadURL) {
0946: this .imageUploadURL = imageUploadURL;
0947: }
0948:
0949: public String getLinkBrowserURL() {
0950: return linkBrowserURL;
0951: }
0952:
0953: /**
0954: * Sets the URL of the page called when the user clicks the 'Browse Server' button in the 'Link' dialog window. In this way, you can create your custom File Browser that is well integrated with your system.
0955: * @ww.tagattribute required="false" type="string" default="/webwork/static/ richtexteditor/ editor/filemanager/ browser/default/browser.html? Type=File& Connector=connectors/jsp/connector.action"
0956: */
0957: public void setLinkBrowserURL(String linkBrowserURL) {
0958: this .linkBrowserURL = linkBrowserURL;
0959: }
0960:
0961: public String getLinkUploadURL() {
0962: return linkUploadURL;
0963: }
0964:
0965: /**
0966: * Sets the URL of the upload handler called when the user clicks the 'Send it to server' button in the 'Link' dialog window. In this way, you can create your custom Link Uploader that is well integrated with your system.
0967: * @ww.tagattribute required="false" type="string" default="/webwork/static/ richtexteditor/ editor/filemanager/ upload/uploader.action? Type=File"
0968: */
0969: public void setLinkUploadURL(String linkUploadURL) {
0970: this .linkUploadURL = linkUploadURL;
0971: }
0972:
0973: public String getPluginsPath() {
0974: return pluginsPath;
0975: }
0976:
0977: /**
0978: * Sets the base path used when looking for registered plugins.
0979: * @ww.tagattribute required="false" type="string" default="/webwork/static/richtexteditor/plugins/"
0980: */
0981: public void setPluginsPath(String pluginsPath) {
0982: this .pluginsPath = pluginsPath;
0983: }
0984:
0985: public String getSkinPath() {
0986: return skinPath;
0987: }
0988:
0989: /**
0990: * Sets the path to the skin (graphical interface settings) to be used by the editor.
0991: * @ww.tagattribute required="false" type="string" default="/webwork/static/richtexteditor/skins/default"
0992: */
0993: public void setSkinPath(String skinPath) {
0994: this .skinPath = skinPath;
0995: }
0996:
0997: public String getStartupFocus() {
0998: return startupFocus;
0999: }
1000:
1001: /**
1002: * Forces the editor to get the keyboard input focus on startup (page load)
1003: * @ww.tagattribute required="false" type="boolean" default="false"
1004: */
1005: public void setStartupFocus(String startupFocus) {
1006: this .startupFocus = startupFocus;
1007: }
1008:
1009: public String getStylesXmlPath() {
1010: return stylesXmlPath;
1011: }
1012:
1013: /**
1014: * Sets the path to the XML file that has the definitions and rules of the styles used by the 'Style' toolbar command
1015: * @ww.tagattribute required="false" type="string" default="/webwork/static/richtexteditor/fckstyles.xml"
1016: */
1017: public void setStylesXmlPath(String stylesXmlPath) {
1018: this .stylesXmlPath = stylesXmlPath;
1019: }
1020:
1021: public String getTabSpaces() {
1022: return tabSpaces;
1023: }
1024:
1025: /**
1026: * Set the number of spaces (&nbsp) to be inserted when the user hits the 'tab' key. This is an Internet Explorer only feature. Other browsers insert spaces automatically by default.
1027: * @ww.tagattribute required="false" type="string" default="0"
1028: */
1029: public void setTabSpaces(String tabSpaces) {
1030: this .tabSpaces = tabSpaces;
1031: }
1032:
1033: public String getToolbarCanCollapse() {
1034: return toolbarCanCollapse;
1035: }
1036:
1037: /**
1038: * Tells the editor that the toolbar can be Collapsed/Expanded by the user when clicking the vertical bar placed on the left of it (on the right for 'rtl' languages).
1039: * @ww.tagattribute required="false" type="boolean" default="true"
1040: *
1041: */
1042: public void setToolbarCanCollapse(String toolbarCanCollapse) {
1043: this .toolbarCanCollapse = toolbarCanCollapse;
1044: }
1045:
1046: public String getToolbarSet() {
1047: return toolbarSet;
1048: }
1049:
1050: /**
1051: * Set the name of the toolbar to display
1052: * @ww.tagattribute required="false" type="string" default="Default"
1053: */
1054: public void setToolbarSet(String toolbarSet) {
1055: this .toolbarSet = toolbarSet;
1056: }
1057:
1058: public String getToolbarStartExpanded() {
1059: return toolbarStartExpanded;
1060: }
1061:
1062: /**
1063: * Decide if the toolbar should be expanded when the rich text editor is loaded
1064: * @ww.tagattribute required="false" type="boolean" default="true"
1065: */
1066: public void setToolbarStartExpanded(String toolbarStartExpanded) {
1067: this .toolbarStartExpanded = toolbarStartExpanded;
1068: }
1069:
1070: public String getUseBROnCarriageReturn() {
1071: return useBROnCarriageReturn;
1072: }
1073:
1074: /**
1075: * Decide if a <br/> should be used in place of the occurence of a carriage return
1076: * @ww.tagattribute required="false" type="boolean" default="true"
1077: */
1078: public void setUseBROnCarriageReturn(String useBROnCarriageReturn) {
1079: this .useBROnCarriageReturn = useBROnCarriageReturn;
1080: }
1081:
1082: public String getWidth() {
1083: return width;
1084: }
1085:
1086: /**
1087: * set the width of the rich text editor
1088: * @ww.tagattribute required="false" type="string" default="100%"
1089: */
1090: public void setWidth(String width) {
1091: this .width = width;
1092: }
1093:
1094: public String getAllowFlashBrowse() {
1095: return allowFlashBrowse;
1096: }
1097:
1098: /**
1099: * determine if to allow flash browsing
1100: * @ww.tagattribute required="false" type="boolean" default="true"
1101: */
1102: public void setAllowFlashBrowse(String allowFlashBrowse) {
1103: this .allowFlashBrowse = allowFlashBrowse;
1104: }
1105:
1106: public String getAllowFlashUpload() {
1107: return allowFlashUpload;
1108: }
1109:
1110: /**
1111: * determine if to allow flash upload
1112: * @ww.tagattribute required="false" type="boolean" default="true"
1113: */
1114: public void setAllowFlashUpload(String allowFlashUpload) {
1115: this .allowFlashUpload = allowFlashUpload;
1116: }
1117:
1118: public String getAllowImageBrowse() {
1119: return allowImageBrowse;
1120: }
1121:
1122: /**
1123: * determine if to allow image browsing
1124: * @ww.tagattribute required="false" type="boolean" default="true"
1125: */
1126: public void setAllowImageBrowse(String allowImageBrowse) {
1127: this .allowImageBrowse = allowImageBrowse;
1128: }
1129:
1130: public String getAllowImageUpload() {
1131: return allowImageUpload;
1132: }
1133:
1134: /**
1135: * determine if to allow image uploading
1136: * @ww.tagattribute required="false" type="boolean" default="true"
1137: */
1138: public void setAllowImageUpload(String allowImageUpload) {
1139: this .allowImageUpload = allowImageUpload;
1140: }
1141:
1142: public String getAllowLinkBrowse() {
1143: return allowLinkBrowse;
1144: }
1145:
1146: /**
1147: * determine if to allow link browsing
1148: * @ww.tagattribute required="false" type="boolean" default="true"
1149: */
1150: public void setAllowLinkBrowse(String allowLinkBrowse) {
1151: this .allowLinkBrowse = allowLinkBrowse;
1152: }
1153:
1154: public String getAllowLinkUpload() {
1155: return allowLinkUpload;
1156: }
1157:
1158: /**
1159: * determine if to allow link uploading
1160: * @ww.tagattribute required="false" type="boolean" default="true"
1161: */
1162: public void setAllowLinkUpload(String allowLinkUpload) {
1163: this .allowLinkUpload = allowLinkUpload;
1164: }
1165:
1166: public String getFlashUploadAllowedExtension() {
1167: return flashUploadAllowedExtension;
1168: }
1169:
1170: /**
1171: * regexp for allowed flash upload file format
1172: * @ww.tagattribute required="false" type="string" default=".(swf|fla)$"
1173: */
1174: public void setFlashUploadAllowedExtension(
1175: String flashUploadAllowedExtension) {
1176: this .flashUploadAllowedExtension = flashUploadAllowedExtension;
1177: }
1178:
1179: public String getFlashUploadDeniedExtension() {
1180: return flashUploadDeniedExtension;
1181: }
1182:
1183: /**
1184: * regexp for deinied flash upload file format
1185: * @ww.tagattribute required="false" type="string" default=""
1186: */
1187: public void setFlashUploadDeniedExtension(
1188: String flashUploadDeniedExtension) {
1189: this .flashUploadDeniedExtension = flashUploadDeniedExtension;
1190: }
1191:
1192: public String getImageUploadAllowedExtension() {
1193: return imageUploadAllowedExtension;
1194: }
1195:
1196: /**
1197: * regexp for allowed image upload file format
1198: * @ww.tagattribute required="false" type="string" default=".(jpg|gif|jpeg|png)$"
1199: */
1200: public void setImageUploadAllowedExtension(
1201: String imageUploadAllowedExtension) {
1202: this .imageUploadAllowedExtension = imageUploadAllowedExtension;
1203: }
1204:
1205: public String getImageUploadDeniedExtension() {
1206: return imageUploadDeniedExtension;
1207: }
1208:
1209: /**
1210: * regexp for denied image upload file format
1211: * @ww.tagattribute required="false" type="string" default=""
1212: */
1213: public void setImageUploadDeniedExtension(
1214: String imageUploadDeniedExtension) {
1215: this .imageUploadDeniedExtension = imageUploadDeniedExtension;
1216: }
1217:
1218: public String getLinkUploadAllowedExtension() {
1219: return linkUploadAllowedExtension;
1220: }
1221:
1222: /**
1223: * regexp for allowed link upload file format
1224: * @ww.tagattribute required="false" type="string" default=""
1225: */
1226: public void setLinkUploadAllowedExtension(
1227: String linkUploadAllowedExtension) {
1228: this .linkUploadAllowedExtension = linkUploadAllowedExtension;
1229: }
1230:
1231: public String getLinkUploadDeniedExtension() {
1232: return linkUploadDeniedExtension;
1233: }
1234:
1235: /**
1236: * regexp for denied link upload file format
1237: * @ww.tagattribute required="false" type="string" default=".(php| php3| php5| phtml| asp| aspx| ascx| jsp| cfm| cfc| pl| bat| exe| dll| reg| cgi)$"
1238: */
1239: public void setLinkUploadDeniedExtension(
1240: String linkUploadDeniedExtension) {
1241: this .linkUploadDeniedExtension = linkUploadDeniedExtension;
1242: }
1243:
1244: public String getSmileyImages() {
1245: return smileyImages;
1246: }
1247:
1248: /**
1249: * js array of smilies files to be included
1250: * @ww.tagattribute required="false" type="string' default="['regular_smile.gif', 'sad_smile.gif', 'wink_smile.gif', 'teeth_smile.gif', 'confused_smile.gif', 'tounge_smile.gif', 'embaressed_smile.gif', 'omg_smile.gif', 'whatchutalkingabout_smile.gif', 'angry_smile.gif', 'angel_smile.gif', 'shades_smile.gif', 'devil_smile.gif', 'cry_smile.gif', 'lightbulb.gif', 'thumbs_down.gif', 'thumbs_up.gif', 'heart.gif', 'broken_heart.gif', 'kiss.gif', 'envelope.gif']"
1251: */
1252: public void setSmileyImages(String smileyImages) {
1253: this .smileyImages = smileyImages;
1254: }
1255:
1256: public String getSmileyPath() {
1257: return smileyPath;
1258: }
1259:
1260: /**
1261: * path where smilies are located
1262: * @ww.tagattribute required="false" type="string" default="/webwork/static/ richtexteditor/editor/ images/smiley/msn/"
1263: */
1264: public void setSmileyPath(String smileyPath) {
1265: this .smileyPath = smileyPath;
1266: }
1267:
1268: public String getTemplatesXmlPath() {
1269: return templatesXmlPath;
1270: }
1271:
1272: public void setTemplatesXmlPath(String templatesXmlPath) {
1273: this.templatesXmlPath = templatesXmlPath;
1274: }
1275:
1276: }
|