This is a migrated thread and some comments may be shown as answers.

Rad Editor as a Custom MOSS Field Type

8 Answers 57 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 28 May 2012, 09:40 PM

One of the limitations of the RadEditor for MOSS feature is that it is unable to support object and embed tags when used as the replacement rich text editor in lists.  I have come to the conclusion that this is actually a function of the underlying sharepoint field type.  However, new, custom, field types are a reality in sharepoint development, and by simply using the default WSP builder template, I have created a custom field that does not suppress these tags.  From there my natural instinct is to use the RadEditor for MOSS as the editor control; however, it doesn't have the necessary control properties exposed to do so.  (no public content or text properties)  Therefore, I'm attempting to use the standard RadEditor.  This is perhaps more of a sharepoint question, but for anyone interested, after littering the code with debugging stops, the last method it leaves is the one below:

protected override void CreateChildControls()
        {
            if (Field == null) return;
  
            base.CreateChildControls();
  
            if (ControlMode == SPControlMode.Display)
                ConstructDisplayMode();
            else
            {
                ConstructEditMode();
  
                if (ControlMode == SPControlMode.New)
                {
                    OpenHTMLField field = (OpenHTMLField)base.Field;
                }
            }
        }

I then see an 'unexpected error has occurred' and the Logs contain the following messages:
05/28/2012 16:15:56.08  w3wp.exe (0x0FE4)                           0x17C8  CMS                             Publishing                      8zug    Medium      PublishingHttpModule.Init() calling AppDomainUnloadListener.Register()   
05/28/2012 16:15:56.08  w3wp.exe (0x0FE4)                           0x17C8  CMS                             Publishing                      8x0a    High        AppDomainUnloadListener.RegisterSelf() entered lock(this=34622967)   
05/28/2012 16:15:56.08  w3wp.exe (0x0FE4)                           0x17C8  CMS                             Publishing                      8zug    Medium      PublishingHttpModule.Init() calling AppDomainUnloadListener.Register()   
05/28/2012 16:15:56.08  w3wp.exe (0x0FE4)                           0x17C8  CMS                             Publishing                      8x0a    High        AppDomainUnloadListener.RegisterSelf() entered lock(this=34622967)

If I'm way out in left field with this I'd appreciate any advice.

8 Answers, 1 is accepted

Sort by
0
Dave
Top achievements
Rank 1
answered on 29 May 2012, 12:14 AM
Update: I tuned the logs to verbose on all and got a message indicating that the control needed a script manager, so I modified the constructEditMode method accordingly.
private void ConstructEditMode()
{
    rScriptManager = new RadScriptManager();
    reOpenHTML = new RadEditor();
    reOpenHTML.CssClass = "ms-long";
    this.Controls.Add(rScriptManager);
    this.Controls.Add(reOpenHTML);
}

However, I'm now getting a message saying that the radScriptManager needs an HTTPModule Registration.  Fair enough; however, I have this registration already:

<add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler,    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />

and I'm wondering if anyone knows if I'm going to run into a train putting one for the radScriptManager in there before this one.
0
Dave
Top achievements
Rank 1
answered on 29 May 2012, 06:45 AM
Moving right along, I've got the RadEditor in the custom field now and it is successfully pushing formatted html out to the display.  That said, The dialogs aren't working and they're indicating I'm missing another httphandler entry.  I've tried using this one:

<add verb="*" path="Telerik.Web.UI.DialogHandler.axd" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Version=2012.1.411.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />

But I'm still getting the error:

Web.config registration missing!
The Telerik dialogs require a HttpHandler registration in the
web.config file.  Please, use the control's Smart Tag to add the
handler automatically, or see the help for more information:
Controls > RadEditor > Dialogs > Introduction

Since I'm not really doing this from a design pane in VS, there's no way to use the smart tag is there?  Also, some of the examples I picked up in different places on the forums seemed to show an entry with a name attribute in it which my web server didn't seem to care for.  Is that an IIS 7.5 thing?
0
Dave
Top achievements
Rank 1
answered on 29 May 2012, 07:04 AM
So I'm a bit stumped here at the moment, and I'll leave this out in the open in case anything pops out at anyone, but I've got this in my handlers section: 
<handlers>
      <remove name="WebServiceHandlerFactory-Integrated" />
      <remove name="ScriptHandlerFactory" />
      <remove name="ScriptHandlerFactoryAppServices" />
      <remove name="ScriptResource" />
      <add name="Telerik_Web_UI_DialogHandler_aspx" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" />
      <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory,         System.Web.Extensions, Version=3.5.0.0, Culture=neutral,         PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory,         System.Web.Extensions, Version=3.5.0.0, Culture=neutral,         PublicKeyToken=31BF3856AD364E35" />
      <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler,         System.Web.Extensions, Version=3.5.0.0, Culture=neutral,         PublicKeyToken=31BF3856AD364E35" />
</handlers>

And I've got this in my httpHandlers section:

<httpHandlers>
      <remove verb="GET,HEAD,POST" path="*" />
      <add verb="GET,HEAD,POST" path="*" type="Microsoft.SharePoint.ApplicationRuntime.SPHttpHandler, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <add verb="OPTIONS,PROPFIND,PUT,LOCK,UNLOCK,MOVE,COPY,GETLIB,PROPPATCH,MKCOL,DELETE,(GETSOURCE),(HEADSOURCE),(POSTSOURCE)" path="*" type="Microsoft.SharePoint.ApplicationRuntime.SPHttpHandler, Microsoft.SharePoint, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" />
      <add verb="*" path="Reserved.ReportViewerWebControl.axd" type="Microsoft.Reporting.WebForms.HttpHandler, Microsoft.ReportViewer.WebForms, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <add verb="*" path="_vti_bin/ReportServer" type="Microsoft.ReportingServices.SharePoint.Soap.RSProxyHttpHandler, RSSharePointSoapProxy, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
      <add verb="*" path="Reserved.ReportViewerWebPart.axd" type="Microsoft.ReportingServices.SharePoint.UI.WebParts.WebPartHttpHandler, Microsoft.ReportingServices.SharePoint.UI.WebParts, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory,    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
      <!--<add verb="*" path="Telerik.Web.UI.DialogHandler.axd" type="Telerik.Web.UI.DialogHandler, Telerik.Web.UI, Version=2012.1.411.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />-->
      <add path="Telerik.Web.UI.DialogHandler.aspx" verb="*" type="Telerik.Web.UI.DialogHandler"    validate="false" />
      <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2012.1.411.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" />
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler,    System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false" />
    </httpHandlers>

And I'm still getting the registration error for dialogs.
0
Dave
Top achievements
Rank 1
answered on 29 May 2012, 09:45 PM
After rereading the documentatoin 'here' I Changed all instances of Telerik.Web.UI.DialogHandler.aspx to Telerik.Web.UI.DialogHandler.axd.  Now, instead of showing me a Page cannot be displayed behind the registration error message in the dialog pane, I'm getting a Sharepoint unknown Error.  But I'm still getting the aforementioned Error message about web.config registration.
0
Dave
Top achievements
Rank 1
answered on 29 May 2012, 10:22 PM
I did another verbose error check, and it looks like the DialogHandler type wasn't being found.  I included the rest of the strong name in the type attribute of both of the relevant web.config entries and now I still get the error, but I'm seeing the dialogs when I close it.  The dialogs are dead though.  None of the controls respond, and they're not really pointing anywhere to begin with, which is understandable since I haven't set any of their properties.  How are the .axd s being referenced by the way?  Does telerik set up a virtual directory of some sort?

~David
0
Rumen
Telerik team
answered on 30 May 2012, 11:23 AM
Hello,

The dialog handlers of RadEditor for MOSS are physical files located in the \Program Files\Common Files\Microsoft Shared\web server extensions\wpresources\RadEditorSharePoint\5.X.XX.0__1f131a624888eeed\Resources folder, where 5.X.XX is the version of RadEditor for MOSS installed on the server:

Telerik.Web.UI.DialogHandler.aspx
Telerik.Web.UI.SpellCheckHandler.ashx
Telerik.Web.UI.WebResource.ashx

We do not recommend using the standard RadEditor for ASP.NET AJAX in SharePoint scenarios, because the especially designed RadEditor for MOSS / RadEditor for SharePoint 2010 automatically registers their handlers and have a special file browser content provider written to work with the SharePoint libraries. If you use the regular editor, you need to register and configure the handlers as well as write the file browser content provider yourself.

What you can do in regards to the Telerik.Web.UI.DialogHandler.aspx registration is to set the DialogHandlerUrl property of regular RadEditor to point to the Telerik.Web.UI.DialogHandler.axd file:

/_wpresources/RadEditorSharePoint/5.8.15.0__1f131a624888eeed/Resources/Telerik.Web.UI.DialogHandler.aspx"

For your convenience I have attached the Telerik.Web.UI.DialogHandler.aspx  file.

Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Dave
Top achievements
Rank 1
answered on 30 May 2012, 03:45 PM
So I've now included the RadEditorSharePoint.dll in my field type solution and am referencing it from the dialog you gave me as per your suggestion.  Though instead of actually deploying the .wsp, I have placed it in the _layouts folder for easier reference.  Presto, that error is gone.  Thank you :D.

Incidentally, I suppose that doesn't automatically reference the version of the File Browser Content Provider I'm looking for though.  The control I see is itself, still dead. 

Would I be able to find the content provider used by radeditorMoss in the sourcecode .zip I can download?

~David
0
Rumen
Telerik team
answered on 04 Jun 2012, 10:46 AM
Hello,

Yes, the SPContentProvider.cs file is available in the \Code\Editor folder in the source code of RadEditor for MOSS.

All the best,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Editor
Asked by
Dave
Top achievements
Rank 1
Answers by
Dave
Top achievements
Rank 1
Rumen
Telerik team
Share this question
or