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

Forums / Developing with Sitefinity / Custom Modules with History

Custom Modules with History

4 posts, 0 answered
  1. Bill
    Bill avatar
    15 posts
    Registered:
    04 Nov 2008
    06 Mar 2009
    Link to this post
    We have been developing custom modules and controls for about 6 months now but with 3.6 we are trying to make sure we are doing things in the best possible way.
    Currently when we have new functionality to include, say a locations module that stores info about a physical location and then a control that uses the location info to populate a Google map, we do the following:
    - Create a new table in the Sitefinity database with fields we deem necessary(ex. address, city, state, zip, locationStatus, revision)
    - Run a code generator to create data and entity layers
    - Create a module with list, edit and history capability
    - Create a control that includes the Google map and populate it with the data entered in the module

    When we manage history in our own modules we basically keep a revision number in the table we create and when the controls call for a location we give it the latest revision.
    We also programmatically do rollbacks of older revisions if the user selects that function in the module.

    What is the recommendation from Sitefinity and other users:
    - Should we be creating our own tables or trying to use the built-in Sitefinity tables?
    - How should we be "managing" history in our custom modules?
    - Are there good examples out there?
  2. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    06 Mar 2009
    Link to this post
    Hi Bill,

    As you may already know, most of the modules that come with Sitefinity are based on the Generic Content module. The reason for this is to reuse common functionality as metafields, tagging, categories... and versioning or history. We encourage most of our clients to also base the custom modules they develop on Generic Content and use whatever is suitable in their scenario.
    What would happen in this case:
     - one table will be used to store all content in the database
     - another one will be used to store metadata
     - a third one will be used for versions of the content
     - data between modules is differentiated according to the application name, not which table it comes from

    That said, history basically comes out of the box for all modules based on generic content. You can still implement this yourself, but I recommend that you use our API for the purpose and don't spend the time. Another advantage is that we would be able to help you in future support inquiries much faster.

    Sincerely yours,
    Slavo
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Nitesh Rastogi
    Nitesh Rastogi avatar
    15 posts
    Registered:
    24 Aug 2009
    07 Sep 2009
    Link to this post
    Hi,

    My requirement is that i need to create a new modulle, which i have done taking help of developer manual.Know what i want is that give the business user an option to select the no of controls (may be one or two) and based on the selected number  generate  Rad Editor and display on the control panel  of the module at that time.Then the user fills the content in the editor and saves the same for one/two controls generated.Following is the code which i have written in the ControlPanel.ascx file but i do not get to see the rad controls generated.Do i have to add the contrls to the container.What would be the code for that.
    protected void ddNoOfControls_SelectedIndexChanged(object sender, EventArgs e)  
        {  
            int noOfControls = 0;  
            noOfControls = Convert.ToInt32(ddNoOfControls.SelectedValue);  
            for (int i = 0; i <= noOfControls; i++)  
            {  
                Telerik.Web.UI.RadEditor radEditor = new Telerik.Web.UI.RadEditor();  
                radEditor.ID = "RadEditor" + i+1;  
                radEditor.Visible = true;  
            }  
     
        } 


    How do i accomplish this .
    Thanks
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    16 Jun 2017
    10 Sep 2009
    Link to this post
    Hi Nitesh Rastogi,

    1. In your code you need to add Controls.Add(YourControls);
    2. If you have a custom module you should do this in CreateChildControls method.
    3.  As I see it you use DropDownList. So you can have ListItems which are the numbers. Then under CreateChildControl you can pass the selectedValue of the DropDownList and use "for" loop to generate desired numbers of the controls as you have already done.
    4. RadEditor is a complex controls so you need to use ViewState, ControlState or Session to persists the date added to the controls.

    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
4 posts, 0 answered