More in this section

Forums / Developing with Sitefinity / Uuummm Help Please! Getting started on creating a module.

Uuummm Help Please! Getting started on creating a module.

4 posts, 0 answered
  1. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    16 Dec 2008
    Link to this post

    Afternoon everyone,

    Well I am new to this part of the SiteFinity Forums, I am however a regular in the other areas of the forum. Reason being is that I am finally getting around to creating a module for my SiteFinity site... The first of many many, complex ones to come! Needless to say I am a little nervous at this point.

    I'm running 3.5, I have gone to the Dev Manual and download the SiteFinity Pluggable Module template and added a new project to my SiteFinity solution. I will not be using Nolics just yet. The providers will remain in the same assembly as the module as it comes in the Template (since I am not going to be using Nolics). I have followed the instructions in the Instructions.txt file within the project, I have moved the public and admin controls to the SiteFinity website, updated the web.cofig file, referenced my module, and renamed the classes of my module as suggested.

    Ok great! Now what? :)

    First let me say this will undoubtedly be the first of many posts as I try wrap my head around these modules; please bare with me.

    Currently we have and entire code base or set of classes that make up our DAL. We would like to continue to use these. In fact we even have a windows application that we developed that handles allot of our website content management, and obviously there are classes that take care of all the update, insert, and delete of data into the database. For a majority of the modules we will be creating, we will be taking this functionality out from this windows app and into SiteFinity, hopefully using the existing DAL classes we have.

    1. - Is this possible to do?
      -Does SiteFinity insert content in a specific way into the database? For example if I create a module that uses the Generic Content Module, is the content it generates put into the database as a sting of HTML? I guess what I am getting at is will we have to change the data types of our table columns that currently exist?

    2. -How do I use other existing module functionality? For example I need to create a module that allows a image to be uploaded along with additional data. How do I use the Images & Documents module functionality? UI also will need to be doing the same with the Generic Content control.

    3. -Some of the modules I need to create may not have tables in the database currently for the data it will be managing. Am I shooting myself in the foot by using our existing DAL or should I use Nolics for all this?

    4. I don’t expect a tutorial here, but maybe some links to some would be nice. Extremely detailed ones as the ones I have found are not in depth enough for the questions I have.

    Duncan

  2. valio b
    valio b avatar
    33 posts
    Registered:
    24 Sep 2012
    17 Dec 2008
    Link to this post
    Hello Duncan,

    Ok great! Now what? :)
    Now you need to decide what kind of logic is your brand new custom module meant to perform. :)

    1. Sitefinity is built with the Provider Model Pattern in mind, so as long as you adhere to this pattern, you should be able to integrate your DAL functionality in it. (structure)
    You may choose to have a manager and maybe have your existing DAL acting as a provider.

    2. For starters you may consider having a look at Ivan's blog at: http://blogs.sitefinity.com/Ivan/Posts.aspx

    Hopefully, it will give you some more insight about custom module creation. (something interesting)

    3. Please note that Nolics is just an ORM and its purpose is to just facilitate object persistence (we are switching to OpenAccess). You may choose to take advantage of it or not in your provider/dal implementation.

    4. Hope the above links will guide in right direction

    Regards,
    valio b
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Mike
    Mike avatar
    221 posts
    Registered:
    19 Aug 2008
    18 Dec 2008
    Link to this post
    Thanks for the reply Valio,

    I have managed to create a simple module that uses our DAL classes. This is great cause we have all the methods there to modify the data we looking to allow the CMS to control.

    I have a  questions though that i hope someone can answer for me:

    We want to take full advantage of the Generic Content editors and Image Library modules in our custom modules. We need to know how our tables need to be modified to store this data? So for example if i create a module that inserts a image into one of our tables along with some data, is this image a BLOB or what? Same for Generic Content Module, if we give someone the ability to modify a text field in out DB with the module, is this stored as straight HTML or ??? Where can i find all this information?

    Then for the public side of our site we use web services... In the case of images that are in the database how are these images sent back out to the public controls via web services (without having to do an additional DB hit to find the image using the SF API)?

    Duncan


  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    22 Dec 2008
    Link to this post
    Hi Duncan,

    The type of the field we use to store the image/documents/files data in SQL server is varbinary. As for the value which is set through the Generic Content control or module, it is nvarchar(MAX).

    We do not have the information about each table in database, because there is almost no case that could couldn't be covered by using our APIs. I am going to suggest you this approach - why don't you use Sitefinity as a "storage"? You can store all kind of information in the appropriate module with our APIs, and store the relative link to that item in your tables. You will have only the relation to the item, and the item itself will be processed by our implementation.

    All the best,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
4 posts, 0 answered