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

Forums / Developing with Sitefinity / Non-Content Based Modules

Non-Content Based Modules

7 posts, 0 answered
  1. Chris
    Chris avatar
    11 posts
    Registered:
    10 Mar 2011
    26 Jul 2011
    Link to this post
    I've seen a lot of documentation and videos for building content based modules. I have a different scenario.

    I'm building a module that self installs. It isn't for managing any kind of content. For simplicity's sake, lets assume it allows users to manage a robots.txt file in the site. The module's only purpose is for allowing the user to change settings. For example, one of the settings might be to disallow a certain page group or to disallow all events. This module isn't managing content or any kind of repeated data. It is for managing settings or configuration.

    Is there an easier way about doing this? Managing settings/configuration through a module (or at all)?
  2. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    01 Aug 2011
    Link to this post
    Hello Chris,

    We generally assume that modules manage some kind of data. A module is essentially backend user interface to manage this data, and also public controls which you can use on pages to display the data.

    In your case, although you don't need a real module, you can create just the backend user interface. You have the ability to create backend pages in Sitefinity. Just make a custom one, and place a control that implements all the functionality you need.

    This will look like a module, but it won't be a real one.

    All the best,
    Slavo
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Craig
    Craig avatar
    45 posts
    Registered:
    28 Sep 2008
    14 Oct 2011
    Link to this post
    Chris,

    I'm currous, how did you setup your module to self install?  Is there documentation or a blog post on how to do this kind of thing?  Any help would be great.  Thanks.


    Craig
  4. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    19 Oct 2011
    Link to this post
    Hello Craig,

    I'm not sure how Chris has setup things, but if you look at all module samples in the Sitefinity SDK, you'll see all of them are installed when you launch the sample. We are doing this through code. If you open a solution in Visual Studio, you can take a look at the Global.asax file, where we use the Configuration API to register the module in Sitefinity. Hope that helps.

    Best wishes,
    Slavo
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Craig
    Craig avatar
    45 posts
    Registered:
    28 Sep 2008
    20 Oct 2011
    Link to this post
    I have gone through the Sitefinity SDK and seen how to automatically register a module from a global.asax file, but I was wondering if there was a way to self-register without modifying the global.asax or Sitefinity configuration.  Basically, is it possible to self-register a module or widget by just dropping an assembly into the bin folder of your Sitefinity web site?

    From the research that I have done so far, I did not think this was possible until I made a discovery about one of the items in the Sitefinity Marketplace.

    http://www.sitefinity.com/marketplace/modules/seo-sitemap-generator.aspx

    If you navigate to the URL above and look at the section titles "How to install" you will see the following directions.

    1. Download.
    2. Unpack.
    3. Copy .dlls to /bin directory of your Sitefinity site.
    4. Done. (Sitemap generator registers automatically)

    How is this even possible with out modifying the Sitefinity configuration, such as adding a new module or widget?
  6. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    26 Oct 2011
    Link to this post
    Hi Craig,

    There is a way to achieve what you want, and the mentioned marketplace component uses it, however, we do not recommend it. 

    There are two methods you implement in each module - Initialize() and Install(). The first one is called on each application start, the second one just once. Usually we recommend people to perform the setup work in Install().

    If you use the Initialize() method (or alternatively subscribe to the Initialized event of the Bootstrapper, like in Global.asax), you can skip the registration step. There are a couple of things wrong with this:
    • Bad performance - on each start, you have to make a database request to see if you have already created the backend pages, and if not, create them.
    • Unsupported upgrades - you module is doing something too early in the app lifecycle and in case it needs to upgrade from a previous version of the module, it can't know the difference. It will just skip the creation of a page (rather than modify the already created page). The sitemap generator in the marketplace has no data to persist, so this problem is only partial (no ability to update the backend page)
    • Deviation from the practice of module creation. If we change something in the product, we might break such a scenario, just because we never supported it officially. With the approved approach through the install() method, we will always make sure not to break custom modules.
    If you think the benefit of pseudo-automatic installation outweighs the disadvantages above, you can go down this road, but again - we don't recommend this for normal custom modules.

    Kind regards,
    Slavo
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Craig
    Craig avatar
    45 posts
    Registered:
    28 Sep 2008
    26 Oct 2011
    Link to this post
    This is great information.  Thanks for the reply. 
7 posts, 0 answered