tutorials needed

Last post 11-24-2004, 2:41 AM by Adam. 1 replies.
Sort Posts: Previous Next
  •  11-24-2004, 1:23 AM 2538

    tutorials needed

    Hi
    I have to agree with kenA, that tutorials are needed very much. In particular I would like to see tutorials on the subjects: 
    • how to apply stylesheets to the textarea
    • a general description on the configuration principles
    • how to apply custom buttons
    Overall I'm very impressed with version4, I just need to straighten out some issues before I'm ready to use it on my website, so hopefully CuteSoft can supply these tutorials. And thanks for the competitive upgrade initiative.

    kind regards
    Lars Kohsel, Denmark 
  •  11-24-2004, 2:41 AM 2539 in reply to 2538

    Re: tutorials needed

    Lars,

    We realize that the document  is lagging behind, and we will included more instructions into the developer guide in this week.

    Here are the answers to your questions:

    >>how to apply stylesheets to the textarea

    In the new version, we have a separate template file to deal with this issue.

    The file name is Template.aspx. you can find it in the CuteSoft_Client/CuteEditor

    You can modify this file to fit your requirements.

    >> a general description on the configuration principles

    There are two types of configuration files.

    One this the toolbar configuration files.

    1. Toolbar configuration files

    The Toolbar configuration filesRepresents several predefined sets of buttons. These configurations are applied using AutoConfigure property.  

    Compare to version 3.0, the version 4.0 provides a convenient way of creating your own toolbars. The details of configuration are specified by an XML file which is very easy to modify.

    2. Security security policy configuration files

    Cute Editor 4.0 allows developers to assign a pre-defined set of permissions by group or individual. This prevents a normal user to access the administration functionality.

    For example, only the admins have the permission to create folders and delele folders.

    The details of permissions are specified by an XML security policy file. Each level maps to a specific file. The default mappings:

    • admin—maps to admin.config
    • default—maps to default.config
    • guest—maps to guest.config
    You can customize and extend each policy file by editing the XML security policy file. You can also create your own policy files that define arbitrary permission sets.

    So we move many editor properties into this XML security policy file.

    In your code, you can do this:

    Example:   case "Administrators":
           Editor1.SecurityPolicyFile  = "Admin.config";
           SetUploadsFolder("~/Uploads/");
           break;
      case "Members":
           Editor1.SecurityPolicyFile  = "default.config";
           SetUploadsFolder("~/Uploads/Member/");
           break;
      case "Guest":
          Editor1.SecurityPolicyFile  = "Guest.config";
          SetUploadsFolder("~/Uploads/Guest/");
          break;
      case "Banned":
    Editor1.ReadOnly = true;
         break;
      case "John":
          Editor1.SecurityPolicyFile  = "Admin.config";
          SetUploadsFolder("~/Uploads/Users/John/");
          break;
      case "Mary":
          Editor1.SecurityPolicyFile  = "default.config";
         SetUploadsFolder("~/Uploads/Users/Mary/");
         break;
        case "Tim":
         Editor1.SecurityPolicyFile  = "default.config";
         SetUploadsFolder("~/Uploads/Users/Tim/");
         break;


    By using the security policy file, you can group permissions into one file.  we think the version 4.0 provides a convenient way of helping you build a clean solution.

    Otherwise,  there a lot of permissions you need to configure in the editor page.

    Permissions/Resource SettingAdminDefaultGuest
    AllowUpload MarkedMarked
    AllowDelete Marked
    AllowCopy Marked
    AllowMove Marked
    AllowCreateFolder Marked
    AllowDeleteFolder Marked
    RestrictUploadedImageDimension MarkedMarked
    AutoResizeUploadedImages MarkedMarked
    MaxImageWidth 6400640640
    MaxImageHeight 4800480480
    MaxImageSize 10000100100
    MaxMediaSize 10000100100
    MaxFlashSize 10000100100
    MaxDocumentSize 10000100100
    ImageGalleryPath~/uploads~/uploads/member~/uploads/guest
    MediaGalleryPath~/uploads~/uploads/member~/uploads/guest
    FlashGalleryPath~/uploads~/uploads/member~/uploads/guest
    FilesGallaryPath~/uploads~/uploads/member~/uploads/guest
    ImageFilters.jpg
    .jpeg
    .gif
    .png
    .jpg
    .jpeg
    .gif
    .jpg
    .jpeg
    .gif
    MediaFilters.avi
    .mpg
    .mpeg
    .mp3
    .avi
    .mpg
    .mpeg
    .avi
    .mpg
    .mpeg
    DocumentFilters.txt, .doc
    .pdf, .zip
    .rar, .avi
    .mpg, .mpeg
    .mp3, .jpg
    .jpeg,.gif
    .png
    .pdf, .doc
    .txt, .doc
    .pdf, .zip


    However, I think the kenA's point make good sense too. In some situation, the developers want to set the permission properties dynamically.

    We are discussing this issue right now. Maybe we will add those properties back in a quick fix.

    The approch is as followings:

    For example:

    when the editor loads, we check the editor.MaxImageSize property. If exists, we use that. If not, we will get the value from the configuration file.

    >> how to apply custom buttons

    In the version 4.0, we have a custom button holder.

    You can find it in the full.config file:

    <item type="holder" name="insertcustombutonhere" />

    You can just create your own button, and add this into this custom button holder control.

    For example, I want to create a custom button, when the users click it, it pastes the html code "Hello world" into the cute editor.

    Step1:  Create custom button holder control

     CuteEditor.ToolControl tc = Editor1.ToolControls["insertcustombutonhere"];
     if(tc!=null)
     {    
     ....
     }

    Step 2. Create your own button and add it into the custom button holder

     CuteEditor.ToolControl tc = Editor1.ToolControls["insertcustombutonhere"];
     if(tc!=null)
     {    
             System.Web.UI.WebControls.Image Image1 = new System.Web.UI.WebControls.Image ();
             Image1.ToolTip    = "Hello world";
             Image1.ImageUrl    = "tools.gif";
             Image1.CssClass    = "CuteEditorButton";
             SetMouseEvents(Image1);
             Image1.Attributes["onclick"]="CuteEditor_GetEditor(this).ExecCommand('PasteHTML',false,'Hello World')";
             tc.Control.Controls.Add(Image1);
      }

    Please not that CuteEditor_GetEditor(this).ExecCommand('PasteHTML',false,'any html code')"; is a clinet side API of Cute Editor.

    Hope the above answers helps, let me know if you have any further questions.














    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML