<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Blog</title><link>http://www.szmyd.com.pl:80/blog</link><description>Blog</description><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/pszmyd" /><feedburner:info uri="pszmyd" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Orchard Steering Committee elections announced</title><link>http://feedproxy.google.com/~r/pszmyd/~3/jL5mvkYlPqk/orchard-steering-committee-elections-announced</link><description>&lt;p&gt;Bertrand Le Roy, PM at Microsoft and leader of the Orchard project, has &lt;a href="http://orchard.codeplex.com/discussions/270600"&gt;&lt;strong&gt;announced today the creation of Orchard Steering Committee&lt;/strong&gt;&lt;/a&gt;, a board responsible for future key (including design) decisions about the project, working closely with the core team at Microsoft. Members of the board will be chosen among the most enthusiastic and active community members in incoming elections. &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Hi all, &lt;p&gt;I've alluded to it before, and now is the time to get this started. We are ready to take the next step in making Orchard a community-based project and incorporating more community participation. We want key decisions (including design) to be handled going forward by a small group of enthusiastic community members in addition to input by the core team at Microsoft. We think about that in the following way: &lt;ul&gt; &lt;li&gt;We'll make a call for candidacy for each of the five seats on the committee. Actually, this post is it.  &lt;li&gt;Seats will be for a year (with an option to leave early if necessary), and will be renewable.  &lt;li&gt;Candidates must commit to spending a portion of their time (personal or professional with their employer's permission) every week. Count on one 1-hour Lync meeting a week usually, plus involvement in feature teams if you so desire. A candidate can be anyone who is active in the community and who is using Orchard. It is not required that you are a ninja coder (although we love ninjas), only that you are passionate and active.  &lt;li&gt;The first elected committee will determine the rules of the game going forward, including the voting process, triage, commit rights, etc.  &lt;li&gt;One of the seats will be for the job of Benevolent Dictator, whose powers are to be determined. Maybe veto or unblocking stalemates.  &lt;li&gt;If we have more candidates than seats, we'll set-up a vote (will be able to vote people who have CodePlex accounts and who have posted at least once on the Orchard discussions).  &lt;li&gt;We’ll create a new mailing-list for the committee, that will be public and archived.  &lt;li&gt;For each development sprint, the committee will spin up feature teams and make calls for participation. Details on this will follow.  &lt;li&gt;We will also need an additional person taking the role of Patch Master (more on this later). This role can be cumulated with a steering committee seat. &lt;/li&gt;&lt;/ul&gt; &lt;p&gt;All comments on this are of course welcome. &lt;p&gt;So there it is. Please make your candidacy known to the world by answering this post. Myself (Bertrand Le Roy) and Sébastien Ros are candidates. I will also be a candidate to the role of Benevolent Dictator. &lt;p&gt;We will leave the thread open for candidacies until 11:59:59PM PST on September 9th, at which point we’ll start the voting process. You will have a week to vote (until 11:59:59PM PST on September 16th), and we’ll announce results on September 19th. &lt;p&gt;Cheers,&lt;br&gt;Bertrand&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;strong&gt;That being said, I’ve obviously &lt;/strong&gt;&lt;a href="http://orchard.codeplex.com/discussions/270600#post664251"&gt;&lt;strong&gt;thrown myself&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; into the hat for candidacy!&lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/afb26209e9c0_121BF/wlEmoticon-smile_2.png"&gt;&lt;/strong&gt; I’d be more than happy for your support for my candidacy in the incoming elections.&lt;/p&gt; &lt;p&gt;It would be so nice to be in the center of the project, which you’ve spent endless hours working with, extending and watching it grow from it’s early days. But first and foremost - nothing could happen without the awesome, growing community gathered around the project, helping which I really enjoy! Being a part of the Orchard Steering Committee could help spreading a word about Orchard to a much broader audience, which is what I’ve always been trying to do&lt;img style="border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/afb26209e9c0_121BF/wlEmoticon-smile_2.png"&gt;&lt;/p&gt; &lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=jL5mvkYlPqk:OqdMm5MWP7U:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=jL5mvkYlPqk:OqdMm5MWP7U:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=jL5mvkYlPqk:OqdMm5MWP7U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=jL5mvkYlPqk:OqdMm5MWP7U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=jL5mvkYlPqk:OqdMm5MWP7U:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=jL5mvkYlPqk:OqdMm5MWP7U:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/jL5mvkYlPqk" height="1" width="1"/&gt;</description><pubDate>Sat, 27 Aug 2011 19:35:37 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/orchard-steering-committee-elections-announced</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/orchard-steering-committee-elections-announced</feedburner:origLink></item><item><title>DI property injection in Orchard</title><link>http://feedproxy.google.com/~r/pszmyd/~3/kxWbK-qO2Vs/di-property-injection-in-orchard</link><description>&lt;p&gt;As everyone developing apps using Orchard surely know, constructor injection in Orchard is a built-in feature. It&amp;rsquo;s used extensively throughout the whole framework and makes the developer&amp;rsquo;s life way much easier&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/b0969098e156_A13/wlEmoticon-smile_2.png" /&gt; But there are scenarios where it&amp;rsquo;s not enough and one may want to do property injection instead. The most common reason is a danger of having circular dependencies, nasty thing hard to trace and sometimes very hard to fix&amp;hellip;&lt;/p&gt;
&lt;p&gt;Property injection comes to the rescue, but it&amp;rsquo;s not a thing that comes out-of-the-box in Orchard. It&amp;rsquo;s ok that the framework doesn&amp;rsquo;t try to forcibly fill my object properties &amp;ndash; property injection should be used only as an alternative to ctor injection and only in certain scenarios.&lt;/p&gt;
&lt;p&gt;There are two ways to fill object properties with instances from the container in Orchard, which I found the most useful:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;On the object&amp;rsquo;s level (the one that has properties you need to fill) &amp;ndash; using Autofac&amp;rsquo;s &lt;strong&gt;IComponentContext.InjectUnsetProperties(object)&lt;/strong&gt; method.&lt;/li&gt;
&lt;li&gt;On the global level &amp;ndash; via &lt;strong&gt;Autofac.Module&lt;/strong&gt; implementation, utilizing the former&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;Object-level property initialization&lt;/h1&gt;
&lt;p&gt;It&amp;rsquo;s a good way to go if you want to inject properties of a specific object only.&lt;/p&gt;
&lt;p&gt;This approach requires you to have &lt;strong&gt;IWorkContextAccessor&lt;/strong&gt; object injected into the constructor first. Let&amp;rsquo;s call this object &lt;strong&gt;&amp;lsquo;context&amp;rsquo;.&lt;/strong&gt; Filling the object is as easy as calling &lt;strong&gt;context.Resolve&amp;lt;IComponentContext&amp;gt;().InjectUnsetProperties(this). &lt;/strong&gt;You may do that wherever you want to, eg. in a place where your object initialization happens. Of course look out with calling that in a constructor &amp;ndash; you may easily run into a circular dependency problem. It&amp;rsquo;s meant to be called &lt;strong&gt;after &lt;/strong&gt;the object has been constructed.&lt;/p&gt;
&lt;p&gt;Of course you may pass any object to &lt;strong&gt;InjectUnsetProperties&lt;/strong&gt; method and have it&amp;rsquo;s properties filled.&lt;/p&gt;
&lt;h1&gt;Global-level property injection&lt;/h1&gt;
&lt;p&gt;Use this approach if you want to do property injection on all objects registered in the container.&lt;/p&gt;
&lt;p&gt;It is a more complex solution as it requires you to create an implementation of Autofac.Module class and plug into the container-building processes. Nothing to fear, though&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/b0969098e156_A13/wlEmoticon-smile_2.png" /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;First of all we need to create and implementation of &lt;strong&gt;Autofac.Module&lt;/strong&gt; class and override method &lt;strong&gt;AttachToComponentRegistration(IComponentRegistry componentRegistry, IComponentRegistration registration).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Next step is to hook up the &lt;strong&gt;Activated &lt;/strong&gt;event of a given&lt;strong&gt; IComponentRegistration&lt;/strong&gt; and pass an event handler to it that would inject all unset properties of a processed object. Here is the code:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;MyModule &lt;/span&gt;: &lt;span style="color: #2b91af;"&gt;Module &lt;/span&gt;{
    &lt;span style="color: blue;"&gt;protected override void &lt;/span&gt;AttachToComponentRegistration(
        &lt;span style="color: #2b91af;"&gt;IComponentRegistry &lt;/span&gt;componentRegistry, 
        &lt;span style="color: #2b91af;"&gt;IComponentRegistration &lt;/span&gt;registration)
    {
        registration.Activated += (s, e) 
            =&amp;gt; e.Context.InjectUnsetProperties(e);
    }
}&lt;/pre&gt;
&lt;p&gt;Nothing more, nothing less &amp;ndash; very simple stuff, I told you&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-winkingsmile" alt="Puszczam oczko" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/b0969098e156_A13/wlEmoticon-winkingsmile_2.png" /&gt; This is only a simple example, of course -&amp;nbsp; you can put more fancy logic inside if you need to (e.g.. act only on specific objects and such).&lt;/p&gt;
&lt;p&gt;&lt;em&gt;I&amp;rsquo;ve recently &lt;/em&gt;&lt;a href="http://stackoverflow.com/questions/6749997/how-to-make-autofac-perform-property-injection-in-orchard-cms"&gt;&lt;em&gt;posted an answer&lt;/em&gt;&lt;/a&gt;&lt;em&gt; on SO to question about achieving property injection in Orchard. It was about filling properties of a &lt;strong&gt;specific type only,&lt;/strong&gt; leaving other properties untouched &amp;ndash; a bit more sophisticated stuff. If that&amp;rsquo;s your case &amp;ndash; take a look. The solution I provided was based on the &lt;strong&gt;Orchard.Logging.LoggingModule,&lt;/strong&gt; which injects &lt;strong&gt;ILogger &lt;/strong&gt;implementations.&lt;/em&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=kxWbK-qO2Vs:6Od-Js5V6Fk:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=kxWbK-qO2Vs:6Od-Js5V6Fk:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=kxWbK-qO2Vs:6Od-Js5V6Fk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=kxWbK-qO2Vs:6Od-Js5V6Fk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=kxWbK-qO2Vs:6Od-Js5V6Fk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=kxWbK-qO2Vs:6Od-Js5V6Fk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/kxWbK-qO2Vs" height="1" width="1"/&gt;</description><pubDate>Thu, 25 Aug 2011 00:09:33 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/di-property-injection-in-orchard</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/di-property-injection-in-orchard</feedburner:origLink></item><item><title>Moving to Orchard 1.2 - Impressions</title><link>http://feedproxy.google.com/~r/pszmyd/~3/XgTs_6tzIOk/moving-to-orchard-1.2-impressions</link><description>&lt;p&gt;After a short struggling I managed to successfully move my site to Orchard 1.2. Official release is just around the corner, but couldn&amp;rsquo;t help myself and built my own from the latest source:)&lt;/p&gt;
&lt;p&gt;Until yesterday my site was running on Orchard 1.0. It&amp;rsquo;s been a while since then and much has changed. That made the transition process a bit more complicated than I previously thought, although was clearly worth it.&lt;/p&gt;
&lt;h1&gt;First impression&lt;/h1&gt;
&lt;p&gt;The most stunning impression is performance. The performance gain is &lt;strong&gt;tremendous&lt;/strong&gt; comparing to previous versions, which can be clearly seen at first sight (or better &amp;ndash; first page load). The Orchard Team has done a really great job!&lt;/p&gt;
&lt;p&gt;From the UI point of view changes (comparing to 1.1) are barely noticeable, but my opinion is surely biased. I&amp;rsquo;ve been working with recent source code base all the time and just got used to it:) The official release notes (coming soon) would surely be much better source of information about all changes from the latest release.&lt;/p&gt;
&lt;h1&gt;v1.0 to v1.2 transition process&lt;/h1&gt;
&lt;p&gt;Orchard docs &lt;a href="http://www.orchardproject.net/docs/Upgrading-a-site-to-a-new-version-of-Orchard.ashx"&gt;describe the process&lt;/a&gt; very well &amp;ndash; I did everything exactly as they say which made the transition pretty easy. I ran into some problems at the modules&amp;rsquo; upgrade step, though. Those apply to 1.0 &amp;ndash; 1.1 transition too.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Some older, &lt;span style="text-decoration: underline;"&gt;enabled&lt;/span&gt; features will break when the core code gets upgraded.&lt;/em&gt; This issue is related to modules dependent on code touched by breaking changes (e.g. v1.1 replaced &lt;em&gt;string&lt;/em&gt; with &lt;em&gt;LocalizedString &lt;/em&gt;in MenuItem class which causes the first version of Advanced Menu, targeted to Orchard 1.0, to bomb the 1.2 instance). The solution is to disable such features prior to upgrading Orchard. If you forgot to do that and run into YSOD, you can use the &amp;ldquo;&lt;em&gt;feature disable&lt;/em&gt;&amp;rdquo; command from &lt;a href="http://www.orchardproject.net/docs/Using-the-command-line-interface.ashx"&gt;Orchard command-line&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Some features, previously available as separate modules, has been pushed to the core.&lt;/em&gt; If you have the old ones installed you can run into YSOD because of ambiguous class references. I stumbled upon this problem with &lt;a href="http://www.orchardproject.net/gallery/List/Modules/Orchard.Module.Iroo.PackageManager"&gt;Iroo.PackageManager&lt;/a&gt;, which since v1.1 is available in core Orchard.Packaging module. In this case, just uninstall the old module. Uninstallation has to be done by hand, as described in &lt;a href="http://orchard.codeplex.com/discussions/246309"&gt;this thread&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Besides that, everything went perfectly fine and now I&amp;rsquo;m a happy user of the newest Orchard Team&amp;rsquo;s creation!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UPDATE (2011/06/15): &lt;/strong&gt;&lt;a href="http://orchard.codeplex.com/releases/view/65184"&gt;&lt;strong&gt;Orchard 1.2&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; has just been released!&lt;/strong&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=XgTs_6tzIOk:EsvHpEO3LXE:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=XgTs_6tzIOk:EsvHpEO3LXE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=XgTs_6tzIOk:EsvHpEO3LXE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=XgTs_6tzIOk:EsvHpEO3LXE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=XgTs_6tzIOk:EsvHpEO3LXE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=XgTs_6tzIOk:EsvHpEO3LXE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/XgTs_6tzIOk" height="1" width="1"/&gt;</description><pubDate>Tue, 14 Jun 2011 15:51:27 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/moving-to-orchard-1.2-impressions</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/moving-to-orchard-1.2-impressions</feedburner:origLink></item><item><title>Orchard Advanced Menu 1.3 released!</title><link>http://feedproxy.google.com/~r/pszmyd/~3/KSg-_2wHn4M/orchard-advanced-menu-1.3-released</link><description>&lt;p&gt;New release is &lt;a href="http://www.orchardproject.net/gallery/List/Modules/Orchard.Module.Szmyd.Orchard.Modules.Menu"&gt;finally out&lt;/a&gt;! I managed to fix all reported bugs, add some new goodies, do a lot of refactoring and boost performance a little bit. Hope it&amp;rsquo;ll serve you well.&lt;/p&gt;
&lt;h1&gt;What&amp;rsquo;s new?&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;MenuRelationPart.&lt;/strong&gt; The part that allows attaching an item to one or more different menus directly from that item&amp;rsquo;s creation/edit screen. It behaves similar to the default menu part (that added &amp;ldquo;Show on main menu&amp;rdquo; checkbox) and replaces it. It&amp;rsquo;s attached to Page, Blog and BlogPost content types by default, but you can attach it to any custom content type you need, in order to allow adding menu links to it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Menu widget creation from command-line. &lt;/strong&gt;You can now create menu widgets directly from Orchard command-line or from your custom recipes. Simply use the command &amp;ldquo;&lt;em&gt;menuwidget create&lt;/em&gt;&amp;rdquo;&lt;strong&gt;&amp;nbsp;&lt;/strong&gt;Great thanks to Raymond de Jong for contributing this piece of code!&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;New menu widget display mode &amp;ndash; SiblingsExpanded.&lt;/strong&gt; In this mode the menu is displayed in full, but children are rendered only for the items on selection path. &lt;em&gt;Basically, the menu in this mode looks like a tree-view with single path fully-rendered and others collapsed to the topmost node.&lt;/em&gt;&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;What&amp;rsquo;s changed?&lt;/h1&gt;
&lt;p&gt;These are some of the most important changes:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Counters and Breadcrumbs has been moved to separate features.&lt;/strong&gt; They are disabled by default. You can enable them, if you wish, from the Modules admin pane.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Marking selected/current menu items.&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&amp;ldquo;Current&amp;rdquo; CSS class&lt;/strong&gt; is used to mark the selected menu item, corresponding to currently viewed page.&lt;em&gt; If you have more than one item with the same URL in a single menu &amp;ndash; all of them will be marked as &amp;ldquo;current&amp;rdquo;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&amp;ldquo;Selected&amp;rdquo; CSS class&lt;/strong&gt; is used to mark all parent items (path), starting from the one that is actually being viewed. &lt;em&gt;If you have more than one item with the same URL in a single menu &amp;ndash; only the first one will have the path marked. &lt;/em&gt;The same applies to breadcrumbs &amp;ndash; the first valid path found from the current item to the top will be used.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Menu items list in admin view has been filled with additional data (URL, direct links to corresponding content items and the item type)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Changed the name of &amp;ldquo;templated menu item&amp;rdquo; to &amp;ldquo;menu item /w custom Html&amp;rdquo; in admin UI. &lt;/strong&gt;There were some misunderstandings about what is it for and I guess putting a more descriptive name is a good idea.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Dropdowns instead of textboxes&lt;/strong&gt; for choosing a menu in menu/breadcrumbs widgets.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Renamed menu widget display modes to be more descriptive.&lt;/strong&gt; It&amp;rsquo;s a topic for the next post.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lots of other minor things&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Orchard-Advanced-Menu-1.3-released_FC81/wlEmoticon-smile_2.png" /&gt;&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h1&gt;What&amp;rsquo;s been fixed?&lt;/h1&gt;
&lt;ul&gt;
&lt;li&gt;Issue with deleting menus which rendered menus non-removable.&lt;/li&gt;
&lt;li&gt;Menu and breadcrumbs rendering issues. In some cases the module rendered empty, additional &amp;lt;li&amp;gt; tags between parent and child menu items.&lt;/li&gt;
&lt;li&gt;After enabling shape tracing, menu items text got overwritten by shape Url (shape tracing has been overwriting an existing property on menu item shape)&lt;/li&gt;
&lt;li&gt;In some cases, selected menu items hasn&amp;rsquo;t been correctly marked with appropriate CSS classes.&lt;/li&gt;
&lt;li&gt;Serialization issues with counters when using SQL Server session store.&lt;/li&gt;
&lt;li&gt;Incorrect menu level cutting when using &amp;ldquo;Limit levels&amp;rdquo; feature&lt;/li&gt;
&lt;li&gt;Link to &amp;lsquo;main&amp;rsquo; menu appearing even after &amp;lsquo;main&amp;rsquo; menu deletion.&lt;/li&gt;
&lt;li&gt;Error when trying to recreate menu with the same name as previously deleted menu. It&amp;rsquo;s an issue with Orchard &amp;ndash; by default menu items are not removed from database (just hidden from UI), so unique constraint on menu names throw errors with subsequent inserts.&lt;/li&gt;
&lt;li&gt;Menu display mode dropdown doesn't keep selected value when you come to edit it again&lt;/li&gt;
&lt;li&gt;Menu widget display modes doesn&amp;rsquo;t work as expected.&lt;/li&gt;
&lt;li&gt;Filling menu with existing items creates duplicates.&lt;/li&gt;
&lt;li&gt;&amp;ldquo;Cut lower levels&amp;rdquo; option in menu widget works exactly the opposite way.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Many thanks for the giant load of feedback some of you provided since &lt;a href="http://www.szmyd.com.pl/blog/featuring-orchard-advanced-menu"&gt;last release&lt;/a&gt;. It really helped me a lot when it came to bugfixing and thinking about new features for this release. &lt;strong&gt;My special thanks go to Raymond de Jong and &lt;a href="http://www.nogginbox.co.uk/"&gt;Richard Garside&lt;/a&gt; for code contributions and great amount of feedback!&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Btw - I&amp;rsquo;m going to write some more detailed tutorial on module usage soon, so stay tuned.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Orchard-Advanced-Menu-1.3-released_FC81/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=KSg-_2wHn4M:6CvCvuzpBX0:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=KSg-_2wHn4M:6CvCvuzpBX0:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=KSg-_2wHn4M:6CvCvuzpBX0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=KSg-_2wHn4M:6CvCvuzpBX0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=KSg-_2wHn4M:6CvCvuzpBX0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=KSg-_2wHn4M:6CvCvuzpBX0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/KSg-_2wHn4M" height="1" width="1"/&gt;</description><pubDate>Sun, 12 Jun 2011 00:16:55 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/orchard-advanced-menu-1.3-released</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/orchard-advanced-menu-1.3-released</feedburner:origLink></item><item><title>Removing items in Orchard</title><link>http://feedproxy.google.com/~r/pszmyd/~3/0ALglkYcwJE/removing-items-in-orchard</link><description>&lt;p&gt;Some of you reported an issue with deleting menus in Advanced Menu module. It was widely discussed in &lt;a href="http://www.szmyd.com.pl/blog/featuring-orchard-advanced-menu"&gt;initial post&lt;/a&gt; comments and on &lt;a href="http://stackoverflow.com/questions/5998440/orchard-cms-navigation-does-not-work-anymore/6117940#6117940"&gt;StackOverflow&lt;/a&gt;. I&amp;rsquo;ve investigated that issue and was pretty surprised with findings. It looks like it was related to how Orchard handles content item removal, what is a pretty interesting thing because it works differently as one may think. &lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Content items never get completely deleted.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Remember that when designing your content parts. They have only certain flags removed which makes them invisible to further queries.&amp;nbsp; It&amp;rsquo;s a desirable behavior in many cases, as it allows items to be undeleted, browse history etc. But it raises a couple of issues though, e.g.. with unique columns on content part records &amp;ndash; you cannot recreate the removed item with the same value, as it&amp;rsquo;s there all the time.&lt;/p&gt;
&lt;p&gt;If you want to completely erase an item &amp;ndash; you can do that via &lt;em&gt;IRepository&amp;lt;ContentItem&amp;gt;&lt;/em&gt; when needed (e.g.. in &lt;em&gt;ContentHandler&amp;rsquo;s OnRemoved&lt;/em&gt; event). Related content part records will be automatically deleted. I hope that future Orchard releases will have the feature to delete content items via &lt;em&gt;ContentManager &lt;/em&gt;built-in.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Thanks to &lt;/em&gt;&lt;a href="http://www.codeplex.com/site/users/view/loudej"&gt;&lt;em&gt;Louis De Jardin&lt;/em&gt;&lt;/a&gt;&lt;em&gt;, who described it in details &lt;/em&gt;&lt;a href="http://orchard.codeplex.com/discussions/259018"&gt;&lt;em&gt;here&lt;/em&gt;&lt;/a&gt;&lt;em&gt;.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=0ALglkYcwJE:xJ9rEKr2qdc:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=0ALglkYcwJE:xJ9rEKr2qdc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=0ALglkYcwJE:xJ9rEKr2qdc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=0ALglkYcwJE:xJ9rEKr2qdc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=0ALglkYcwJE:xJ9rEKr2qdc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=0ALglkYcwJE:xJ9rEKr2qdc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/0ALglkYcwJE" height="1" width="1"/&gt;</description><pubDate>Fri, 27 May 2011 20:47:48 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/removing-items-in-orchard</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/removing-items-in-orchard</feedburner:origLink></item><item><title>New code generation features for Orchard</title><link>http://feedproxy.google.com/~r/pszmyd/~3/k2eAnSNxlYE/new-code-generation-features-for-orchard</link><description>&lt;p&gt;Back on track after a short break!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/eadea774d187_886/wlEmoticon-smile_2.png" /&gt; I&amp;rsquo;ve just uploaded to the Orchard Gallery a much updated version of Code Generation Extensions module.&lt;/p&gt;
&lt;p&gt;Some of you asked for features such as settings codegen and assigning the generated part to specific feature. Here they are! I described the basic commands and usage of those in my &lt;a href="http://www.szmyd.com.pl/blog/generating-orchard-content-parts-via-command-line"&gt;previous article&lt;/a&gt;. Now, I&amp;rsquo;d like to describe the new goodies, starting from&amp;hellip;&lt;/p&gt;
&lt;h1&gt;Introducing &amp;lsquo;codegen typesettings&amp;rsquo;&lt;/h1&gt;
&lt;p&gt;This is a new Orchard CLI command that generates all files necessary for adding type-specific settings to any existing part. Such settings are commonly used for holding some default values for content parts. You can read more about those &lt;a href="http://www.szmyd.com.pl/blog/using-custom-settings-in-orchard-part-2-content-type-settings"&gt;here&lt;/a&gt; and &lt;a href="http://www.orchardproject.net/docs/Adding-custom-settings.ashx"&gt;here&lt;/a&gt; (&lt;em&gt;which is the same post, just copied to the official docs&lt;/em&gt;).&lt;/p&gt;
&lt;p&gt;Like the&lt;strong&gt; &amp;lsquo;codegen part&amp;rsquo;&lt;/strong&gt; command,&lt;strong&gt; &amp;lsquo;codegen typesettings&amp;rsquo;&lt;/strong&gt; also has a&lt;strong&gt; /Properties:&lt;/strong&gt; switch (optional parameter), with exactly the same syntax. It allows you to easily provide necessary properties via command-line. If you do so, the form fields necessary for editing those properties will be automatically created in an appropriate .cshtml file (&lt;em&gt;which can save you some keystrokes &lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-winkingsmile" alt="Puszczam oczko" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/eadea774d187_886/wlEmoticon-winkingsmile_2.png" /&gt;&lt;/em&gt;).&lt;/p&gt;
&lt;h1&gt;New parameters in &amp;lsquo;codegen part&amp;rsquo;&lt;/h1&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;/ForFeature:&amp;lt;feature-name&amp;gt; &amp;ndash;&lt;/strong&gt; this switch lets you specify which feature (existing in your module, of course) the generated part has to be specifically bound to. &lt;em&gt;The existence of a feature you specify isn&amp;rsquo;t being verified (yet), so look out for typing errors.&lt;/em&gt; For those of you who would like to get into greater detail &amp;ndash; &lt;em&gt;it adds an appropriate&lt;strong&gt; [OrchardFeature(&amp;hellip;)]&lt;/strong&gt; attribute to generated classes.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;/AttachTo:&amp;lt;type-name&amp;gt;&lt;/strong&gt; &amp;ndash; allows you to specify the &lt;em&gt;content type&lt;/em&gt; this part should be automatically attached to. As you may or may not know, attaching parts to content types in Orchard can be done twofold &amp;ndash; by &lt;a href="http://www.orchardproject.net/docs/Creating-a-module-with-a-simple-text-editor.ashx"&gt;describing the structure&lt;/a&gt; in data migrations class (which can be further modified via admin UI) or by hardcoding the relation in content handler using &lt;em&gt;ActivationFilter&lt;/em&gt; (like e.g.. &lt;a href="http://www.szmyd.com.pl/blog/how-to-add-settings-to-your-content-parts-and-items"&gt;site settings&lt;/a&gt; do).&lt;em&gt;&lt;strong&gt; &lt;/strong&gt;This command uses the second approach.&lt;/em&gt;&lt;br /&gt;&lt;strong&gt;This switch makes creation of &lt;a href="http://www.szmyd.com.pl/blog/how-to-add-settings-to-your-content-parts-and-items"&gt;site settings&lt;/a&gt; as easy as specifying &lt;em&gt;/AttachTo:Site&lt;/em&gt;. &lt;em&gt;Site&lt;/em&gt; is a content type in Orchard, so you can attach to it virtually any part you want!&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;/ShapeFile:&amp;lt;name&amp;gt;&lt;/strong&gt; &amp;ndash; if you want to provide your own name for generated shape files instead of part name &amp;ndash; this is the right place. &lt;strong&gt;Do not specify the file extension (.cshtml) here &amp;ndash; it will be added automatically&lt;/strong&gt;. This parameter allows you to keep your file-naming scheme intact (e.g.. &lt;em&gt;Funny.MyPart.cshtml&lt;/em&gt; instead of &lt;em&gt;MyFunnyPart.cshtml&lt;/em&gt;, where &lt;em&gt;MyFunnyPart&lt;/em&gt; is the name of your part).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;strong&gt;I&amp;rsquo;d like to thank Brad Millington very much for &lt;a href="http://channel9.msdn.com/events/MIX/MIX11/FRM06"&gt;mentioning this module during speech on MIX11!&lt;/a&gt;&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/eadea774d187_886/wlEmoticon-smile_2.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;That is all for now. I&amp;rsquo;ll probably make some more additions soon so stay tuned!&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=k2eAnSNxlYE:eHeJ24Y3Okw:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=k2eAnSNxlYE:eHeJ24Y3Okw:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=k2eAnSNxlYE:eHeJ24Y3Okw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=k2eAnSNxlYE:eHeJ24Y3Okw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=k2eAnSNxlYE:eHeJ24Y3Okw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=k2eAnSNxlYE:eHeJ24Y3Okw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/k2eAnSNxlYE" height="1" width="1"/&gt;</description><pubDate>Tue, 26 Apr 2011 23:36:49 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/new-code-generation-features-for-orchard</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/new-code-generation-features-for-orchard</feedburner:origLink></item><item><title>Generating Orchard content parts via command-line</title><link>http://feedproxy.google.com/~r/pszmyd/~3/AiECgx7Xa28/generating-orchard-content-parts-via-command-line</link><description>&lt;p&gt;Creating a content part in Orchard, even the most trivial one, involves creating many small objects &amp;ndash; handler, driver, model (main part object), record, display and editor shapes to name a few. As I was tired of hand-creating/copy-pasting all those every time I needed a content part I wrote a simple Orchard module that automates the process (&lt;em&gt;being a dev is about making life easier, right?&lt;/em&gt;)&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Content-part-code-generation-in-Orchard_224E/wlEmoticon-smile_2.png" /&gt; I called that module &lt;strong&gt;Code Generation Extensions&lt;/strong&gt;, as it generally extends the default codegen features.&lt;/p&gt;
&lt;p&gt;Module adds an Orchard command-line command&lt;strong&gt; &amp;ldquo;codegen part&amp;rdquo;&lt;/strong&gt;. It&amp;rsquo;s syntax is as follows:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;codegen part &lt;em&gt;&amp;lt;module_name&amp;gt; &amp;lt;part_name&amp;gt;&lt;/em&gt; [&lt;em&gt;/Properties:&amp;lt;comma-delimited list of name:type pairs&amp;gt;&lt;/em&gt;]&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;codegen part Modules.Shop ProductPart /Properties: Name:string, Price:int&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Properties is an optional parameter, so if you&amp;rsquo;d like to create an empty part you can just write&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;codegen part Modules.Shop ProductPart&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;The command creates a handler, driver, model, record, display and editor shapes and updates the Placement.info file with default &lt;em&gt;Content:before&lt;/em&gt; placement for your part shape. If you provide &lt;em&gt;/Properties&lt;/em&gt; parameter, the model, record and editor shapes will be filled with appropriate code accordingly.&lt;/p&gt;
&lt;p&gt;You can &lt;a href="http://www.orchardproject.net/gallery/List/Modules/Orchard.Module.Szmyd.CodeGeneration"&gt;download&lt;/a&gt; the module from the &lt;a href="http://www.orchardproject.net/gallery/List/Modules/Orchard.Module.Szmyd.CodeGeneration"&gt;Orchard Gallery&lt;/a&gt;. Feel free to play with it and I hope you find it useful!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Content-part-code-generation-in-Orchard_224E/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=AiECgx7Xa28:ilAIjqoteJo:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=AiECgx7Xa28:ilAIjqoteJo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=AiECgx7Xa28:ilAIjqoteJo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=AiECgx7Xa28:ilAIjqoteJo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=AiECgx7Xa28:ilAIjqoteJo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=AiECgx7Xa28:ilAIjqoteJo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/AiECgx7Xa28" height="1" width="1"/&gt;</description><pubDate>Thu, 07 Apr 2011 00:52:37 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/generating-orchard-content-parts-via-command-line</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/generating-orchard-content-parts-via-command-line</feedburner:origLink></item><item><title>Featuring Orchard Advanced Menu</title><link>http://feedproxy.google.com/~r/pszmyd/~3/_-jl1yrMz-U/featuring-orchard-advanced-menu</link><description>&lt;p&gt;New Hierarchical Menu module release is finally here. As you probably noticed, the module name has changed to &lt;em&gt;Advanced Menu&lt;/em&gt;, as I guess it&amp;rsquo;s more appropriate now. Why? This is basically what I&amp;rsquo;m about to write about, as there&amp;rsquo;s been &lt;span style="text-decoration: underline;"&gt;a lot&lt;/span&gt; of changes since the last release&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/df3da1739b0e_F594/wlEmoticon-smile_2.png" /&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;First and foremost &amp;ndash; the module is prepared to &lt;strong&gt;work with the upcoming Orchard 1.1&lt;/strong&gt; release! The bad news about it is that it probably won&amp;rsquo;t work with the Orchard 1.0, because the new release introduces some &lt;strong&gt;breaking changes &lt;/strong&gt;(e.g. different LocalizationString handling). Would there be a demand for backward compatibility, I&amp;rsquo;ll do my best to try adding that (I have to make some research if it&amp;rsquo;s possible at all first).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;As the module takes part in the &lt;/strong&gt;&lt;a href="http://www.orchardproject.net/omc"&gt;&lt;strong&gt;Orchard Module Challenge&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;, I created a simple &lt;/strong&gt;&lt;a href="http://orchard18.webmatrix-appliedi.net/"&gt;&lt;strong&gt;demo site&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;, which shows it&amp;rsquo;s most powerful features&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/df3da1739b0e_F594/wlEmoticon-smile_2.png" /&gt; Check it out!&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;&lt;strong&gt;New features&lt;/strong&gt;&lt;/h2&gt;
&lt;p&gt;Version 1.2 introduces many features not available in previous versions (in addition to changes to existing ones, which are described later in this article):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Custom menus&lt;/strong&gt;&amp;ndash; ability to create your own menus.
&lt;ul&gt;
&lt;li&gt;Easily create different menus &lt;strong&gt;for different purposes&lt;/strong&gt;, e.g. separate the menus used for display and breadcrumb rendering&lt;/li&gt;
&lt;li&gt;You can&lt;strong&gt; auto-fill&lt;/strong&gt; the created menu with existing content items (Pages, Blogs, Lists etc.) with just a click of a button. There is also an option to include contained items (e.g. Blog posts, List items and such)&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Styled menu widget &amp;ndash; &lt;/strong&gt;styled and scripted with &lt;a href="http://users.tpg.com.au/j_birch/plugins/superfish/"&gt;Superfish&lt;/a&gt; jQuery library menu widget with color customization options. Works with all major browsers and degrades gracefully when JS is disabled&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Templated menu items&lt;/strong&gt; &amp;ndash; you can put your own Html markup inside menu items&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Visit counters &amp;ndash; &lt;/strong&gt;attach a visit counter to any displayable content type (attached to Page type by default)
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Scoped&lt;/strong&gt; &amp;ndash; you can choose from three predefined counter scopes: &lt;strong&gt;PerSite, PerUser&lt;/strong&gt; and &lt;strong&gt;PerSession&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;This is the flag use of the counting framework I created while rewriting the included RecentlySeenWidget (which now utilizes this). There&amp;rsquo;s way more than this, but this is clearly a topic for a different article.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;When the Advanced Menu module&amp;nbsp;is enabled, the default menu&amp;nbsp;gets automatically replaced with StyledMenuWidget. So you don't have to create the first widget by hand, as it's already there!&amp;nbsp;You can change it or replace from the Dashboard if you need to.&lt;/p&gt;
&lt;h2&gt;&lt;strong&gt;Changes&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;More menu and menu item rendering options&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;Optional wrapping of sub-items in additional &amp;lt;div&amp;gt; tags&lt;/li&gt;
&lt;li&gt;Add optional subtitle to menu items&lt;/li&gt;
&lt;li&gt;Hide/show menu item&amp;rsquo;s text&lt;/li&gt;
&lt;li&gt;Render menu item as link (default) or just as a plain text&lt;/li&gt;
&lt;li&gt;Limit the number of menu levels displayed with an option to cut or flatten to a single list the items below threshold&lt;/li&gt;
&lt;li&gt;Specify which menu item children to use as a top level of a displayed menu. By default none, which means that the whole menu is rendered&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tweaks for easy styling/scripting&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Unique Id attribute for each menu widget &amp;ndash; &lt;/strong&gt;each menu widget has a unique &lt;strong&gt;menu-&amp;lt;item_id&amp;gt;&lt;/strong&gt;&amp;nbsp; HTML Id attribute to allow targeting specific menu with jQuery/CSS selectors. The &lt;em&gt;item_id&lt;/em&gt; is menu widget&amp;rsquo;s content item Id.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unique Id attribute for each counter &amp;ndash; &lt;strong&gt;counter-&amp;lt;item_id&amp;gt;, &lt;/strong&gt;&lt;/strong&gt;analogous to the former&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Additional CSS classes for counters&lt;/strong&gt; &amp;ndash; &lt;strong&gt;counter-&amp;lt;counter_scope&amp;gt;&lt;/strong&gt;, where &lt;em&gt;counter_scope&lt;/em&gt; is the scope used &lt;em&gt;(&amp;ldquo;PerSite&amp;rdquo;, &amp;ldquo;PerUser&amp;rdquo; or &amp;ldquo;PerSession&amp;rdquo;).&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Additional shape alternates for customization&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Menu__[item_id]&lt;/strong&gt;, where &lt;em&gt;item_id&lt;/em&gt; stands for MenuWidget/StyledMenuWidget content item Id. Example: &lt;em&gt;Menu-33.cshtml&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Breadcrumbs__[item_id]&lt;/strong&gt; &amp;ndash; where &lt;em&gt;item_id&lt;/em&gt; is BreadcrumbsWidget content item Id. Example: &lt;em&gt;Breadcrumbs-22.cshtml&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Breadcrumbs__[menu_name]&lt;/strong&gt; &amp;ndash; where &lt;em&gt;menu_name&lt;/em&gt; is the name of menu used to render BreadcrumbsWidget. Example: &lt;em&gt;Breadcrumbs-main.cshtml&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Counter__[counter_scope]&lt;/strong&gt; &amp;ndash; where &lt;em&gt;counter_scope&lt;/em&gt; is counter scope used &lt;em&gt;(&amp;ldquo;PerSite&amp;rdquo;, &amp;ldquo;PerUser&amp;rdquo; or &amp;ldquo;PerSession&amp;rdquo;).&lt;/em&gt; Example: &lt;em&gt;Counter-PerSite.cshtml&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Counter__[item_type] &amp;ndash; &lt;/strong&gt;where &lt;em&gt;item_type&lt;/em&gt; is the name of content type the counter is attached to. Example: &lt;em&gt;Counter-BlogPost.cshtml&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Counter__[item_id] &amp;ndash;&lt;/strong&gt; where &lt;em&gt;item_id&lt;/em&gt; stands for the Id of an item the counter is attached to. Example: &lt;em&gt;Counter-11.cshtml&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Lot of code refactoring&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;&lt;strong&gt;Plans for the next release (around mid/end-April 2011)&lt;/strong&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Editing content item menu associations&lt;/strong&gt; on item edit/creation screen&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multi-column sub-items layout &amp;ndash; &lt;/strong&gt;dividing children into multiple lists&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Menu item position auto-creation&lt;/strong&gt; based on existing items&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Menu item listing UI&lt;/strong&gt; improvement and tweaks&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance improvements&lt;/strong&gt; by utilizing caching engine where possible&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;More styling options for StyledMenuWidget&lt;/strong&gt; &amp;ndash; borders, padding, margins, custom CSS, top menu level alignment (left/right/center)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Refactoring &amp;ndash; group and divide the features into separate features - &lt;/strong&gt;I just didn't have time to&amp;nbsp;do this, as OMC deadline was nearby (and being left with the totally broken build few hours before wasn't the thing I dreamt of&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/df3da1739b0e_F594/wlEmoticon-smile_2.png" /&gt;)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I hope you&amp;rsquo;ll find it useful in your Orchard projects! I&amp;rsquo;m going to update my blog to Orchard 1.1 as soon as it arrives to utilize this nice new feature. I&amp;rsquo;d be very glad for any feedback so I could make this module better and better&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/df3da1739b0e_F594/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=_-jl1yrMz-U:gqdOBIC4SsQ:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=_-jl1yrMz-U:gqdOBIC4SsQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=_-jl1yrMz-U:gqdOBIC4SsQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=_-jl1yrMz-U:gqdOBIC4SsQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=_-jl1yrMz-U:gqdOBIC4SsQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=_-jl1yrMz-U:gqdOBIC4SsQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/_-jl1yrMz-U" height="1" width="1"/&gt;</description><pubDate>Sun, 03 Apr 2011 20:05:02 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/featuring-orchard-advanced-menu</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/featuring-orchard-advanced-menu</feedburner:origLink></item><item><title>SQL Server 2008: Reverting accidental delete/update without recent backup</title><link>http://feedproxy.google.com/~r/pszmyd/~3/TZDKgn7PfT0/sql-server-2008-reverting-accidental-delete-update-without-recent-backup</link><description>&lt;p&gt;Recently I ran into a problem after accidentally clearing an important column in one of my DB tables. Ooops&amp;hellip; I was in a real hurry and haven&amp;rsquo;t thought about making a backup first&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-sadsmile" alt="Smutek" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/60958dbc8563_E53C/wlEmoticon-sadsmile_2.png" /&gt; Just a simple query, but also with simple, nasty error within... First thought &amp;ndash; I&amp;rsquo;m doomed! &lt;em&gt;I&amp;rsquo;m pretty sure many of you had the same situation once&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/60958dbc8563_E53C/wlEmoticon-smile_2.png" /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I had only a week old backup &amp;ndash; much has changed since, so it&amp;rsquo;s not an option to revert the whole week.&amp;nbsp; So I started digging for a solution&amp;hellip; And found one!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/60958dbc8563_E53C/wlEmoticon-smile_2.png" /&gt; My DB is running in Full Recovery mode, so maybe there&amp;rsquo;s a chance (&lt;em&gt;your DB has to run in this mode too for this solution to work&lt;/em&gt;):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Create a Transaction Log-only backup now&lt;/strong&gt; (after the accident)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Restore the old backup&lt;/strong&gt; (week old in my situation) &lt;strong&gt;using RESTORE WITH NORECOVERY option.&lt;/strong&gt; This option can be selected in &lt;strong&gt;Restore Wizard &amp;ndash;&amp;gt;&lt;/strong&gt;&amp;nbsp;&lt;strong&gt;Options&lt;/strong&gt; screen (or specified in restoration script). &lt;em&gt;This ensures that DB will be restored from backup and won&amp;rsquo;t allow outside connections until we&amp;rsquo;re finished the whole restoration process.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Restore the Transaction Log backup (created in 1.) to a point in time before the accidental update/delete happened. &lt;/strong&gt;You can choose the desired point in time in Restore Wizard, or (if you prefer the scripted way of doing things) use the WITH STOPAT &amp;lt;date&amp;gt; option. &lt;strong&gt;This time, choose RESTORE WITH RECOVERY option&lt;/strong&gt;, to make DB fully operational after restoration process.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;You may also need to check &lt;strong&gt;WITH REPLACE &lt;/strong&gt;option in 2. and 3. if your DB shouts with errors.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;And everything returns back to normal, phew&amp;hellip;&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/60958dbc8563_E53C/wlEmoticon-smile_2.png" /&gt; HTH!&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=TZDKgn7PfT0:Cj_ToA6oI5Y:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=TZDKgn7PfT0:Cj_ToA6oI5Y:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=TZDKgn7PfT0:Cj_ToA6oI5Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=TZDKgn7PfT0:Cj_ToA6oI5Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=TZDKgn7PfT0:Cj_ToA6oI5Y:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=TZDKgn7PfT0:Cj_ToA6oI5Y:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/TZDKgn7PfT0" height="1" width="1"/&gt;</description><pubDate>Mon, 28 Mar 2011 14:35:27 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/sql-server-2008-reverting-accidental-delete-update-without-recent-backup</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/sql-server-2008-reverting-accidental-delete-update-without-recent-backup</feedburner:origLink></item><item><title>Incoming Warm-up module helps running Orchard on shared hosting</title><link>http://feedproxy.google.com/~r/pszmyd/~3/JhC7h4jJNX0/incoming-warm-up-module-helps-running-orchard-on-shared-hosting</link><description>&lt;p&gt;Most of us doesn&amp;rsquo;t have the possibility to run Orchard on his own server machine. Using the shared hosting account is the cheapest and most common way to have your site up and running, but it has lots of drawbacks, especially in terms of &lt;strong&gt;performance &lt;/strong&gt;and &lt;strong&gt;first-load (cold-start) response times. &lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;A while ago I wrote an &lt;a href="http://www.szmyd.com.pl/blog/running-orchard-on-shared-hosting" target="_blank"&gt;article&lt;/a&gt; on how to boost your Orchard instance cold-start times. Most of the solutions to this issue unfortunately require you to have access to IIS Management Console, which isn&amp;rsquo;t always possible.&lt;/p&gt;
&lt;p&gt;Here comes the &lt;strong&gt;Orchard.Warmup&lt;/strong&gt; module, which will arrive with the incoming Orchard release. As application response times are crucial in terms of UX, this module will allow your site to be responsive even when your AppPool gets recycled! &lt;em&gt;You&amp;rsquo;d be able to quickly serve your visitors the cached versions of pages you want, until your application loads fully in the background. When that happens, everything returns to normal&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/104ae198676b_A6D1/wlEmoticon-smile_2.png" /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Check out &lt;a href="http://orchard.codeplex.com/discussions/242228" target="_blank"&gt;this thread&lt;/a&gt;, where &lt;strong&gt;Renaud Paquay&lt;/strong&gt; from The Orchard Team describes the idea in greater detail.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=JhC7h4jJNX0:thT_7a-03Yc:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=JhC7h4jJNX0:thT_7a-03Yc:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=JhC7h4jJNX0:thT_7a-03Yc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=JhC7h4jJNX0:thT_7a-03Yc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=JhC7h4jJNX0:thT_7a-03Yc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=JhC7h4jJNX0:thT_7a-03Yc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/JhC7h4jJNX0" height="1" width="1"/&gt;</description><pubDate>Thu, 24 Mar 2011 11:10:19 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/incoming-warm-up-module-helps-running-orchard-on-shared-hosting</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/incoming-warm-up-module-helps-running-orchard-on-shared-hosting</feedburner:origLink></item><item><title>The whole truth about CS studies</title><link>http://feedproxy.google.com/~r/pszmyd/~3/xDOEqvL90gE/the-whole-truth-about-cs-studies</link><description>&lt;p&gt;It&amp;rsquo;s so true, that I couldn&amp;rsquo;t help myself posting this&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/The-whole-truth-about-CS_F9AF/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/The-whole-truth-about-CS_F9AF/196338_154790191247969_100001509667558_334722_1419322_n_2.jpg"&gt;&lt;img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="196338_154790191247969_100001509667558_334722_1419322_n" border="0" alt="196338_154790191247969_100001509667558_334722_1419322_n" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/The-whole-truth-about-CS_F9AF/196338_154790191247969_100001509667558_334722_1419322_n_thumb.jpg" width="398" height="423" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What do you think about that?&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Is it university CS programmes that lag behind the real-world needs or new wave of students who believe CS courses to be a longer version of a (Java/.NET/PHP/whatever) programming tutorial and don&amp;rsquo;t care about the principles?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=xDOEqvL90gE:t9x5XyXiKQo:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=xDOEqvL90gE:t9x5XyXiKQo:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=xDOEqvL90gE:t9x5XyXiKQo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=xDOEqvL90gE:t9x5XyXiKQo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=xDOEqvL90gE:t9x5XyXiKQo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=xDOEqvL90gE:t9x5XyXiKQo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/xDOEqvL90gE" height="1" width="1"/&gt;</description><pubDate>Wed, 23 Mar 2011 16:52:44 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/the-whole-truth-about-cs-studies</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/the-whole-truth-about-cs-studies</feedburner:origLink></item><item><title>Customizing Orchard shapes</title><link>http://feedproxy.google.com/~r/pszmyd/~3/xpp2J32vLPo/customizing-orchard-shapes</link><description>&lt;p&gt;Shapes are the basic building blocks of Orchard UI. They can be easily created and further reused by just putting an appropriate .cshtml file in your module /Views folder. This is nicely described &lt;a href="http://www.orchardproject.net/docs/Accessing-and-rendering-shapes.ashx" target="_blank"&gt;here&lt;/a&gt; and &lt;a href="http://www.szmyd.com.pl/blog/using-shapes-as-html-helpers-in-orchard" target="_blank"&gt;here&lt;/a&gt;. But what if you&amp;rsquo;d want to arm your shape with some more fancy logic (eg. let them contain other shapes/objects, make them auto-wrapped with some Html tags, allow fine-grained overriding and such)? I&amp;rsquo;ll try to show you how to get the most from your Orchard shapes.&lt;/p&gt;
&lt;h2&gt;&lt;span style="font-weight: bold;"&gt;Creating a custom IShapeTableProvider&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;This is the main extension points for adding some custom logic to shapes. What&amp;rsquo;s the most important thing &amp;ndash; &lt;em&gt;not only your shapes&lt;/em&gt;! You can also alter the behavior of existing ones &amp;ndash; cool&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/f251733f5cb7_D3FC/wlEmoticon-smile_2.png" /&gt;! Basically, you are able to eg. add custom wrappers, class names, attributes, fire some custom logic on shape lifetime events and so on.&lt;/p&gt;
&lt;p&gt;The place everything happens in is the &lt;strong&gt;Discover(ShapeTableBuilder builder)&lt;/strong&gt; method. You operate on the provided &lt;em&gt;builder&lt;/em&gt; object to create all shapes&amp;rsquo; customizations. The basic structure looks like this:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;MyShapes &lt;/span&gt;: &lt;span style="color: #2b91af;"&gt;IShapeTableProvider &lt;/span&gt;{
    &lt;span style="color: blue;"&gt;public void &lt;/span&gt;Discover(&lt;span style="color: #2b91af;"&gt;ShapeTableBuilder &lt;/span&gt;builder)
    {
        builder.Describe(&lt;span style="color: #a31515;"&gt;"MyShape"&lt;/span&gt;)
	    .Configure(descriptor =&amp;gt; { })
            .OnCreated(context =&amp;gt; { })
            .OnCreating(context =&amp;gt; { })
            .OnDisplayed(context =&amp;gt; { })
            .OnDisplaying(context =&amp;gt; { });
    }
}
&lt;/pre&gt;
&lt;p&gt;As you can see the builder adds a nice, fluent interface for specifying the necessary stuff. First, you have to tell the builder which shape you&amp;rsquo;d like to alter by using a &lt;strong&gt;Describe()&lt;/strong&gt; method. &amp;ldquo;&lt;em&gt;MyShape&lt;/em&gt;&amp;rdquo; name I provided corresponds to &lt;em&gt;/Views/MyShape.cshtml&lt;/em&gt; shape file. &lt;strong&gt;The way shape names are constructed from the corresponding .cshtml file names is described in detail &lt;/strong&gt;&lt;a href="http://www.orchardproject.net/docs/Accessing-and-rendering-shapes.ashx" target="_blank"&gt;&lt;strong&gt;here&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; (&lt;em&gt;section &amp;ldquo;From template file name to shape name&amp;rdquo;).&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Next, you are free to add your own logic inside one or more of the five provided methods. For each of those methods you can specify a delegate (or lambda/anonymous method as shown above) which will get called at an appropriate moment:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Configure &amp;ndash; &lt;/strong&gt;used to add some config options to your shape. &lt;em&gt;Mostly used to define wrappers (other shapes that wrap your shape) via &lt;strong&gt;descriptor.Wrappers&lt;/strong&gt; collection.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OnCreating&lt;/strong&gt; &amp;ndash; called when your shape is about to be created. &lt;em&gt;This event is mostly used for providing some custom shape construction info, like &lt;strong&gt;context.ShapeType (the type of object you want to be the base type of this shape &amp;ndash; nice if you&amp;rsquo;d like to add some custom properties to the shape) &lt;/strong&gt;or context.Behaviors (collection of IClayBehavior implementations for defining behavior when accessing shape members - pretty low-level stuff). &lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OnCreated&lt;/strong&gt; &amp;ndash; called when your shape is fully created, but not pushed to display yet. &lt;em&gt;Generally, all display structure is defined here (eg. shape zones, startup items, child items placement and such) &lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OnDisplaying&lt;/strong&gt; &amp;ndash; called when your shape is about to be displayed.&lt;em&gt; Mainly used for adding custom CSS classes (via context.Shape.Classes) or defining shape alternates to allow fine-grained overriding by your module users. What are shape alternates is described &lt;a href="http://www.orchardproject.net/docs/Accessing-and-rendering-shapes.ashx" target="_blank"&gt;here&lt;/a&gt;. &lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;OnDisplayed &lt;/strong&gt;&amp;ndash; called when your shape Html just got rendered.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Next, you can operate on the provided context object to add necessary customizations. That&amp;rsquo;s it!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/f251733f5cb7_D3FC/wlEmoticon-smile_2.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The most important thing - you can access the corresponding dynamic Shape object by &lt;em&gt;context.Shape&lt;/em&gt;. The Shape property is &lt;span style="text-decoration: underline;"&gt;not&lt;/span&gt; available in&lt;em&gt; OnCreating&lt;/em&gt; event though (for obvious reasons).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;There are more methods, of course, but these are the &lt;strong&gt;most&lt;/strong&gt; useful ones. In most cases you won&amp;rsquo;t ever need to use the others.&lt;/p&gt;
&lt;p&gt;As an example I&amp;rsquo;d advise you to take a look at &lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard.Web%2fCore%2fShapes%2fCoreShapes.cs" target="_blank"&gt;CoreShapes.cs&lt;/a&gt;, located in Orchard.Core/Shapes. It contains the definitions for the most common shapes and nice examples of how you can customize your own shapes!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/f251733f5cb7_D3FC/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=xpp2J32vLPo:QCw9PXUrjek:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=xpp2J32vLPo:QCw9PXUrjek:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=xpp2J32vLPo:QCw9PXUrjek:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=xpp2J32vLPo:QCw9PXUrjek:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=xpp2J32vLPo:QCw9PXUrjek:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=xpp2J32vLPo:QCw9PXUrjek:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/xpp2J32vLPo" height="1" width="1"/&gt;</description><pubDate>Wed, 23 Mar 2011 16:03:17 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/customizing-orchard-shapes</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/customizing-orchard-shapes</feedburner:origLink></item><item><title>WDI2011 conference site runs on Orchard</title><link>http://feedproxy.google.com/~r/pszmyd/~3/d9Epl3ytP-Q/wdi2011-conference-site-runs-on-orchard</link><description>&lt;p&gt;Had a hard work for a last few days rewriting the whole existing &lt;a href="http://www.wdi2011.pl" target="_blank"&gt;WDI2011&lt;/a&gt; conference site to Orchard. Works like a charm so I think it was worth that&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/WDI2011-Conference-site-runs-on-Orchard_6146/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;As I had to assign some time to that (and, unfortunately, this resource is highly limited&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-winkingsmile" alt="Puszczam oczko" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/WDI2011-Conference-site-runs-on-Orchard_6146/wlEmoticon-winkingsmile_2.png" /&gt;) - the planned releases (refreshed Hierarchical Menu and the new one - &lt;em&gt;Frooth&lt;/em&gt; &amp;ndash; dynamic layout platform) will be delayed to Tuesday/Wednesday next week. I apologize for that&amp;hellip; But I can also promise you won&amp;rsquo;t be disappointed with the incoming bits!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/WDI2011-Conference-site-runs-on-Orchard_6146/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;An I&amp;rsquo;d be happy to invite those of you visiting Warsaw &lt;span style="text-decoration: underline;"&gt;at the end of March (30-31)&lt;/span&gt; to come and join us at the annual &lt;a href="http://www.wdi2011.pl" target="_blank"&gt;WDI 2011&lt;/a&gt; conference. &lt;em&gt;WDI is the biggest student-oriented (but not only) IT conference in Poland. This year the conference is being held at the Warsaw University of Technology.&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Cheers&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=d9Epl3ytP-Q:eo6d7JQnH9g:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=d9Epl3ytP-Q:eo6d7JQnH9g:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=d9Epl3ytP-Q:eo6d7JQnH9g:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=d9Epl3ytP-Q:eo6d7JQnH9g:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=d9Epl3ytP-Q:eo6d7JQnH9g:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=d9Epl3ytP-Q:eo6d7JQnH9g:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/d9Epl3ytP-Q" height="1" width="1"/&gt;</description><pubDate>Sat, 19 Mar 2011 06:02:57 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/wdi2011-conference-site-runs-on-orchard</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/wdi2011-conference-site-runs-on-orchard</feedburner:origLink></item><item><title>New Hierarchical Menu coming soon - features</title><link>http://feedproxy.google.com/~r/pszmyd/~3/2HNgeJF94iE/new-hierarchical-menu-coming-soon-features</link><description>&lt;p&gt;I&amp;rsquo;m working hard to deliver the next release of Hierarchical Menu, which will arrive soon (as the deadline for OMC is nearby&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-winkingsmile" alt="Puszczam oczko" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/befe67daa921_E3D6/wlEmoticon-winkingsmile_2.png" /&gt;). I&amp;rsquo;d like to list some new features most of which many of you asked for:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Custom menus&lt;/strong&gt; &amp;ndash; &lt;em&gt;the ability to create your own menus from Dashboard, in addition to existing, hardcoded ones - &amp;ldquo;main&amp;rdquo; and &amp;ldquo;admin&amp;rdquo;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Pre-filling the menu with existing items&lt;/strong&gt; &amp;ndash; it will allow you to pre-fill the custom menu with existing routable items in one click (and save time). &lt;em&gt;You could further customize the menu (delete, modify items) as you wish&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/befe67daa921_E3D6/wlEmoticon-smile_2.png" /&gt;&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;New, styled and scripted menu widget&lt;/strong&gt; &amp;ndash; in addition to the current plain one.&lt;em&gt; Many of you had problems with proper styling the hierarchy, so I added the pre-configured widget with some GUI-based display customization properties. It&amp;rsquo;s intended for those of you who don&amp;rsquo;t want to deal with styling and scripting.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Main menu as a widget&lt;/strong&gt; &amp;ndash; the new release will replace the hardcoded main menu with a widget, so you&amp;rsquo;d be able to customize/remove/replace it from Dashboard.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flexible menu localization&lt;/strong&gt; &amp;ndash; you&amp;rsquo;d be able to specify the menu item names for different cultures.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Menu item visibility &amp;ndash;&lt;/strong&gt; allowing you to state whether the item should be visible/invisible when displaying in menus. This is mainly for breadcrumbs widget purpose so you&amp;rsquo;d be able to hide item in the menu (to keep menu concise), but make it show in the breadcrumbs path.&lt;em&gt; &lt;strong&gt;I&amp;rsquo;m thinking about this feature right now whether to add it or not.&lt;/strong&gt; Why? There are some issues:&lt;/em&gt;
&lt;ul&gt;
&lt;li&gt;&lt;em&gt;What to do with child items?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Would it bring the unnecessary complexity and further problems? This can be achievable by just having two defined menus &amp;ndash; one for display (shorter) and one for breadcrumbs (full). I guess this is much cleaner though.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tweaked &amp;ldquo;Recently seen&amp;rdquo; widget &lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Restricting the number of items displayed&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Option to display the number of views&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Scoping the view counter used&lt;/strong&gt; &amp;ndash; you&amp;rsquo;d be able to choose one of the following: &lt;em&gt;per-session&lt;/em&gt;, &lt;em&gt;per-user&lt;/em&gt; and &lt;em&gt;per-site&lt;/em&gt; view counters&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Tweaked &amp;ldquo;Menu&amp;rdquo; widget&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Restricting levels displayed per-widget&lt;/strong&gt; &amp;ndash; as opposed to per-menu atm,&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Choosing the root node for menu display&lt;/strong&gt; &amp;ndash; you&amp;rsquo;d be able to select one of the existing items as the display root to restrict the displayed menu to only the subset of the whole (the selected item&amp;rsquo;s children).&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I&amp;rsquo;d like to thank all of you for a lot of feedback on using the Hierarchical Menu module! It made the feature selection for the upcoming release much easier&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/befe67daa921_E3D6/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;My special thanks go to: &lt;em&gt;Olin&lt;/em&gt;, &lt;em&gt;Skywalker&lt;/em&gt;,&lt;em&gt; tobias&lt;/em&gt; and &lt;em&gt;John Tarbox&lt;/em&gt; for the very elaborate feedback on the subject.&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=2HNgeJF94iE:2VqPgzwqvAY:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=2HNgeJF94iE:2VqPgzwqvAY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=2HNgeJF94iE:2VqPgzwqvAY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=2HNgeJF94iE:2VqPgzwqvAY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=2HNgeJF94iE:2VqPgzwqvAY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=2HNgeJF94iE:2VqPgzwqvAY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/2HNgeJF94iE" height="1" width="1"/&gt;</description><pubDate>Sun, 06 Mar 2011 15:58:45 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/new-hierarchical-menu-coming-soon-features</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/new-hierarchical-menu-coming-soon-features</feedburner:origLink></item><item><title>Orchard cool new feature - Recipes</title><link>http://feedproxy.google.com/~r/pszmyd/~3/H2DVDYNbVjs/orchard-cool-new-feature-recipes</link><description>&lt;p&gt;I&amp;rsquo;ve just came across a new feature which, I suppose, will be ready for the upcoming Orchard 1.1 release &amp;ndash; the Recipes.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;It allows you to describe the startup configuration of Orchard and brew your own environment just by defining the necessary setup steps in simple XML. Cool!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Orchard-cool-new-featureRecipes_E154/wlEmoticon-smile_2.png" /&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Apart from the manifest part (the &lt;em&gt;&amp;lt;Recipe&amp;gt;&lt;/em&gt; section) containing info about recipe you can define everything you need for your Orchard application to successfully set up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Modules needed&lt;/strong&gt; (the &lt;em&gt;&amp;lt;Module&amp;gt;&lt;/em&gt; section). &lt;em&gt;The coolest thing about this section is that you can define even the modules &lt;span style="text-decoration: underline;"&gt;not existing&lt;/span&gt; in the installation package and those will be &lt;span style="text-decoration: underline;"&gt;automatically downloaded and installed from Orchard Gallery&lt;/span&gt; (or other repositories of your own you may optionally specify)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Features enabled/disabled by default&lt;/strong&gt; (the &amp;lt;Feature&amp;gt; section)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Themes available &lt;/strong&gt;(the &lt;em&gt;&amp;lt;Theme&amp;gt;&lt;/em&gt; section)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Content types and parts&lt;/strong&gt; (&amp;lt;&lt;em&gt;Metadata&amp;gt;&lt;/em&gt; section with &lt;em&gt;&amp;lt;Types&amp;gt;&lt;/em&gt; and &lt;em&gt;&amp;lt;Parts&amp;gt;&lt;/em&gt; subsections)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Default site settings&lt;/strong&gt; (&amp;lt;&lt;em&gt;Settings&amp;gt;&lt;/em&gt; section)&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Migrations to run&lt;/strong&gt; &lt;em&gt;(&amp;lt;Migration&amp;gt;&lt;/em&gt; section). &lt;em&gt;You can specify for which features the migrations should be run (* by default, which means all)&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Commands to invoke&lt;/strong&gt; &lt;em&gt;(&amp;lt;Command&amp;gt;&lt;/em&gt; section).&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;As an example of such recipe take a look at the one used for setting up a &lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/622d58e5caae#src%2fOrchard.Web%2fModules%2fOrchard.Setup%2fRecipes%2fdefault.recipe.xml" target="_blank"&gt;default environment&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I guess this gives a&lt;strong&gt; huge&lt;/strong&gt; boost for everyone building highly customized applications on Orchard, as the whole setup phase can be clearly defined. So you can simply say &amp;ldquo;goodbye&amp;rdquo; to hours spent on setting up your Orchard box for the n-th time!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Orchard-cool-new-featureRecipes_E154/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://dotnetshoutout.com/Orchard-cool-new-feature-Recipes" rev="vote-for"&gt;&lt;img style="border: 0px;" alt="Shout it" src="http://dotnetshoutout.com/image.axd?url=http%3A%2F%2Fwww.szmyd.com.pl%2Fblog%2Forchard-cool-new-feature-recipes%3Fsms_ss%3Ddotnetshoutout%26at_xt%3D4d6e663b4f2e0daa%252C0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.szmyd.com.pl%2fblog%2forchard-cool-new-feature-recipes%3fsms_ss%3ddotnetkicks"&gt;&lt;img border="0" alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.szmyd.com.pl%2fblog%2forchard-cool-new-feature-recipes%3fsms_ss%3ddotnetkicks%26border%3DEEEEEE%26bgcolor%3D0066CC%26cbgcolor%3DFFFFCC" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=H2DVDYNbVjs:USWk6v_KEc8:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=H2DVDYNbVjs:USWk6v_KEc8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=H2DVDYNbVjs:USWk6v_KEc8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=H2DVDYNbVjs:USWk6v_KEc8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=H2DVDYNbVjs:USWk6v_KEc8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=H2DVDYNbVjs:USWk6v_KEc8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/H2DVDYNbVjs" height="1" width="1"/&gt;</description><pubDate>Wed, 02 Mar 2011 15:32:06 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/orchard-cool-new-feature-recipes</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/orchard-cool-new-feature-recipes</feedburner:origLink></item><item><title>Running Orchard on shared hosting</title><link>http://feedproxy.google.com/~r/pszmyd/~3/1ahgufHaNxM/running-orchard-on-shared-hosting</link><description>&lt;p&gt;Trying to run Orchard on shared hosting can run you into many problems. There&amp;rsquo;s already been a long &lt;a href="http://orchard.codeplex.com/discussions/242228" target="_blank"&gt;discussion&lt;/a&gt; about that on Orchard discussion board. The main issue noticed is a long Orchard loading time, especially when accessing the site for the first time.&lt;/p&gt;
&lt;p&gt;Orchard is a very complex application which needs a lot of preparation stuff at startup. &lt;em&gt;Unfortunately shared hosting providers care the most about site density on their servers and do frequent AppPool restarts so to allow other sites to reuse the server resources. Every AppPool restart forces Orchard to load itself from scratch and do the so-called &amp;ldquo;cold-start&amp;rdquo;.&lt;/em&gt; Also, on less frequently visited sites the AppPool will be additionally recycled because of long idle times.&lt;/p&gt;
&lt;p&gt;There are two approaches to lessen the impact of those on your visitors&amp;rsquo; experience (&lt;em&gt;of course if AppPool recycling is the case&lt;/em&gt;):&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Use ping service&lt;/strong&gt; to shorten the application idle time. It will ensure that your site is constantly running by pinging the specified URL in specified time periods and will automatically force cold-starts. Some of such services were mentioned in &lt;a href="http://orchard.codeplex.com/discussions/242228" target="_blank"&gt;this thread&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Use &lt;a href="http://www.iis.net/download/ApplicationWarmup" target="_blank"&gt;Application Warm-Up&lt;/a&gt; IIS plugin.&lt;/strong&gt; This is the much better way as long as you have access to your site via IIS Management Console. &lt;strong&gt;In my opinion this is a must-have plugin!&lt;/strong&gt; It ensures the application gets a hot-start even when AppPool gets recycled. Basically it makes your application start before the first request arrives.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Hope you find it helpful&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Running-Orchard-on-shared-hosting_F9ED/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=1ahgufHaNxM:gs0Thw0GKz8:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=1ahgufHaNxM:gs0Thw0GKz8:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=1ahgufHaNxM:gs0Thw0GKz8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=1ahgufHaNxM:gs0Thw0GKz8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=1ahgufHaNxM:gs0Thw0GKz8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=1ahgufHaNxM:gs0Thw0GKz8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/1ahgufHaNxM" height="1" width="1"/&gt;</description><pubDate>Tue, 01 Mar 2011 17:04:31 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/running-orchard-on-shared-hosting</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/running-orchard-on-shared-hosting</feedburner:origLink></item><item><title>Referencing custom assemblies in Orchard module</title><link>http://feedproxy.google.com/~r/pszmyd/~3/z3_hXOYuZnw/referencing-custom-assemblies-in-orchard-module</link><description>&lt;p&gt;This is one of the common problems you can run into at module development time.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;In the most usual (and preferred) dev setup you work in VS 2010 on a single &lt;em&gt;Orchard.sln&lt;/em&gt; solution containing full Orchard source and add your custom modules as an &lt;em&gt;additional&amp;nbsp; projects&lt;/em&gt;. This setup works perfectly fine unless you try to use additional assemblies not listed in /lib folder (under the full Orchard source code root, as downloaded from Codeplex).&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;If you try to add a custom assembly reference to your module project it&amp;rsquo;s inevitable that sooner or later you&amp;rsquo;ll run into:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;"The type or namespace name 'yyy' does not exist in the namespace 'xxx' (are you missing an assembly reference?)"&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;exception when debugging from Visual Studio. The reason is fairly simple. &lt;em&gt;As Orchard is a sophisticated platform, it&amp;rsquo;s still an ASP.NET MVC application though and needs all of the assemblies used placed in the Orchard.Web &lt;strong&gt;/bin&lt;/strong&gt; folder (apart from those coming from GAC)! [EDIT] Orchard has also a second directory for holding custom assemblies - /AppData/Dependencies - and this is the place where all of non-core dlls land. Renaud Paquay from the Orchard Team wrote about the reasons behind that below.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;When you install a module from NuGet package, the necessary assemblies contained in this package get copied to the Orchard.Web application&amp;rsquo;s&amp;nbsp;/AppData/Dependencies&amp;nbsp;folder and everything is fine. But when you debug the whole app from VS, the modules are already there and no installation (and file copying) happens&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The workaround to this problem is to add all assemblies referenced by your module(s) to the &lt;em&gt;Orchard.Web&lt;/em&gt; project too.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;[EDIT] There is also a different&amp;nbsp;workaround. You can store all your necessary assemblies in a single folder, and point Orchard to look into that folder at runtime (when the dynamic compilation happens). To achieve that just add the path to that folder to &lt;em&gt;Web.config&lt;/em&gt; file in &lt;em&gt;Orchard.Web &lt;/em&gt;project. The path should be placed in /runtime/assemblyBinding/probing privatePath property, separated with semi-colon from others.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As I stated above, this is only necessary at development time. When you deploy your module as NuGet package (via &lt;em&gt;package create&lt;/em&gt; command) and install it &amp;ndash; everything is perfectly fine. Your custom assemblies get packaged together with the module source and Orchard copies them to the appropriate locations.&lt;/p&gt;
&lt;p&gt;And btw, I&amp;rsquo;d like to give you a tip at the end of this article&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/b01ef36e8653_DE19/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;When using custom assemblies in your modules, check if they exist in /lib folder under the Orchard listing root. If so, make use of them &amp;ndash; those assemblies won&amp;rsquo;t get packaged within your module NuGet package, so you&amp;rsquo;ll end up with a much lighter file. Remember though that for this to happen you MUST use exactly the same version of assemblies as in /lib folder.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Hope you find it helpful!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=z3_hXOYuZnw:dWhGiCyz7Ok:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=z3_hXOYuZnw:dWhGiCyz7Ok:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=z3_hXOYuZnw:dWhGiCyz7Ok:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=z3_hXOYuZnw:dWhGiCyz7Ok:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=z3_hXOYuZnw:dWhGiCyz7Ok:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=z3_hXOYuZnw:dWhGiCyz7Ok:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/z3_hXOYuZnw" height="1" width="1"/&gt;</description><pubDate>Tue, 01 Mar 2011 16:07:39 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/referencing-custom-assemblies-in-orchard-module</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/referencing-custom-assemblies-in-orchard-module</feedburner:origLink></item><item><title>Most useful Orchard extension points</title><link>http://feedproxy.google.com/~r/pszmyd/~3/hI432e0IoRA/most-useful-orchard-extension-points</link><description>&lt;p&gt;After some time spent developing &lt;a href="http://www.orchardproject.net/" target="_blank"&gt;Orchard&lt;/a&gt; modules I found many useful, yet not documented extension points you can use when writing your own Orchard-based apps. Mentions of many of them are scattered throughout the Orchard &lt;a href="http://orchard.codeplex.com/discussions" target="_blank"&gt;discussion board&lt;/a&gt; so I made an effort to put them all in one place.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Although in most cases you won&amp;rsquo;t use all of those features in a single app, knowledge of what you can do can be useful when building more complex, custom, Orchard-based applications.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;span style="text-decoration: underline;"&gt;Note:&lt;/span&gt; As far as I have seen the naming convention states that interfaces ending with &lt;strong&gt;&amp;ldquo;Service&amp;rdquo;&lt;/strong&gt; are single instance, so if you create the custom implementation, it will be the one used across the whole app. In contrast, interfaces ending with &lt;strong&gt;&amp;ldquo;Provider&amp;rdquo;&lt;/strong&gt; mark objects that are thought to provide additional functionality and cooperate with other existing ones, so to be used and injected as an IEnumerable&amp;lt;ISomeProvider&amp;gt;.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span style="font-weight: bold;"&gt;Authentication and authorization&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fSecurity%2fIAuthenticationService.cs" target="_blank"&gt;IAuthenticationService&lt;/a&gt; &lt;/strong&gt;&lt;em&gt;&amp;ndash; &lt;/em&gt;responsible for user authentication in Orchard. By default, orchard uses forms-based authentication delivered by &lt;em&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fSecurity%2fProviders%2fFormsAuthenticationService.cs" target="_blank"&gt;FormsAuthenticationService&lt;/a&gt;&lt;/em&gt;. Custom implementation overrides the default one.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fSecurity%2fIAuthorizationService.cs" target="_blank"&gt;IAuthorizationService&lt;/a&gt;&lt;/strong&gt;&lt;em&gt; &amp;ndash;&lt;/em&gt; responsible for user authorization in Orchard. By default, Orchard uses role-based authorization delivered by &lt;em&gt;Orchard.Roles&lt;/em&gt; module. Custom implementation overrides the default &lt;em&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard.Web%2fModules%2fOrchard.Roles%2fServices%2fRolesBasedAuthorizationService.cs" target="_blank"&gt;RolesBasedAuthorizationService&lt;/a&gt;.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fSecurity%2fIMembershipService.cs" target="_blank"&gt;IMembershipService&lt;/a&gt;&lt;/strong&gt;&lt;em&gt; &amp;ndash;&lt;/em&gt; responsible for account creation and retrieval. The default &lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard.Web%2fModules%2fOrchard.Users%2fServices%2fMembershipService.cs" target="_blank"&gt;&lt;em&gt;MembershipService&lt;/em&gt;&lt;/a&gt; comes from &lt;em&gt;Orchard.Users.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fSecurity%2fPermissions%2fIPermissionProvider.cs" target="_blank"&gt;IPermissionsProvider&lt;/a&gt;&lt;/strong&gt;&lt;em&gt; &amp;ndash;&lt;/em&gt; allows creating custom permissions for reuse in authorization service. Check the &lt;em&gt;Orchard.Blogs&lt;/em&gt; &lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard.Web%2fModules%2fOrchard.Blogs%2fPermissions.cs" target="_blank"&gt;permissions provider&lt;/a&gt; as an example.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span style="font-weight: bold;"&gt;Navigation&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fUI%2fNavigation%2fINavigationProvider.cs" target="_blank"&gt;INavigationProvider&lt;/a&gt; &amp;ndash; &lt;/strong&gt;provides additional menu items to be merged into the named menu. Implementations can be found almost in every module, which adds menu items to the Dashboard (e.g.. in &lt;em&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard.Web%2fModules%2fOrchard.Blogs%2fAdminMenu.cs" target="_blank"&gt;Orchard.Blogs&lt;/a&gt;&lt;/em&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span style="font-weight: bold;"&gt;Messaging&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fMessaging%2fServices%2fIMessagingChannel.cs" target="_blank"&gt;IMessagingChannel&lt;/a&gt;&lt;/strong&gt; &amp;ndash; defines a channel for sending messages from Orchard. Orchard.Email defines the only one &amp;ndash; &amp;ldquo;email&amp;rdquo; messaging channel, but you are free to create your own. &lt;em&gt;After creating a custom channel you&amp;rsquo;d be able to force Orchard to use it by default by choosing it as a default one in Site settings.&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span style="font-weight: bold;"&gt;Request filters&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fMvc%2fFilters%2fFilterProvider.cs" target="_blank"&gt;FilterProvider&lt;/a&gt;&lt;/strong&gt; &amp;ndash; defines the filter applied to each request. Resembles the way default ASP.NET MVC action filters work with the difference that it&amp;rsquo;s not an attribute. All &lt;em&gt;FilterProvider&lt;/em&gt; objects are injected into the request pipeline and are applied to all requests (&lt;em&gt;so you need to check if the current request is suitable for your filter at the beginning of an appropriate method&lt;/em&gt;).&lt;/li&gt;
&lt;li&gt;As with the default &lt;a href="http://www.asp.net/mvc/tutorials/understanding-action-filters-cs" target="_blank"&gt;ASP.NET MVC filters&lt;/a&gt;, your filter also has to implement one (or more)&amp;nbsp;of the following interfaces: &lt;em&gt;IActionFilter, IAuthorizationFilter, IResultFilter, IExceptionFilter. &lt;/em&gt;Check those as an example: &lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fUI%2fAdmin%2fAdminFilter.cs" target="_blank"&gt;AdminFilter&lt;/a&gt;, &lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fThemes%2fThemeFilter.cs" target="_blank"&gt;ThemeFilter&lt;/a&gt;, &lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fSecurity%2fSecurityFilter.cs" target="_blank"&gt;SecurityFilter&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span style="font-weight: bold;"&gt;Display shapes&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fDisplayManagement%2fDescriptors%2fInterfaces.cs" target="_blank"&gt;IShapeTableProvider&lt;/a&gt;&lt;/strong&gt; &amp;ndash; allows you to programmatically describe your own shapes. Shapes from shape table providers are merged with the dynamically discovered ones (from .cshtml files). Check the &lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard.Web%2fCore%2fShapes%2fCoreShapes.cs" target="_blank"&gt;CoreShapes&lt;/a&gt; definition as an example.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span style="font-weight: bold;"&gt;Background tasks&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fTasks%2fIBackgroundTask.cs" target="_blank"&gt;&lt;strong&gt;IBackgroundTask&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; &amp;ndash; &lt;/strong&gt;defines the task, which will be run in the background in specified time intervals. It&amp;rsquo;s &lt;em&gt;Sweep()&lt;/em&gt; method will be called every 1 minute (hardcoded in &lt;em&gt;Orchard.Tasks.SweepGenerator&lt;/em&gt;). Chris Bower wrote a nice &lt;a href="http://chrisbower.com/2011/02/18/background-tasks-in-orchard/" target="_blank"&gt;article&lt;/a&gt; about that.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fTasks%2fScheduling%2fIScheduledTask.cs" target="_blank"&gt;&lt;strong&gt;IScheduledTask&lt;/strong&gt;&lt;/a&gt; &amp;ndash; defines the task, which will be run once at a specified time. You can create new tasks via &lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fTasks%2fScheduling%2fIScheduledTaskManager.cs" target="_blank"&gt;IScheduledTaskManager&lt;/a&gt; &amp;ndash; just inject this as a dependency and use inside your task-creating objects.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fTasks%2fScheduling%2fIScheduledTaskHandler.cs" target="_blank"&gt;&lt;strong&gt;IScheduledTaskHandler&lt;/strong&gt;&lt;/a&gt; &amp;ndash; defines the processing logic for your custom defined scheduled tasks (look at &lt;em&gt;Orchard.PublishLater &lt;/em&gt;module&lt;em&gt;&amp;nbsp;&lt;/em&gt;for &lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard.Web%2fModules%2fOrchard.PublishLater%2fHandlers%2fPublishingTaskHandler.cs" target="_blank"&gt;example&lt;/a&gt;).&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;&lt;span style="font-weight: bold;"&gt;Data storage&lt;/span&gt;&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://orchard.codeplex.com/SourceControl/changeset/view/fe55d6737a3e#src%2fOrchard%2fData%2fIRepository.cs" target="_blank"&gt;&lt;strong&gt;IRepository&amp;lt;T&amp;gt;&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt; &amp;ndash; &lt;/strong&gt;defines the interface for data storage. By default Orchard&amp;nbsp;uses &lt;em&gt;NHibernate&lt;/em&gt; to store items in the DB, but you are free to define your own storage logic&amp;nbsp;for specific items. Just implement this interface for the&amp;nbsp;object type&amp;nbsp;you'd like to store an it will override the default one.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Orchard delivers a &lt;span style="text-decoration: underline;"&gt;lot&lt;/span&gt; more extension points you can make use of. I tried to describe the ones I found the most useful. If you found some other useful ones not described here, fell free to post the info about them in comments &amp;ndash; I&amp;rsquo;ll update the list above.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;If the list becomes full enough &amp;ndash; I&amp;rsquo;ll make an effort to place it in the &lt;a href="http://orchardproject.net/docs/" target="_blank"&gt;official documentation&lt;/a&gt;&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Orchard-common-extension-points_EF3C/wlEmoticon-smile_2.png" /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=hI432e0IoRA:EdxEgx47FqQ:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=hI432e0IoRA:EdxEgx47FqQ:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=hI432e0IoRA:EdxEgx47FqQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=hI432e0IoRA:EdxEgx47FqQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=hI432e0IoRA:EdxEgx47FqQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=hI432e0IoRA:EdxEgx47FqQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/hI432e0IoRA" height="1" width="1"/&gt;</description><pubDate>Fri, 25 Feb 2011 13:00:38 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/most-useful-orchard-extension-points</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/most-useful-orchard-extension-points</feedburner:origLink></item><item><title>Connect to SQL Server using domain account from remote machine</title><link>http://feedproxy.google.com/~r/pszmyd/~3/Mrk6Sqz_2Xo/connect-to-sql-server-using-domain-account-from-remote-machine</link><description>&lt;p&gt;As most of production databases don&amp;rsquo;t use the SQL Server integrated logon and leverage the existing AD domain accounts instead, there exists an issue with connecting to them from outside the domain. &lt;strong&gt;Unfortunately SSMS do not allow you to specify the domain account used in the connection directly (only SQL or Windows Integrated authentication are the options). &lt;/strong&gt;It means that you can&amp;rsquo;t access such DB directly eg. when connecting to corporate VPN network from your own laptop&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-annoyed" alt="Irytacja" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Run-SQL-Server-2008-Management-Studio_E880/wlEmoticon-annoyed_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not keen on RDPing to the DB server every time to make a bunch of queries, so I found this workaround&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Run-SQL-Server-2008-Management-Studio_E880/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;From the command line you can specify the account that will be impersonated in all network-related communication of a given executable:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;runas /netonly /user:DOMAIN\account "&amp;lt;path to your exe&amp;gt;"&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Cool!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-openmouthedsmile" alt="Szeroki uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Run-SQL-Server-2008-Management-Studio_E880/wlEmoticon-openmouthedsmile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;So to impersonate your domain account when using SSMS simply write:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;runas /netonly /user:DOMAIN\account &amp;ldquo;C:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Ssms.exe&amp;rdquo;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll be asked for domain password and&amp;hellip; That&amp;rsquo;s it! Choose &amp;ldquo;Windows Integrated&amp;rdquo; in SSMS connection screen and you can work with your DB from outside!&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/Run-SQL-Server-2008-Management-Studio_E880/wlEmoticon-smile_2.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Remember the /netonly switch &amp;ndash; it ensures that the account provided will be used in the network-related stuff only. It won&amp;rsquo;t work without supplying it, though.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http%3a%2f%2fwww.szmyd.com.pl%2fblog%2fconnect-to-sql-server-using-domain-account-from-remote-machine%3fsms_ss%3ddotnetkicks"&gt;&lt;img border="0" alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http%3a%2f%2fwww.szmyd.com.pl%2fblog%2fconnect-to-sql-server-using-domain-account-from-remote-machine%3fsms_ss%3ddotnetkicks%26border%3DEEEEEE%26bgcolor%3D0066CC%26cbgcolor%3DFFFFCC" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=Mrk6Sqz_2Xo:okgmOERh2tY:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=Mrk6Sqz_2Xo:okgmOERh2tY:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=Mrk6Sqz_2Xo:okgmOERh2tY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=Mrk6Sqz_2Xo:okgmOERh2tY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=Mrk6Sqz_2Xo:okgmOERh2tY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=Mrk6Sqz_2Xo:okgmOERh2tY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/Mrk6Sqz_2Xo" height="1" width="1"/&gt;</description><pubDate>Wed, 23 Feb 2011 15:41:47 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/connect-to-sql-server-using-domain-account-from-remote-machine</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/connect-to-sql-server-using-domain-account-from-remote-machine</feedburner:origLink></item><item><title>How to assign default role(s) to new user in Orchard</title><link>http://feedproxy.google.com/~r/pszmyd/~3/ZWnNzh5chZ0/how-to-assign-default-role-s-to-new-user-in-orchard</link><description>&lt;p&gt;This is a commonly asked question. Orchard, by default, assigns no explicit roles to the newly created user&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-sadsmile" alt="Smutek" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/9f9dd36ef28a_132DA/wlEmoticon-sadsmile_2.png" /&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Every authenticated user has the &lt;strong&gt;Authenticated &lt;/strong&gt;role, which is attached to the user object at runtime (it&amp;rsquo;s hardcoded, so you won&amp;rsquo;t find the user role in DB). Although adding necessary permissions to this role can suit most needs, sometimes you may need &lt;strong&gt;to explicitly add some other roles&lt;/strong&gt;, possibly different, based on some set of rules, etc. In other words &amp;ndash; sometimes there is some custom logic involved, which makes the default behavior unsuitable.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;In such case the admin action is needed after user creation&amp;hellip; It&amp;rsquo;s not the preferred option, though, especially when you have lots of users&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-annoyed" alt="Irytacja" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/9f9dd36ef28a_132DA/wlEmoticon-annoyed_2.png" /&gt;. The best way would be to do this automatically, so the user gets assigned one (or more) defined roles after registration. How to do that?&lt;/p&gt;
&lt;p&gt;This can be achieved in&amp;nbsp;two ways:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;By implementing the &lt;strong&gt;IUserEventHandler&lt;/strong&gt; interface (from &lt;em&gt;Orchard.Users.Events&lt;/em&gt;) and handling the role-adding logic in &lt;strong&gt;Created&lt;/strong&gt; method&lt;/li&gt;
&lt;li&gt;By hooking to &lt;strong&gt;OnCreated&amp;lt;UserPart&amp;gt;()&lt;/strong&gt; event in one of your &lt;strong&gt;ContentHandler&lt;/strong&gt;s, and handling the role-adding logic inside.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;em&gt;Assigning the role to the user is a bit tricky, as there is no such thing as RolePart, which you can easily query for. Also, there is neither any collection property on User object which you could add your role to, nor any method for assigning roles in IAuthorizationService&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-annoyed" alt="Irytacja" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/9f9dd36ef28a_132DA/wlEmoticon-annoyed_2.png" /&gt;&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;&lt;span style="font-weight: bold;"&gt;Assigning role via IUserEventHandler&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;In this example we&amp;rsquo;re assigning the Administrator role to created user (&lt;em&gt;not necessarily the best&lt;/em&gt; &lt;em&gt;option though&lt;/em&gt;&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-winkingsmile" alt="Puszczam oczko" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/9f9dd36ef28a_132DA/wlEmoticon-winkingsmile_2.png" /&gt;):&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="color: blue;"&gt;public class &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;DefaultRolesHandler &lt;/span&gt;: &lt;span style="color: #2b91af;"&gt;IUserEventHandler &lt;/span&gt;{
    &lt;span style="color: blue;"&gt;private readonly &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IRepository&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;UserRolesPartRecord&lt;/span&gt;&amp;gt; _userRolesRepository;
    &lt;span style="color: blue;"&gt;private readonly &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IRoleService &lt;/span&gt;_roleService;
    &lt;span style="color: blue;"&gt;private readonly &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;IOrchardServices &lt;/span&gt;_services;

    &lt;span style="color: blue;"&gt;public &lt;/span&gt;DefaultRolesHandler(
        &lt;span style="color: #2b91af;"&gt;IRepository&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;UserRolesPartRecord&lt;/span&gt;&amp;gt; userRolesRepository,
        &lt;span style="color: #2b91af;"&gt;IRoleService &lt;/span&gt;roleService,
        &lt;span style="color: #2b91af;"&gt;IOrchardServices &lt;/span&gt;services)
    {
        _userRolesRepository = userRolesRepository;
        _roleService = roleService;
        _services = services;
    }

    &lt;span style="color: blue;"&gt;#region &lt;/span&gt;Implementation of IUserEventHandler

    &lt;span style="color: gray;"&gt;/// &amp;lt;summary&amp;gt; /// &lt;/span&gt;&lt;span style="color: green;"&gt;Called before a User is created &lt;/span&gt;&lt;span style="color: gray;"&gt;/// &amp;lt;/summary&amp;gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;public void &lt;/span&gt;Creating(&lt;span style="color: #2b91af;"&gt;UserContext &lt;/span&gt;context)
    {
    }

    &lt;span style="color: gray;"&gt;/// &amp;lt;summary&amp;gt; /// &lt;/span&gt;&lt;span style="color: green;"&gt;Called once a user has been created &lt;/span&gt;&lt;span style="color: gray;"&gt;/// &amp;lt;/summary&amp;gt; &lt;/span&gt;&lt;span style="color: blue;"&gt;public void &lt;/span&gt;Created(&lt;span style="color: #2b91af;"&gt;UserContext &lt;/span&gt;context)
    {
        &lt;span style="color: blue;"&gt;var &lt;/span&gt;role = _roleService.GetRoleByName(&lt;span style="color: #a31515;"&gt;"Administrator"&lt;/span&gt;);
        &lt;span style="color: blue;"&gt;if &lt;/span&gt;(role != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)
        {
            _userRolesRepository.Create(
                &lt;span style="color: blue;"&gt;new &lt;/span&gt;&lt;span style="color: #2b91af;"&gt;UserRolesPartRecord &lt;/span&gt;{
                    UserId = context.User.As&amp;lt;&lt;span style="color: #2b91af;"&gt;IUser&lt;/span&gt;&amp;gt;().Id,
                    Role = role
                });
        }
    }
    &lt;span style="color: blue;"&gt;#endregion &lt;/span&gt;}&lt;/pre&gt;
&lt;p&gt;&lt;span&gt;As shown above, we have to use the repository of &lt;strong&gt;UserRolePartRecord&lt;/strong&gt; directly to create an appropriate &lt;em&gt;User-Role relation&lt;/em&gt; record. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;IRoleService&lt;/strong&gt; is a wrapper around the Role repository for CRUD operations on roles. It comes with some useful methods (e.g.. &lt;strong&gt;GetRoleByName&lt;/strong&gt; for fetching roles by name, used above).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;We&amp;rsquo;re done!&lt;/strong&gt;&lt;img style="border-style: none;" class="wlEmoticon wlEmoticon-smile" alt="Uśmiech" src="http://www.szmyd.com.pl/Media/BlogPs/Windows-Live-Writer/9f9dd36ef28a_132DA/wlEmoticon-smile_2.png" /&gt; Now, if a user account gets created in our Orchard app, it will be assigned the Administrator role instantly.&lt;/p&gt;
&lt;h2&gt;&lt;span style="font-weight: bold;"&gt;Assigning role via ContentHandler&amp;rsquo;s OnCreated method&lt;/span&gt;&lt;/h2&gt;
&lt;p&gt;&lt;span&gt;For the sake of brevity, I&amp;rsquo;ll omit the code for achieving this, as it&amp;rsquo;s almost identical to shown above. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The only difference is, that we place the code for attaching the role inside &lt;strong&gt;OnCreated&amp;lt;UserPart&amp;gt;((ctx, part) =&amp;gt; { &amp;lt;code_goes_here&amp;gt; }) &lt;/strong&gt;method in one of your content handlers instead of the Created method of IUserEventHandler.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Hope you found this useful!&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Cheers!&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=ZWnNzh5chZ0:TEBrhAw9OGE:bcOpcFrp8Mo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=bcOpcFrp8Mo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=ZWnNzh5chZ0:TEBrhAw9OGE:qj6IDK7rITs"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?d=qj6IDK7rITs" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=ZWnNzh5chZ0:TEBrhAw9OGE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=ZWnNzh5chZ0:TEBrhAw9OGE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/pszmyd?a=ZWnNzh5chZ0:TEBrhAw9OGE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/pszmyd?i=ZWnNzh5chZ0:TEBrhAw9OGE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/pszmyd/~4/ZWnNzh5chZ0" height="1" width="1"/&gt;</description><pubDate>Sun, 20 Feb 2011 22:31:37 GMT</pubDate><guid isPermaLink="false">http://www.szmyd.com.pl:80/blog/how-to-assign-default-role-s-to-new-user-in-orchard</guid><feedburner:origLink>http://www.szmyd.com.pl:80/blog/how-to-assign-default-role-s-to-new-user-in-orchard</feedburner:origLink></item></channel></rss>

