Update multiple Umbraco sites through windows application - asp.net

We are using umbraco 7.1.3
As per client's requirement we need to create more then 550 Umbraco CMS sites for different cities with same template and asp.net user control which access data from one master database.
So we created one windows application that will create 550+ sites as per city name under one Non-Umbraco root site.
We also managed to create different Umbraco database for each site is created and moved published code under to Non-Umbraco root site and convert to application and also updated Web.config file for each site dynamically.
After that when-ever we found that our logic or UI was not correct we also update DLL, ASCX user controls and CSS to all sites through same window application.
Till now everything was going smooth, but now we have one major change and that contains new document type, template, macro and new menu needs to be added dynamically. Updating published code through windows application was easy but we don't found any way to make update Umbraco database of 500+ sites through another application.
Some websites are already updated through respective sites owners, so without affected any existing changes we need to add new macro, content, document type and menu for each site and we don't know in which Umbraco database we need to enter records?
Had already posted the same in umbraco issue tracker #U4-7105
Also in Umbraco forums #71443
Thanks & Regard

Sounds like an interesting case!
If you want to migrate items that are in the database such as document types, templates and macros you would most likely need to get a product like Courier. I can see that due to license costs this could be an issue for you with 500+ sites.
Another option could be to take a look at uSync to see if it does what you need. I don't have much experience with this package but from the looks of it, it seems like it is handling all the database bits - and everything else (files on the file system) would be handled by your application just as it is right now.

Related

How to create dynamic google sitemap in asp.net?

I have one website like www.example.com and have dynamic pages like www.example.com/page?1 and www.example.com/page?2 etc. more pages are created every hours. I need to create sitemap.xml file automatically save in server path and update my latest web pages to Google search engine. How to do this in ASP.NET? Give me any clue on this.
I was looking for similar information recently, there is a similar topic. What you need is called "web crawler" - the principle of work consists in the searching of all URL-address in the HTML-code, excluding links to other sites, and creating a list of found links. For each of the URL-address in the list it will repeat these steps and as result you'll get list of address for all your web pages. And then you can build file Sitemap.xml, I have used for this the class of .net Framework - XmlTextWriter.What about automatically updating the Sitemap file , I think you can set some timer and to update the file, for example, once a day or do it yourself every day. Good luck

ASP.NET MVC full offline website

I made an ASP.NET MVC application which allows user to create dynamic websites. I need to add feature which will allow to download from server off-line version of choosen website as static html files with menu, hyperlinks, images, documents etc. It should work similar to applications such as Teleport Pro, but I have to choose from Admin Panel which content should be export.
Client wants to burn static website on CD, save on pendrive.
Do you have any ideas how to begin? Please help.
I currently have implemented that in a current project...
User is able to change anything in the frontend and at the end he can publish and download the offline files... the site subscribe users and show all prizes, winners and more information about that campaign.
All was done in ASP.NET MVC3 under .NET4 and hosted in AppHarbor.
It's composed at several applications but for what you want, you develop the Backend and the Frontend, and to generate the static files, simple use the Frontend to grab the full HTML
As an example, I can show what 2 users did...
Callme.dk did http://callme.julekal.info and
Sony Nordic did http://sony.julekal.info
plus, you can simply point custom domains to it as well like http://sonynordicxmas.net/
To publish and generate all files:
one part of the editing:
So I give the users, offline access (through the .zip file), online access (through the frontend application) and the ability of using custom domains...
I think the only way this might be possible is if you go to every single page and then use your browser to "Save" the web page script and all.
However this causes several issues;
You never quite get everything and you need to massage the HTML produced, dowload all the images etc to get the page to look right
Each html file now has an associated folder with the same name and each time you do this you will get another html file with a folder. You can combine all the folders into a single one but that leads me to item 3.
You will need to edit each html file to clear up any pathing issues if you want to share a single source folder.
Data is no longer dynamic!
You need to, if you want to link all the pages to each other, edit every single html file and resolver the anchor tags.
This is too much work and I think it actually breaks the true requirement.
Don't do it! :)

What are some ways to support multiple websites with a single code base?

I'm writing a pretty straight forward ASP.NET MVC web app: only a couple of CRUD pages, some folders where clients can browse documents and just 3 or 4 roles. The website will be used in a B2B scenario, where every client will have their "own" website.
At this point, the only thing that will change in the website, from client to client is the content (ie. the documents, and the rows of data they'll see). If this is the case, what's the best way to manage roles across all of my clients? I'm looking for the simplest possible solution because this is a proof of concept and I don't want to invest a lot of time right now.
What if it's not just the content that changes? Maybe some clients will want a few custom static pages. At this point, is my only option replicating the entire website? I'm leery of this because it'll become hard to maintain if I get a lot of clients.
I'd appreciate any help... I just don't want to shoot myself in the foot; I'm sure someone has done this before.
I create Virtual Directories in IIS for each client, all pointed back to the same folder where my ASP.NET code resides.
This allows me to support several dozen nearly-identical "web sites," each with their own database that is basically identical in form, only differs in data.
So, my site URLs look like:
http://mysite.com/clientacme/
http://mysite.com/clientbill/
http://mysite.com/clientcharlie/
There are two key implementation details I worked out for this:
I use the Virtual Directory folder name to determine which DSN my code reads from. This is accomplished by creating a simple static method that injects the folder name into a DSN string template. If you want to use the same database to store everyone's data, you can use the folder name as a default filter in your queries.
I store the settings for each web site (headers and footers, options, links to custom reports, etc.) in a simple "settings" table in each database (key, value) rather than in the web.config (which is shared). This allows me to extend the code base over time to customize the experience for each client without forking the code.
For user authentication, I use Basic authentication, and I keep usernames, passwords, and roles in a table in each database.
The important thing is that if you use different SQL Server databases for each client's content, you need to script any changes to your database tables, indexes, etc. and apply them across all databases at the same time (after testing of course). One simple way to do this is to maintain an Excel sheet with a table of database names and a big "SQL" cell at the top. Beside each database name, create a formula to "USE databasename;" and then concat the SQL code at the top.
I'm not sure if this answers your question completely, but as far as maintaining custom "static" pages I found myself implementing a system on a client's MVC website where the client can create "Pages" from their admin control panel and each Page has a collection of "PageContent" entities which consist of a Title and and HTML content field (populated using a WYISWYG editor). Upon creating a page the MVC application maps http://yoursite.com/Page/Page-Url-Specified-By-The-User to that page and renders its content there. Obviously, the pages are dynamic, but as far as the client can tell they have created a brand new custom page with little or no effort.

Using master pages with multiple entities

I'm beginning to plan a complete redesign of our departments intranet pages. As it stands, every department gets their own folder within root. They all share the same look and feel but don't use CSS everything in each file is straight up static text. Basically, if a change has to be made to the header, every file must get changed. The number of files is somewhere in the hundreds. Since we're in the process of getting a new look & feel, I figured this would be the appropriate time to redesign the structure as a whole as well. My idea was to create a new C# Web Project to utilize the C# Master Pages. Within that project, each page would use the master page. Since I know they like to make many minor cosmetic changes, master pages would make things much simpler and quite frankly, I don't have time to manually edit a header 564 (random) times. The other aspect of this site is that the root would contain a documents folder within sub folders pertaining to each fo our departments.
Guess my question is, has anyone tackled an issue like this and could shed some light as to how they fixed it.
Also, would it be worth upgrading IIS and .NET to their latest version?
If you are already working in .NET 2.0, then you shouldn't need to do any upgrades, and there won't be any additional infrastructure cost.
I would highly recommend using Master pages, as they do make it painless to have a common look and feel for your entire site.
Another cool feature of Master pages is that you can nest them together. This would let you have a common feel between all pages. And then each department would have it's own Master page nested into your top-level page.
I'll start with the cost question. You need to be using ASP.NET 2.0 or higher to take advantage of master pages. Technically the .NET framework is free, however Visual Studio is not. Visual Web Developer is free, but the license might be for non-commercial projects only. I'm not sure. IIS is also free, Windows Server 2008 is not. You are fine running on XP or Server 2000/2003. There isn't really any reason to upgrade.
I can't say that I have tackled a problem exactly like yours, but it sounds like what you need is a content management system. Some examples are the cuyahoga project, or Umbraco. These systems allow you to create a general look and feel, and store all content in a database or xml files and provide an online content editor, so the content of the pages can be managed by people that don't necessarily know HTML or Programming.
You can have a master-page hierarchy:
Master page for everyone
Master page for department A
Master page for department B
Whatever's common for everyone you set in the first master page.
Then you make a master page for department A pages - this master page's master page is the first one.

How to consolidate ASP.NET master pages across applications?

First shot at throwing a question on these boards so hopefully I can get some help, here goes:
I am working to start up the .NET practice at my client. We have 5 small scale .NET applications in place currently with a few them of them live into production. They're mostly small reporting pieces with some data entry/business logic functionality. Each of these applications is currently using the identical master pages.
What I mean is that there is a copy of the same master page in each application. They are all basic website->WCF->BL->DB tiered applications. So I have 4 copies of the same master page that I have to change when I make a change to it.
The client DOES NOT want to consolidate all of these into a single solution. They like the separation of applications across sites. I just don't want to continue dealing with the hassle of multiple updates for common elements (which there will be many more of across these applications).
The code is all stored in team foundation server. We also do NOT want to compile the master page into a .dll and deploy it.
Can anyone please make some suggestions as to how I can maintain a single copy of these common files (master, .css, etc) across my multiple applications.
thanks in advance
You might want to look at Sharing Master Pages in Visual Studio.
If that is no help then you could try using Build Events in Visual Studio. I would pick one of the projects to be my "Main Project" and only edit the master page from that project. When you build the project it would run a command that would copy that master page(if it had changed) to your set locations.
The client DOES NOT want to
consolidate all of these into a single
solution. They like the separation of
applications across sites. I just dont
want to continue dealing with the
hassle of multiple updates for common
elements (which there will be many
more of across these applications).
The code is all stored in team
foundation server. We also do NOT want
to compile the master page into a dll
and deploy it.
You eliminated the only two real options there. What all is in the master page? Would it be possible to extract the HTML UI elements to a single template or series of template HTML files and import those dynamically into the master page? You could then relocate the common HTML to an arbitrary URL and have the master page for each application pull it in dynamically.
Edit: I lied. You could also use a VirtualPathProvider like Sharepoint does to store the master page in a database or some other directory, but beware that VirtualPathProviders do not work in MediumTrust environments.
See:
http://msdn.microsoft.com/en-us/library/system.web.hosting.virtualpathprovider.aspx
If you are using Web Applications (compiled into a dll) rather than Web Sites you can do the following:
Right click on the folder you want to store the master page in
Select "Add Existing Item..."
Browse to the master page on the file system, and select both the .master and the .master.cs files.
Then, rather than clicking on the "Add" button, click on the little down arrow to the right of Add, this will bring up a little menu with the options: "Add" and "Add As Link"
Select "Add As Link" this will reference the file in your project, while leaving it in the original location in your dev environment - this allows you to edit it in either application, while keeping it up to date in the other applications.
Obviously if you edit the code behind, you'll need to re-compile the other projects before you deploy the changes to those sites.
This isn't available in web site projects as they rely on the file structure to work out what is in the project.
EDIT: Missed the css part. Obviously you won't be able to serve those files, so this should only work for the master page.
Don't know your scenario, so
IF you can control the DNS / virtual directories to the applications you could use a format like this:
c:\inetpub\wwwroot\Application1
c:\inetpub\wwwroot\Application2
c:\inetpub\wwwroot\Application3
c:\inetpub\wwwroot\Application4
c:\inetpub\wwwroot\Application5
and have your Master page at c:\inetpub\wwwroot\master.Master,
c:\inetpub\wwwroot\master.Master.cs,
c:\inetpub\wwwroot\master.Master.cs.designer
Then you could reference the single copy of the master page from /../master.Master. I gave this a quick shot with a precompiled master page to make sure I could reach back beyond my root. You might have to give it a shot to see.
We use our source control to create links to the shared files in all the places that we need it. So if you edit in one place, you just need to do a get latest and it will appear in the other places you have linked it.
I ended up going with the VPP route. I created a virtual path provider and built my master page into a DLL and this is working. Now I have a massive problem though in that a Content page whos master page is late bound through the codebehind throws validation/formatting hissy fits because it thinks its should be a stand along page. my CNTRL + K, CNTRL + D has broken on every page where I'm now sharing my master page. This is extremely frustring for me and the team

Resources