<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Boris Masis - Personal Homepage &#187; umbraco</title>
	<atom:link href="http://borism.net/category/umbraco/feed/" rel="self" type="application/rss+xml" />
	<link>http://borism.net</link>
	<description></description>
	<lastBuildDate>Fri, 23 Mar 2012 23:06:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Write Yourself a Merry Little URL Re-writer</title>
		<link>http://borism.net/2009/08/21/write-yourself-a-merry-little-url-re-writer/</link>
		<comments>http://borism.net/2009/08/21/write-yourself-a-merry-little-url-re-writer/#comments</comments>
		<pubDate>Fri, 21 Aug 2009 18:35:31 +0000</pubDate>
		<dc:creator>boris</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[umbraco]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://www.borism.net/?p=191</guid>
		<description><![CDATA[A common web development concern is the www subdomain. Do you host at http://www.site.com or http://site.com? Which ever you choose you want to be sure that visitors who type in the other get re-directed properly. If you use IIS you can setup a new website to do such a permanent redirect, but that solution doesn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>A common web development concern is the www subdomain. Do you host at http://www.site.com or http://site.com? Which ever you choose you want to be sure that visitors who type in the other get re-directed properly.</p>
<p>If you use IIS you can setup a new website to do such a permanent redirect, but that solution doesn&#8217;t scale well. For example, we run 42 websites using one install of <a href="http://www.umbraco.org">umbraco</a>, and consequently one IIS website. We&#8217;d need 42 new websites in IIS to use the built-in redirect feature.</p>
<p>One example site is <a href="http://en.culturalcare.com">http://en.culturalcare.com</a>, and I want to make sure that if someone types in <a href="http://www.en.culturalcare.com">http://www.en.culturalcare.com</a> they get redirected properly. The solution is to write a little generic URL re-writer yourself using the global.asax file.</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;</span> <span style="color: #008000;">%</span>@ Application Language<span style="color: #008000;">=</span><span style="color: #666666;">&quot;C#&quot;</span> <span style="color: #008000;">%&gt;</span>
<span style="color: #008000;">&lt;</span>script runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span><span style="color: #008000;">&gt;</span>
<span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> Application_BeginRequest<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">Object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span>
		<span style="color: #008000;">&#123;</span>
			<span style="color: #6666cc; font-weight: bold;">string</span> domainName <span style="color: #008000;">=</span> Request<span style="color: #008000;">.</span><span style="color: #0000FF;">Url</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Host</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Replace</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;www.&quot;</span>, <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToLower</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			<span style="color: #6666cc; font-weight: bold;">string</span> sOldPath <span style="color: #008000;">=</span> HttpContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Request</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Path</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToLower</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			<span style="color: #6666cc; font-weight: bold;">string</span> sPage <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;http://&quot;</span> <span style="color: #008000;">+</span> domainName <span style="color: #008000;">+</span> sOldPath<span style="color: #008000;">;</span>
			Response<span style="color: #008000;">.</span><span style="color: #0000FF;">Clear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			Response<span style="color: #008000;">.</span><span style="color: #0000FF;">Status</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;301 Moved Permanently&quot;</span><span style="color: #008000;">;</span>
			Response<span style="color: #008000;">.</span><span style="color: #0000FF;">AddHeader</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Location&quot;</span>,sPage<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			Response<span style="color: #008000;">.</span><span style="color: #0000FF;">End</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&lt;/</span>script<span style="color: #008000;">&gt;</span></pre></div></div>

<p>As you can see the code removes &#8220;www.&#8221; from the url and 301 redirects to the non-www version. It also passes the full path.</p>
<p>You could modify the code slightly to add www&#8217;s instead of removing them if that&#8217;s the desired effect:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;</span> <span style="color: #008000;">%</span>@ Application Language<span style="color: #008000;">=</span><span style="color: #666666;">&quot;C#&quot;</span> <span style="color: #008000;">%&gt;</span>
<span style="color: #008000;">&lt;</span>script runat<span style="color: #008000;">=</span><span style="color: #666666;">&quot;server&quot;</span><span style="color: #008000;">&gt;</span>
<span style="color: #0600FF; font-weight: bold;">protected</span> <span style="color: #6666cc; font-weight: bold;">void</span> Application_BeginRequest<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">Object</span> sender, EventArgs e<span style="color: #008000;">&#41;</span>
		<span style="color: #008000;">&#123;</span>
			<span style="color: #6666cc; font-weight: bold;">string</span> domainName <span style="color: #008000;">=</span> Request<span style="color: #008000;">.</span><span style="color: #0000FF;">Url</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Host</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToLower</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			<span style="color: #6666cc; font-weight: bold;">string</span> sOldPath <span style="color: #008000;">=</span> HttpContext<span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Request</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Path</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ToLower</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			<span style="color: #6666cc; font-weight: bold;">string</span> sPage <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;http://www.&quot;</span> <span style="color: #008000;">+</span> domainName <span style="color: #008000;">+</span> sOldPath<span style="color: #008000;">;</span>
			Response<span style="color: #008000;">.</span><span style="color: #0000FF;">Clear</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			Response<span style="color: #008000;">.</span><span style="color: #0000FF;">Status</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;301 Moved Permanently&quot;</span><span style="color: #008000;">;</span>
			Response<span style="color: #008000;">.</span><span style="color: #0000FF;">AddHeader</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;Location&quot;</span>,sPage<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
			Response<span style="color: #008000;">.</span><span style="color: #0000FF;">End</span><span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
		<span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&lt;/</span>script<span style="color: #008000;">&gt;</span></pre></div></div>

<p><a href='http://www.borism.net/wordpress/wp-content/uploads/2009/08/rewriter.zip'>Download a full example for use with IIS</a>.</p>
<p>To implement:</p>
<ul>
<li>create a new site in IIS and add host headers for all of the domains you would like to redirect</li>
<li>extract the zip above to the directory setup in IIS</li>
<li>setup wildcard application mapping in IIS to let the global.asax file handle all requests (not just ones that end in .aspx, etc). On windows server 2003 just go to Home Directory -> Configuration and paste in the aspnet_isapi.dll location in the wildcard application maps section. By default the path is C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll (uncheck &#8220;Verify that file exists&#8221;)
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://borism.net/2009/08/21/write-yourself-a-merry-little-url-re-writer/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Insert Arbitrary HTML into Umbraco Pages</title>
		<link>http://borism.net/2009/02/18/insert-arbitrary-html-into-umbraco-pages/</link>
		<comments>http://borism.net/2009/02/18/insert-arbitrary-html-into-umbraco-pages/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 22:00:19 +0000</pubDate>
		<dc:creator>boris</dc:creator>
				<category><![CDATA[ballroom]]></category>
		<category><![CDATA[google analytics]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[umbraco]]></category>

		<guid isPermaLink="false">http://www.borism.net/?p=100</guid>
		<description><![CDATA[We have the Umbraco CMS (version 3) configured to use TinyMCE for WYSIWYG editing. It works quite well up until we want to insert some HTML content that TinyMCE strips out (like an embedded youtube video, or a screencast) Here&#8217;s how to create a very simple Umbraco macro (using a c# user control) to allow [...]]]></description>
			<content:encoded><![CDATA[<p>We have the <a href="http://www.umbraco.org">Umbraco CMS</a> (version 3) configured to use TinyMCE for WYSIWYG editing. It works quite well up until we want to insert some HTML content that TinyMCE strips out (like an embedded youtube video, or a screencast)</p>
<p>Here&#8217;s how to create a very simple Umbraco macro (using a c# user control) to allow you to insert arbitrary HTML code that won&#8217;t interfere with TinyMCE:</p>
<p>Create a visual studio solution and create InsertHTML.ascx with the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008000;">&lt;</span> <span style="color: #008000;">%</span>@ Control Language<span style="color: #008000;">=</span><span style="color: #666666;">&quot;C#&quot;</span> AutoEventWireup<span style="color: #008000;">=</span><span style="color: #666666;">&quot;true&quot;</span> Codebehind<span style="color: #008000;">=</span><span style="color: #666666;">&quot;InsertHTML.ascx.cs&quot;</span>
    Inherits<span style="color: #008000;">=</span><span style="color: #666666;">&quot;YourNameSpace.InsertHTML&quot;</span> <span style="color: #008000;">%&gt;</span>
<span style="color: #008000;">&lt;</span> <span style="color: #008000;">%=</span>HTMLCode<span style="color: #008000;">%&gt;</span></pre></div></div>

<p>The code-behind InsertHTML.ascx.cs just needs to have:</p>

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Collections</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.Security</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.UI</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.UI.WebControls</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.UI.WebControls.WebParts</span><span style="color: #008000;">;</span>
<span style="color: #0600FF; font-weight: bold;">using</span> <span style="color: #008080;">System.Web.UI.HtmlControls</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF; font-weight: bold;">namespace</span> YourNameSpace
<span style="color: #008000;">&#123;</span>
    <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #0600FF; font-weight: bold;">partial</span> <span style="color: #6666cc; font-weight: bold;">class</span> InsertHTML <span style="color: #008000;">:</span> <span style="color: #000000;">System.<span style="color: #0000FF;">Web</span><span style="color: #008000;">.</span><span style="color: #0000FF;">UI</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">UserControl</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">string</span> __HTMLCode <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;&quot;</span><span style="color: #008000;">;</span>
&nbsp;
        <span style="color: #0600FF; font-weight: bold;">public</span> <span style="color: #6666cc; font-weight: bold;">string</span> HTMLCode
        <span style="color: #008000;">&#123;</span>
            get
            <span style="color: #008000;">&#123;</span>
                <span style="color: #0600FF; font-weight: bold;">return</span> __HTMLCode<span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
            set
            <span style="color: #008000;">&#123;</span>
                __HTMLCode <span style="color: #008000;">=</span> value<span style="color: #008000;">;</span>
            <span style="color: #008000;">&#125;</span>
        <span style="color: #008000;">&#125;</span>
&nbsp;
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

<p>Build your DLL, drop it into the umbraco bin folder, and put the .ascx file in the \usercontrols\ directory. You&#8217;re almost done. Go to Developer -> Macros and create a new macro called &#8220;Insert HTML.&#8221; Point it to the user control on the server and be sure to check &#8220;use in editor.&#8221; Lastly, on the &#8220;Parameters&#8221; tab add a textMultiLine parameter and call it HTMLCode.</p>
<p>You should now see the &#8220;Insert HTML&#8221; macro as one of the options when you click the macro button in the TinyMCE editor. And we&#8217;re done.</p>
<p>Here&#8217;s a solution file extracted from my project:<br />
<a href='http://www.borism.net/wordpress/wp-content/uploads/2009/02/inserthtml.zip'>Download Solution</a></p>
]]></content:encoded>
			<wfw:commentRss>http://borism.net/2009/02/18/insert-arbitrary-html-into-umbraco-pages/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Fixing a Large CMSPropertyData Table in Umbraco</title>
		<link>http://borism.net/2008/12/16/fixing-a-large-cmspropertydata-table-in-umbraco/</link>
		<comments>http://borism.net/2008/12/16/fixing-a-large-cmspropertydata-table-in-umbraco/#comments</comments>
		<pubDate>Tue, 16 Dec 2008 15:39:58 +0000</pubDate>
		<dc:creator>boris</dc:creator>
				<category><![CDATA[umbraco]]></category>

		<guid isPermaLink="false">http://www.borism.net/?p=36</guid>
		<description><![CDATA[Current versions of Umbraco appear to have a bug that may cause corruption of publishing times and cause documents to re-publish themselves many times over. This can lead to an extremely large CMSPropertyData table and the need for frequent application pool recycles. See http://forum.umbraco.org/yaf_postst4699p2_Extremely-large-Umbraco-database-55GB-table-cmsPropertyData-contains-over-135-million-records.aspx and http://forum.umbraco.org/yaf_postst6564_305-Database-Huge&#8211;cmsPropertyData&#8211;392MB.aspx for a discussion of the issue. We&#8217;ve done several [...]]]></description>
			<content:encoded><![CDATA[<p>Current versions of <a href="http://www.umbraco.org">Umbraco</a> appear to have a bug that may cause corruption of publishing times and cause documents to re-publish themselves many times over. This can lead to an extremely large CMSPropertyData table and the need for frequent application pool recycles. See <a id="acg0" title="http://forum.umbraco.org/yaf_postst4699p2_Extremely-large-Umbraco-database-55GB-table-cmsPropertyData-contains-over-135-million-records.aspx" href="http://forum.umbraco.org/yaf_postst4699p2_Extremely-large-Umbraco-database-55GB-table-cmsPropertyData-contains-over-135-million-records.aspx">http://forum.umbraco.org/yaf_postst4699p2_Extremely-large-Umbraco-database-55GB-table-cmsPropertyData-contains-over-135-million-records.aspx</a> and <a id="f3ks" title="http://forum.umbraco.org/yaf_postst6564_305-Database-Huge--cmsPropertyData--392MB.aspx" href="http://forum.umbraco.org/yaf_postst6564_305-Database-Huge--cmsPropertyData--392MB.aspx">http://forum.umbraco.org/yaf_postst6564_305-Database-Huge&#8211;cmsPropertyData&#8211;392MB.aspx</a> for a discussion of the issue.</p>
<p>We&#8217;ve done several <strong>things to control this issue</strong>, though a true fix has yet to be developed:</p>
<ol>
<li>We applied the <a id="zja-" title="suggested fix" href="http://forum.umbraco.org/yaf_postst6564p2_305-Database-Huge--cmsPropertyData--392MB.aspx#forum_ctl00_MessageList_ctl04_ctl00_NameCell">suggested fix</a> of changing the umbraco.presentation.cache.CacheRefresher() constructor (this seemed to have no effect):

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">public</span> CacheRefresher<span style="color: #008000;">&#40;</span><span style="color: #008000;">&#41;</span> <span style="color: #008000;">&#123;</span>
   <span style="color: #0600FF; font-weight: bold;">if</span> <span style="color: #008000;">&#40;</span><span style="color: #000000;">System.<span style="color: #0000FF;">Web</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">HttpContext</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span> <span style="color: #008000;">!=</span> <span style="color: #0600FF; font-weight: bold;">null</span><span style="color: #008000;">&#41;</span>
    <span style="color: #008000;">&#123;</span>
        <span style="color: #0600FF; font-weight: bold;">this</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Url</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;http://&quot;</span> <span style="color: #008000;">+</span> <span style="color: #000000;">System.<span style="color: #0000FF;">Web</span></span><span style="color: #008000;">.</span><span style="color: #0000FF;">HttpContext</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Current</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Request</span><span style="color: #008000;">.</span><span style="color: #0000FF;">ServerVariables</span><span style="color: #008000;">&#91;</span><span style="color: #666666;">&quot;SERVER_NAME&quot;</span><span style="color: #008000;">&#93;</span> <span style="color: #008000;">+</span> <span style="color: #666666;">&quot;/umbraco/webservices/cacheRefresher.asmx&quot;</span><span style="color: #008000;">;</span>
    <span style="color: #008000;">&#125;</span>
<span style="color: #008000;">&#125;</span></pre></div></div>

</li>
<li>We removed the future publishing functionality from the UI (umbraco/presentation/umbraco/editContent.aspx.cs in umbraco 3.03):

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">//dpRelease.ID = &quot;releaseDate&quot;;</span>
<span style="color: #008080; font-style: italic;">//dpRelease.DateTime = _document.ReleaseDate;</span>
<span style="color: #008080; font-style: italic;">//dpRelease.ShowTime = true;</span>
<span style="color: #008080; font-style: italic;">//publishProps.addProperty(ui.Text(&quot;content&quot;, &quot;releaseDate&quot;, base.getUser()), dpRelease);</span>
<span style="color: #008080; font-style: italic;">//dpExpire.ID = &quot;expireDate&quot;;</span>
<span style="color: #008080; font-style: italic;">//dpExpire.DateTime = _document.ExpireDate;</span>
<span style="color: #008080; font-style: italic;">//dpExpire.ShowTime = true;</span>
<span style="color: #008080; font-style: italic;">//publishProps.addProperty(ui.Text(&quot;content&quot;, &quot;expireDate&quot;, base.getUser()), dpExpire);</span></pre></div></div>

</li>
<li>We commended out the publishing timer which seems to have stopped the growth without adverse effects (thought I imagine that scheduled publishing would no longer work) (/umbraco/presentation/requestModule.cs in umbraco 3.03)

<div class="wp_syntax"><div class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #008080; font-style: italic;">//publishingTimer =</span>
<span style="color: #008080; font-style: italic;">//    new Timer(new TimerCallback(publishingService.CheckPublishing), HttpApp.Context, 600000, 60000);</span></pre></div></div>

</li>
</ol>
<p>The <a id="j4k7" title="author of ClientTools promises to release a new version" href="http://www.codeplex.com/ClientTools4Umbraco">author of ClientTools promises to release a new version</a> which should be able to cleanup the large number of item revisions in the database.</p>
<p><strong>Stored procedures useful for troubleshooting</strong> this issue include:</p>
<ul>
<li><em>find items with the most revisions:</em>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> contentNodeId<span style="color: #66cc66;">,</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span>contentNodeId<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">FROM</span> cmsPropertyData <span style="color: #993333; font-weight: bold;">GROUP</span> <span style="color: #993333; font-weight: bold;">BY</span> contentNodeId <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> <span style="color: #993333; font-weight: bold;">COUNT</span><span style="color: #66cc66;">&#40;</span>contentNodeid<span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">DESC</span></pre></div></div>

</li>
<li><em>manually delete an item (if you can&#8217;t find the item in the UI using http://site/umbraco/editContent.aspx?id=IDHERE</em>):

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">DELETE</span> <span style="color: #993333; font-weight: bold;">FROM</span> cmsPropertyData <span style="color: #993333; font-weight: bold;">WHERE</span> contentNodeId <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'4023'</span></pre></div></div>

</li>
<li><em>find lost documents:</em>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #66cc66;">*</span> <span style="color: #993333; font-weight: bold;">FROM</span> umbracoNode
<span style="color: #993333; font-weight: bold;">WHERE</span> nodeObjectType <span style="color: #66cc66;">=</span> <span style="color: #ff0000;">'c66ba18e-eaf3-4cff-8a22-41b16d66a972'</span> <span style="color: #993333; font-weight: bold;">AND</span> ID <span style="color: #993333; font-weight: bold;">NOT</span> <span style="color: #993333; font-weight: bold;">IN</span> <span style="color: #66cc66;">&#40;</span><span style="color: #993333; font-weight: bold;">SELECT</span> Nodeid <span style="color: #993333; font-weight: bold;">FROM</span> cmsDocument<span style="color: #66cc66;">&#41;</span></pre></div></div>

</li>
<li><em>find items scheduled to publish:</em>

<div class="wp_syntax"><div class="code"><pre class="sql" style="font-family:monospace;"><span style="color: #993333; font-weight: bold;">SELECT</span> <span style="color: #993333; font-weight: bold;">DISTINCT</span> nodeId<span style="color: #66cc66;">,</span> level<span style="color: #66cc66;">,</span> sortOrder <span style="color: #993333; font-weight: bold;">FROM</span> cmsDocument <span style="color: #993333; font-weight: bold;">INNER</span> <span style="color: #993333; font-weight: bold;">JOIN</span> umbracoNode <span style="color: #993333; font-weight: bold;">ON</span> umbracoNode<span style="color: #66cc66;">.</span>id <span style="color: #66cc66;">=</span> cmsDocument<span style="color: #66cc66;">.</span>nodeId <span style="color: #993333; font-weight: bold;">WHERE</span> newest <span style="color: #66cc66;">=</span> <span style="color: #cc66cc;">1</span> <span style="color: #993333; font-weight: bold;">AND</span> <span style="color: #993333; font-weight: bold;">NOT</span> releaseDate <span style="color: #993333; font-weight: bold;">IS</span> <span style="color: #993333; font-weight: bold;">NULL</span> <span style="color: #993333; font-weight: bold;">AND</span> releaseDate <span style="color: #66cc66;">&lt;</span> <span style="color: #66cc66;">=</span> getdate<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #993333; font-weight: bold;">ORDER</span> <span style="color: #993333; font-weight: bold;">BY</span> level<span style="color: #66cc66;">,</span> sortOrder</pre></div></div>

</pre>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://borism.net/2008/12/16/fixing-a-large-cmspropertydata-table-in-umbraco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>URL Rewriting with IIS and Umbraco</title>
		<link>http://borism.net/2008/11/26/url-rewriting-with-iis-and-umbraco/</link>
		<comments>http://borism.net/2008/11/26/url-rewriting-with-iis-and-umbraco/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 17:08:14 +0000</pubDate>
		<dc:creator>boris</dc:creator>
				<category><![CDATA[technology]]></category>
		<category><![CDATA[umbraco]]></category>

		<guid isPermaLink="false">http://www.borism.net/?p=25</guid>
		<description><![CDATA[At Cultural Care Au Pair we use Google Analytics to track the sucess of our campaigns both online and offline. Google provides a nice url builder tool that generates links tagged with our various campaign attributes. Here&#8217;s the problem though, the links end up looking like: http://www.culturalcare.com/default.aspx?utm_source=testSource&#038;utm_campaign=testCampaign That&#8217;s quite an ugly url for something like [...]]]></description>
			<content:encoded><![CDATA[<p>At <a href="http://www.culturalcare.com">Cultural Care Au Pair</a> we use Google Analytics to track the sucess of our campaigns both online and offline. Google provides a nice <a href="http://www.google.com/support/googleanalytics/bin/answer.py?hl=en&amp;answer=55578">url builder tool</a> that generates links tagged with our various campaign attributes. Here&#8217;s the problem though, the links end up looking like:</p>
<p>http://www.culturalcare.com/default.aspx?utm_source=testSource&#038;utm_campaign=testCampaign</p>
<p>That&#8217;s quite an ugly url for something like a postcard campaign. Luckily umbraco includes a <a href="http://www.urlrewriting.net">full url rewriter</a> that can help us easily transform that into something like www.culturalcare.com/postcard</p>
<p><strong>1. Configure IIS for <a href="http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/5c5ae5e0-f4f9-44b0-a743-f4c3a5ff68ec.mspx">wildcard application mapping</a>. </strong>This allows ASP.NET to process extension-less urls (such as /postcard/):</p>
<ul>
<li>right click on the umbraco website and select properties</li>
<li>go to the &#8220;home directory&#8221; tab and click &#8220;configuration&#8221;</li>
<li>in the &#8220;wildcard application maps&#8221; insert the ASP.NET dll (something like C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll ) and un-check &#8220;verify that file exists&#8221;</li>
</ul>
<p><strong>2. Edit /config/UrlRewriting.config in your umbraco folder</strong></p>
<ul>
<li>Change the top tag to ensure that you don&#8217;t have any conflicts with other extension-less urls (like /umbraco)

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;urlrewritingnet</span> <span style="color: #000066;">rewriteOnlyVirtualUrls</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">contextItemsPrefix</span>=<span style="color: #ff0000;">&quot;QueryString&quot;</span></span>
<span style="color: #009900;">defaultPage = <span style="color: #ff0000;">&quot;default.aspx&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">defaultProvider</span>=<span style="color: #ff0000;">&quot;RegEx&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.urlrewriting.net/schemas/config/2006/07&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span><span style="color: #000000; font-weight: bold;">&lt;rewrites<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
...
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/rewrites<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/urlrewritingnet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

</li>
<li>add your rewrite rules following the example in the file or the <a href="http://www.urlrewriting.net">documentation at urlrewriting.net</a>. For example, if I wanted to redirect /postcard/ to /default.aspx?utm_source=testSource&amp;utm_campaign=testCampaign I would add the following rule:

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;postcard&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">virtualUrl</span>=<span style="color: #ff0000;">&quot;^~/postcard/?$&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">redirect</span>=<span style="color: #ff0000;">&quot;Application&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">rewriteUrlParameter</span>=<span style="color: #ff0000;">&quot;ExcludeFromClientQueryString&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">destinationUrl</span>=<span style="color: #ff0000;">&quot;~/default.aspx?utm_source=testSource&amp;amp;utm_campaign=testCampaign&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">ignoreCase</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

</li>
<li>Note that the &amp; needs to be written as &amp;amp; in the destination url.</li>
<li>If you&#8217;d like to redirect to a different domain, virtual url and redirect need to be specified accordingly:

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;add</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;offsite&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">virtualUrl</span>=<span style="color: #ff0000;">&quot;^http\://(.*)my.domain/redirect/?$&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">redirect</span>=<span style="color: #ff0000;">&quot;Domain&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">rewriteUrlParameter</span>=<span style="color: #ff0000;">&quot;ExcludeFromClientQueryString&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">destinationUrl</span>=<span style="color: #ff0000;">&quot;http://offsitedomain.com&quot;</span></span>
<span style="color: #009900;"><span style="color: #000066;">ignoreCase</span>=<span style="color: #ff0000;">&quot;true&quot;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

</li>
</ul>
<p>Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://borism.net/2008/11/26/url-rewriting-with-iis-and-umbraco/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

