<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://dotnetmafia.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Kevin Williams .NET and Stuff : Umbraco</title><link>http://dotnetmafia.com/blogs/kevin/archive/tags/Umbraco/default.aspx</link><description>Tags: Umbraco</description><dc:language>en</dc:language><generator>CommunityServer 2007.1 (Build: 20917.1142)</generator><item><title>Umbraco Action Handlers 101</title><link>http://dotnetmafia.com/blogs/kevin/archive/2008/02/13/umbraco-action-handlers-101.aspx</link><pubDate>Thu, 14 Feb 2008 02:12:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:492</guid><dc:creator>Kevin</dc:creator><slash:comments>3</slash:comments><description>Something I have done a few times in Sitecore is to have new news articles or blog posts automatically organize themselves within year/month folders in my content tree.&amp;nbsp; The URL to a specific news article might be /news/2008/02/ActionHandler.aspx for instance.&amp;nbsp; When I create the ActionHandler content item, the 2008 folder and the 02 folder would be created automatically if they did not already exist and my posting would be placed under these folders for me.&amp;nbsp; In Sitecore, I do this with an event handler for item:creating.&amp;nbsp; Tonight, I set out to do the same thing with Umbraco.&lt;br /&gt;&lt;br /&gt;First, let me present an example of&amp;nbsp; what I want to see when I&amp;#39;m done...&lt;br /&gt;&lt;p&gt;&lt;a href="http://www.dotnetmafia.com/blogs/kevin/BlogFolders.JPG"&gt;&lt;img src="http://www.dotnetmafia.com/blogs/kevin/BlogFolders.JPG" border="0" alt="" /&gt;&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;I want to be able to right-click on &amp;quot;Blog&amp;quot; and create a new document of type &amp;quot;BlogPost&amp;quot;.&amp;nbsp; Given today&amp;#39;s date, I want a year folder and a month folder to be created (if they don&amp;#39;t already exist) and my new post moved into the proper folder automatically.&lt;br /&gt;&lt;br /&gt;A bit of research uncovered Umbraco&amp;#39;s concept of Action Handlers.&amp;nbsp; Basically, these are your own classes you can use to perform custom actions when certain events occur in Umbraco&amp;#39;s content editor.&amp;nbsp; They just have to implement the umbraco.BusinessLogic.Actions.IActionHandler interface and exist in an assembly in the Umbraco bin folder.&lt;br /&gt;&lt;br /&gt;So, I set out to implement my DateFolderActionHandler class...&amp;nbsp; I created a new class library project, added references to Umbraco&amp;#39;s businesslogic.dll, cms.dll, and interfaces.dll, and added a class that implements IActionHandler.&amp;nbsp; Visual Studio was kind enough to fill in a skeleton implementation for me - here&amp;#39;s what it looked like:&lt;/p&gt;&lt;div style="background:white none repeat scroll 0% 50%;font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; System.Text;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; umbraco.BusinessLogic.Actions;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; umbraco.BusinessLogic.console;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;using&lt;/span&gt; umbraco.cms.businesslogic.web;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;namespace&lt;/span&gt; Demo&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;class&lt;/span&gt; DateFolderActionHandler : IActionHandler&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #region&lt;/span&gt; IActionHandler Members&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;bool&lt;/span&gt; Execute(Document documentObject, umbraco.interfaces.IAction action)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;throw&lt;/span&gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt; NotImplementedException();&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; &lt;span style="color:blue;"&gt;string&lt;/span&gt; HandlerName()&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;throw&lt;/span&gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt; NotImplementedException();&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;public&lt;/span&gt; umbraco.interfaces.IAction[] ReturnActions()&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;throw&lt;/span&gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt; NotImplementedException();&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; #endregion&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The first method that grabbed my attention was HandlerName() - all I have to do is return a string!&amp;nbsp; I did some digging with Reflector and it doesn&amp;#39;t appear to be used for anything important, so return anything you want from this method.&amp;nbsp; I used &amp;quot;DateFolderActionHandler&amp;quot; - the name of my class.&lt;/p&gt;&lt;p&gt;Next up - ReturnActions().&amp;nbsp; This appears to return a list of actions your handler wants to be notified of.&amp;nbsp; The actions you can choose from are members of the umbraco.BusinessLogic.Actions namespace.&amp;nbsp; My handler needs to execute when a new content item is created, so I&amp;#39;m using ActionNew().&amp;nbsp; ReturnActions() now looks like this:&lt;br /&gt;&lt;/p&gt;
&lt;div style="background:white none repeat scroll 0% 50%;font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;public&lt;/span&gt; umbraco.interfaces.&lt;span&gt;IAction&lt;/span&gt;[] ReturnActions()&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;new&lt;/span&gt; umbraco.interfaces.&lt;span&gt;IAction&lt;/span&gt;[] { &lt;span style="color:blue;"&gt;new&lt;/span&gt; umbraco.BusinessLogic.Actions.&lt;span&gt;ActionNew&lt;/span&gt;() };&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Last to implement is the Execute() method.&amp;nbsp; I&amp;#39;m guessing Execute() gets called when one of the actions you have subscribed to occurs.&amp;nbsp; The Document must be the content item that was acted upon and the IAction must be the action that was triggered.&amp;nbsp; In my case, I am only subscribing to ActionNew so I don&amp;#39;t have to check the action, but I will in this example to demonstrate how it&amp;#39;s done.&lt;br /&gt;&lt;/p&gt;&lt;div style="background:white none repeat scroll 0% 50%;font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// Not interested in anything but &amp;quot;create&amp;quot; events.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (action.Alias != &lt;span&gt;&amp;quot;create&amp;quot;&lt;/span&gt;) &lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;My action handler will be called for every new content item that is created, so the first thing I will want to do is verify that this document is one that I&amp;#39;m interested in.&amp;nbsp; I checked the content type like this:&lt;/p&gt;&lt;div style="background:white none repeat scroll 0% 50%;font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// Not interested if the item being added is not a blog post.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (documentObject.ContentType.Alias != &lt;span&gt;&amp;quot;BlogPost&amp;quot;&lt;/span&gt;) &lt;span style="color:blue;"&gt;return&lt;/span&gt; &lt;span style="color:blue;"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Note that
I am returning true on both of these cases.&lt;span&gt;&amp;nbsp;
&lt;/span&gt;My assumption was that the return value from Execute() indicated if the
action should be allowed to continue or not.&lt;span&gt;&amp;nbsp;
&lt;/span&gt;After playing around with returning false (and peeking at the code with
Reflector), it appears the return value is just ignored.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Shame on Umbraco - there does not appear to
be any way to cancel an action!&lt;span&gt;&amp;nbsp; &lt;/span&gt;Even
throwing an exception here doesn&amp;#39;t keep the action from happening.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Anyway - I will continue to return true when
I want the action to complete and false if I don&amp;#39;t in hopes that it will
someday make a difference. :)&lt;/p&gt;
&lt;p&gt;So if my code is still executing, I know I have a new document that I&amp;#39;m interested in
placing in date folders.&lt;span&gt;&amp;nbsp; &lt;/span&gt;I want a folder
for the year and a folder for the month, so I&amp;#39;ll start with the current date.&lt;/p&gt;&lt;div style="background:white none repeat scroll 0% 50%;font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; year = &lt;span&gt;DateTime&lt;/span&gt;.Now.ToString(&lt;span&gt;&amp;quot;yyyy&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;string&lt;/span&gt; month = &lt;span&gt;DateTime&lt;/span&gt;.Now.ToString(&lt;span&gt;&amp;quot;MM&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;As I
mentioned at the start of this article, I expect the new document to be created
as a child of &amp;quot;Blog&amp;quot;.&lt;span&gt;&amp;nbsp; &lt;/span&gt;The year
folder should also exist as a child of &amp;quot;Blog&amp;quot;.&lt;span&gt;&amp;nbsp; &lt;/span&gt;My first task is to check if that already
exists.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Here&amp;#39;s the code I used:&lt;/p&gt;&lt;div style="background:white none repeat scroll 0% 50%;font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span&gt;Document&lt;/span&gt; yearDocument = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (&lt;span&gt;IconI&lt;/span&gt; child &lt;span style="color:blue;"&gt;in&lt;/span&gt; documentObject.Parent.Children)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (child.Text == year)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; yearDocument = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span&gt;Document&lt;/span&gt;(child.Id);&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;break&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;(note - I
have no idea why the members of documentObject.Parent.Children are of type
&amp;quot;IconI&amp;quot;.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Maybe someone that
knows Umbraco better can answer that?)&lt;/p&gt;





&lt;p&gt;What this does is get the new item&amp;#39;s parent&amp;#39;s children (children of &amp;quot;Blog&amp;quot;) and
loops through them looking for one whose name matches the current year.&lt;span&gt;&amp;nbsp; &lt;/span&gt;If we make it through this loop and
yearDocument is still null, we know the folder doesn&amp;#39;t exist and needs to be
created.&lt;span&gt;&amp;nbsp; &lt;/span&gt;Here is how I handle that:&lt;/p&gt;&lt;div style="background:white none repeat scroll 0% 50%;font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// If the year folder doesn&amp;#39;t exist, create it.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (yearDocument == &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; yearDocument = &lt;span&gt;Document&lt;/span&gt;.MakeNew(year, &lt;span&gt;DocumentType&lt;/span&gt;.GetByAlias(&lt;span&gt;&amp;quot;YearFolder&amp;quot;&lt;/span&gt;), documentObject.User, documentObject.Parent.Id);&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The Document.MakeNew() call creates a new content item named for the current year,
using the document type &amp;quot;YearFolder&amp;quot;, created by the same user that
created the blog post, underneath the parent of the blog post
(&amp;quot;Blog&amp;quot;).&lt;/p&gt;



&lt;p&gt;Now I
have to repeat the same process for the month folder...&lt;/p&gt;&lt;div style="background:white none repeat scroll 0% 50%;font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span&gt;Document&lt;/span&gt; monthDocument = &lt;span style="color:blue;"&gt;null&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;foreach&lt;/span&gt; (&lt;span&gt;IconI&lt;/span&gt; child &lt;span style="color:blue;"&gt;in&lt;/span&gt; yearDocument.Children)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;if&lt;/span&gt; (child.Text == month)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; monthDocument = &lt;span style="color:blue;"&gt;new&lt;/span&gt; &lt;span&gt;Document&lt;/span&gt;(child.Id);&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;break&lt;/span&gt;;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;}&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// If the month folder doesn&amp;#39;t exist, create it.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:blue;"&gt;if&lt;/span&gt; (monthDocument == &lt;span style="color:blue;"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;{&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; monthDocument = &lt;span&gt;Document&lt;/span&gt;.MakeNew(month, &lt;span&gt;DocumentType&lt;/span&gt;.GetByAlias(&lt;span&gt;&amp;quot;MonthFolder&amp;quot;&lt;/span&gt;), documentObject.User, yearDocument.Id);&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;}&lt;/pre&gt;
&lt;/div&gt;

&lt;p&gt;And the
final step is to move the new content item into the month folder...&lt;/p&gt;&lt;div style="background:white none repeat scroll 0% 50%;font-family:Courier New;font-size:10pt;color:black;-moz-background-clip:-moz-initial;-moz-background-origin:-moz-initial;-moz-background-inline-policy:-moz-initial;"&gt;
&lt;pre style="margin:0px;"&gt;&lt;span style="color:green;"&gt;// Move the document into the month folder.&lt;/span&gt;&lt;/pre&gt;
&lt;pre style="margin:0px;"&gt;documentObject.Move(monthDocument.Id);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Then I
can just return true and I&amp;#39;m done!&lt;/p&gt;

&lt;p&gt;If you want to see the final DateFolderActionHandler.cs source file, I have attached it to this blog post.&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=492" width="1" height="1"&gt;</description><enclosure url="http://dotnetmafia.com/blogs/kevin/attachment/492.ashx" length="2462" type="text/plain" /><category domain="http://dotnetmafia.com/blogs/kevin/archive/tags/Umbraco/default.aspx">Umbraco</category><category domain="http://dotnetmafia.com/blogs/kevin/archive/tags/Action+Handler/default.aspx">Action Handler</category></item><item><title>Hello World</title><link>http://dotnetmafia.com/blogs/kevin/archive/2008/01/24/hello-world.aspx</link><pubDate>Thu, 24 Jan 2008 16:15:00 GMT</pubDate><guid isPermaLink="false">ceb7fe2a-c56b-4d85-99e6-8dd548580538:449</guid><dc:creator>Kevin</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://dotnetmafia.com/blogs/kevin/rsscomments.aspx?PostID=449</wfw:commentRss><comments>http://dotnetmafia.com/blogs/kevin/archive/2008/01/24/hello-world.aspx#comments</comments><description>&lt;p&gt;Ok, time for the usual lame first blog post to test that everything is set up properly, yada yada...&amp;nbsp; Maybe an introduction?&amp;nbsp; I&amp;#39;m currently working as a consultant doing .NET and web development work in Tulsa, OK.&amp;nbsp; I have worked with lots of programming languages over the years including C/C++, Python, Java, VB, C#, and others.&amp;nbsp; I&amp;#39;ve developed for various Unix platforms, done some Mac development, lots of web development, and for Windows of course. &lt;/p&gt;&lt;p&gt;No idea what exactly I&amp;#39;ll be writing about on this blog.&amp;nbsp; Right now, I&amp;#39;m playing with an open source .NET CMS called Umbraco as well as messing with using Cocoa# to put native Mac GUIs on my .NET programs, so those topics are sure to show up.&amp;nbsp; I also work with the Sitecore CMS a lot at work, so that might show up here as well. &lt;br /&gt;&lt;/p&gt;&lt;img src="http://dotnetmafia.com/aggbug.aspx?PostID=449" width="1" height="1"&gt;</description><category domain="http://dotnetmafia.com/blogs/kevin/archive/tags/Umbraco/default.aspx">Umbraco</category><category domain="http://dotnetmafia.com/blogs/kevin/archive/tags/Cocoa_2300_/default.aspx">Cocoa#</category><category domain="http://dotnetmafia.com/blogs/kevin/archive/tags/introduction/default.aspx">introduction</category><category domain="http://dotnetmafia.com/blogs/kevin/archive/tags/Sitecore/default.aspx">Sitecore</category></item></channel></rss>