Ohhhh umbraco 4.5.1

Thursday, August 26th, 2010

This is the second in a series of posts about umbraco. To see my first post click here.

In my first post about umbraco I documented the installation process that I went through for the 4.5.1 release of umbraco. Everything seemed to work out well during the installation. The only hiccup was a minor one encountered while attempting to install the Runway example site. After the installation was completed I was able to login using the administrator account that I set up during the install. I assumed I was ready to rock. Man was I off! I am sitting here two full days later still not understanding exactly what the issue was.

When I logged in the first time I saw all of the top level nodes that I expected to see, unfortunately that is all that I could see. Nothing under any of the nodes was there. I was not able to add anything into the system. This really perplexed me because inside of the umbraco database that I had specified I could see lots of data. I immediately hit the forums and was relieved to find out that I wasn’t the only one having this issue. I assumed a couple configuration settings and I would be on my way.

I was using a brand new Windows 7 VM with SQL Server 2008 Express R2. All signs seemed to point to a permission error since I was able to login. (The site could obviously access the database) I went about re-installing the database and application several times as well as through a serious of checks that I will summarize now. Here are a couple links that had helpful hints.

http://forum.umbraco.org/yaf_postst7395_UMB4RC–No-nodes-below-top-in-all-sections.aspx

http://our.umbraco.org/forum/getting-started/installing-umbraco/10747-Umbraco-45-and-empty-tree-nodes-in-shared-hosting?p=3

These are all of the checks that I performed. If any one reads this and has more suggestions please leave a comment with any other helpful hints.

1.) Made sure the IIS directoy had full trust
2.) Made sure that the App Pool that umbraco was running under was set to v4 and integrated pipes. Also made sure that the Network Service was being used by it.
3.) Made sure that the Network Service had full access permissions to the umbraco web folder.
4.) Made sure that the Network Service had full access to the Windows\Temp folder.
5.) Made sure that the umbraco build was properly extracted from the downloaded zip.

Unfortunately none of these changes helped. Everytime I reinstalled and logged back in the same thing would happen, no nodes. Thankfully the beta release of 4.5.2 was released this week. I installed the beta release with the exact same permissions and could see all of the nodes! I may never get to the bottom of the issue, but I am happy to finally get to play with the framework.

Success!

Umbraco Successful Install

posted by Pat McLoughlin

A First Look at umbraco Setup

Monday, August 23rd, 2010

My knowledge of CMS frameworks is very limited. I definitely understand their role and see the need for them, but outside of Sharepoint I don’t have much experience. This gives me a unique viewpoint that I hope to exploit for a few blogs! I have just started work for a client and we will be using umbraco. After a long period of research and comparison umbraco has been selected because of its light weight and open sourcedness :) Since I am just starting with it, I am going to chronicle the setup and configuration process, as well as try to discover some of the features that make working with umbraco and .NET very appealing.

My first stop along this journey is at the umbraco website. My first impression is definitely framed by the MMA video that is on the front of their site. According to the video, they like things that just get the job done. A funny way to make a point and an awesome reference to the movie Never Back Down.

After reading through the site I found the link to download umbraco off CodePlex. I am going to run through a setup of the free version, although I believe the client that I will be working with will be buying a supported version. I download the 4.5.1 version from the codeplex site. I did not opt for the web based installer version. It should be noted that I am working on a new Windows 7 VM with SQL Server Express R2 and VS 2010 installed.

Steps to configure Umbraco:
1.) Unzip the folder that was downloaded from the CodePlex site. Place the files in a folder that can be made a virtual directory in IIS. I am placing the files on my installation in C:\Projects\umbraco

2.) Configure the directory as an application in IIS. (This is a brand new VM. I had to do some installing of IIS and .NET 4. Hopefully you won’t have to do that. Nothing to do with umbraco)

3.) Load the website. Hopefully you see this screen.

Umbraco Setup Screen 1

4.) Accept the License.

5.) Create a database with the name that you would like your umbraco instance to use. I am calling the database name ‘Umbraco’

6.) Fill in the database information for your setup. You can select from 3 different database types. I will be using the SQL Server Driver.

Umbraco Setup Screen 2

7.) Click ‘Install’ to install the database tables.

8.) Validate the permissions. On my install I got the following message and didn’t have to do anything else.

Umbraco Setup Screen 3

9.) Set a new admin password.

10.) For this run through I am going to install ‘Runway’ so that I can hopefully see some of the cool features of umbraco. I am sure that in production that isn’t something that is installed.

11.) Launch umbraco and login!

*Note that when I first attempted to install Runway I got the error below. After some research I found this thread on the umbraco forum. The advice was to hit the back button and attempt the install again. Sure enough I hit the back button, made no changes to the page, clicked install and it worked.

Given Key Error

Overall I found the installation process to be pretty easy to follow and bar the one exception thrown when installing ‘Runway’. I am looking forward to getting into umbraco and playing with some features. More blogs to come!

posted by Pat McLoughlin

CITYTECH Azure Calculator Parser

Thursday, May 13th, 2010

The CITYTECH Azure Calculator (CAC) is a Silverlight based tool that takes IIS log files as input and produces a graph that shows how much it would cost to run that server on Windows Azure. Check the CITYTECH Azure Calculator out here.

One of the coolest features about the CAC is its ability to parse the IIS log files. IIS log files are very configurable and can come in many different forms. One of the nice things about IIS log files are the column headers that each file contains. These column headers tell you the location of each piece of information. The inside of each file looks like this.

IIS Log Columns

The headers can be any place inside of the file as well. So at any point the parser needs to be able to reorder the columns. The parser only pulls out the information that is important for the CAC, but it could easily be modified to grab any information that can be contained in the file.

The process of parsing the files is pretty straight forward. The first thing that is done is the file is read into a ByteArray using the code below.

 private byte[] Convert2ByteArray(FileInfo file)
 {
      Stream fileStream = file.OpenRead();

      // attach filestream to binary reader
      var _BinaryReader = new BinaryReader(fileStream);

     // get total byte length of the file
     long _TotalBytes = file.Length;

     // read entire file into buffer
     byte[] byteArray = _BinaryReader.ReadBytes((Int32)_TotalBytes);

    // close file reader
    _BinaryReader.Close();

    return byteArray;
}

Once the file is in the byte array each line is looped through and a series of checks are performed to see what is in each line. The first check that is performed is to make sure that the line at least has something in it or it can be skipped.

if(lineArray.Length == 0)
{
     return null;
}

The second check is to see if the line contains the date that the file is processed for. Depending on settings inside of IIS there can be a file per day or the files can roll based on size or a number of other restrictions. Due to this feature the file parser must constantly be able to update itself with the latest settings pulled out of the file.

public const string DATE_HEADER = "#Date:";

if (lineArray[0] == DATE_HEADER)
{
     DateTime.TryParse(lineArray[1], out _entryDate);
     return null;
}

The next check is where things getting interesting. The parser will now check to see if this is a row that contains file headers. If it does contain file headers the parser will use a static list to determine if the calculator makes use of the header and if so it stores the column name and the column index inside of a dictionary. When the parser gets to rows that actually have logging data in them it uses the dictionary to determine which column contains what information. This allows the parser to handle any column configuration.

private Dictionary<string, string> _fieldNames = new Dictionary<string, string>();

_fieldNames.Add("TimeStamp", "time");
_fieldNames.Add("ClientIP", "c-ip");
_fieldNames.Add("Method", "cs-method");
_fieldNames.Add("URL", "cs-uri-stem");
_fieldNames.Add("HTTPStatus", "sc-status");
_fieldNames.Add("BytesSent", "sc-bytes");
_fieldNames.Add("BytesReceived", "cs-bytes");
_fieldNames.Add("TimeTaken", "time-taken");
_fieldNames.Add("QueryString", "cs-uri-query");
if (lineArray[0] == FIELD_HEADER)
{
     for (int i = 1; i < lineArray.Length-1; i++)
     {
          var propertyName = GetProperty(lineArray[i]);

          if(string.IsNullOrEmpty(propertyName))
          {
               continue;
          }

          if (!_columns.ContainsKey(propertyName))
          {
               _columns.Add(propertyName, -1);
          }

          _columns[propertyName] = i - 1;

          if(!_properties.ContainsKey((i-1).ToString()))
          {
               _properties.Add((i-1).ToString(),"");
          }

          _properties[(i-1).ToString()] = propertyName;
     }

     return null;
}

Now that the parser has identified what columns contain what information all there is left to do is parse the actual information rows. The parser determines that a row is an information row by checking to see if the start of the row has a ‘#’. If there is no ‘#’ then the parser treats the row an information row. The parser for separates the row into a string array, by splitting on spaces. Each column is then looped through and the index of each column is checked against the dictionary that was created while processing the header row. If the column index exists the string is then associated with the column name and reflection is used to dynamically added the property to our fileline object based on the associated column name. This prevents any need for hard coding property names into the file parser.

/* If there is no # sign it is a normal line and should be parsed */
if(!lineArray[0].Contains("#"))
{
     CheckFileFormat();

     var fileLine = new FileLine();

     for (int i = 0; i < lineArray.Length; i++)
     {
          if(!_properties.ContainsKey(i.ToString()))
          {
               continue;
          }

          var columnName = _properties[i.ToString()];
          var columnValue = lineArray[i]; 

          if (columnName == "TimeStamp")
          {
               columnValue = _entryDate.ToShortDateString() + " " + lineArray[i];
          }

          fileLine.GetType().GetProperty(columnName).SetValue(fileLine, columnValue, null);
     }

     return fileLine;
}

There is a call to CheckFileFormat() in the code above. That is just a helper method that makes sure that there is at least one date and one url which the calculator requires to make it’s calculations.

Check out the CITYTECH Azure Calculator Check back soon for more blogs about how the CITYTECH Azure Calculator works!

posted by Pat McLoughlin

CITYTECH Azure Calculator BETA

Wednesday, May 12th, 2010

The CITYTECH Azure Calculator (CAC) is now ready with a BETA release! After a few last minute hiccups the application is up on CITYTECH’s Windows Azure instance and ready for use. Check it out here. The CITYTECH Azure Calculator is a Silverlight based application that is served up via Windows Azure. Currently the application runs completely within a users browser on the Silverlight framework. In future releases we hope to leverage some more Worker Roles to let Azure do alot of the heavy lifting.

For more information about the history of the CITYTECH Azure Calculator please check out my previous blog post.

The CAC is very simple to use. All you need to use the CAC is at least one IIS log file. If you don’t have any log files, but still want to see how the calculator works go to the About page and you can download a zip file with a few log files in it.

IIS Test Files

Once you have some IIS log files the CAC is very easy to use. Go to the Home page (Clicking on the CITYTECH Azure Calculator image will take you there) and click the Select Files button. This will open a dialog up that allows you to select multiple files. Once you have selected your files click the Process Files button.

Azure Calculator File Upload

The CAC will process for a little bit. (The processing time is based on the amount and size of the files that are uploaded) Once it is done processing you will be taken to the Usage page. The Usage page shows a graph that approximates how much it would cost to run the applications in the log files on Windows Azure.

CAC Graph

For the CAC to work it has to make a lot of assumptions. In most cases these assumptions are accurate and represent the average size and cost of things. In special cases these assumptions may not accurately represent the applications that your web server runs. The CAC provides an Advanced tab that lets you update individual elements in your IIS log files and recalculate graph. Dynamic pages vary not only in size, but per request, so the advanced tab can be very useful in estimating database and transfer sizes.

CAC Customize

The CAC was a fun application to build and we are looking forward to improving it with every release. We are looking forward to any feedback that can help make the calculator an even more accurate prediction tool!

posted by Pat McLoughlin

Introducing the CITYTECH Azure Calculator

Wednesday, May 5th, 2010

For the last month the .NET Nerds (Seth, Rohit and I ) have been huddled in the CITYTECH nerdery working on a project to show off some of the great features of the Windows Azure platform. Our goal for the project was to create something both useful and interesting. After many refactors of both ideas and code I am very happy to introduce the CITYTECH Azure Calculator (CAC)! The CAC is in its final stages of testing and will be available in the next 24 hours.

So what is the CAC? The CAC is a calculator that figures out how much it would cost to run a website on Windows Azure. When we settled on the idea of creating a calculator we were aware of the other calculators that are out there. Most notably the Microsoft ROI Calculator which can be found here. When developing the CAC we wanted to provide the functionality of the calculators that are currently out there while adding a way to seed real data.

This is achieved through the processing of IIS log files. Each URL is treated as a unique event in the system. The date and time that each URL is accessed is tracked along with the bytes that were sent to and from the server. (If they are available… more on that later!) Once the size of each unique request to each URL is tracked the events are run through a series of calculations that show in graph form how much it would cost to run a site on Windows Azure.

The only real issue that we had with the calculations revolved around the fact that you need a chart as complex as the Baseketball Playoff Bracket to figure out how much it costs to run a site.

The other problem that showed itself several weeks into development: missing transfer sizes. By default IIS log files do not have the bytes in and bytes out set. This resulted in a rather large list of assumptions that we will be posting with the calculator. We had to divide up each unique element into different categories and assign default sizes for each. We are looking forward to getting some feedback on our assumptions!

I am looking forward to the BETA release of the CITYTECH Azure Calculator and hopefully lots of great feedback for future versions. After the release I will be posting a series of blogs about how best to use the CAC as well as how it works!

Sneak Peak at the home page!

Azure Calculator File Upload

posted by Pat McLoughlin

Lists of Four in Honor of the .NET 4 Release

Monday, April 12th, 2010

As a count down to the release of the .NET 4 Framework on April 12, 2010, I am going to list out the top Four features from the top Four products for the next Four days leading up to the official release!

0 work days until the official release of .NET 4! Today is the official release!

Check out yesterdays list of Four exciting features of ADO.NET Entity Framework.

Today’s list is the top Four features of Silverlight 4 that I am most excited about.

1.) Printing Support

Silverlight 4 allows developers access to a print object. Developers can control what is printed and can actually make reports that can be directly printed from Silverlight. Developers can use elements on the screen or create brand new documents for printing. Access to the print dialog can be obtained through the new Silverlight API.

2.) WCF RIA Services

RIA Services has been in beta up until this point. With this release RIA Services is ready to move into production. Generated middle tier services allow for the rapid development of Silverlight applications. RIA Services integrate with ORM tools, most notably Entity Framework and also provide middle tier organization. Using RIA Services for data validation is the feature that I am most excited about!

3.) RichTextbox

It is rare that a new control could make the list of the most exciting things about a new framework (except the DataGrid in Silverlight 2), but this control is definitely special. It allows for the addition of links, images, formatted text and html inside of an input box. Silverlight 4 also has support for html. This allows for webpages and emails to be hosted inside of a silverlight application. The combination of the RichTextbox and HTML support is very exciting.

4.) ‘Toast’ Notifications

Silverlight 4 comes with a Notification API when running out of browser. This API allows developers to pop up a notification window based on an event in the out of browser application. This window can be set to close after a specified amount of time or can be closed based on an event, like a mouse click. These notifications will pop up in front of whatever a user is working on. This ability, along with other ’sandbox’ features makes Silverlight 4 a viable framework for desktop development.

These are Four features that I am very excited about in Silverlight 4.

posted by Pat McLoughlin

Lists of Four in Honor of the .NET 4 Release

Friday, April 9th, 2010

As a count down to the release of the .NET 4 Framework on April 12, 2010, I am going to list out the top Four features from the top Four products for the next Four days leading up to the official release!

2 work days until the official release of .NET 4!

Check out yesterdays list of Four exciting features of Visual Studio 2010.

Today’s list is the top Four features of ADO.NET Entity Framework that I am most excited about.

1.) POCO support

Entity Framework (EF) now supports POCOs! In the previous versions of EF POCOs were supported, but they were not completely ignorant. For them to be compatible, POCOs had to inherit from specfic base classes and interfaces. This new version allows EF to return completely ignorant objects which helps with modularity across entire applications.

Please check out my blog on Persistence Ignorant POCOs.

2.) Lazy Loading

Lazy loading allows more control over when data is retrieved from the database. Data is only retrieved when necessary therefore increasing the speed of queries and the size of object graphs.

3.) Model-First Support

Entity Framework 4 allows developers to create a conceptual model and then generate a database from that model.

4.) Foreign Keys

Foreign keys can now be part of the conceptual model. Enforcement of the foreign keys can now be left to the actual model and errors can be caught before a save to the database.

These are Four new features of Entity Framework that I am very excited about!

posted by Pat McLoughlin

Lists of Four in Honor of the .NET 4 Release

Thursday, April 8th, 2010

As a count down to the release of the .NET 4 Framework on April 12, 2010, I am going to list out the top Four features from the top Four products for the next Four days leading up to the official release!

3 work days until the official release of .NET 4!

Check out yesterdays list of Four exciting features of ASP.NET 4.

Today’s list is the top Four features of Visual Studio 2010 that I am most excited about.

1.) VS 2010 Built on WPF

Although this is not a new feature within Visual Studio, I am very excited to see that Microsoft has built Visual Studio on the Windows Presentation Foundation (WPF). At PDC, it was mentioned that there were some performance issues around Visual Studio running on WPF, but they seem to have been solved. It is great to see Microsoft using their own framework to build such a large product. This kind of investment ensures that WPF will be supported for a long time. I do wonder if the next version of Visual Studio will be running on the Silverlight framework? :)

2.) Add Reference Dialog

I can’t even count the number of times that adding a reference has crashed my instance of Visual Studio. When adding a reference in Visual Studio 2010 the first tab that will be selected will be the ‘Projects’ tab. This alone will save a great deal of loading, but Microsoft took it one step further and have actually changed the way that the system references load. System references now load asynchronously on a background thread that does not block the UI thread. This is a small thing, but probably will save tons of time for developers.

3.) Enhanced Docking Behavior

Windows with in the Visual Studio IDE no longer need to be inside of the editable areas of Visual Studio. Document windows can sit on the outside edges as well as float on a developer’s desk top. Even in the disconnected state changes in any Window will still be immediately updated in other windows. Spreading windows out will allow more room in the editable areas.

4.) Generate From Usage

Generate From Usage is a new feature that allows a developer to stub in classes and methods without leaving the code that they are currently working in. This can greatly increase productivity and also can be very useful when doing Test Driven Development.

These are Four new features of Visual Studio 2010 that I am very excited about!

posted by Pat McLoughlin

Lists of Four in Honor of the .NET 4 Release

Thursday, April 8th, 2010

As a count down to the release of the .NET 4 Framework on April 12, 2010, I am going to list out the top Four features from the top Four products for the next Four days leading up to the official release!

4 work days until the official release of .NET 4!

Today’s list is the top Four features of ASP.NET 4 that I am most excited about.

1.) ClientIdMode

Accessing controls from AJAX scripts and Javascript has now become much easier! Control naming will now be much simpler. Backwards compatibility is also provided for those pesky older pages.

2.) ASP.NET Chart Control

The chart control is a fully functioning graphing tool that supports databinding. The charts give control over the axes, legends, titles, data and even gives data manipulation tools. The most exciting feature may be the 3D graphing that is provided!

3.) ViewStateMode

ViewState can now be turned on and off for individual controls within a page. ViewStateMode works in conjunction with EnableViewState to allow a developer to only use ViewState for specified controls.

4.) CSS Support in Update Panels

This is a smaller thing, but has been an annoyance for some time. In previous versions of ASP.NET you couldn’t specify a CSS class for an Update Panel. The work around was always to add either an ASP.NET panel control inside of the Update Panel or a HTML Span tag. Now you can add the CSS property to an Update Panel and it will be added to the HTML Div tag that is rendered.

These are Four new features of ASP.NET 4 that I am very excited about!

posted by Pat McLoughlin

Windows Azure Start Up Error

Monday, April 5th, 2010

When starting up my first Windows Azure project, i kept receiving a System.IO.FileLoadException. The message was saying that the path of the temp directory that the assemblies are being built in was too long. The error message looked like this.

Path Too Long

When starting up, Windows Azure compiles all of the assemblies into a temporary folder. By default the folder is located here: C:\Users\\AppData\Local\dftmp Some of the paths can get very long. If you are getting this message there are really only two things you can do. You can rename all of the your projects to shorter names or you can change the directory name that the assemblies are compiled and run from.

An environmental variable can be set that overrides the default location. The environmental variable is called _CSRUN_STATE_DIRECTORY. This can be set to a shorter path, buying you some more characters.

Environmental Variable

After the variable is set make sure to shutdown the development fabric either by shutting it down through the system tray or at the command line using csrun /devfabric:shutdown. If shortening the path doesn’t do the trick, the only option may be to rename your project and assemblies.

posted by Pat McLoughlin

CityTech Home