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

<channel>
	<title>Fredrik Haglund's blog &#187; EPiServer CMS</title>
	<atom:link href="http://blog.fredrikhaglund.se/blog/tag/episerver-cms/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.fredrikhaglund.se</link>
	<description>Chatter about EPiServer, ASP.NET, CSS and Web Development.</description>
	<lastBuildDate>Tue, 28 Jun 2011 13:37:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>New stuff in EPiServer CMS 6 R2</title>
		<link>http://blog.fredrikhaglund.se/blog/2011/03/22/new-stuff-in-episerver-cms-6-r2/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2011/03/22/new-stuff-in-episerver-cms-6-r2/#comments</comments>
		<pubDate>Tue, 22 Mar 2011 17:42:22 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer CMS]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2011/03/22/new-stuff-in-episerver-cms-6-r2/</guid>
		<description><![CDATA[I like to dig around and here are a few things I did notice in the upcoming EPiServer CMS 6 R2 release. Visitor Groups and personalized content On Page Edit is cross browser compatible (not only available for IE) New AutoSaveRepository to handle drafts unsaved pages. New InUseNotificationRepository used to warn editors that someone is [...]]]></description>
			<content:encoded><![CDATA[<p>I like to dig around and here are a few things I did notice in the upcoming EPiServer CMS 6 R2 release.</p>
<ul>
<li>Visitor Groups and personalized content</li>
<li>On Page Edit is cross browser compatible (not only available for IE) </li>
<li>New <em>AutoSaveRepository</em> to handle drafts unsaved pages.</li>
<li>New <em>InUseNotificationRepository</em> used to warn editors that someone is working with a page.</li>
<li>Much easier to create and register Dynamic Content as a developer and an editor can change values easier and preview it.</li>
</ul>
<p>And a few smaller things&#8230;</p>
<ul>
<li>New namespace <strong><em>EPiServer.Framework.CssParsing</em></strong> and <em><strong>EPiServer.Framework.HtmlParsing</strong></em> with public classes.</li>
<li>new <strong><em>Geolocation</em></strong> and database in <em>EPiServer.Framework.Personalization</em></li>
<li><strong>Virtual Roles</strong> moved to <em>EPiServer.Framework</em></li>
<li>EPiServer’s <em>InitializationModule</em> will forward HttpModule initialization and the HttpApplication to all modules with both <a href="http://www.aisto.com/roeder/dotnet/Default.aspx?Target=code://EPiServer.Framework:6.2.249.0:8fe83dea738b45b7/EPiServer.Framework.IInitializableModule">IInitializableModule</a> and IInitializableHttpModule interface. An easy way to setup events without having to mess with own http module registration in web.config.</li>
<li>Most methods in <em><strong>UserControlBase</strong></em> are now virtual like in <em>PageBase</em> so you can override them. </li>
<li><em><strong>PageBase</strong></em> now has a <em>GetPage</em> method with language selector parameter. </li>
<li><em>Dope</em> is obsolete and renamed to <em>OnPageEdit</em> <img src='http://blog.fredrikhaglund.se/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </li>
<li><em><strong>DataFactory.Copy</strong></em> is now delegated to an interface (<em>IPageCopyHandler</em>) so you can override the behavior </li>
<li>New method <em><strong>DataFactory.GetPages</strong>(IList&lt;PageReference&gt; pageLinks, ILanguageSelector selector)</em> </li>
<li><em>UrlRewriteEventArgs</em> used by <strong><em>UrlRewriterModule</em></strong> has a new property <em>ForceRewriteHtml</em> that overrides the existing <em>Cancel</em> property. </li>
<li>New interface IPermanentLinkMapper exposed on UrlRewriteProvider that can be used instead of accessing PermanentLinkMapStore class directly. </li>
<li>Several new nice extension methods for <em><strong>FindControl</strong></em> (typed and recursively) in <em>EPiServer.Web.ControlExtensions</em>. </li>
<li><strong><em>PropertyDataControl</em></strong> has a new property <strong><em>CustomTagName</em></strong> that change rendering in view mode from a <em>Label</em> using span to a <em>HtmlControl</em> with the tag specified in <em>CustomTagName</em> and creating child controls in view mode is controlled with virtual method <em>ShouldCreateDefaultControls.</em> </li>
<li><strong><u>PropertyDataControl</u></strong> has a new <strong><em>CopyWebAttributes</em></strong> method that supports <em>HtmlControls</em> and not only <em>WebControls</em>. </li>
<li><em>MultipleOptionsListSettings </em>is a new settings class with UI to enter name and value pairs used by the new properties <strong><em>PropertyCheckBoxList</em></strong> and <strong><em>PropertyDropDownList</em></strong>. </li>
<li>You can now set default language for a site in <em>EPiServerFramwork.config</em> and get the value with <em>ContentLanguage.GetDefaultHostLanguage()</em>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">add </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">*</span>&quot; <span style="color: red">language</span><span style="color: blue">=</span>&quot;<span style="color: blue">en</span>&quot; <span style="color: blue">/&gt;</span></pre>
</li>
<li>New filter: <strong><em>FilterReplacementLanguage</em></strong></li>
<li><em>TinyMCE</em> editor is initialized using the new <strong><em>CssParser</em></strong> that extract styles from editor css files like the old editor. The name of the style is extracted from the dummy css attribute <em>EditMenuName</em> like in earlier but since this is done server side it can be translated (below <em>editorstyleoptions</em> node). <a href="http://world.episerver.com/Blogs/Linus-Ekstrom/Dates/2011/3/Improvements-in-TinyMCE-in-EPiServer-CMS-6-R2/">Read more in Linus blog post</a></li>
<li><strong><em>DynamicContentPlugInAttribute</em></strong> can be used to register Dynamic Content without messing with <em>web.config</em>. Use <em>ViewUrl</em> parameter for User Controls can be used to register user controls.</li>
<li>New namespace <strong><em>EPiServer.Core.Html.StringParsing</em></strong> with public classes that handles the different elements of rich text (static text, url, dynamic content, vistor group content)</li>
<li><strong><em>LanguageSelector</em></strong> and related classes are refactored (and probably works better but different). <a href="http://world.episerver.com/Blogs/Linus-Ekstrom/Dates/2011/3/Changes-to-the-EPiServer-CMS-Globalization/">Read more in a blog post from Linus</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2011/03/22/new-stuff-in-episerver-cms-6-r2/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to fix alphabetic sorting of pages in EPiServer</title>
		<link>http://blog.fredrikhaglund.se/blog/2010/04/15/how-to-fix-alphabetic-sorting-of-pages-in-episerver/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2010/04/15/how-to-fix-alphabetic-sorting-of-pages-in-episerver/#comments</comments>
		<pubDate>Thu, 15 Apr 2010 09:14:20 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Collation]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[FilterSort]]></category>
		<category><![CDATA[FinishedLoadingChildren]]></category>
		<category><![CDATA[GetChildren]]></category>
		<category><![CDATA[PeerOrderRule]]></category>
		<category><![CDATA[Sort Order]]></category>
		<category><![CDATA[tblPageLanguage]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2010/04/15/how-to-fix-alphabetic-sorting-of-pages-in-episerver/</guid>
		<description><![CDATA[Update: Do not try to change collation order in the database! Use this approach instead to sort pages in the page tree in EPiServer CMS 5. I recently got the question how to fix the incorrect alphabetic sorting of child pages in EPiServer. It is usually Scandinavian users complaining that Å, Ä and Ö are sorted [...]]]></description>
			<content:encoded><![CDATA[<div><strong><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2010/04/image2.png"><img style="margin: 0px 0px 0px 10px; display: inline; border-width: 0px;" title="image" src="http://blog.fredrikhaglund.se/wp-content/uploads/2010/04/image_thumb2.png" border="0" alt="image" width="244" height="112" align="right" /></a>Update: <a href="http://blog.fredrikhaglund.se/blog/2010/10/11/fix-alphabetic-sorting-of-pages-in-episerver-cms-5/">Do not try to change collation order in the database! Use this approach instead to sort pages in the page tree in EPiServer CMS 5</a>.</strong></div>
<div>I recently got the question how to fix the incorrect alphabetic sorting of child pages in EPiServer. It is usually Scandinavian users complaining that Å, Ä and Ö are sorted together with A and O instead of being at the end of the list.</div>
<h3>Sort order: Alphabetical</h3>
<div>When you specify the sort order of child pages your selection is stored in the database (<em>tblPage.PeerOrderRule</em>) and is shared for all language branches.</div>
<div>When you use <em>GetChildren()</em> it calls a stored procedure called <em>netPageLinkList </em>that returns the children ordered differently depending on the selection. Sorting is done in the database.</div>
<h3><del>Easy Solution To Child Page Sort Order in EPiServer</del></h3>
<div>
<div><del></del></div>
<div><del></del></div>
<p><del></p>
<div>1) Easiest way to fix sorting is to change the Collation order of the Name column in the <em>tblPageLanguage</em> table.</div>
<p></del></p>
<div><del><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2010/04/image3.png"><img style="display: block; float: none; margin-left: auto; margin-right: auto; border-width: 0px;" title="image" src="http://blog.fredrikhaglund.se/wp-content/uploads/2010/04/image_thumb3.png" border="0" alt="image" width="500" height="321" /></a></del></div>
<h3>different sort order depending on the current culture</h3>
<div>The easy solution only allows one common sort order for the entire database and that might not be good enough for multi lingual sites.</div>
<div>2) You can solve this for the whole site by hooking the event <em>DataFactory.FinishedLoadingChildren</em> and resorting the pages. Remember that this event is called every time you call <em>GetChildren()</em> and the result is not cached.</div>
<div>3) Another way is to solve it locally is to use the FilterSort class on you PageDataCollection or setting the SortOrder property on you PageList.</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2010/04/15/how-to-fix-alphabetic-sorting-of-pages-in-episerver/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>EPiServer &#8211; Security and Access Control (1/2)</title>
		<link>http://blog.fredrikhaglund.se/blog/2010/03/08/episerver-security-and-access-control-12/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2010/03/08/episerver-security-and-access-control-12/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 07:15:00 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[Security]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2010/03/08/episerver-security-and-access-control-12/</guid>
		<description><![CDATA[EPiServer CMS is using the standard methods in ASP.NET to handle authentication and authorization. On top of this they have added a few providers to handle authentication and access control to EPiServer assets like pages and files uploaded by editors. Make sure that you read up on how the authentication, location and authorization-tags works in [...]]]></description>
			<content:encoded><![CDATA[<p>EPiServer CMS is using the standard methods in ASP.NET to handle authentication and authorization. On top of this they have added a few providers to handle authentication and access control to EPiServer assets like pages and files uploaded by editors.</p>
<p><strong>Make sure that you read up on how the authentication, location and authorization-tags works in <em>web.config</em> before you try to understand security in EPiServer CMS.</strong></p>
<h3>Check list for ASP.NET security</h3>
<ul>
<li><strong>MachineKey</strong> – Always add a machinekey-tag to your <em>web.config</em>-file. Use this <a href="http://www.orcsweb.com/articles/aspnetmachinekey.aspx" target="_blank">online tool to generate the MachineKey</a>. </li>
<li><strong>Authentication</strong> – I almost always use ASP.NET Forms authentication because it gives you the most flexibility. This is all you need and I always set timeout high to get the “Remember Me”-checkbox to work as expected. Sometimes I also use the <em>defaultUrl</em>-attribute to control what happens after login.
<pre><code>&lt;authentication mode=&quot;Forms&quot;&gt;
  &lt;forms loginUrl=&quot;Util/login.aspx&quot; defaultUrl=&quot;/&quot;
    timeout=&quot;<strong>129600</strong>&quot; /&gt;
&lt;/authentication&gt;</code></pre>
</li>
<li><strong>Membership</strong> and <strong>RoleProvider</strong> – Configures how a username and password is validated and how to retrieve what groups a user is a member of. </li>
<li><strong>Authorization</strong> – EPiServer uses authorization tags together with location tags to control access to physical folders like the EPiServer user interface. </li>
</ul>
<h3>Select Security PROVIDERS</h3>
<p>Select the right providers for your site:</p>
<ul>
<li><strong>SqlMembershipProvider</strong> and <strong>SqlRoleProvider</strong> from Microsoft stores username, password and group membership in a SQL database. EPiServer is preconfigured with the needed tables so you can just start using them by changing <em>defaultProvider</em>-attribute.</li>
<li><strong>WindowsMembershipProvider</strong> and <strong>WindowsRoleProvider</strong> from EPiServer enabled forms login but with windows credentials. This is the default provider for a new installation. A big limitation if an editor needs to work with Access Control is that Window Users and Groups are only synchronized when a user log on. So it is not possible to add rights to a user before it has logged in at least one time and the security admin tool shows cached data for who is a member of a group.</li>
<li><strong>ActiveDirectoryMembershipProvider</strong> from Microsoft and <strong>ActiveDirectoryRoleProvider</strong> from EPiServer. Tries to workaround the problem with cached Users and Groups by talking directly to the Active Directory. I have personally have had a lot of issues with exceptions from the Active Directory providers and trouble to get it to work in a DMZ. They are also sensitive to interruptions if the LDAP server is not available. I recommend to use WindowsMembershipProvider if possible since it also uses the local machine as a cache.</li>
<li><strong>MultiplexingMembershipProvider</strong> and <strong>MultiplexingRoleProvider</strong> from EPiServer forwards the requests to a list of providers and this enables you to combine both SQL and Windows accounts.</li>
</ul>
<h3>TIPS – IF you Can not login with your Windows Account</h3>
<p>EPiServer <strong>WindowsMembershipProvider</strong> does not work if you try to login with a domain account but do your machine does not have a working connection to your Domain Controler. </p>
<p>Workaround by creating a local account that is a member of the local administrators group.</p>
<h3>Tips – Use a local group to optimize and handle Groups in groups </h3>
<p>EPiServer <strong>WindowsRoleProvider</strong> uses queries that only retrieve a list of groups you are a member of directly. It does not discover if you indirectly are a member of group through another group.</p>
<p>This is quite annoying and and AD-admin get something sad in their eyes if you suggest that you should not use groups in groups.</p>
<p>Workaround this by creating a local group on the web server and add the AD group that is using groups in groups. <strong>WindowsRoleProvider</strong> will see that you are a direct member of the local group. </p>
<p>This technique can also be useful if a lot of different AD-groups should have the same access in EPiServer. The reason is that EPiServer stores one row in a table for each access control entry for each EPiServer page and directory in VPP. </p>
<p>It could simplify your web.config if you do not have to maintain a long list group names for edit and admin mode access. (EPiServer 6 has a new feature that takes care of this.)</p>
<h3>Break in to an EPiServer site </h3>
<p>Forgot the password? Only got ftp-access? Do not worry, as long as you have the right to change web.config you can always break in!</p>
<p>You need to comment out all “&lt;deny users=&quot;*&quot; /&gt;” in web.config and then it is possible to access edit and admin mode without authentication.</p>
<p>I suggest that you reset your password or create a new account in admin mode and turn on security as fast as possible!</p>
<p>Notice that you must login to be able to edit pages.</p>
<h3>Access Rights for pages and uploaded files</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2010/02/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="image" border="0" alt="image" align="right" src="http://blog.fredrikhaglund.se/wp-content/uploads/2010/02/image_thumb.png" width="244" height="145" /></a> EPiServer has the following Access Rights that can be set per page. You can also set access right for files in the File Manager. </p>
<ul>
<li><strong>Read</strong> – Let’s you see the page or download the file.</li>
<li><strong>Create</strong> – Allows you to create child pages that will inherit the same ACL as the parent, upload new files or create directories.</li>
<li><strong>Change</strong> – Allows you to save a new version of a page and mark it ready to publish. You can also check in a new version of an existing files.</li>
<li><strong>Delete</strong> – Allows you to move a page to the wastebasket or delete it permanently. You can delete files and directories.</li>
<li><strong>Publish</strong> – Allows you to change and publish pages. Not applicable on files.</li>
<li><strong>Administer</strong> – Allows you to change the ACL for this page or directory as an editor and change dynamic properties on this page (and indirectly all children)</li>
</ul>
<p>Users with access to admin mode can always change access control lists and do not need Administer right.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2010/02/image1.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; margin-left: 0px; border-top: 0px; margin-right: 0px; border-right: 0px" title="image" border="0" alt="image" align="left" src="http://blog.fredrikhaglund.se/wp-content/uploads/2010/02/image_thumb1.png" width="240" height="190" /></a>Notice that you can only set Access Rights per directory and not on individual files.</p>
<p>Page Files are special. Each page can have its own page folder and files uploaded to this directory have the same availability as the page. So if the page is not publish – no one can access the files in the page folder except editors. Very convenient since scheduled publishing also affects the files! </p>
</p>
<p>The same happens when the page is moved to the waste basket. No one can access the files in the page folder than editors. This is a common cause for broken images and links to document when editors copy and paste pages. If you delete the original page, no one can access the images its page folder!</p>
<h3>Tips for Access Right configuration</h3>
<p>If you follow these guidelines it will be much easier to administer access.</p>
<ul>
<li>Avoid giving users access rights directly. Always add roles (groups) and make users members of these instead.</li>
<li>Never give WebEditors group any access rights (except on small sites where you are not going to use Access Rights at all). This roles is intended as a master switch if you have access to edit mode or not.</li>
<li>Give the virtual role “Creator” the right to change and delete pages if you setup a site with writers and an editors-in-chief that publish pages. It will save a lot of maintenance work when writers makes mistakes. </li>
<li>Using role names with both location and role will simplify when you administer who is a member of what, i.e. pressrelease_writer, pressrelease_publisher, startpage_editor, article_writer, blog_admin</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2010/03/08/episerver-security-and-access-control-12/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Tool to re-index all EPiServer pages</title>
		<link>http://blog.fredrikhaglund.se/blog/2010/02/19/tool-to-re-index-all-episerver-pages/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2010/02/19/tool-to-re-index-all-episerver-pages/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 18:19:55 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[LazyIndexer]]></category>
		<category><![CDATA[SoftLink]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2010/02/19/tool-to-re-index-all-episerver-pages/</guid>
		<description><![CDATA[You get a warning when you try to delete a file or EPiServer page if it is referenced form another page. EPiServer uses EPiServer.DataAbstraction.SoftLink for this feature and all links to files, other EPiServer pages and external urls are stored here every time you publish a page. It is also worth to notice that EPiServer [...]]]></description>
			<content:encoded><![CDATA[<p>You get a warning when you try to delete a file or EPiServer page if it is referenced form another page.</p>
<p>EPiServer uses <em>EPiServer.DataAbstraction.SoftLink</em> for this feature and all links to files, other EPiServer pages and external urls are stored here every time you publish a page.</p>
<p>It is also worth to notice that EPiServer built-in keyword table that is used for text searching pages also is updated during publish.</p>
<h3>Corrupt data = Broken Links</h3>
<p>The index can be corrupt or out of sync and then it is <strong>possible to delete a file or a page without getting a warning that it has incoming links</strong>. Text search can also fail or return wrong data.</p>
<p>I have seen this very often after a migration from EPiServer CMS 4. EPiServer CMS 4 databases tends to have really poor data for soft links.</p>
<p>The index is updated when you publish a page with a delay controled by <em>indexingDelayAfterPublish</em> setting. If the delay it is very large and the application restarts before the page is indexed, neither soft links or keywords will be updated.</p>
<h3>How to repair EPiServer CMS soft link and keyword index</h3>
<p>I have created an admin tool that we always run after migration from EPiServer 4 and also if we want to repair the index if the settings has been strange.</p>
<p>You sould set <em>indexingDelayAfterPublish</em> to a very large delay during the time you run the tool because if you try to use <em>LaxyIndexer.IndexPage()</em> in more than one thread at the same time you are guaranteed to get deadlocks or get other strange SQL exceptions sooner or later.</p>
<blockquote><p>System.Data.SqlClient.SqlException:Violation of PRIMARY KEY constraint &#8216;PK_tblPageKeyword&#8217;. Cannot insert duplicate key in object &#8216;dbo.tblPageKeyword&#8217;.</p>
</blockquote>
<h3>Example code</h3>
<pre class="code">[GuiPlugIn(DisplayName = <span style="color: #a31515">&quot;Reindex pages&quot;</span>, Description = <span style="color: #a31515">&quot;Tool to index keywords and soft links&quot;</span>, Area = PlugInArea.AdminMenu, Url = <span style="color: #a31515">&quot;~/Common/FixIndexing.aspx&quot;</span>)]
<span style="color: blue">public partial class </span><span style="color: #2b91af">FixIndexing </span>: System.Web.UI.Page
{
    <span style="color: blue">private static readonly </span>ILog log;
    <span style="color: blue">private static long </span>QueueLength;
    <span style="color: blue">private static long </span>IndexedPages;
    <span style="color: blue">private static </span><span style="color: #2b91af">DateTime </span>Started = <span style="color: #2b91af">DateTime</span>.MinValue;
    <span style="color: blue">private static readonly </span>Queue&lt;PageData&gt; Queue = <span style="color: blue">new </span>Queue&lt;PageData&gt;();
    <span style="color: blue">private static object </span>LockRoot = <span style="color: blue">new object</span>();

    <span style="color: blue">static </span>FixIndexing()
    {
        log = LogManager.GetLogger(<span style="color: blue">typeof</span>(FixIndexing));
    }

    <span style="color: blue">protected override void </span>OnLoad(<span style="color: #2b91af">EventArgs </span>e)
    {
        <span style="color: blue">base</span>.OnLoad(e);
        UpdateStatus();
    }

    <span style="color: blue">private void </span>UpdateStatus()
    {
        <span style="color: blue">long </span>q = <span style="color: #2b91af">Interlocked</span>.Read(<span style="color: blue">ref </span>QueueLength);
        <span style="color: blue">long </span>n = <span style="color: #2b91af">Interlocked</span>.Read(<span style="color: blue">ref </span>IndexedPages);
        <span style="color: blue">if </span>(Started != <span style="color: #2b91af">DateTime</span>.MinValue)
        {
            StatusLabel.Text = <span style="color: blue">string</span>.Format(<span style="color: #a31515">&quot;Started: {0}  Indexed pages: {1}  Queue: {2}&quot;</span>, Started, n, q);
        }
        FixPageSoftLinkButton.Enabled = q &lt;= 0;
    }

    <span style="color: blue">protected void </span>FixPageSoftLinkButton_Click(<span style="color: blue">object </span>sender, <span style="color: #2b91af">EventArgs </span>e)
    {
        log.Info(<span style="color: #a31515">&quot;Start LazyIndex of all pages!&quot;</span>);
        Started = <span style="color: #2b91af">DateTime</span>.Now;
        <span style="color: #2b91af">ThreadPool</span>.QueueUserWorkItem(ThreadProc);
        UpdateStatus();
    }

    <span style="color: green">// This thread procedure performs the task.
    </span><span style="color: blue">static void </span>ThreadProc(<span style="color: #2b91af">Object </span>stateInfo)
    {
        <span style="color: blue">if </span>(!<span style="color: #2b91af">Monitor</span>.TryEnter(LockRoot)) <span style="color: blue">return</span>; <span style="color: green">//Job was already running
        </span><span style="color: blue">try
        </span>{
            IndexedPages = 0;
            PageData page;
            Queue.Enqueue(DataFactory.Instance.GetPage(PageReference.RootPage, LanguageSelector.MasterLanguage()));
            <span style="color: #2b91af">Interlocked</span>.Increment(<span style="color: blue">ref </span>QueueLength);
            <span style="color: blue">while </span>((page = Queue.Dequeue()) != <span style="color: blue">null</span>)
            {
                <span style="color: #2b91af">Interlocked</span>.Decrement(<span style="color: blue">ref </span>QueueLength);
                <span style="color: blue">try
                </span>{
                    log.Debug(<span style="color: blue">string</span>.Format(<span style="color: #a31515">&quot;Indexing page {0}:{1}...&quot;</span>, page.PageLink.ID, page.PageName));
                    LazyIndexer.IndexPage(page.PageLink.ID);
                    <span style="color: #2b91af">Interlocked</span>.Increment(<span style="color: blue">ref </span>IndexedPages);
                }
                <span style="color: blue">catch </span>(<span style="color: #2b91af">Exception </span>ex)
                {
                    <span style="color: blue">int </span>id = (stateInfo <span style="color: blue">as </span>PageData) != <span style="color: blue">null </span>? ((PageData)stateInfo).PageLink.ID : -1;
                    log.Error(<span style="color: blue">string</span>.Format(<span style="color: #a31515">&quot;Error while indexing {0}&quot;</span>, id), ex);
                }
                <span style="color: blue">try
                </span>{
                    PageDataCollection pages = DataFactory.Instance.GetChildren(page.PageLink, LanguageSelector.MasterLanguage());
                    log.Debug(<span style="color: blue">string</span>.Format(<span style="color: #a31515">&quot;Done indexing page {0}. Adding {1} children to Queue...&quot;</span>, page.PageLink.ID, pages.Count));
                    <span style="color: blue">foreach </span>(PageData data <span style="color: blue">in </span>pages)
                    {
                        Queue.Enqueue(data);
                        <span style="color: #2b91af">Interlocked</span>.Increment(<span style="color: blue">ref </span>QueueLength);
                    }
                }
                <span style="color: blue">catch </span>(<span style="color: #2b91af">Exception </span>ex)
                {
                    <span style="color: blue">int </span>id = (stateInfo <span style="color: blue">as </span>PageData) != <span style="color: blue">null </span>? ((PageData)stateInfo).PageLink.ID : -1;
                    log.Error(<span style="color: blue">string</span>.Format(<span style="color: #a31515">&quot;Error while adding children for {0}&quot;</span>, id), ex);
                }

            }
        }
        <span style="color: blue">finally
        </span>{
            <span style="color: #2b91af">Monitor</span>.Exit(LockRoot);
        }

    }

}</pre>
<h3>Index as Scheduled task</h3>
<p>Another way to use the code above is to just add an <em>Execute()</em> method that calls <em>ThreadProc</em> and register it as a Scheduled Job plug-in. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2010/02/19/tool-to-re-index-all-episerver-pages/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>How to get started developing with EPiServer CMS</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/12/23/how-to-get-started-developing-with-episerver-cms/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/12/23/how-to-get-started-developing-with-episerver-cms/#comments</comments>
		<pubDate>Wed, 23 Dec 2009 09:00:00 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Beginner]]></category>
		<category><![CDATA[EPiServer CMS]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2009/12/23/how-to-get-started-developing-with-episerver-cms/</guid>
		<description><![CDATA[I got a question in the mail today how to get started with EPiServer CMS as a developer. Here are my tips: Register at world.episerver.com with your work email address. Start by downloading and installing &#34;EPiServer CMS 5 R2 SP2&#34; plus SDK on a machine with Visual Studio 2008 and IIS installed. See the installation [...]]]></description>
			<content:encoded><![CDATA[<p>I got a question in the mail today how to get started with EPiServer CMS as a developer. Here are my tips:</p>
<ul>
<li>Register at <a href="http://world.episerver.com/ " target="_blank">world.episerver.com</a> with your work email address.</li>
<li>Start by <a href="http://world.episerver.com/Download/Categories/Products/EPiServer-CMS/" target="_blank">downloading and installing &quot;EPiServer CMS 5 R2 SP2&quot; plus SDK</a> on a machine with Visual Studio 2008 and IIS installed.
<p>See the installation instructions that are linked on the download page.</li>
<li>You generate demo licenses here: <a href="http://license.episerver.com/" target="_blank">license.episerver.com</a></li>
<li>Learn more in the <a href="http://world.episerver.com/Get-Started/Developing-with-EPiServer-CMS/" target="_blank">Getting-Started</a> section by watching video presentations and reading articles and tutorials.</li>
<li>Take the <a href="http://www.episerver.com/en/Education/Course-Schedule---Developers/" target="_blank">basic developer training for EPiServer CMS (E2550)</a>.</li>
<li>Get certified as EPiServer Developer after you have participated in 2-3 EPiServer projects. Read my <a href="http://blog.fredrikhaglund.se/blog/2008/11/30/how-to-become-a-episerver-ceritified-developer/" target="_blank">certification tips</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/12/23/how-to-get-started-developing-with-episerver-cms/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EPiServer CMS: How to configure Remote Events with many servers and Firewalls between them</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/#comments</comments>
		<pubDate>Tue, 22 Sep 2009 20:40:22 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[enableRemoteEvents]]></category>
		<category><![CDATA[EPiServer 5]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[RemoteEventsBinding]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/</guid>
		<description><![CDATA[The Event Management System in EPiServer CMS 5 is used to propagate information that a page has changed to other web servers connected to the same database. This is very important to setup if you have more than one web server or an enterprise site with several start pages because if it does not invalidate [...]]]></description>
			<content:encoded><![CDATA[<p>The Event Management System in EPiServer CMS 5 is used to propagate information that a page has changed to other web servers connected to the same database. </p>
<p>This is very important to setup if you have more than one web server or an enterprise site with several start pages because if it does not invalidate cache, the other web sites can potentially return old versions of a page!</p>
<h3>Pitfall – Default configuration is using Multicast UDP!</h3>
<p>If you read <a href="http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-5-R2-SP2/Configuring-EPiServer-CMS-5-R2-SP2-Enterprise/">Configuring EPiServer CMS 5 R2 SP2 Enterprise</a> you will learn that all you have to do is to set <code>enableRemoteEvents=&quot;true&quot;</code> in <em>web.config</em>. </p>
<p>It is only mentioned briefly that it is using UDP and you may have to change your firewall settings. Too be more specific the default configuration is using multicast UDP broadcast! Tell this to your network guys and watch their reaction&#8230;</p>
<p>If you look around you will also find a tech note about the <a href="http://world.episerver.com/Documentation/Items/Tech-Notes/EPiServer-CMS-5/EPiServer-CMS-5-R2-SP2/Event-Management-System-Specification/">Event Management System Specification</a> and a FAQ about <a href="http://world.episerver.com/FAQ/Items/Multicast-UDP-not-working/">setting up a server to use TCP protocol</a> but not all clues needed are found there – you have to dig with the reflector to find out the rest.</p>
<h3>Scenario: 4 start pages, 8 Front-end servers IN DMZ and 2 in LAN</h3>
<p>You can change how the Event Management System communicates by changing WCF settings in <em>web.config</em>. It is possible to use TCP instead of UDP and also specify ports to use.</p>
<p>First, the current release (5 R2 SP2) does not support WCF Port Sharing so we need one port opened in the firewall for each start page (that is when you have several <em>siteSettings</em>-tags in web.config).</p>
<p>In our case we need to get four ports (for example port 13000-13003) opened in the firewall for TCP traffic between servers in DMZ and LAN.</p>
<p>Use the sample configuration below as a template to get it to work. In production I suggest using <em>configSource</em>-attribute in <em>web.config</em> to keep the WCF-settings in separate files.</p>
<h4>Web.Config</h4>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">system.serviceModel</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">services </span><span style="color: red">configSource</span><span style="color: blue">=</span>&quot;<span style="color: blue">system.serviceModel.services.config</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">client </span><span style="color: red">configSource</span><span style="color: blue">=</span>&quot;<span style="color: blue">system.serviceModel.client.config</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">behaviors</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">serviceBehaviors</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">behavior </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
        &lt;!--</span><span style="color: green">TODO: the option should be only in test environment true in the production should be false</span><span style="color: blue">--&gt;
        &lt;</span><span style="color: #a31515">serviceDebug </span><span style="color: red">includeExceptionDetailInFaults</span><span style="color: blue">=</span>&quot;<span style="color: blue">true</span>&quot; <span style="color: blue">/&gt;
      &lt;/</span><span style="color: #a31515">behavior</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">serviceBehaviors</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">behaviors</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">bindings</span><span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">netTcpBinding</span><span style="color: blue">&gt;
      &lt;</span><span style="color: #a31515">binding </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot;<span style="color: blue">&gt;
        &lt;</span><span style="color: #a31515">security </span><span style="color: red">mode</span><span style="color: blue">=</span>&quot;<span style="color: blue">None</span>&quot; <span style="color: blue">/&gt;
      &lt;/</span><span style="color: #a31515">binding</span><span style="color: blue">&gt;
    &lt;/</span><span style="color: #a31515">netTcpBinding</span><span style="color: blue">&gt;
  &lt;/</span><span style="color: #a31515">bindings</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">system.serviceModel</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h4>system.serviceModel.services.config</h4>
<p>Use this to configure WCF Services (listens to incoming messages). Setup one service for each EPiServer site-tag.</p>
<ul>
<li>Name should be unique. </li>
<li>Name must be the value of episerver/sites[siteid] plus &quot;/EPiServer.Events.Remote.EventReplication&quot;, i.e. if siteId is “sss.se” then name should be “sss.se/EPiServer.Events.Remote.EventReplication”. </li>
<li>Each site must use a diffrent port in services/service/endpoint[address]. </li>
<li>Use &quot;localhost&quot; in the address attribute to bind to all NIC on the machine. </li>
</ul>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">services</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.se/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13000/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.no/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13001/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.dk/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13002/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
  &lt;</span><span style="color: #a31515">service </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.com/EPiServer.Events.Remote.EventReplication</span>&quot; <span style="color: red">behaviorConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">DebugServiceBehaviour</span>&quot;<span style="color: blue">&gt;
    &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventServiceEndPoint</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://localhost:13003/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;/</span><span style="color: #a31515">service</span><span style="color: blue">&gt;
&lt;/</span><span style="color: #a31515">services</span><span style="color: blue">&gt;</span></pre>
<p><a href="http://11011.net/software/vspaste"></a></p>
<h4>system.serviceModel.client.config</h4>
<p>And each server that changes the content must also be aware of where to send notifications so we must list all servers and websites. </p>
<ul>
<li>Name should be unique. </li>
<li>It is better if address contains IP-addresses than hostnames. </li>
<li>There should be one endpoint for each website on a server where port number matches the ports used in the services/service/endpoint[address]. </li>
</ul>
<pre class="code"><span style="color: blue">&lt;</span><span style="color: #a31515">client</span><span style="color: blue">&gt;
  &lt;!-- </span><span style="color: green">SERVER1 </span><span style="color: blue">--&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.se-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13000/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.no-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13001/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.dk-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13002/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.com-SERVER1</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER1:13003/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;!-- </span><span style="color: green">SERVER2 </span><span style="color: blue">--&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.se-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13000/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.no-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13001/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.dk-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13002/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;</span><span style="color: #a31515">endpoint </span><span style="color: red">name</span><span style="color: blue">=</span>&quot;<span style="color: blue">sss.com-SERVER2</span>&quot; <span style="color: red">contract</span><span style="color: blue">=</span>&quot;<span style="color: blue">EPiServer.Events.ServiceModel.IEventReplication</span>&quot; <span style="color: red">bindingConfiguration</span><span style="color: blue">=</span>&quot;<span style="color: blue">RemoteEventsBinding</span>&quot; <span style="color: red">address</span><span style="color: blue">=</span>&quot;<span style="color: blue">net.tcp://SERVER2:13003/RemoteEventService</span>&quot; <span style="color: red">binding</span><span style="color: blue">=</span>&quot;<span style="color: blue">netTcpBinding</span>&quot; <span style="color: blue">/&gt;
  &lt;!-- </span><span style="color: green">Repeat pattern above for all other servers and sites </span><span style="color: blue">--&gt;
&lt;/</span><span style="color: #a31515">client</span><span style="color: blue">&gt;</span></pre>
<p>Good luck! And let me know if this helps you or if you get stuck&#8230;</p>
<p><em>Credits to Petter Klang at EPiServer Support and Shahram Shahinzadeh on the backend dev team that has been helping us out.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/09/22/episerver-cms-how-to-configure-remote-events-with-many-servers-and-firewalls-between-them/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>EPiServer LicenseException: x.x.x.x is not a valid ip-address</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/09/11/episerver-licenseexception-xxxx-is-not-a-valid-ip-address/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/09/11/episerver-licenseexception-xxxx-is-not-a-valid-ip-address/#comments</comments>
		<pubDate>Fri, 11 Sep 2009 13:20:58 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[Hosting]]></category>
		<category><![CDATA[LicenseException]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=242</guid>
		<description><![CDATA[I got a support question on this Exception today. First thought is that the ip-address was misstyped or the wrong license.config file was used but ipconfig /all and the IPRestiriction tag in license.config matched! How does EPiServer validate the ip-address? The code to check is quite simple. It is using the DNS service to lookup [...]]]></description>
			<content:encoded><![CDATA[<p>I got a support question on this Exception today. First thought is that the ip-address was misstyped or the wrong license.config file was used but ipconfig /all and the IPRestiriction tag in license.config matched!</p>
<h3>How does EPiServer validate the ip-address?</h3>
<p>The code to check is quite simple. It is using the DNS service to lookup the name of the computer and then lookup all ip-addresses for that computer name.</p>
<pre><code>foreach (IPAddress address in Dns.GetHostEntry(Dns.GetHostName()).AddressList)
{
    if (!IPAddress.IsLoopback(address) &amp;&amp; this._ip.Equals(address))
    {
        this._isValid = true;
    }
}
</code></pre>
<h3>Troubleshooting License Exception  </h3>
<p>A quick test is to add a small debug.aspx file to find out what values are returned.</p>
<pre><code>&lt;%@ Page Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot;  %&gt;
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>
 &quot;&gt;
&lt;script runat=&quot;server&quot;&gt;

    protected void Button1_Click(object sender, EventArgs e)
    {
        foreach (System.Net.IPAddress address in System.Net.Dns.GetHostEntry(System.Net.Dns.GetHostName()).AddressList)
        {
            ListBox1.Items.Add(address.ToString()+ &quot;-&quot; + System.Net.IPAddress.IsLoopback(address).ToString());
        }
    }
&lt;/script&gt;
&lt;html xmlns=&quot;<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>
 &quot; &gt;
&lt;head runat=&quot;server&quot;&gt;&lt;title&gt;&lt;/title&gt;&lt;/head&gt;
&lt;body&gt;
    &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
    &lt;h1&gt;Check IP-addresses&lt;/h1&gt;
    &lt;p&gt;Current host name: &lt;%= System.Net.Dns.GetHostName() %&gt;&lt;/p&gt;
    &lt;div&gt;
        &lt;asp:ListBox ID=&quot;ListBox1&quot; runat=&quot;server&quot;&gt;&lt;/asp:ListBox&gt;
        &lt;asp:Button ID=&quot;Button1&quot; runat=&quot;server&quot; onclick=&quot;Button1_Click&quot; Text=&quot;Test&quot; /&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;</code></pre>
<h3>Resolution to LicenseException in this case</h3>
<p>Running the test aboved showed us that the IP-address returned was the loopback address 127.0.0.1 instead of the computers ip-address.</p>
<p>Since this setup is an enterprise site with a lot of diffrent host names pointing to diffrent start pages the local hosts-file (at C:\Windows\System32\drivers\etc\hosts) was edited and all known host names was added pointing to 127.0.0.1 to make it possible to test. One entry was accidentally added with the machine name and when we removed that line everything started to work!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/09/11/episerver-licenseexception-xxxx-is-not-a-valid-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Work with Unpublished PageData from code</title>
		<link>http://blog.fredrikhaglund.se/blog/2009/02/18/work-with-unpublished-pagedata-from-code/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2009/02/18/work-with-unpublished-pagedata-from-code/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 18:01:20 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[AccessLevel]]></category>
		<category><![CDATA[DataFactory]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[GetChildren]]></category>
		<category><![CDATA[ILanguageSelector]]></category>
		<category><![CDATA[IsMasterLanguageBranch]]></category>
		<category><![CDATA[LanguageSelector]]></category>
		<category><![CDATA[PageVersion]]></category>
		<category><![CDATA[SaveAction]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[VersionStatus]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2009/02/18/work-with-unpublished-pagedata-from-code/</guid>
		<description><![CDATA[Mari Jørgensen wrote about Breaking change in GetChildren() and I would like to share some of my findings when working with PageData from code when you want to use the built-in flow for publishing. As you might know a Page Version can have VersionStatus Not Ready (CheckedOut), Ready To Publish (CheckedOut), Published and Previously Published. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://labs.episerver.com/en/Blogs/Mari-Jorgensen/">Mari Jørgensen</a> wrote about <a href="http://labs.episerver.com/en/Blogs/Mari-Jorgensen/Dates/2009/2/Breaking-change-in-GetChildren/">Breaking change in GetChildren()</a> and I would like to share some of my findings when working with <em>PageData</em> from code when you want to use the built-in flow for publishing.</p>
<p>As you might know a Page Version can have <em>VersionStatus</em> <strong>Not Ready </strong>(<em>CheckedOut</em>), <strong>Ready To Publish</strong> (<em>CheckedOut</em>), <strong>Published</strong> and <strong>Previously Published</strong>. Since you in almost all cases are only interested in the published version most methods in <em>DataFactory</em> class only returns <em>PageData</em> objects with the published version.</p>
<h3>Get unpublished pages and pages not in current language branch</h3>
<p><em>GetPage()</em> and <em>GetChildren()</em> returns page(s) published in the current language. You always have to use in a <em>ILanguageSelector</em> if you want to get <em>PageData</em> for another Language Branch than the current language branch.</p>
<pre class="csharpcode">PageDataCollection pages =
  DataFactory.Instance.GetChildren(
    CurrentPage.PageLink,  LanguageSelector.AutoDetect(<span class="kwrd">true</span>));</pre>
<p>This will retrieve all children the same way as the Page Tree in the Structure Tab in Edit Mode. If there is no published version in the <strong>Current Content Language</strong> it will return <em>PageData</em> for the Master Langauge Branch, regardless of Publish Status.</p>
<h3>Saving a page without publishing it</h3>
<p>It is easy to create a new page and not publish it. This can be used for moderation where an Editor uses the publish button in Edit mode to approve.</p>
<pre class="csharpcode">PageData page = DataFactory.Instance.GetDefaultPageData(
                  rootpage.PageLink, <span class="str">"My Page Type"</span>);
page.PageName = <span class="str">"New Page"</span>;
DataFactory.Instance.Save(page, SaveAction.CheckIn,
                          AccessLevel.NoAccess);</pre>
<p><em>SaveAction.CheckIn</em> will make you page Ready to Publish.</p>
<h3>Access Rights</h3>
<p>Even if the current your is not an Editor you may give them Edit access rights to their pages.  It is very easy to add access rights for the current user <span style="text-decoration: underline;">after</span> the page is saved. Note that all existing access right on the parent page will be inherited as usual.</p>
<pre class="csharpcode">PageAccessControlList acl = <span class="kwrd">new</span> PageAccessControlList(page.PageLink);
acl.Add(<span class="kwrd">new</span> AccessControlEntry(
          Membership.GetUser().UserName,
          AccessLevel.Read | AccessLevel.Edit | AccessLevel.Create | AccessLevel.Delete,
          SecurityEntityType.User));
acl.Save();</pre>
<p>It is also easy to filter a collection and remove pages you should not be able to change.</p>
<pre class="csharpcode"><span class="kwrd">new</span> FilterAccess(AccessLevel.Edit).Filter(pages);</pre>
<p>Another approach is to show the page but maybe disable the edit button.</p>
<pre class="csharpcode"><span class="kwrd">bool</span> canChange = page.QueryDistinctAccess(AccessLevel.Edit);</pre>
<h3>Page Versions and Unpublished Pages</h3>
<p>Property Values for the Published Version of a Page is stored in different tables in the database than all other versions of the page. You need something called <strong>WorkID</strong> in your <em>PageReference</em> to load other versions of a page than the published version.</p>
<p><strong>WARNING! Last time I checked <em>GetPage()</em> and <em>GetPages()</em> returned skeleton <em>PageData</em> objects, where all user defined properties are null, for unpublished pages if you did not have a <em>WorkID</em>.</strong></p>
<p>This is an example of how you have to use <em>PageVersion</em> class to retrieve a list of all versions of a page. Each <em>PageVersion</em> has a <em>PageReference</em> with both <em>PageID</em> and <em>WorkID</em>. </p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">static</span> PageData GetLastVersion(PageReference pageRef)
{
    PageVersionCollection pageVersions = PageVersion.List(pageRef);
    PageReference lastVersion = pageVersions[0].ID;
    <span class="kwrd">foreach</span> (PageVersion pageVersion <span class="kwrd">in</span> pageVersions)
    {
        <span class="kwrd">if</span> (pageVersion.IsMasterLanguageBranch)
        {
            lastVersion = pageVersion.ID;
        }
    }
    <span class="kwrd">return</span> DataFactory.Instance.GetPage(lastVersion,
             LanguageSelector.AutoDetect(<span class="kwrd">true</span>));
}</pre>
<p>When you have a <em>PageReference</em> with <em>WorkID</em> you can use it with <em>GetPage()</em> to retrieve other versions of a Page. Using and a <em>LanguageSelector</em> with fallback to Master Language is required to get around the filter.</p>
<h3>Update a page without creating a new version</h3>
<p>Sometimes you want to change a PageData object without creating a new version. In the example below UpdatePageFromForm copies values from text boxes to the page. If a value has changed it will be saved.</p>
<pre class="csharpcode">page = GetLastVersion(pageRef).CreateWritableClone();
UpdatePageFromForm(page);
<span class="kwrd">if</span> (page.IsModified)
{
    SaveAction saveAction = SaveAction.CheckIn;
    <span class="kwrd">if</span> (page.Status != VersionStatus.Published)
    {
        <span class="rem">// Update existing version if it is not published</span>
        saveAction = saveAction | SaveAction.ForceCurrentVersion;
    }
    DataFactory.Instance.Save(page, saveAction);
}</pre>
<p>That&#8217;s all for now folks!</p>
<p>Please, leave a comment if you learned something. It is good for my blogging morale to know that someone got helped&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2009/02/18/work-with-unpublished-pagedata-from-code/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>EPiPattern: How to render valid xhtml (part 1/2)</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/12/08/epipattern-how-to-render-valid-xhtml-part-12/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/12/08/epipattern-how-to-render-valid-xhtml-part-12/#comments</comments>
		<pubDate>Mon, 08 Dec 2008 12:39:50 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[EPiPattern]]></category>
		<category><![CDATA[EPiServer CMS]]></category>
		<category><![CDATA[HtmlEncode]]></category>
		<category><![CDATA[script injection]]></category>
		<category><![CDATA[ToWebString]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=182</guid>
		<description><![CDATA[How do you inject dynamic content into your web page? Following is a list of the most common methods I find when doing quality and code reviews with some comments and dangerous pitfalls. #1: Inline Expressions with Code Render Blocks Using inline expressions is a shortcut for calling the Write method. Example &#8211; DONT: &#60;h2&#62;&#60;%= [...]]]></description>
			<content:encoded><![CDATA[<p>How do you inject dynamic content into your web page? Following is a list of the most common methods I find when doing quality and code reviews with some comments and dangerous pitfalls.</p>
<h3>#1: Inline Expressions with Code Render Blocks</h3>
<p>Using <a href="http://msdn.microsoft.com/en-us/library/k6xeyd4z.aspx" target="_blank">inline expressions</a> is a shortcut for calling the <a href="http://msdn.microsoft.com/en-us/library/system.web.httpresponse.write.aspx">Write</a> method.</p>
<h4>Example &#8211; DONT:</h4>
<pre class="csharpcode">&lt;h2&gt;&lt;%= CurrentPage.PageName %&gt;&lt;/h2&gt;
&lt;img src=<span class="str">"&lt;%= CurrentPage["</span>ImageUrl<span class="str">"] %&gt;"</span> alt=<span class="str">"&lt;%= CurrentPage["</span>MainIntro<span class="str">"] %&gt;"</span> /&gt;
&lt;div <span class="kwrd">class</span>=<span class="str">"mainarea"</span>&gt;

     &lt;%= CurrentPage[<span class="str">"MainBody"</span>] %&gt;
&lt;/div&gt;</pre>
<p>Since xhtml is just text, writing some more in-between existing static blocks is fast and simple. Probably the easiest way to inject dynamic content but it is also dangerous!</p>
<h4>Example – DO always use HtmlEncode:</h4>
<pre class="csharpcode">&lt;h2&gt;&lt;%= HttpUtility.HtmlEncode(CurrentPage.PageName) %&gt;&lt;/h2&gt;</pre>
<p>What happens if our PageName property contains a &#8220;&lt;&#8221; or &#8220;&amp;&#8221; character in the example above? Your page will not validate and you risk that it breaks down. It can also be exposed to <a title="How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings" href="http://msdn.microsoft.com/en-us/library/a2a4yykt.aspx" target="_blank">script injection</a> if the content is user generated.</p>
<p>To be on the safe side you should always call <em><a href="http://msdn.microsoft.com/en-us/library/73z22y6h.aspx" target="_blank">HttpUtility.HtmlEncode</a></em> on all strings that you inject with inline expressions.</p>
<h4>Example – DO always use a fallback for src-attributes</h4>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">img</span> <span class="attr">src</span><span class="kwrd">="&lt;%= CurrentPage["</span><span class="attr">ImageUrl</span><span class="kwrd">"] ?? "</span>/<span class="attr">Missing</span>.<span class="attr">png</span><span class="kwrd">" %&gt;"</span> <span class="kwrd">/&gt;</span></pre>
<p>If your ImageUrl property is empty you would get a img-tag with an empty src-attribute. This can lead to the page being rendered twice. <a title="How Firefox Handles Empty SRC tags" href="http://geekswithblogs.net/bcaraway/archive/2007/08/24/114945.aspx" target="_blank">FireFox interpret a null src-attribute a relative url and evaluate it using the page url as base returning the same url</a>.</p>
<h3>#2: With EPiServer:Property web control</h3>
<p>Using the EPiServer Property Web Controls instead of inline expressions has several benefits. It could be used for rendering the PageName and MainBody in the example above.</p>
<h4>Example – DO use EPiServer:Property web control</h4>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">h2</span><span class="kwrd">&gt;&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">PropertyName</span><span class="kwrd">="PageName"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">h2</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">CssClass</span><span class="kwrd">="mainarea"</span> <span class="attr">PropertyName</span><span class="kwrd">="MainBody"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;</span></pre>
<p>1) When rendering EPiServer&#8217;s <em>ToWebString()</em> is used. This does almost the same job as always calling <em>HtmlEncode</em> yourself.</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">virtual</span> <span class="kwrd">void</span> CreateDefaultControls()
{
    Label target = <span class="kwrd">new</span> Label();
    target.Text = PropertyData.ToWebString();
    CopyWebAttributes(target);
    Controls.Add(target);
}</pre>
<p>2) It enables the Simple Edit feature for the editors without any extra work. (If you do not know what &#8220;Simple Edit&#8221; is, you should read the <a title="EPiServer Documentation" href="http://world.episerver.com/en/Documentation/Categories/Documentation-Type/Manuals/" target="_blank">Editors Manual for EPiServer</a> before doing any more development.)</p>
<p>3) Different types have get different rendering automatically. Commonly used for <em>PageReferences</em> and Url&#8217;s that are rendered as a Hyperlink.</p>
<h4>Example – DO use EPiServer:Property for rendering links if possible</h4>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">EPiServer:PageList</span> <span class="attr">PageLinkProperty</span><span class="kwrd">="NewsArchivePage"</span> <span class="attr">MaxCount</span><span class="kwrd">="5"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">HeaderTemplate</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">h3</span><span class="kwrd">&gt;&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">PropertyName</span><span class="kwrd">="PageLink"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">h3</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">ul</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">HeaderTemplate</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">li</span><span class="kwrd">&gt;&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">PropertyName</span><span class="kwrd">="PageLink"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">li</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">ItemTemplate</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;</span><span class="html">FooterTemplate</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">ul</span><span class="kwrd">&gt;</span>
  <span class="kwrd">&lt;/</span><span class="html">FooterTemplate</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">EPiServer:PageList</span><span class="kwrd">&gt;</span></pre>
<p>4) Use <em>PageLinkProperty</em> to follow a Page-property to another page and render a value. Takes care of all hassle and calls <em>GetPage()</em> and check for nulls for you.</p>
<h4>Example – DO use EPiServer:Property to render values from another page</h4>
<pre class="csharpcode">
<span class="kwrd">&lt;</span><span class="html">h3</span><span class="kwrd">&gt;&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">PageLinkProperty</span><span class="kwrd">="FeatureArticlePage"</span> <span class="attr">PropertyName</span><span class="kwrd">="PageLink"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">h3</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">div</span><span class="kwrd">&gt;&lt;</span><span class="html">EPiServer:Property</span> <span class="attr">PageLinkProperty</span><span class="kwrd">="FeatureArticlePage"</span> <span class="attr">PropertyName</span><span class="kwrd">="MainIntro"</span> <span class="attr">runat</span><span class="kwrd">="server"</span> <span class="kwrd">/&gt;&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span></pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/12/08/epipattern-how-to-render-valid-xhtml-part-12/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>How to become a EPiServer Ceritified Developer</title>
		<link>http://blog.fredrikhaglund.se/blog/2008/11/30/how-to-become-a-episerver-ceritified-developer/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2008/11/30/how-to-become-a-episerver-ceritified-developer/#comments</comments>
		<pubDate>Sun, 30 Nov 2008 11:30:19 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[Certification]]></category>
		<category><![CDATA[EPiServer CMS]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=178</guid>
		<description><![CDATA[I would like to congratulate Mikael Lundin to becoming a Certified EPiServer Developer. He writes about this experience in his blog with some tips about what you should study. I would like to complement what he has written with some of the tips I give to my students who are going to take the certification. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright" src="/wp-content/uploads/2008/12/certificate.gif" alt="" width="48" height="48" />I would like to congratulate <a title="Mikael Lundin about EPiServer Certification" href="http://mint.litemedia.se/2008/11/29/episerver-cms-5-certified-developer/" target="_blank">Mikael Lundin to becoming a Certified EPiServer Developer</a>. He writes about this experience in his blog with some tips about what you should study. I would like to complement what he has written with some of the tips I give to my students who are going to take the certification.</p>
<h3>About the EPiServer Certification</h3>
<p>You have two hours to complete around 70 multiple choice questions. You can skip a question during exam and go back to it later but you can not change answered questions.  To pass, you need answer correct on 60% of the questions.</p>
<h3>My tips for passing the test</h3>
<p>Preparing yourself is a must because the the goal of the test is to separate those who have worked with EPiServer from those who have not. But working with EPiServer is not enough, you must also have a good understanding of all features availible in EPiServer, even those you have not used&#8230;</p>
<ul>
<li>Do develop with EPiServer for a while before you take the test. I do not think many have passed the certification directly after <a title="Read more about EPiServer Training" href="http://www.episerver.com/en/Education/Course-Descriptions-Sorted-by-Products/Courses-in-EPiServer-CMS/" target="_blank">completing the basic developer training</a>.</li>
<li>Do check <a title="More about EPiServer Certification" href="http://www.episerver.com/en/Education/EPiServer-Certified--Developer/Knowledge-Areas/" target="_blank">EPiServer&#8217;s list of Knowledge Areas</a> you are going to be tested on.</li>
<li>Do read the <a title="EPiServer Documentation" href="http://world.episerver.com/Documentation/Categories/Products/EPiServer-CMS/" target="_blank">Editors and Administrators manual</a>. As a developer you are supposed to know how to use the product from an end users perspective.</li>
<li>EPiServer Developers knows to little about Deployment in general. Make sure that you undrestand how to configure EPiServer. Do you know how Mirroring works or Enterprise features like multi-homed sites and load balancing is configured?</li>
<li>Do read all the <a title="EPiServer Tech Notes" href="http://world.episerver.com/Documentation/Categories/Products/EPiServer-CMS/" target="_blank">Tech Notes for the latest EPiServer CMS</a> release. You need to have a basic understanding about all features in EPiServer.</li>
<li>Do read through the pages in the <em>Developers Guide</em> part of <a title="EPiServer CMS Online SDK" href="http://sdk.episerver.com/" target="_blank">EPiServer SDK</a>, too. Personally I do not understand why they put some pages in the SDK and some as Tech Notes. It is high and low in both places and you must at least browse through it all&#8230;</li>
<li>Do not try to read through the whole Framework Reference. You could look on a few key classes like: PageBase, UserControlBase, TemplatePage, IPageSource, PageData, PageReference, DataFactory, PropertyData and PropertyDataControl. And also make sure you know your EPiServer Web Controls.</li>
</ul>
<p>Many questions is on a very detailed level and I must say that I have heard a lot of complaints that the test is too hard. You have to make qualified guesses. I had to do a lot of qualified guessing myself , and I&#8217;m an EPiServer teacher and have turned EPiServer inside out with Roeders Reflector!</p>
<p>Remeber, you do not have to get 100% to pass and if you follow the tips above I&#8217;m sure you too will be a Certified EPiServer Developer&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2008/11/30/how-to-become-a-episerver-ceritified-developer/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>

