Monday, August 30, 2010

SharePoint 2010 And SharePoint 2007 Content Database

SharePoint 2007 content database can be used by SharePoint 2010 directly without major problems. You can created a site collection in SharePoint 2007, copy its content database to the SharePoint 2010 environment, configure your SharePoint 2010 site collection content database to it, and you are done! Andrew Connell gave detailed instructions on how to do this with WCM sites.

That implies there're no big difference between SharePoint 2010 and SharePoint 2007 in terms of back-end database schema.

I checked briefly and found following tables existing in SharePoint 2007 but not in SharePoint 2010:
  1. Categories
  2. Image0x
  3. WebCat
  4. WebParts
More than 10 tables are added to SharePoint 2010 content database:
  1. AllfileFragments
  2. AllListsAux
  3. AllListsPlus
  4. AllListsUniqueFields
  5. AllLookupRelateionships
  6. AllWebParts
  7. CustomActions
  8. FeatureTracking
  9. Resources
  10. SharedAccessRequests
  11. SolutionResourceUsageDaily
  12. SolutionResourceUsageDailyOrdinal
  13. SolutionResourceUsageLog
  14. SolutionResourceUsageWindowed
  15. Solutions
  16. WebsPlus

Tuesday, August 03, 2010

RadEditor for MOSS 2007 - Assembly Binding

Just a quick note that it's possible to upgrade Telerik RadEditor for MOSS to a new version without changing registry on Page Layout and reference on VS project. The magic is the assembly binding. For example, if you want to upgrade the RadeEditor from version 5.6.2.0 to 5.8.0.0, first you need to install and deploy the new RadEditor solution package, then add following to the web.config file:
<configuration>
...
<runtime>
...
<dependentAssembly>
<assemblyIdentity name="RadEditorSharePoint" publicKeyToken="1f131a624888eeed" />
<bindingRedirect oldVersion="5.6.2.0" newVersion="5.8.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Telerik.Web.UI" publicKeyToken="121fae78165ba3d4" />
<bindingRedirect oldVersion="2009.3.1314.20" newVersion="2010.2.713.20" />
</dependentAssembly>
</assemblyBinding>
</runtime>
...
</configuration>

RadEditor for MOSS 2007 - Spell-check Multi-language Support

We use Telerik RadEditor for MOSS (5.6.2.0) as a cross-browser rich-text editor in one MOSS WCM publishing site to replace out-of-box Rich HTML field control. One great feature of the RadEditor is its AJAX spell checking function. By default, it would search against all three default dictionaries, English (en-US), French(fr-FR) and German(de-DE) that are included in solution package.

Is it possible to spell check based on the context that is selected by the end user? The answer is yes. Following are the setup steps:

1. Install and deploy RadEditorMoss solution package.

2. Open up related Page Layout and replace the Rich HTML Field Controls (or text fields) by the RadEditor Control:
  • Register Telerik assembly in Page Layout

    <%@ Register TagPrefix="telerik" Namespace="Telerik.SharePoint.FieldEditor" Assembly="RadEditorSharePoint, Version=5.6.2.0, culture=neutral, PublicKeyToken=1f131a624888eeed" %>

  • Replace the tag of the default editor with the RadeEditor control:

    <telerik:RadHtmlField id="PageContent" FieldName="PageContent" runat="server">telerik:RadHtmlField>

3. (Optional) Download dictionaries from web site http://www.telerik.com/community/forums/aspnet-ajax/spell/147971-radspell-dictionaries.aspx, and save dictionaries with tdf extension to RadEditor dictionary folder (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\RadEditorSharePoint\5.6.2.0__1f131a624888eeed\Resources\App_Data\RadSpell).

4. Inside RadEditor global resource folder (C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\wpresources\RadEditorSharePoint\5.6.2.0__1f131a624888eeed\Resources), update ToolsFile.XML and add Languages element just before </root> tag (assume that both en-Us.tdf and fr-FR.tdf are installed):
<root>

...
<tools name="MossTools1">
<tool name="AjaxSpellCheck" />
</tools>
...
<languages>
<language code="en-US" title="English"></language>
<language code="fr-FR" title="French"></language>
</languages>
</root>

5. Now you have option to select English or French for spell-check on the toolbar on each RadEditor instance, for example, you want to check English on PageContent text, and check French on PageContentFrench text:

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.