Umbraco Redirect Module Package

For past clients, I have generated many solutions for handling large numbers of redirects. This is definitely a problem that everyone encounters. I have some ideas on how to solve within umbraco and making it configurable for both the technical and non-technical masses. The approach is to store the redirect rules in the media library.

I just created the codeplex project. It is not yet complete, but should be soon. I will update here and twitter (TommyDudeBreaux) when complete.

http://umbtrafficcentral.codeplex.com

Code Garden 2010

I completed my presentation at Code Garaden 2010 today. The details will be up shortly including the Rave Engine and twitter integration from the demo and contextual content aggregating from other sites.

The topics that I covered follow:

  1. Application Request Routing + Reverse Proxy = secure, maintainable, powerful
  2. Content Aggregation using the Rave Engine, ARR, and xslt
  3. jQuery databinding using xlst transforrms thorugh Rave Engine
  4. jQuery databinding using client repeater templates
  5. Media Library as a generic store

PS - I just upgraded to Umbraco 4.5!

Comments Fixed

Securing Umbraco back office is something that I dont see enough sites do effectively.  I'll elaborate further at a later date when I have time to consolidate the details. 

Why did I start a post about securing Umbraco back offfice when fixing comments is the topic?  Because I have a Url Rewrite rule that was incorrectly blocking more traffic than I wanted it to so the comment post was returning a 403.

So comments are fixed.  Hopefully, this will encourage you to leave one. :)

 

-T

Heart Attack Burger

We made this gargantuan burger.  1/3 lb hand made patty grilled with half a stick of butter.  Topped with seranos, carmelized onions, cheddar cheese,  and a fried egg.  Finally, the bun was 2 grilled cheese sandwiches!!

mmm...

burger1

 

burger2

Blog4Umbraco and Richtext Macros

I setup the newest version of SyntaxHighlighter by Alex Gobatchev. To start, unzip the package and put on your files system.  Then add to your masterpage..  Looks something like this:

 

 

To get around some encoding issues, I made a macro called SyntaxHighlight.xslt. This macro calls a simple xslt that looks like this:

 

 

This fixes encoding issues that arise with tinymce in Umbraco.  Just paste your code in the macro parameter.  As you can see from the xslt, I set 2 params - code and brush. The brush is the literal string from the SyntaxHighlighter plugins set of brushes.  For example, "brush: xml" or "brush: csharp"

Be sure to check the box for Use in Editor and uncheck the box for Render Content in Editor.  This will allow you to insert the macro from the Rich Text Editor.

Once you have this complete, your code will show up in your blog posts.  Here is the problem, the base install of Blog4Umbraco has a macro called BlogListPosts.xslt.  This is used to list all from the home page of your site.  You may notice that your code snippets are not rendered on the site.

Here is the fix:

Go to the BlogListPosts.xslt and locate the showposts template.  Scroll down to the line that emits the bodyText field.  Update to match this:

 

 

 

Failed Request Tracing and IIS Rewrite

Today, I learned that by default, the URL rewrite and Request Routing logging does not automatically appear in IIS Failed Request Tracing. My guess is that the order of install matters. If you install Failed Request Tracing before ARR 2.0 or IIS Rewrite, then it may show up. I did the opposite.

So on to the fix. Though it is simple, I have no idea I would have found this except that I happened to be on a call with Microsoft on an open support ticket today....

The fix is to add a few values to the following path in your applicationhost.config under the tracing section. Your tracing section should have a section call "WWW Server." Check to see if the Rewrite and/or RequestRouting keys are added. If not, then add them.

 

 

Below is a copy of my working section. Once complete, you can trace all of your rewrite rules, routing, etc. Nice!

 

 

Feed a cold, starve a fever?

I have been posting things lately for 3 reasons:

  1. So I remember what I did to fix an issue
  2. To increase the number of blogs on my site
  3. As a sort of captain's log of things

So I am sick today.  Since I work with a bunch of funny guys, they decided to reply to my out sick emails with "Why don't you blog about it?" (I bet they could also some up with a joke around the captain's log involving poo...)  Anyways, here is my blog about being sick so my jokers friends and co-workers can enjoy.

How much should you eat when sick?

The old addage "feed a cold, starve a fever" was mentioned to me this morning when I said I did not want to eat.  As of 11:07am, March 4, 2010, I am my own man and if I dont feel like eating, then I don't have too.

Aside from my opinion that it sounds nice when you say it fast, I dont believe in "feed a cold, starve a fever." If you read here, you will find lots of people that are not doctors speculating on how the internals of your body work.

So my problem with this idea of feeding and starving is..  What if you have a cold and a fever?

My solution is to have a 2 year old make you fake food.  Then play pretend eat.  It allows you to do both at the same time.

3-2010-cold-2

 

 

 

 

Identicons for .NET - Fix for Windows 7 and Windows Server 2008 R2

Recently, I upgraded a hosting environment to Windows Server 2008 R2 as well as my notebook to Windows 7.  Upon testing, I found that Identicons for .NET was not working.  After checking lots of configurations, etc between the old server and the new one, I found that the issue was code related.  There is something different in the implementation of the .NET GraphicsPath class that is different in these operating systems.  I bet it is related to a migration away from GDI and to DirectX for code graphics, but I dont know..

In any case, if you are using Identicons for .NET then you will find that it stops working.  I did a search and I found 1 hint here.  After taking the suggestion in the brief comment and toying with the placement of the CloseFigure() calls, voila.. it works again.

Here is the code that needs updating.  There are only 2 lines that need changing and they are in the blocks below.

Add the patch.CloseAllFigures() to PatchSize property

      

Remove the path.CloseFigures() from the AddPointToGraphicsPath()


Reverse proxy, Cross Domain, WCF services in IIS7 and ARR

Using cross domain calls is not permitted in most javascript frameworks (jQuery being the example that prompted me to work on this blog).

You can use:

  • jsonp to proxy the call, but I dont particularly like the pattern.
  • nested applications, but configuration is difficult
  • ARR and Rewrite module

Lets talk reverse proxy in ARR.  This is a pattern that allows us to host applications from any host binding, but have them show up as the same domain without having to fight configuration inheritance, etc.

Example:

http://yourdomain.com/services/mediaplayer.svc
http://yourdomain.com/soa/data.svc

where services is a separate application and soa is a separate application hosted on the same server but under a separate host binding and application pool.

I could re-write a post on how to use this, but there is a perfectly good article at www.iis.net.  Hopefully, this article helps you make the decision which pattern to use.  Check out the following link to understand how reverse proxy works.

http://learn.iis.net/page.aspx/659/reverse-proxy-with-url-rewrite-v2-and-application-request-routing/

Since we are talking services, you may also want to understand how to host multiple endpoints under the same http binding in WCF.  This is covered here if you ever need it.

http://blogs.msdn.com/rampo/archive/2008/02/11/how-can-wcf-support-multiple-iis-binding-specified-per-site.aspx

WCF has some pretty substantial configuration challenges when you start using it, making deployment challenging at times.  The biggest challenges that I have found is gettng WCF to play nice with other applications.  Reverse proxy solves this problem since you will deploy your service to a single application with no inheritance.

Until I discovered reverse proxy, I did not recommend WCF in web applications for these reasons unless the client insisted on it.  Now I can recommend it with no issues.