Adding complexity to Modules
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
Anyone from Sitefinity out there?
Rob
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);
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
Sigh...... Anyone?
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
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
I have similiar problem. Could you post solution?
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,