More in this section

Forums / Developing with Sitefinity / Develop a custom module withour OpenAccess ORM

Develop a custom module withour OpenAccess ORM

8 posts, 0 answered
  1. Ancuta Me
    Ancuta Me avatar
    43 posts
    Registered:
    26 Apr 2010
    11 May 2011
    Link to this post
    Hi,

    Is there a simple example out there of a custom module built for SF 4 that does not use OpenAccess ORM?
    The "Jobs" module that comes with SDK (and not only this one) is poorly documented and for those unfamiliar with this orm, like me,  is making things harder.

    Thanks.
  2. David
    David  avatar
    78 posts
    Registered:
    29 Dec 2008
    13 May 2011
    Link to this post
    Hi,  Like you I am researching this.  I have data in a different database (1500 records) that is manage with a linqtosql module in 3.7.  I don't want to tie down that data into sitefinity tables.   Currently setting up external pages to manage the data, but would like to have a module for it.

    I did find where someone has done this with LinqtoSql. 

    http://stackoverflow.com/questions/5643731/sitefinity-4-with-linq-to-sql


    I am going to attempt to duplicate his solutions.  I might something on the way. :)  It will be another week before I have free time to research again (setting up a new Sitefinity 3.7 site, pretty site by the way).  I will post back if I make any progress.

    Maybe if Rob (aka Modika on Stackoverflow) is reading this, he can share some sample code for us, and for Gabe to present it in a webiniar. 

    David
  3. Slavo
    Slavo avatar
    295 posts
    Registered:
    24 Sep 2012
    18 May 2011
    Link to this post
    Hi all,

    The Jobs module is indeed using the OpenAccess ORM. We have a tutorial documenting each step of the process to create such a module here. Let us know if this documentation is not enough and what else you feel should be expanded or revised.

    As for creating a module which does not use OpenAccess - we have received numerous requests for this, but we don't have sample code yet. It is one of our top priorities for the next release of the SDK (with Sitefinity 4.2). It would involve a lot more coding than creating the modules similar to Jobs and Products, but totally possible. As Ivan mentioned in his reply to the thread on StackOverflow - we use a provider model, so the only thing different would be to just implement a provider which uses LINQtoSQL.

    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
  4. aldo
    aldo avatar
    2 posts
    Registered:
    24 May 2011
    26 May 2011
    Link to this post
    Hi,
    in this page http://www.sitefinity.com/40/help/developers-guide/how-to-how-to-create-a-custom-content-based-module-using-the-module-in-your-website.html
    You didn't mention how to use Jobs module.
    after these steps

    Registering a module

    To register a module in Sitefinity project, perform the following:

    1. Build the Visual Studio solution, where the module was developed, by clicking Build Solution from the context menu of the solution.

    2. Browse to the bin folder of the solution.

    3. Copy the .dll file of the module project to the bin folder inside your Sitefinity folder.

    4. Go to the Sitefinity backend (http://<yoursite>/sitefinity).

    5. In the main menu, click Administration » Settings » Advanced.

    6. In the treeview on the left, click System » ApplicationModules.

    7. To register the module, click Create New.

    8. In the Name input field and in the Title input field, enter the name of your module. For example, enter MyModule.

    9. In the Type field, enter the fully qualified name of the module class. For example, enter MyModuleProject.MyModule.


    how can I access this page http://www.sitefinity.com/40/help/developers-guide/media/UsingTheJobsModuleBackend.png
  5. Daniel Plomp
    Daniel Plomp avatar
    112 posts
    Registered:
    14 Jun 2012
    26 May 2011
    Link to this post
    So, would it be possible to define relations between custom content-based modules?

    For example: I use the ProductsModule but I want to link an OrderModule to it.
    How would this be done?

    Another example: I have a module that holds Companies, but I want to associated a person to it, who will be able to login on the front-end of my website.

    Where should I start and is it possible with SF4.1 at the moment?

    Regards,
    Daniel
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    30 May 2011
    Link to this post
    Hello Daniel ,

    You can add custom dynamic fields that will allow you to make the relation between several modules. Another option is exposing a public property inside your object model , so this member will be a part of the data contract and you can serialize/deserialize it

    Regards,
    Ivan Dimitrov
    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. John
    John avatar
    61 posts
    Registered:
    08 Jun 2012
    13 Jun 2011
    Link to this post
    @Ivan: Is there any SDK (or other sample) code that shows how to setup the association mappings for generic content-based model entities?

    We have looked at some of the OpenAccess documentation, but the examples are not specific to Sitefinity so we don't know if there are special considerations when trying to create an association between to model objects that inherit from Content.

    Thank you for any insight!

    Regards,
    John
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    14 Jun 2011
    Link to this post
    Hello John,

    You should crate a mapping association

    http://www.telerik.com/help/openaccess-orm/fluent-mapping-mapping-clr-mapping-associations.html

    using HasAssociation property

    sample

    var draftMapping= new MappingConfiguration<Telerik.Sitefinity.Samples.Model.ItemDraft>();
                draftMapping.MapType(p => new { }).Inheritance(InheritanceStrategy.Flat).SetTableName("sf_draft_items", this.Context);
                draftMapping.HasAssociation<Telerik.Sitefinity.Samples.Model.Item>(p => p.ParentItem).ToColumn("item_id");

    Kind regards,
    Ivan Dimitrov
    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
8 posts, 0 answered