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

FileBrowserContentProviderTypeName?? for the new editor

12 Answers 288 Views
Editor
This is a migrated thread and some comments may be shown as answers.
a.bek
Top achievements
Rank 1
a.bek asked on 03 Oct 2007, 12:32 PM
how can i achieve that functionality in the new editor??

12 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 03 Oct 2007, 01:12 PM
Hi Apo,

It seems that the FileBrowserContentProviderTypeName property was not exposed in the RadEditor API in the official release. I will ensure that the property will be available in the SP1 of RadEditor Prometheus, scheduled for the beginning of the next week. While waiting for the hotfix, you could use the following workaround to set your own provider:

DialogOpener opener = RadEditor1.FindControl(RadEditor1.ID + "dialogOpener") as DialogOpener;

string myContentProviderTypeName = typeof(MyContentProviderClass).AssemblyQualifiedName;
opener.DialogDefinitions["ImageManager"].Parameters["FileBrowserContentProviderTypeName"] = myContentProviderTypeName;
opener.DialogDefinitions["DocumentManager"].Parameters["FileBrowserContentProviderTypeName"] = myContentProviderTypeName;

Regarding the two StoreFile() methods. RadEditor Prometheus will use only the method with the following signature:
public abstract string StoreFile(UploadedFile file, string path, string name, params string[] arguments);

The other method could just return string.Empty or other string of your choice. It will never be called.



Best regards,
Rumen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
a.bek
Top achievements
Rank 1
answered on 04 Oct 2007, 02:28 PM
but

opener.DialogDefinitions["ImageManager"] throws

The given key was not present in the dictionary.




0
Valeri Hristov
Telerik team
answered on 05 Oct 2007, 08:31 AM
Hi a.bek,

The dialog definitions are populated after Page.PreRender, so to access them you will have to override the Render method of the Page:

protected override void Render(HtmlTextWriter writer)
{
    DialogOpener opener = RadEditor1.FindControl(RadEditor1.ID + "dialogOpener") as DialogOpener;

    string myContentProviderTypeName = typeof(Telerik.Web.UI.Widgets.FileSystemContentProvider).AssemblyQualifiedName;

    opener.DialogDefinitions[
"ImageManager"].Parameters["FileBrowserContentProviderTypeName"] = myContentProviderTypeName;
    opener.DialogDefinitions[
"DocumentManager"].Parameters["FileBrowserContentProviderTypeName"] = myContentProviderTypeName;

    base.Render(writer);
}


I apologize for not mentioning that.

The SP1 of RadEditor Prometheus, scheduled for 10th October will introduce a new property:
RadEditor1.ImageManager.ContentProviderTypeName = myContentProviderTypeName;

which will let you set content provider without hacking into RadEditor.

Best wishes,

Valeri Hristov (Senior Developer, MCSD)
the Telerik team


Instantly find answers to your questions at the new Telerik Support Center
0
a.bek
Top achievements
Rank 1
answered on 05 Oct 2007, 09:49 AM
Hi and thnks for the info

i have noticed that u write a lot of vital code at prerender is there any specific reason for that?
0
Valeri Hristov
Telerik team
answered on 05 Oct 2007, 01:05 PM
This way it is easier to synchronize the inner controls' properties with the RadEditor's properties, since OnPreRender is the last appropriate event in the page life cycle. Actually, this shouldn't be a problem if we did not missed the ContentProviderTypeName...

Regards,
Valeri Hristov (Senior Developer, MCSD)
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
a.bek
Top achievements
Rank 1
answered on 05 Oct 2007, 08:54 PM
A last one please i load an editor inside a grid's formtemplate like this

private void radGridArticles_ItemCreated(object sender, GridItemEventArgs e) 
    { 
         
        if (e.Item is GridEditableItem && e.Item.IsInEditMode) 
        { 
            Control control = LoadControl("/webforms/Content/articles/articlesTabStrip.ascx"); 
             
 
            ((GridEditFormItem)e.Item).EditFormCell.Controls.Add(control);  
        } 
                 
    } 

where should i place the code u posted in order to work??

also the none of the editor's tools is visible how can i enable them i have tried the toolsfile propertu with no luck
0
Valeri Hristov
Telerik team
answered on 08 Oct 2007, 07:25 AM

Hello a.bek,

Regarding the FileBrowserContentProviderTypeName property: I suggest waiting for wednesday, when we are going to release SP1 for RadEditor Prometheus, which will contain a proper way to set it.

The tools problem could be easily resolved if you define them inline between the RadEditor tags:
http://www.telerik.com/help/radcontrols/prometheus/?AddingStandardButtons.html

On the other hand, could you please check which version of RadEditor Prometheus are you using? As far as I remember, this problem was present in the Futures build...

Best wishes,

Valeri Hristov (Senior Developer, MCSD)
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
a.bek
Top achievements
Rank 1
answered on 30 Oct 2007, 09:37 PM
hi i have tried the new properies that u have implemented and my provider seems to work

but cannot make the image preview to work when i click on a file no request starts

is this another bug ?? can we have a working example of the dbprovider?
0
Valeri Hristov
Telerik team
answered on 31 Oct 2007, 03:07 PM
Hi a.bek,

Yes, this is a known bug, which we will try to address for the upcoming hotfix of RadEditor, scheduled for the next couple of days.

All the best,
Valeri Hristov (Senior Developer, MCSD)
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
idjones
Top achievements
Rank 1
answered on 18 Nov 2007, 04:16 PM
Hello did you resolve the preview image issue?

On mine it works find in dev, but on live the image won't preview and the url which gets added starts with
http://itemhandler.ashx/?path

so it obviously isn't adding on the application path, although there is the code in the provider:

if (_itemHandlerPath.StartsWith("~/"))

{

_itemHandlerPath = HttpContext.Current.Request.ApplicationPath + ItemHandlerPath.Substring(1);

}

Thanks

0
idjones
Top achievements
Rank 1
answered on 18 Nov 2007, 04:28 PM

got it to work by specifying the full url.

not sure why

~/ItemHandler.ashx

didn't work on live

0
Lini
Telerik team
answered on 21 Nov 2007, 01:25 PM
Hi,

We are glad that you managed to solve this problem on your own. Perhaps there was a difference in the web servers configuration (dev/live).

Kind regards,
Lini
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
a.bek
Top achievements
Rank 1
Answers by
Rumen
Telerik team
a.bek
Top achievements
Rank 1
Valeri Hristov
Telerik team
idjones
Top achievements
Rank 1
Lini
Telerik team
Share this question
or