Adding complexity to Modules

Posted by Community Admin on 04-Aug-2018 11:52

Adding complexity to Modules

All Replies

Posted by Community Admin on 23-Jul-2011 00:00

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

Posted by Community Admin on 25-Jul-2011 00:00

Anyone from Sitefinity out there?

Rob

Posted by Community Admin on 26-Jul-2011 00:00

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

Posted by Community Admin on 26-Jul-2011 00:00

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

Posted by Community Admin on 27-Jul-2011 00:00

Sigh...... Anyone?

Posted by Community Admin on 28-Jul-2011 00:00

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

Posted by Community Admin on 28-Jul-2011 00:00

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

Posted by Community Admin on 31-May-2013 00:00

I have similiar problem. Could you post solution?

Posted by Community Admin on 03-Jun-2013 00:00

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

This thread is closed