Advanced Language Manipulation Tool for EPiServer
Have you ever (or have your customers) created and edited a page in one language only to realize that their selected locale was wrong? Have you ever wished you could delete a master language branch of a page after creating its localized counterpart but you could only delete the newly created slave language instead? Have a customer ever requested that they could copy a whole branch and you convert it to another language so that they could then translate in-place?
Well I have… and I’m sure I will. And so did Fredrikj on the our #epicode IRC channel ;).
Basically I had the tool that would convert from one language to another, but Fredrikj requested something that would switch master language of a page from one to another. Since I’ve already had some of the work done, I’ve updated the stored procedure I’ve written some time ago and slapped a nice GUI up on it. Here’s the result:
What the tool allows you to do is perform either language conversion or master branch switching on a selected page and all of its children (if you choose so).
The stored procedure have been updated to work on CMS5 R2 (will no longer work on R1 – but if you need that functionality, comment here or give me a shout and I’ll create a compatible version for you).
A word of caution though – I take no guarantee whatsoever about its operation. Especially, if you wreck your client’s database with it. I did what I could to prevent some of the obvious problems (like switching to a non existing master or converting to an existing one) but I will not be responsible if it won’t work for you. make a database backup and experiment there before you do any changes on the real data. That said – it works for me, so I think it should also work for you.
You can download the archive containing the tool here. unzip it to your EPiServer web application folder keeping the folder structure or the plugin reference will be wrong. Include the *.aspx and the *.cs files in your project and apply the SQL file to your database (The manipulation is performed by a stored procedure located in the file).
Also if you’re performing the change in a load balanced environment, you may need to restart the other servers once you do the changes. I reset the DataFactory cache, but I am not sure it propagates through to other servers.
Popularity: 73% [?]
This entry (Permalink) was posted
on Monday, April 6th, 2009 at 4:49 pm and is filed under .Net Framework, ASP.NET, C#, Code Samples, Downloadable, EPiCode, EPiServer, Microsoft SqlServer, Open Source, Software, Software Development, Solution, Web applications.
You can follow any responses to this entry through the RSS 2.0
feed.
You can leave a response
, or trackback
from your own site.

(4 votes, average: 4.50 out of 5)





21 Responses to “Advanced Language Manipulation Tool for EPiServer”
April 8th, 2009 at 12:58 pm
Nice work Adam!
April 8th, 2009 at 2:59 pm
Very nice Adam, thanks for the code! Oh, and thanks for the mention ;)
April 14th, 2009 at 8:43 am
Excellent. Havent tried it yet, but if it does what is says it will add something that should have been a standard function in the product!
September 3rd, 2009 at 3:09 pm
Brilliant Adam!
I’m relatively new to EPiServer and I was perplexed why EPiServer didnt have this functionality built into it.
Thanks, this has definitely saved me many days of frustration.
October 12th, 2009 at 2:55 pm
Downloaded it, and tried it, but the downloadfile lacks some files. In the sourcefile for the page I can see reference to “/to/javascript/system.js” that is important to make it work.
October 12th, 2009 at 3:27 pm
Problem solved. Changed the reference to the system.js file to my relatively to my project.
November 6th, 2009 at 11:37 am
As a follow up, does anyone know how to programatically change the Available Languages for the page you’ve just processed with this tool?
For instance, the page to process has set Available Language to English. Then we use the tool to change it, and its children, to French, how can we programatically update the Available Language from English to French?
thanks again Adam for this great tool!
November 6th, 2009 at 2:06 pm
hi Neil,
I have not so far needed that but by a quick glance in the SDK I would suggest you look at the EPiServer.DataAbstraction.PageLanguageSetting class. it seems to have load and save methods as well as some basic manipulation regarding fallbacks
November 24th, 2009 at 1:27 pm
[...] This post was mentioned on Twitter by Joel Abrahamsson, Benny Skogberg. Benny Skogberg said: Advanced Language Manipulation Tool for EPiServer http://blog.najmanowicz.com/2009/04/06/advanced-language-manipulation-tool-for-episerver/ [...]
November 30th, 2009 at 5:40 pm
Hi. We are still on CMS5 R1 but this tool would be a massive help as I’ve got regional sites that need to be moved into a single global site. Is there anything i can do to get this tool working with R1? It looks perfect but we cant upgrade to R2 for various reasons.
December 1st, 2009 at 4:22 pm
Viv, I am afraid the tool won’t solve your problem. How I assume your sites are structured is that they are separate trees in the CMS.
The tool will not integrate such sites into a single structure, the only thing it does is convert a wrongly attributed language tags on a page.
That said – the tool was initially developed on R1, but was significatyly enhanced since then. I suppose I could modify the stored procedure to work with the R1 database again, I would just need the precise revision of the CMS that you use (the database version).
January 13th, 2010 at 3:52 pm
This is a nice plugin, often necessary after migrated a site. The bad thing is that it’s not uploaded to a community source project place like epicode / codeplex etc so the module could be updated by those who use it.
There is a problem when changing a language like this and not updating all the needed tables. In this case, the tblKeyword is not updated so the SearchDataSource will fail for all searches using the default EPiServer search.
Take a look at this bloggpost and my comment.
http://world.episerver.com/Blogs/Per-Bjurstrom/Archive/2009/6/Performance-How-to-disable-keyword-indexing-in-SP2/#comment36085
January 18th, 2010 at 4:32 pm
About the above comment – we agreed that Øyvind will upload the code to epicode and add the necessary changes, which he has my permission to do.
Nice catch with the search tables, thanks Øyvind!
April 1st, 2010 at 11:37 am
Hello.
I can not get this to work.
The referense to the two javascript files,
“/to/javascript/system.js”
“/to/javascript/pagetreeview.js”
What should that be?
It seems that they can not be found.
Regards,
Anders
April 2nd, 2010 at 9:10 am
Andres, those references are not needed there, they are just copied form my template page where I experiment with things. go ahead and delete the lines referring to those scripts – all the functionality in it is server side.
The reason however for it not working for you might be that
a) haver you applied the stored procedure to your database?
b) are you running the same Episerver version that was current at the time the article was created? I believe it’s CMS 5 R2, but can be off right now. In which case the stored procedure might simply be off in terms of the database structures.
April 20th, 2010 at 3:02 pm
I downloaded the module available from EPiCode and installed it and everything seemed to work fine. My problem is when I try to click the button to select page to do the convertion from, then I get a a javascript saying “Object required”. That usually means that a system.js is missing but it seems to be there, so what am I missing?
May 22nd, 2010 at 7:23 am
This is a nice plugin, often necessary after migrated a site. The bad thing is that it’s not uploaded to a community source project place like epicode / codeplex etc so the module could be updated by those who use it.
There is a problem when changing a language like this and not updating all the needed tables. In this case, the tblKeyword is not updated so the SearchDataSource will fail for all searches using the default EPiServer search.
Take a look at this bloggpost and my comment.
http://world.episerver.com/Blogs/Per-Bjurstrom/Archive/2009/6/Performance-How-to-disable-keyword-indexing-in-SP2/#comment36085
May 25th, 2010 at 12:27 pm
Thank you! Worked like a charm. I exported a couple of hundred pages from an EPi 4 site and when I imported them the language was wrong.
This tool saved my day. Thanks!
//J
May 27th, 2010 at 4:12 pm
Just for the record; This Tool also work for EPiServer CMS 6.
To get it to work you have to do a few things:
1. Change the EPiServerUI:ToolButton to a regular asp:Button
2. Remove the “Register TagPrefix=”EPiServerUI” asembly=”EPiServer.UI” Namespace=”EPiServer.UI.WebControls” in the top of the LanguangeTool.aspx page
3. Remove the using EPiServer.UI.WebControls; statement in LanguageTool.aspx.cs
5. Add the system.js and the pagetreeview.js files to your solution and change the paths to the correct ones in LanguageTool.aspx page. The files is usually located in C:\Program Files (x86)\EPiServer\CMS\6.0.530.0\Application\UI\CMS\Javascript
Now it should work in CMS 6 as well.
/Andreas
June 9th, 2010 at 9:47 am
@Andreas – The code is on EPiCode (EPiCode.LanguageTool), would be great if you could update it and create an EPiServer CMS 6 version as well :).
Cheers
Frederik
June 15th, 2010 at 9:55 am
Regarding module on EPiCode and issue with search indexes, see:
Changes to the Advanced Language Manipulation Tool
/Mari
Leave a Reply