1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Pluggable module

Pluggable module

12 posts, 0 answered
  1. Luc Baeten
    Luc Baeten avatar
    169 posts
    Registered:
    23 Sep 2005
    22 Feb 2008
    Link to this post
    Hello

    I want to create a new custom module for a specific website. I looked at the different samples (contacts, events) to see how a pluggable module must be implemented.

    I started with the very base contacts_4_4 module where the ContactsModule.cs, ControlPanel.cs and CommandPanel.cs are added in a very base form (without any functionality).

    This is what I have:
    LSConnectionModule.cs:

    using System;
    using System.Web;
    using System.Web.UI;
    using System.Collections.Generic;
    using System.Drawing.Design;
    using System.Text;
    using Telerik;

    namespace Milestre.CustomModule.LS
    {
        using Milestre.CustomModule.LS.WebControls.Admin;
        using Telerik.Web;

        public class LSConnectionModule : WebModule
        {
            /// <summary>
            /// Gets the name of the module.
            /// </summary>
            public override string Name
            {
                get
                {
                    return "LSConnection";
                }
            }

            /// <summary>
            /// The module title which will appear in the navigation.
            /// </summary>
            public override string Title
            {
                get
                {
                    return "LSConnection";
                }
            }

            /// <summary>
            /// Short description for the module.
            /// </summary>
            public override string Description
            {
                get
                {
                    return "Make a connection with the LS email environment";
                }
            }

            /// <summary>
            /// Gets ToolboxItemCollection with all ToolboxItem objects which register the corresponding control for use in the public part of the CMS system.
            /// </summary>
            public override IList<IToolboxItem> Controls
            {
                get
                {
                    return new List<IToolboxItem>(new ToolboxItem[0]);
                }
            }

            /// <summary>
            /// Creates the ControlPanel object which is rendered on the right side of the screen.
            /// </summary>
            /// <returns>Instance of the ControlPanel object of the module.</returns>
            public override Control CreateControlPanel(TemplateControl parent)
            {
                return new ControlPanel();
            }

            /// <summary>
            /// Creates the toolbox controls which are rendered on the left side of the screen.
            /// </summary>
            /// <returns>IControlPanelCommand[] containing all the tool box controls for the module.</returns>
            public override IControlPanelCommand[] CreateToolBoxControls(TemplateControl parent)
            {
                return new IControlPanelCommand[0];
            }
        }
    }


    CommandPanel.cs:

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using Telerik;
    using Telerik.Web;
    using Telerik.Cms.Web.UI;
    using System.ComponentModel;
    using Telerik.Framework.Web;

    namespace Milestre.CustomModule.LS.WebControls.Admin
    {

        class CommandPanel : CommandPanelBase
        {
            public CommandPanel(ControlPanel controlPanel)
                : base(controlPanel)
            {
            }

            #region Properties
            public string ControlPanelID
            {
                get
                {
                    return this.panelId;
                }
                set
                {
                    this.panelId = value;
                }
            }
            #endregion

            #region Methods

            protected override void CreateChildControls()
            {
                this.Controls.Clear();

                Label lblCommandPanel = new Label();
                lblCommandPanel.Text = "Command panel test label";
                this.Controls.Add(lblCommandPanel);
            }

            #endregion

            #region Private fields

            string panelId;

            #endregion

        }
    }

    ControlPanel.cs:

    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using Telerik;
    using Telerik.Web;
    using Telerik.Cms.Web.UI;
    using System.ComponentModel;
    using Telerik.Framework.Web;

    namespace Milestre.CustomModule.LS.WebControls.Admin
    {
        class ControlPanel : ControlPanelBase
        {
            public ControlPanel()
            {
                base.commandPnls = new ICommandPanel[] { new CommandPanel(this) };
            }


            #region Methods

            protected override void CreateChildControls()
            {
                this.Controls.Clear();

                Label lblControlPanel = new Label();
                lblControlPanel.Text = "Control panel label";
                this.Controls.Add(lblControlPanel);
            }

            #endregion

        }
    }

    As you can see, without any functionality or database information.
    The problem is that the Module doesn't show up in the admin environment of the website.

    I added the following in the webconfig of the website:

      <sectionGroup name="telerik">
       .
       <section name="lsconnection" type="Milestre.CustomModule.LS.Configuration.SectionHandler, Milestre.CustomModule.LS" requirePermission="false"/>
       .
      </sectionGroup>


    And

       <modules>
        .
        <add type="Milestre.CustomModule.LS.LSConnectionModule, Milestre.CustomModule.LS"/>
        .
       </modules>


    I didn't add any provider because initially I don't have one.

    What should I do more to present the module?

    Regards
    Luc Baeten

  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    22 Feb 2008
    Link to this post
    Hello Luc Baeten,

    We were able to implement your module, and in fact, it is showing in the modules section. Therefore, could you check if you have put the assembly files of this custom module, into the bin directory of your project ?

    Let us know how it is going.

    Sincerely yours,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Luc Baeten
    Luc Baeten avatar
    169 posts
    Registered:
    23 Sep 2005
    22 Feb 2008
    Link to this post

    Hi Georgi

    Yes I did: I added the LSConnection.dll in the bin directory of the website. Did I miss something else that causes the problem?

    Regards
    Luc

  4. Luc Baeten
    Luc Baeten avatar
    169 posts
    Registered:
    23 Sep 2005
    22 Feb 2008
    Link to this post
    Hi Georgi

    As addition: what I don't understand is that in the developers manual nothing is mentioned about the SectionHandler.cs. I tried different things: with this file (I copied it form a contacts module sample) and without it. It doesn't matter.

    Regards
    Luc
  5. Luc Baeten
    Luc Baeten avatar
    169 posts
    Registered:
    23 Sep 2005
    22 Feb 2008
    Link to this post
    Hi Georgi

    Because it works in your environment (I take the view that you used my 3 files), could you send me your declaration in the web.config or is it exactly the same as I described?

    regards
    Luc
  6. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    22 Feb 2008
    Link to this post
    Hello Luc Baeten,

    The settings in the web.config are exactly the same as the settings you have given to us. We think that one more case is possible - if you have drag-and-dropped the module assemblies into the bin folder, please make sure that the .DLL files inherit the IO permissions from the parent folder (sometimes when you drag&drop files from an archive, they do not inherit permissions from the parent folder). This could cause the project process not to access the module files due to a permission error.
    If this is not your case, we suggest you send us your project. You can open a new support thread and attach the project and DB as a .zip file to it.

    Regards,
    Georgi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. Luc Baeten
    Luc Baeten avatar
    169 posts
    Registered:
    23 Sep 2005
    25 Feb 2008
    Link to this post
    Hi Georgi

    I started again with a clean Sitefinity website project and used the base Contacts pluggable module. I was able now to show it in the admin environment. From this state I worked to my own situation. Now it works.

    Thanks for your help

    regards
    Luc
  8. Luc Baeten
    Luc Baeten avatar
    169 posts
    Registered:
    23 Sep 2005
    06 Mar 2008
    Link to this post
    Hello georgi

    Based on the contacts module, I developed my own pluggable module. I was able to get it work although I have no database integration.

    I have one question: is there a detailed description of the implementation of a pluggable module, because I want to understand completely how it is implemented. The developer manual doesn't give this kind of description in detail.

    Kind regards
    Luc
  9. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    07 Mar 2008
    Link to this post
    Hello Luc Baeten,

    Unfortunately, the Developer manual and Sitefinity blogs are the only sources that provide a description of applying a pluggable module in Sitefinity. We were not sure what depth should the details reach when describing the usage of this type of module. Please let us know what might help you at this stage of your development and we will try to give you some guidance. Apart from that, based on your needs and recommendations, we will extend the description of the manual so that it covers the topics you ask for.


    Regards,
    Sonya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  10. Luc Baeten
    Luc Baeten avatar
    169 posts
    Registered:
    23 Sep 2005
    07 Mar 2008
    Link to this post
    Hello Sonya

    Thanks for your answer. I went through the complete source of the contacts module to understand what is programmed and why it is done that way.

    Because I didn't need a database integration I tried to solve our pluggable module without the implementation of a data dll. Therefor I needed to go through all the sources. Especially the provider implementation with the template implementations is complex. It was at that place where I wanted to have a more detailed description.

    Regards
    Luc
  11. Sonya
    Sonya avatar
    231 posts
    Registered:
    24 Sep 2012
    12 Mar 2008
    Link to this post
    Hello Luc Baeten,

    Please excuse us for the delayed reply. We need to release the Service Pack of Sitefinity 3.2. Right after that we will create a simpler module and describe it. Apart from that, we will provide a detailed description about the topic you asked for. In the meantime, you could send any specific questions on your custom implementation and we will  do our best to assist you in the process.


    Regards,
    Sonya
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  12. Luc Baeten
    Luc Baeten avatar
    169 posts
    Registered:
    23 Sep 2005
    12 Mar 2008
    Link to this post

    Hello Sonya

    I have a running pluggable module right now. The more I am working with the pluggable module the more I understand what is done and why it is done that way.

    But still it took a lot of time to implement this pluggable module (based on the contacts module). However if I have a question I will send it to you.
    Thanks for your response.

    Regards
    Luc

Register for webinar
12 posts, 0 answered