Print version
  Products   wiris.com 
Products » Formula and CAS plugins » FCKeditor plugin


WIRIS Formula Editor
Formula and CAS plugins
WIRIS Desktop
WIRIS CAS
WIRIS Quizzes
 
FCKeditor WIRIS Plugin integration

1        FCKeditor WIRIS Plugin integration

1.1      Download files

Available packages:

 

Note: you should have a valid license to install the plugin in a production environment; otherwise, you can use the downloaded file just for demo purposes. To acquire the full rights license, please contact to info@wiris.com or visit www.wiris.com.

1.2      Copying files

Unzip the FCKeditor WIRIS Plugin and copy the fckeditor_wiris directory into your FCKeditor plugins directory. For example, you will have fckeditor/editor/plugins/fckeditor_wiris (the name of the WIRIS plugin directory must be fckeditor_wiris).

1.2.1      For PHP servers

Because the plugin needs server scripting support, we provide a solution based on PHP (which could be rewritten to any desired scripting language). To use our PHP integration files, you must give execution rights to the web server user on the PHP files contained at to fckeditor/editor/plugins/fckeditor_wiris/integration. Now, give write permissions to fckeditor/editor/plugins/fckeditor_wiris/cache and to fckeditor/editor/plugins/fckeditor_wiris/formulas directories to the web server user (it will be used to store formula MathML codes and temporal images).

1.2.2      For ASP.NET servers

Because the plugin needs server scripting support, we provide a solution based on ASP.NET (which could be rewritten to any desired scripting language). To use our ASP.NET integration files, you must create an application through your IIS control panel with root directory at to fckeditor/editor/plugins/fckeditor_wiris/integration. Now, give write permissions to fckeditor/editor/plugins/fckeditor_wiris/cache and to fckeditor/editor/plugins/fckeditor_wiris/formulas directories to the web server user (it will be used to store formula MathML codes and temporal images). How to create applications: http://support.microsoft.com/kb/172138

1.2.3      As Java servlet

Because the plugin needs server scripting support, we provide a solution based on Java servlets (which could be rewritten to any desired scripting language). To use our Java integration files, follow these steps:

  1. Install the pluginwiris_engine.war in your Java web applications server (tomcat).
  2. Edit the WEB-INF/web.xml and set the params cacheDirectory and formulaDirectory. cacheDirectory is the directory where your temporal formula images will be stored. formulaDirectory is the directory where your formula will be stored (as xml files). You must create both directories. The servlet should have write rights on both directories.
  3. By default, the javascript code loads the pluginwiris_engine from the root of web application server (/pluginwiris_engine/app). However, if you want to store the pluginwiris_engine in another path, you should edit these javascript codes.
    1. Open fckeditor/editor/plugins/fckeditor_wiris/fckplugin.js.
    2. Change the variables _wrs_conf_editorPath, _wrs_conf_CASPath, _wrs_conf_createimagePath and _wrs_conf_createcasimagePath with your preferred values.
    3. Save changes.

1.3      Configure

1.3.1      On PHP and ASP.NET integrations

Open to fckeditor/editor/plugins/fckeditor_wiris/configuration.ini to set your own values. This table specifies all possible parameters:

1.3.2      On Java integration

Edit the WEB-INF/pluginwiris/configuration.ini file to set your own values. The table below specifies all possible parameters.

Key

Description

Default value

Possible values

wirisimageservicehost(1)

Specifies formula image server host.

services.wiris.net

 

wirisimageserviceport

Specifies formula image server port.

80

 

wirisimageservicepath

Specifies formula image server path.

/formula/render

 

wirisimagebgcolor

Specifies formula background color.

#FFFFFF

 

wiristransparency

Specifies whether formula background must be transparent.

true

true, false

wirisimagesymbolcolor

Specifies formula foreground color.

#000000

 

wirisimagefontsize

Specifies formula font size.

16

 

wirisformulaeditorcodebase(1)

Specifies where is your formula editor applet codebase.

http://services.wiris.net/formula/codebase/

 

wirisformulaeditorarchive

Specifies the formula editor applet file name.

wiriseditor.jar

 

wirisformulaeditorcode

Specifies main formula editor applet class.

WirisFormulaEditor

 

wirisformulaeditorlang

Specifies main formula editor language.

en

ar, ca, de, es, et, en, eu, fr, gl, it, nl, pt, zh

wiriscascodebase(1)

Specifies where is your CAS applet codebase.

http://www.wiris.net/wiris/wiris-codebase/

 

wiriscasarchive(1)

Specifies the CAS applet file name.

wrs_net_en.jar

 

wiriscasclass(1)

Specifies main CAS applet class.

WirisApplet_net_en

 

CAS_width

Specifies the default CAS applet width.

450

 

CAS_height

Specifies the default CAS applet height.

400

 

wirisproxy

Specifies if your server is using a proxy connection or not.

false

true, false

wirisproxy_host

If wirisproxy is true, this value specifies the proxy host.

 

 

wirisproxy_port

If wirisproxy is true, this value specifies the proxy port.

 

 

(1) The WIRIS plugin needs to access an external server to get additional resources (formula editor applet, image service and WIRIS CAS). See architecture for more information. The default configuration connects to services.wiris.com to get such services. However, you might consider acquiring a production access. Under certain circumstances it is possible to install all necessary services in the customer server (not only the plugin).

Advanced:

You can also modify other values in javascript environment. Open to fckeditor/editor/plugins/fckeditor_wiris/fckplugin.js and read the first few lines.

1.4      Include FCKeditor WIRIS Plugin on your own platform

You must include fckeditor_wiris on your FCKeditor plugin list. This list is specified at fckeditor/fckconfig.js (see FCKeditor documentation).

1.4.1      Adding the plugin to the plugin list

Search the line:

FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;

Then, add after this line the code below:

FCKConfig.Plugins.Add('fckeditor_wiris');

The result should look like this:

FCKConfig.PluginsPath = FCKConfig.BasePath + 'plugins/' ;

FCKConfig.Plugins.Add('fckeditor_wiris');

1.4.2      Adding WIRIS buttons on FCKeditor toolbar

Search the line:

FCKConfig.ToolbarSets["Default"] = [

There is the toolbar configuration. You should add fckeditor_wiris_openFormulaEditor and fckeditor_wiris_openCAS buttons where you want.

1.5      Custom WIRIS properties

Sometimes you need to use different WIRIS configuration parameters in different FCKeditors on your web. For example: if you have two editors (one with white background and other with black background), maybe you want to use a different font colors for each of them.

The problem is that you can’t modify “wirisimagesymbolcolor” on your configuration.ini because each plugin needs its own font color, and this property affects both. The solution is to add a configuration key on FCKeditor configuration object (on javascript level).

In this example, you should do it when starting each editor:

var editorWithBlackBackground = new FCKeditor('blackBackground');

// WIRIS properties

editorWithBlackBackground.Config['wirisimagesymbolcolor'] = '#FFFFFF';

editorWithBlackBackground.Config['wirisimagenumbercolor'] = '#FFFFFF';

editorWithBlackBackground.Config['wirisimageidentcolor'] = '#FFFFFF';

editorWithBlackBackground.Create();

Values that can be configured are:

// WIRIS properties

editorExample.Config['wirisimagebgcolor'] = '#FFFFFF';

editorExample.Config['wirisimagesymbolcolor'] = '#000000';

editorExample.Config['wiristransparency'] = 'true';

editorExample.Config['wirisimagefontsize'] = '16';

editorExample.Config['wirisimagenumbercolor'] = '#000000';

editorExample.Config['wirisimageidentcolor'] = '#000000';

1.6      Clean and backup your FCKeditor WIRIS Plugin installation

There are two important directories:

  • Cache directory: fckeditor/editor/plugins/fckeditor_wiris/cache
  • Formula directory: fckeditor/editor/plugins/fckeditor_wiris/formulas

 

On Java integration, these paths are provided by you on the WEB-INF/web.xml file.

1.6.1      Freeing disk space: cleaning the image cache folder

If you want to free your disk space, you can empty the cache directory (remember: don’t delete the directory, only remove its contents).

This directory will be repopulated when users view the formulas.

1.6.2      Migrating your web server

If you want to migrate your web server, and you want to backup your formula images, you must migrate also the formula directory.

This directory contains the MathML of your web site formula images. If these files are removed, you will lose your formulas. Note that the MathML is still stored in the <IMG> tag but it is useless.