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

[Solved] Flash/Media/Attachment managers fails

5 Answers 56 Views
RadEditor
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nikolaj Rasmussen
Top achievements
Rank 1
Nikolaj Rasmussen asked on 30 Jan 2006, 12:05 PM
Hey,
What to I need to set to get them to work,
right now all 3 results in the "value cannot be null".

Right now, the only settings for my editor is...
    reDescription.DialogParameters.Clear();
    ParameterCollection imageArgumentsDesc = new ParameterCollection();
    imageArgumentsDesc.Add(new Parameter("ThumbSuffix", reDescription.ThumbSuffix));
    imageArgumentsDesc.Add(new Parameter("MaxImageSize", reDescription.MaxImageSize.ToString()));
    imageArgumentsDesc.Add(new Parameter("AllowThumbGeneration",   reDescription.AllowThumbGeneration.ToString()));
    imageArgumentsDesc.Add(new Parameter("SiteUrl", SPEncode.UrlEncode(sURL)));
    imageArgumentsDesc.Add(new Parameter("WebUrl", SPEncode.UrlEncode(sRelativeURL)));/**/
    reDescription.DialogParameters.Add("SharePoint/ImageManager", imageArgumentsDesc);

Or even better, where can i see what i can setup through a ParameterCollection?

5 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 01 Feb 2006, 03:29 PM

Hello Nikolaj,

Can you remove reDescription.DialogParameters.Clear(); and see if problem persists? The editor uses the DialogPrameters collection for passing some special parameter to the dialogs.



Have a nice day,
George
the telerik team
0
Nikolaj Rasmussen
Top achievements
Rank 1
answered on 02 Feb 2006, 08:52 AM
The problem still persist i'm afraid..

Tried to before adding myself...
Response.Write(reDescription.DialogParameters.Count.ToString());
... the output was "0"
0
Atanas Korchev
Telerik team
answered on 02 Feb 2006, 06:51 PM

Hello Nikolaj,

Does that code work for the ImageManager dialog? If yes, you need to do the same for the Flash, Media, Document and Template manager dialogs. Here is the code which should work (taken from the implementation of r.a.d.editor SharePoint edition):
  
private ParameterCollection SharePointArguments()
  {
   ParameterCollection dialogArguments = new ParameterCollection();
   dialogArguments.Add(new Parameter("SiteUrl", SPEncode.UrlEncode(Request.Params.Get("SiteUrl"))));
   dialogArguments.Add(new Parameter("WebUrl", SPEncode.UrlEncode(Request.Params.Get("WebUrl"))));
   dialogArguments.Add(new Parameter("WebID", SPEncode.UrlEncode(Request.Params.Get("WebID"))));
   return dialogArguments;
  }
private void SetSharePointDialogs()
  {
   contentEditor.DialogParameters.Clear();

   ParameterCollection imageArguments = SharePointArguments();
   imageArguments.Add(new Parameter("ThumbSuffix", contentEditor.ThumbSuffix));
   imageArguments.Add(new Parameter("MaxImageSize", contentEditor.MaxImageSize.ToString()));
   imageArguments.Add(new Parameter("AllowThumbGeneration", contentEditor.AllowThumbGeneration.ToString()));
   contentEditor.DialogParameters.Add("SharePoint/ImageManager", imageArguments);

   ParameterCollection documentArguments = SharePointArguments();
   documentArguments.Add(new Parameter("MaxDocumentSize", contentEditor.MaxDocumentSize.ToString()));
   contentEditor.DialogParameters.Add("SharePoint/DocumentManager", documentArguments);

   ParameterCollection flashArguments = SharePointArguments();
   flashArguments.Add(new Parameter("MaxFlashSize", contentEditor.MaxFlashSize.ToString()));
   contentEditor.DialogParameters.Add("SharePoint/FlashManager", flashArguments);

   ParameterCollection mediaArguments = SharePointArguments();
   mediaArguments.Add(new Parameter("MaxMediaSize", contentEditor.MaxMediaSize.ToString()));
   contentEditor.DialogParameters.Add("SharePoint/MediaManager", mediaArguments);

   ParameterCollection templateArguments = SharePointArguments();
   templateArguments.Add(new Parameter("MaxTemplateSize", contentEditor.MaxTemplateSize.ToString()));
   contentEditor.DialogParameters.Add("SharePoint/TemplateManager", templateArguments );
   
   contentEditor.DialogParameters.Add("SharePoint/SetImageProperties", SharePointArguments());
  }


You need to call the SetSharePointDialogs in your Page_Load event.

Let us know how it goes,

Albertthe telerik team
0
Nikolaj Rasmussen
Top achievements
Rank 1
answered on 06 Feb 2006, 11:51 AM
Super, now the ImageProperties which i posted a bug about in another thread works.

But I got a question about the WebID, whats that for? Doesn't really looks like its necessary.
0
Atanas Korchev
Telerik team
answered on 06 Feb 2006, 05:30 PM
Hello Nikolaj,

WebID is used in the internal implementation of r.a.d.editor SharePoint Edition and indeed might not be necessary in your case. You can remove it from your code.

However there is one improvement you can make. If you want the dialogs to show only the document libraries visible in the current web you should replace 
Request.Params.Get("SiteUrl") with SPControl.GetContextSite(Context).Url
and 
Request.Params.Get("WebUrl") with SPControl.GetContextWeb(Context).ServerRelativeUrl.


Regards,
Albert
the telerik team
Tags
RadEditor
Asked by
Nikolaj Rasmussen
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Nikolaj Rasmussen
Top achievements
Rank 1
Atanas Korchev
Telerik team
Share this question
or