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

Forums / Developing with Sitefinity / Adding complexity to Modules

Adding complexity to Modules

9 posts, 0 answered
  1. Roberto Modica
    Roberto Modica avatar
    146 posts
    Registered:
    08 Feb 2008
    23 Jul 2011
    Link to this post
    Hi,

    I have been developing a custom module (content based with OA as ORM) for a little while and simply to get myelf up to speed i created the basis of my custom module just to see how it would work and understand how the items fit together.  I am now at a stage where i need to add some more complexity to the module by adding to the data model and bringing that into the UI.

    For instance i have a Location item, and that location item can be linked to one or many facilities that surround it.  I need to create a facilties object and also create a property in my location class to hold a list and then create the mapping between the objects using the fluid mapper, i think that is the correct approach (we are knew to ORMs in general), if this is not correct please let me know.  After that i guess its a process of defining views for the facilitiies in the same way they were for the locations (again clarity here would be great)

    After that, i need to somehow get this into the UI to give the user the ability to select facilities for a particular location, how can i go about doing this?  I cant seem to find anything in the samples that goes beyond the built in stuff, and this i feel would be custom?

    Any ideas and documents on this would be great.

    Regards,

    Rob
  2. Roberto Modica
    Roberto Modica avatar
    146 posts
    Registered:
    08 Feb 2008
    25 Jul 2011
    Link to this post
    Anyone from Sitefinity out there?

    Rob
  3. Roberto Modica
    Roberto Modica avatar
    146 posts
    Registered:
    08 Feb 2008
    26 Jul 2011
    Link to this post
    Hi,

    I am stuck.  I am not sure if what i am doing is correct and i need some clarity.  I had a locations module, but needed to add some complexity to the module.  I have added a new type to my model called ServiceItem which will deal with the services i need to attach to locations (LocationItem).  I have updated my fluent mappings to the following (many-to-many)
    private void MapItem(IList<MappingConfiguration> mappings)
    {         
        //Define Location Item Mapping
        var serviceMapping = new MappingConfiguration<ServiceItem>();
        serviceMapping.HasProperty(s => s.Id).IsIdentity();
        serviceMapping.MapType(s => new { }).ToTable("z_custom_services");
        serviceMapping.HasProperty(s => s.Synopsis);
         
        var locationMapping = new MappingConfiguration<LocationItem>();
        locationMapping.HasProperty(p => p.Id).IsIdentity();
        locationMapping.MapType(p => new {}).ToTable("z_custom_locations");
        locationMapping.HasProperty(p => p.ReferenceId);
        locationMapping.HasProperty(p => p.AddressLine1);
        locationMapping.HasProperty(p => p.AddressLine2);
        locationMapping.HasProperty(p => p.AddressLine3);
        locationMapping.HasProperty(p => p.County);
        locationMapping.HasProperty(p => p.Country);
        locationMapping.HasProperty(p => p.PostalCode);
        locationMapping.HasProperty(p => p.Synopsis);
     
        locationMapping.HasAssociation<Telerik.Sitefinity.Security.Model.Permission>(p => p.Permissions);
        locationMapping.HasProperty(p => p.InheritsPermissions);
        locationMapping.HasAssociation<Telerik.Sitefinity.Security.Model.PermissionsInheritanceMap>(p => p.PermissionChildren);
        locationMapping.HasProperty(p => p.CanInheritPermissions);
        locationMapping.HasAssociation(p => p.Urls).WithOppositeMember("parent", "Parent").ToColumn("content_id").IsDependent().IsManaged();
        locationMapping.HasAssociation<Telerik.Sitefinity.Workflow.Model.Tracking.ApprovalTrackingRecordMap>(p => p.ApprovalTrackingRecordMap);
     
        //Many-to-Many (Locations to Services)
        locationMapping.HasAssociation(p => p.Services).MapJoinTable("z_custom_location_services", (locationItem, serviceItem) => new
            {
                LocationID = locationItem.Id,
                ServiceID = serviceItem.Id
            });
     
        //Add Mappings to collection
        mappings.Add(serviceMapping);
        mappings.Add(locationMapping);
    }


    ServiceItem is based on a content item, so that it can take advantage of localisation etc.  I have created seperate provider for ServiceItem (not sure if this is correct, ServiceItems will exist outside of LocationItem so could be classed as an aggregate), i have created a seperate definitions class ServiceDefintions to define the backend views (no front end are required as services will be shown as part of the location details), i have created a seperate service (and ServiceItemViewModel class) and ServiceItem also has its own manager.  the more i look at it, the more it looks like it should go in its own Module, but is that how this is supposed to work??? Surely you can create more complex modules then that of one item, as the products item. 

    What is the best practice here, i am sitting wasting so much time with SF4, i have a deadline which i am dreading as it seems to me i am spending days infront of the computer with no forward movement, i want to go down the custom module route but if i may have to drop it and just produce intrastite modules, but then i have other issues such as including it within search indexes, and rolling out my own localisation so nothing is perfect.

    HEEEEEEEEEEEEEEEEEEEEEEEEELLLLLLLLLLLLLLLLLLLLLLLLLLLLLPPPPPPPPPPPP (does shouting help?)

    Rob

  4. Roberto Modica
    Roberto Modica avatar
    146 posts
    Registered:
    08 Feb 2008
    26 Jul 2011
    Link to this post

    Me again,

    i am now thinking about going down a certain route but any clarification would be fantastic from the telerik guys, i am thinking about doing it this way:

    - creating a module for locations (model, views etc)
    - creating a module for services (models, views etc)
    - including services module as a reference to the locations module and creating the mapping there (fluent mapping for OA)

    Is this how you guys do it, for example the ecommerce module, how was that built architectually? was that built using one big module with all the model/views/services being defined there, or do you create seperate modules, maybe packaged in one dll that link with each other?

    Please can someone take a look!

    Rob

  5. Roberto Modica
    Roberto Modica avatar
    146 posts
    Registered:
    08 Feb 2008
    27 Jul 2011
    Link to this post
    Sigh...... Anyone?
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    28 Jul 2011
    Link to this post
    Hello Roberto Modica,

    I have responded to your support ticket. I am also going to update the forum post with all the information, once I answer all of your questions int he ticket.

    Greetings,
    Radoslav Georgiev
    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. Roberto Modica
    Roberto Modica avatar
    146 posts
    Registered:
    08 Feb 2008
    28 Jul 2011
    Link to this post
    Hi Radoslav,

    Thanks for the response, i have added to the ticket since you first post (which did help me move forwards) but please review the additional questions and get back to me, i am slighlty stuck again.

    Rob
  8. Gooya
    Gooya avatar
    23 posts
    Registered:
    11 May 2010
    31 May 2013
    Link to this post
    I have similiar problem. Could you post solution?
  9. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    03 Jun 2013
    Link to this post
    Hi,

    can you please open a new thread and provide a detailed explanation on the problem you are facing? This thread is about two years old I am not quite sure of the version of Sitefinity you are using.

    Regards,
    Radoslav Georgiev
    Telerik
    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
9 posts, 0 answered