Kentico Document Importer

Posted on April 26th, 2008 in Development, Tools, Web by Jay

After working with Kentico for some time, I’ve slowly developed a few little tools to help migrate information from our old site to the new Kentico framework. 

One of the things that’s a little time consuming in Kentico is creating documents.  I’ve decided to use a custom document type for a particular type of content on our new site.  The data for this new document type is in a bunch of different tables in the old website and I needed a way to get all that information into the Kentico content tree, and fast.

So… I created a module to do this.  It’s kind of simple and doesn’t look too flash but it works (if you follow the rules).

It takes a spreadsheet, uploads it to a temp folder and then creates documents at the specified path in the tree.  If you need it, it’s yours to do with as you see fit.

BTW: No warranty provided on this of course.

Download

The code is pretty simple:

   1:  While dsImport.Read
   2:      ListBox1.Items.Add(dsImport.Item(0).ToString)
   3:      ‘add documents
   4:  
   5:      nodTemp = New CMS.TreeEngine.TreeNode(“NAS.Card”)
   6:      nodTemp.NodeName = dsImport.Item(“NodeName”).ToString
   7:      nodTemp.NodeAlias = dsImport.Item(“NodeName”).ToString
   8:   
   9:      For i = 0 To strCols.Length - 1
  10:          nodTemp.SetValue(strCols(I), dsImport.Item(strCols(I)))
  11:      Next
  12:              
  13:      nodTemp.DocumentCulture = “en-au”
  14:      nodTemp.Insert(parent.NodeID)
  15:  End While

The form collects a few things like the document type to create and the name of the columns in the spreadsheet to map to fields in the kentico document.  Looking at this at the moment I have left the document type hard coded, but you could easily change this to be driven from the form.

Additionally you’ll see at line 9 I loop through an array, this is derived from a comma separated list of column names to get from the excel sheet.  Let me know if you use it, just out of interest.

Web Developers Best Friend

Posted on May 15th, 2007 in Development, Tools, Web by Jay

This has to be one of the most useful programs I’ve used in years, maybe most useful.

As a part time web developer I rarely get the time to learn the ‘right’ way to do things, so I end up giving a go and then fine tuning what doesn’t work.  To that end this tool enabled me to see where I went wrong in my HTML, javascript or CSS.

There are so many features in this product, but there are only a few that I use regularly:

  • Firstly it’s a Firefox extension
  • If something doesn’t line up perfectly on a page I can analyse the CSS behind any element on a page to see what went wrong.
  • If I want to see what the name of a control is without scanning through the HTML source then this will let my just click on it and find the answer.
  • Maybe the best, it lets me dymanically apply new formatting to a site to see a change will look like on the fly.  So if i want to change fonts, sizes, borders, colour or just about anything then I can edit the HTML and CSS of ANY web page live and see the changes instantly on the screen and in the browser.

You can get this plug from here.

Time to Rebuild

Posted on July 29th, 2006 in Development, Personal, Rebuild, Web, Websites by Jay

Some of you might now that my wife and I run www.newagestore.com.

This site is currently running using some really old ASP code that I wrote, and an access database (or 4) that has is well overdue for a re-design.

So, over the coming weeks and month I’ll be writing about what I have learned and the process for completing the re-write.

Step 1 - choosing the right CMS. No decision as yet, however I have set up a test environment for the new site consisting of a server running Win2003 Server and SQL server.

More to follow…

ASP.NET Forms Authentication

Posted on June 26th, 2006 in Development by Jay

I’ve always struggled a bit with the forms authentication system in .NET, however this article does a great job of explaining it in simple terms.

Look also at the comments, there is reference to using the location tag in the web.config file to ensure that only specific pages or folders require authentication.

SQL Injection Prevention

Posted on April 11th, 2006 in Development, Software, Web by Jay

Found a great article to explain how to prevent SQL injection in ASP.