Tuesday, August 03, 2010

RadEditor for MOSS 2007 - Re-package

Telerik’s RadEditor for SharePoint includes two versions, a free Lite version that is similar to the default rich-text editor with addition of providing cross-browser support, and a full version with more features such as AJAX spell-checking. Here RadEditor for MOSS 5.6.2.0 full version is used for our discussion.

After installation, many RadEditor settings, such as toolbar size, can be configured in ConfigFile.xml, ToolsFile.xml, ListConfigFile.xml, and ListConfigFile.xml under RadEditor's global resource folder; (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\RadEditorSharePoint\5.6.2.0__1f131a624888eeed\Resources). The details of settings can be found in http://www.telerik.com/help/aspnet-ajax/moss-introduction.html.

Manually changing the configuration files is cumbersome. Consider an environment of a QA farm, a staging farm, an authoring farm and a production farm, you have to update each machine one by one. The better way is to change the configuration and then re-package to a new wsp for deployment.

Steps to re-package RadEditorMOSS.wsp:

1. Rename the original RadEditorMOSS.wsp to RadEditorMOSS.cab.

2. Extract all files from RadEditorMOSS.cab to a RadEditorMOSS folder using any unzip tool such as 7-zip; remain the original folder structure in extraction. Notice all configuration files we mentioned above are located in RadEditorMOSS/Resources folder:


3.Update configuration files as required.

4.Create a repack.ddf file in the RadEditorMOSS extraction folder. The ddf diamond file has following instruction:
.OPTION Explicit
.Set DiskDirectoryTemplate=CDROM
.Set MaxDiskSize=CDROM
.Set CompressionType=MSZIP
.Set UniqueFiles=On
.Set Cabinet=On
;.Set DiskDirectory1=Package
.Set CabinetNameTemplate="RadMOSSEditorRepack.wsp"

;******************************

manifest.xml
RadEditorSharePoint.dll
RadEditorSharePoint.dwp
Telerik.Web.UI.dll

.Set DestinationDir=CONTROLTEMPLATES
CONTROLTEMPLATES\TelerikRadEditorHtml.ascx
CONTROLTEMPLATES\TelerikRadEditorText.ascx

.Set DestinationDir=Images
Images\RadEditor.gif

.Set DestinationDir=RadEditorFeatureRichHtml
RadEditorFeatureRichHtml\Feature.xml

.Set DestinationDir=RadEditorFeatureRichText
RadEditorFeatureRichText\Feature.xml

.Set DestinationDir=Resources
Resources\ConfigFile.xml
Resources\EditorToolPart.js
Resources\ListConfigFile.xml
Resources\ListToolsFile.xml
Resources\MOSSEditorTools.js
Resources\Telerik.Web.UI.DialogHandler.aspx
Resources\Telerik.Web.UI.SpellCheckHandler.ashx
Resources\ToolsFile.xml
Resources\web.config

.Set DestinationDir=Resources\App_Data\RadSpell
Resources\App_Data\RadSpell\de-DE.tdf
Resources\App_Data\RadSpell\en-US.tdf
Resources\App_Data\RadSpell\fr-FR.tdf

.Set DestinationDir=Resources\App_GlobalResources
Resources\App_GlobalResources\RadEditor.Dialogs.de-DE.resx
Resources\App_GlobalResources\RadEditor.Dialogs.fr-FR.resx
Resources\App_GlobalResources\RadEditor.Dialogs.resx
Resources\App_GlobalResources\RadEditor.Main.de-DE.resx
Resources\App_GlobalResources\RadEditor.Main.fr-FR.resx
Resources\App_GlobalResources\RadEditor.Main.resx
Resources\App_GlobalResources\RadEditor.Modules.de-DE.resx
Resources\App_GlobalResources\RadEditor.Modules.fr-FR.resx
Resources\App_GlobalResources\RadEditor.Modules.resx
Resources\App_GlobalResources\RadEditor.Tools.de-DE.resx
Resources\App_GlobalResources\RadEditor.Tools.fr-FR.resx
Resources\App_GlobalResources\RadEditor.Tools.resx
Resources\App_GlobalResources\RadListBox.resx
Resources\App_GlobalResources\RadProgressArea.resx
Resources\App_GlobalResources\RadScheduler.Main.resx
Resources\App_GlobalResources\RadSpell.Dialog.de-DE.resx
Resources\App_GlobalResources\RadSpell.Dialog.fr-FR.resx
Resources\App_GlobalResources\RadSpell.Dialog.resx
Resources\App_GlobalResources\RadUpload.resx

.Set DestinationDir=Resources\ToolImages
Resources\ToolImages\MOSSDeleteTableElement.gif
Resources\ToolImages\MOSSHelp.gif
Resources\ToolImages\MOSSImageManager.gif
Resources\ToolImages\MOSSInsertTable.GIF
Resources\ToolImages\MOSSInsertTableElement.gif
Resources\ToolImages\MOSSLeftToRight.GIF
Resources\ToolImages\MOSSLinkManager.gif
Resources\ToolImages\MOSSRightToLeft.GIF
Resources\ToolImages\MOSSTemplateManager.gif
Resources\ToolImages\RadEditorStyles_Black.css
Resources\ToolImages\RadEditorStyles_Default.css
Resources\ToolImages\RadEditorStyles_Forest.css
Resources\ToolImages\RadEditorStyles_Hay.css
Resources\ToolImages\RadEditorStyles_Office2007.css
Resources\ToolImages\RadEditorStyles_Outlook.css
Resources\ToolImages\RadEditorStyles_Sunset.css
Resources\ToolImages\RadEditorStyles_Telerik.css
Resources\ToolImages\RadEditorStyles_Vista.css
Resources\ToolImages\RadEditorStyles_Web20.css
Resources\ToolImages\RadEditorStyles_WebBlue.css
Resources\ToolImages\ToggleSource.GIF
4.In command line mode go to RadEditorMOSS extraction folder, type:
makecab /f repack.ddf
5.A new solution package with name of "RadMOSSEditorRepack.wsp" will be created. All installation with this RadMOSSEditorRepack.wsp will have the same custom configuration.