<?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 6</title>
	<atom:link href="http://blog.fredrikhaglund.se/blog/tag/episerver-6/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>Dynamic Content in EPiServer CMS 6 R2</title>
		<link>http://blog.fredrikhaglund.se/blog/2011/06/28/dynamic-content-in-episerver-cms-6-r2/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2011/06/28/dynamic-content-in-episerver-cms-6-r2/#comments</comments>
		<pubDate>Tue, 28 Jun 2011 12:51:26 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[DynamicContentPlugIn]]></category>
		<category><![CDATA[EPIServer 6]]></category>
		<category><![CDATA[EPIServer CMS 6]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/?p=360</guid>
		<description><![CDATA[This is a short demo of how you can use the new simpler way to implement Dynamic Content with a ordinary User Control and some Plug-In attributes. DynamicContentPlugIn is the simplifying solution First add a normal User Control or EPiServer User Control if you want to be aware about the Current Page. HelloDynamic.ascx.cs using EPiServer.DynamicContent; [...]]]></description>
			<content:encoded><![CDATA[<p>This is a short demo of how you can use the new simpler way to implement Dynamic Content with a ordinary User Control and some Plug-In attributes.</p>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2011/06/image.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="Dynamic Content in EPiServer CMS using DynamicContentPlugIn attribute" border="0" alt="Screenshot of Dynamic Content in EPiServer CMS using DynamicContentPlugIn attribute" src="http://blog.fredrikhaglund.se/wp-content/uploads/2011/06/image_thumb.png" width="504" height="416" /></a></p>
<h3>DynamicContentPlugIn is the simplifying solution</h3>
<p>First add a normal User Control or EPiServer User Control if you want to be aware about the Current Page.</p>
<p><strong>HelloDynamic.ascx.cs</strong></p>
<pre class="csharpcode">

<span class="kwrd">using</span> EPiServer.DynamicContent;
<span class="kwrd">using</span> EPiServer.PlugIn;

<span class="kwrd">namespace</span> EPiServer
{
    [DynamicContentPlugIn(DisplayName = <span class="str">&quot;Hello...&quot;</span>, 

      ViewUrl = <span class="str">&quot;~/HelloDynamic.ascx&quot;</span>)]
    <span class="kwrd">public</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> HelloDynamic : EPiServer.UserControlBase
    {
        <span class="kwrd">public</span> <span class="kwrd">string</span> Firstname { get; set; }
        <span class="kwrd">public</span> PageReference FeatureArticle { get; set; }
    }
}
</pre>
<p><em>DynamicContentPlugIn</em> will auto register the Dynamic Content control and wrap wrap all handling of settings, rendering and state handling. There is no need to register the class in <em>episerver.config</em> or to implement <em>IDynamicContent</em>. </p>
<p>All public properties inheriting from <em>PageData</em> will be used as settings. Properties with primitives as type like <em>string</em>, <em>int</em>, <em>bool </em>but also <em>PageReference</em> will be converted to <em>PropertyString</em>, <em>PropertyNumber</em>, <em>PropertyBoolean</em> respectively <em>PropertyPageReference</em>.</p>
<p><strong>HelloDynamic.ascx</strong></p>
<pre class="csharpcode"><span class="asp">&lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;HelloDynamic.ascx.cs&quot; Inherits=&quot;EPiServer.HelloDynamic&quot; %&gt;</span>
<span class="kwrd">&lt;</span><span class="html">h1</span><span class="kwrd">&gt;</span>Hello <span class="asp">&lt;%</span>= Firstname <span class="asp">%&gt;</span>!<span class="kwrd">&lt;/</span><span class="html">h1</span><span class="kwrd">&gt;</span></pre>
<h3>How to add a Custom Settings Editor for Dynamic Content</h3>
<p><a href="http://blog.fredrikhaglund.se/wp-content/uploads/2011/06/image1.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: right; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" align="right" src="http://blog.fredrikhaglund.se/wp-content/uploads/2011/06/image_thumb1.png" width="244" height="106" /></a>If you do not use the <strong><em>Url</em></strong> and <strong><em>Area</em></strong> parameters of the <em>DynamicContentPlugIn</em> attribute you will get the default settings editor that just show all Properties in a list.</p>
<p><strong>HelloDynamic.ascx.cs</strong></p>
<pre class="csharpcode">

    [DynamicContentPlugIn(DisplayName = <span class="str">&quot;Hello...&quot;</span>, 

        ViewUrl = <span class="str">&quot;~/HelloDynamic.ascx&quot;</span>, 

        Url = <span class="str">&quot;~/HelloDynamicEdit.ascx&quot;</span>, 

        Area = PlugInArea.DynamicContent)]
    <span class="kwrd">public</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> HelloDynamic : EPiServer.UserControlBase
</pre>
<p><strong>HelloDynamicEdit.ascx.cs</strong></p>
<pre class="csharpcode"><span class="kwrd">using</span> EPiServer.DynamicContent;

<span class="kwrd">namespace</span> EPiServer
{
    <span class="kwrd">public</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> HelloDynamicEdit : DynamicContentEditControl
    {
        <span class="kwrd">protected</span> <span class="kwrd">void</span> Page_Load(<span class="kwrd">object</span> sender, EventArgs e)
        {
            <span class="kwrd">if</span> (!IsPostBack)
            {
                Firstname.Text = Content.Properties[<span class="str">&quot;Firstname&quot;</span>].Value <span class="kwrd">as</span> <span class="kwrd">string</span>;
            }
        }

        <span class="kwrd">public</span> <span class="kwrd">override</span> <span class="kwrd">void</span> PrepareForSave()
        {
            Content.Properties[<span class="str">&quot;Firstname&quot;</span>].Value = Firstname.Text;
        }
    }
}</pre>
<p>Inherit from <strong><em>DynamicContentEditControl</em></strong> and implement the method <strong><em>PrepareForSave()</em></strong> to move the values back from your user interface to the Property collection of your Dynamic Content class. Note the use of <em>IsPostBack</em> to prevent overwriting of changed values. </p>
<p><strong>HelloDynamicEdit.ascx</strong></p>
<pre class="csharpcode"><span class="asp">&lt;%@ Control Language=&quot;C#&quot; AutoEventWireup=&quot;true&quot; CodeBehind=&quot;HelloDynamicEdit.ascx.cs&quot; Inherits=&quot;EPiServer.HelloDynamicEdit&quot; %&gt;</span>
<span class="kwrd">&lt;</span><span class="html">h1</span><span class="kwrd">&gt;</span>This is a custom editor<span class="kwrd">&lt;/</span><span class="html">h1</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">p</span><span class="kwrd">&gt;</span>Hello <span class="kwrd">&lt;</span><span class="html">asp:TextBox</span> <span class="attr">ID</span><span class="kwrd">=&quot;Firstname&quot;</span> <span class="attr">runat</span><span class="kwrd">=&quot;server&quot;</span> <span class="kwrd">/&gt;</span>!<span class="kwrd">&lt;/</span><span class="html">p</span><span class="kwrd">&gt;</span></pre>
<h3>Translating the User Interface for Dynamic Content</h3>
<p>You can use the <em>DisplayName</em> and <em>Description</em> parameters for the name and instructions for editors. Use <em>LanguagePath</em> parameter together with translations in the <em>lang</em>-folder.</p>
<pre class="csharpcode">

    [DynamicContentPlugIn(DisplayName = <span class="str">&quot;Hello...&quot;</span>, 

        ViewUrl = <span class="str">&quot;~/HelloDynamic.ascx&quot;</span>, 

        LanguagePath = <span class="str">&quot;/dynamiccontent/hello&quot;</span>)]
    <span class="kwrd">public</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> HelloDynamic : EPiServer.UserControlBase
</pre>
<pre class="csharpcode"><span class="kwrd">&lt;?</span><span class="html">xml</span> <span class="attr">version</span><span class="kwrd">=&quot;1.0&quot;</span> <span class="attr">encoding</span><span class="kwrd">=&quot;utf-8&quot;</span> <span class="attr">standalone</span><span class="kwrd">=&quot;yes&quot;</span>?<span class="kwrd">&gt;</span>
<span class="kwrd">&lt;</span><span class="html">languages</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;</span><span class="html">language</span> <span class="attr">name</span><span class="kwrd">=&quot;Svenska&quot;</span> <span class="attr">id</span><span class="kwrd">=&quot;sv&quot;</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">dynamiccontent</span><span class="kwrd">&gt;</span>
         <span class="kwrd">&lt;</span><span class="html">hello</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">name</span><span class="kwrd">&gt;</span>Hej…<span class="kwrd">&lt;/</span><span class="html">name</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">description</span><span class="kwrd">&gt;</span>En beskrivning…<span class="kwrd">&lt;/</span><span class="html">description</span><span class="kwrd">&gt;</span>
         <span class="kwrd">&lt;/</span><span class="html">hello</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;/</span><span class="html">dynamiccontent</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;</span><span class="html">pagetypes</span><span class="kwrd">&gt;</span>
         <span class="kwrd">&lt;</span><span class="html">common</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;</span><span class="html">property</span> <span class="attr">name</span><span class="kwrd">=&quot;Firstname&quot;</span><span class="kwrd">&gt;</span>
               <span class="kwrd">&lt;</span><span class="html">caption</span><span class="kwrd">&gt;</span>Fornamn<span class="kwrd">&lt;/</span><span class="html">caption</span><span class="kwrd">&gt;</span>
               <span class="kwrd">&lt;</span><span class="html">help</span><span class="kwrd">&gt;</span>Vad heter du?<span class="kwrd">&lt;/</span><span class="html">help</span><span class="kwrd">&gt;</span>
            <span class="kwrd">&lt;/</span><span class="html">property</span><span class="kwrd">&gt;</span>
         <span class="kwrd">&lt;/</span><span class="html">common</span><span class="kwrd">&gt;</span>
      <span class="kwrd">&lt;/</span><span class="html">pagetypes</span><span class="kwrd">&gt;</span>
   <span class="kwrd">&lt;/</span><span class="html">language</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">languages</span><span class="kwrd">&gt;</span></pre>
<style type="text/css">
<p>.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2011/06/28/dynamic-content-in-episerver-cms-6-r2/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Configuration Management and EPiServer CMS 6</title>
		<link>http://blog.fredrikhaglund.se/blog/2010/03/10/configuration-management-and-episerver-cms-6/</link>
		<comments>http://blog.fredrikhaglund.se/blog/2010/03/10/configuration-management-and-episerver-cms-6/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 20:00:00 +0000</pubDate>
		<dc:creator>Fredrik Haglund</dc:creator>
				<category><![CDATA[EPiServer]]></category>
		<category><![CDATA[CM]]></category>
		<category><![CDATA[Configuration Management]]></category>
		<category><![CDATA[EPIServer 6]]></category>
		<category><![CDATA[episerver.config]]></category>
		<category><![CDATA[episerver.datastore]]></category>
		<category><![CDATA[episerver.shell]]></category>
		<category><![CDATA[EPiServerFramework.config]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">http://blog.fredrikhaglund.se/blog/2010/03/10/configuration-management-and-episerver-cms-6/</guid>
		<description><![CDATA[This blog post is based on the experience of upgrading one EPiServer CMS 5 project and creating a new one from scratch based on a release candidate of EPiServer CMS 6 and things may change before the release. New configuration files Web.config contained a lot of settings for EPiServer CMS that is now split into [...]]]></description>
			<content:encoded><![CDATA[<p>This blog post is based on the experience of upgrading one EPiServer CMS 5 project and creating a new one from scratch based on a release candidate of EPiServer CMS 6 and things may change before the release. </p>
<h3>New configuration files</h3>
<p><em>Web.config</em> contained a lot of settings for EPiServer CMS that is now split into several files. Unfortunately another 250 lines of configuration is also added increasing the burden to manage the configuration.</p>
<h4>EPiServerFramework.config</h4>
<p>This file contains mapping between host header name and site and default language. This information was previously located in <em>configuration/episerver/sites/site/siteHosts</em>-tag.</p>
<p>Notice that the EpiServer framework automatically updates this file with machine specific information which makes it harder to put under version control but EPiServer will work even if the file is read-only (you get some exceptions in the log files and maybe temporary version of the files). </p>
<p>It is needed by all developers, staging and QA so one strategy could be to put it on version control directly or check-in a file with another name or location copy it during the post build event.</p>
<h4>episerver.config</h4>
<p>This is basically everything previously located in <em>configuration/episerver</em>-tag in <em>web.config</em>. It is connected using the configSource attribute in the same way as <em>connectionStrings.config</em>-file.</p>
<p>It contains the same information as before except that <em>siteHosts</em>-tag is migrated to <em>EPiServerFramework.config</em>-file.</p>
<p>In addition to the paths in <em>configuration/episerver/virtualPath/providers/add</em>-tag another machine specific attribute has been added on the <em>site</em>-tag called <em>licenseFilePath</em>. </p>
<p>This file must be put under version control but if the machine specific <em>licenseFilePath</em> it is present it will be hard to get it to work well.</p>
<h3>New configuration</h3>
<p>There are new sections in <em>web.config</em> and for <em>episerver.shell</em> and <em>episerver.datastore</em>. </p>
<h4>episerver.shell</h4>
<p>You need to add you modules here if you want to add your own things to the new menu system or add gadgets to the new Dashboard.</p>
<h4>episerver.datastore</h4>
<p>Even if you do not use the datastore yourself EPiServer does for XForms and other features that was previously handled by the now deprecated <em>objectstore</em>. You need to make sure that you change the <em>connectionStringName</em>-attribute to match the one your site is using.</p>
<p>Since it is possible to have different values on connectionStringName-attribute on <em>configuration/episerver/sites/site/siteSettings</em>-tag in an Enterprise setup this can be problematic.</p>
<h3>Change of configuration does not restart application</h3>
<p>Both <em>episerver</em> and <em>episerver.framework</em> configuration section has restartOnExternalChanges attrubute set to false.</p>
<p>This is annoying because you have to remember to manually do a <em>iisreset</em> or change <em>web.config</em> to trigger a restart so your changes take effect.</p>
<h3>New Site/License Information feature in Admin Mode</h3>
<p>There is a new feature that enables you to upload, activate or request a demo license in admin mode. <strong>This feature should <u>not be used by developers</u> since it adds machine specific information episerver.config. </strong>If you do and check in the changes your co-developers will get a file that does not work on their computer.</p>
<p>My suggestion is to continue using the manual approach and add the <em>Licence.config</em>-file to the application root folder your self. Remeber that if you want to put your license files under version control it is possible to do that very easily because EPiServer will look for “<em>License.config</em>” first and then “<em><strong>MACHINENAME</strong>License.config</em>” so just rename your <em>license.config</em>-file and check it in.</p>
<h3>Location of EPiServer User Interface is changed during upgrade</h3>
<p>Notice that all location and VPP paths for EPiServers User Interface are changed during upgrade. If you path to edit mode was <em>/secret/edit</em> before it will now be <em>/secret/<strong>CMS</strong>/edit</em>. There is no redirect so bookmarks or hard coded links in your application to edit mode may break.</p>
<h3>Language files</h3>
<p>Notice that you no longer can translate the whole EPiServer User Interface yourself (or override some translations) by changing xml-files in the lang folder. The new Dashboard feature (aka. Shell, Online Center) is using binary resource assemblies.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.fredrikhaglund.se/blog/2010/03/10/configuration-management-and-episerver-cms-6/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

