Migrating dynamic ASP website to Umbraco - umbraco

I am looking for an advice. I have an ASP website, where pages are generated from database. I have URL, title, content, metatags and other page specific fields in DB tables.
I would like to reuse this databse in Umbraco and be able to generate dynamic pages from these data. I will want to use Razor in views. My dynamic pages will need to be integrated with CMS sitemap.
I will also need a backend to manage these data (added in Umbraco backend if possible).
Is that possible? What would be the high level steps?
Thanks!
UPDATE:
The data have multiple relationships and business logic needs to be applied before presenting them to the users. What I am looking for is a CMS that will allow me to define routes and inject search, index and detail partials (use global layout, set page title and metatags). It can be a more or less hacky solution as long as CMS updates don't break it.
Is Umbraco flexible enough to do such thing?

Many people who look at Umbraco for the first time try to work out how they can fit an existing project into umbraco and reuse code / databases.
The truth is that using Umbraco involves a shift in how you think about data. Essentially, in most cases, Umbraco is your database. Especially if all your database is doing is providing the data that you describe ie the contents of the standard pages of your website.
Your approach should be to rebuild the data structure of your site using Umbraco document types. Umbraco document types provide the data to your page templates (MVC Views).
You should really download Umbraco and take out a subscription to Umbraco TV to shortcut a rather steep, but very worthwhile learning curve.
Wing

Related

how to implement search engine on existing mvc page

Suppose I have MVC application with some static and dynamic web pages. How to add search feature for such site?
I dont want to create simple page searching for the data contained in database, I want to be able to index whole pages as they are displayed to customer.
Any solution for ASP.NET MVC4/5?
Shell I use existing solution (which?) or create my own one ?
Disclaimer: it's the product of the company I work for.
You can use SearchUnit for indexing/searching MVC web sites. There's a free Community version, and a more powerful paid version.
I don't know the specifics of what you need, but it's easier to use and more rounded (eg. includes spell checking, many document format parsers) than other options such as Lucene (IMHO, let me know if you disagree).
MVC specifics are here.

architecture of Umbraco application

I m new to Umbraco, I have watched Umbraco.tv videos and want to use Umbraco in a project as a cms for managing and editing content. I am highly thankful for your guidance, time and for your thoughts on 3 questions:
How a Umbraco based data driven proejct should be architecutured ? For custom database tables do you use a separate database or same Umbraco database ?
How you work with custom data (non content) ? Do you make everything a document type, even if it is data which you are not going to create content of, for example a simple form submitted data ?
For DAL what technology or ORM you use ? Does Umbraco provide any API for saving simple data which is not a content or document type ?
Thank you so much once again.
1 The architecture question is important but it also has be considered against how complex the project needs to be.
I would usually recommend a separate database for non-Umbraco data since this keeps everything nicely independent and manageable especially as projects grow. It also means that CMS-specific data (i.e. content) can be kept separately from none-CMS data, e.g. user registrations.
However, if the project is small and isn't likely to grow, keep it simple. Use the same database and piggy back off Umbraco's implementation of the Petapoco ORM. For example:
ApplicationContext.DatabaseContext.Database.Save(new Thing());
Or
var item = ApplicationContext.DatabaseContext.Database.Single(thingId);
2 For custom data, again it's a matter of need, maintainability and simplicity. Only use document types for what needs to be and can be stored in the CMS. My personal rule is that if it isn't content or organises content then it doesn't belong in the CMS. For example news and news categories obviously belong in the CMS. However, the comments made on an article have no reason to in the CMS.
3 With regards to DAL, as I have said, Umbraco has an implementation of Petapoco that can be used out of the box. If the project is basic enough, just use that. There is little point in using anything else unless you need some separation and/or some additional grunt in which case I would recommend using NHibernate or EF.
In addition to the points above,
Use NuGet;
Use the MVC mode of Umbraco, as it will provide you with substantially more flexibility. Check out the Hybrid Framework as it provides a very good start point for a robust and flexible project architecture;
http://www.youtube.com/watch?v=0PtzyrEFG7I.
You always need a doctype in Umbraco, even if a page doesn't offer any WYSIWYG type editability
I would recommend using a Service Oriented Architecture, and the .dlls you drop into Umbraco can call the service. You can then deploy this service and have full control over how you do data access. Choose whatever method you want. Most modern sites use an ORM and it doesn't matter which, although nHIbernate and Entity Framework are the favourites. Don't be frightened to mix and match a more direct form of data access though as it can give you more control, especially in situations where performance optimisation of large queries is important.
If you're not familiar with adding custom .NET functionality into Umbraco, Trying out adding .NET user controls into Umbraco will give you a good start, and to help you to understand how you can utilise your own .dlls in Umbraco:
http://umbraco.com/help-and-support/video-tutorials/introduction-to-umbraco/developer-introduction/using-net-user-controls.aspx
Anything custom I put in the same database as my Umbraco installation, but everything in custom tables. I don't touch the Umbraco tabes, I would not want to affect my future version updates.
Form submitted data I store in my own custom tables, I avoid creating content nodes with those, it's often tricky and doesn't give me the flexebility I often need. What I do instead is create an "Admin" document type, that is behind login (hard coded access, but easy to hook up to Umbraco users / members if wanted) and use my own custom UI to display my stored custom data.
I use PetaPoto (http://www.toptensoftware.com/petapoco/), it's a micro ORM that is added through a single file (installation is so easy then), using the same db connection string. Then I create custom models as I need and with with parts of the MVC. I normally stay away from route hijacking and rather use Surface Controllers and ajax calls for almost everything.
Hope this helps!
You can use the database containing the Umbraco tables for tables not used in Umbraco. If there are no hosting problems for you using multiple databases then you can simply link to a second database in the web.config - this would be safer than using the default Umbraco database as Umbraco packages often add database tables & there could be naming conflicts.
Viewing non-Umbraco data (eg from a database) is best done by adding macros that access the data using standard .Net patterns (eg razor scripts, .Net User Controls) & then in Umbraco you add in a reference to the macro in the template (view). You can use multiple templates (views) for any document type; so if you have a document type called 'forms' that contains no data you can use the 'allowed templates' checkboxes to say which view(s) are valid for this document type. When you add a content item you must specify a doc type at the start, but the template (view) can be changed at any time.
If you are storing data any .Net ORM will work with Umbraco (see http://en.wikipedia.org/wiki/List_of_object-relational_mapping_software#.NET) I've used Linq to Sql, Subsonic & Dapper before now - but there are lots of options.
Take a look at my example using umbraco within Onion Architecture
https://github.com/afroukh/OnionCMS

Merging Orchard CMS with custom MVC ecommerce site

I have a large custom ecommerce engine that is currently using a SQL Server database (stored procedures handling most data tasks), a WCF middle-tier (handling business logic), and an MVC front-end site (that has no knowledge of any database). Our need for a content management system is increasing rapidly and I'm trying to figure out the best way to implement one, considering our very taxed development resources.
My first thought it to simply have two websites, an Orchard CMS site and our e-commerce site. I could setup some type of request routing that would send URLs for catalog browsing and cart functions to the ecommerce site, while other URLs get handled by the Orchard site. I would have to have a couple of modules (or widgets) built within the Orchard site that would display things like the cart summary that appears in the heading of each page. This seems like the easiest method of handling this, even if it is short-term.
My other thought is to have the site completely built using Orchard. This would require porting our ecommerce logic into modules. This seems like it would be one hell of a task. All of our work is done via web services, so if a user goes to a specific category URL, the site would call a web service and pass some variables (customer ID, category, etc). The web service would return the categories, products and prices for that customer - which would then be displayed on the screen.
Lastly, an even more complex version of the last option would be to actually store the products in Orchard, so that editable fields (description, meta tags, etc) would be managed through the Orchard CMS. This would require major changes to (or absorption of) our WCF middle-tier. This seems like it would be almost impossible, but may allow better handling of more media down the road (photos, videos, MSDS sheets, product literature, etc).
What are your thoughts so far, between these three models.
You can create a simple Orchard module that is a lot like an area in an MVC project. It uses controllers and views and is easy to do if you're familiar with MVC. You don't need to integrate it very heavily with Orchard if you don't want too. Your module's content would be in a folder and Orchard would manage the rest of the site's content.
To make the pages in your module use the orchard theme from the site you just need to add the [Themed] filter to your controller.
The hello world example in the Orchard Documentation shows you how to do this.
This would be the easiest option, but there would be benefits if you decided to store the products as Orchard content items. It would be more difficult to get there, but you'd be able to take advantage of other Orchard modules and add content parts like tags, comments and reviews to your products.

Flatpages equivalent for ASP.Net MVC

Django has the Flatpages app, which lets site admins change content on specific pages without changing code. Flatpage content i stored in the database, sort of like in a CMS. Flatpages are typically used for about-pages and such.
Are there any good equivalents for ASP.Net MVC? I.e., a convenient way to manage page-content persisted to a database.
No.
Django seems closer to a CMS then "ASP.NET MVC" which is both a framework and just a general design pattern.
Have a look at http://http://cmsmvc.codeplex.com, it allows you to create pages, and manage content on the page.
The solution is still in early stages, but it could help you out.

ASP.NET MVC+ multilingual page

I'm developing a website using ASP.NET MVC. The website should handle multiple languages.
I would like to ask what are the best practices of handling multiple languagues - both for "static" texts and taken from DB. I read some threads about this on stackoverflow but i'm not sure how can I implement in when data from DB are received. I also read this article
Well, if you need to localize your web application then you can't really use any "static" text. The article link you included talks about using resource files. While this does work in ASP.Net MVC it means that everything in your view pages will have to be an ASP.Net Literal control and you have to push ALL of your textual content into the .RES file and not put any of it in your view pages.
If you have a lot of users from different cultures then using the .RES files will be the way to go. If you have the majority of your users all in one language and just a small percentage in a different language then you may be able to take advantage of Microsoft’s translation engine. You just embed some JavaScript in your page and Microsoft will translate the page’s text for you.

Resources