<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title type="text">Blog posts by Matthew Boniface</title><link href="http://world.optimizely.com" /><updated>2015-09-04T02:05:29.0000000Z</updated><id>https://world.optimizely.com/blogs/Matthew-Boniface/</id> <generator uri="http://world.optimizely.com" version="2.0">Optimizely World</generator> <entry><title>EPiServer Commerce CartCheckout workflow with IsIgnoreProcessPayment parameter</title><link href="http://vu3lo.tumblr.com/post/128295808606" /><id>&lt;p&gt;EPiServer Commerce has substantial processes which rely on workflows. In many scenarios, like on a simple consumer website, you may get away without modifying or configuring these workflows beyond their defaults.&lt;/p&gt;&lt;p&gt;But on my current project I needed to simply disable payment processing in the CartCheckout workflow. And there is an API method in&#160;Mediachase.Commerce.Orders.OrderGroup that facilitates this:&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;// Summary:&lt;br /&gt;// &#160; &#160; Runs the specified workflow.&lt;br /&gt;//&lt;br /&gt;// Parameters:&lt;br /&gt;// &#160; name:&lt;br /&gt;// &#160; &#160; The name.&lt;br /&gt;//&lt;br /&gt;// &#160; throwException:&lt;br /&gt;// &#160; &#160; if set to true the exception will be thrown and should be handled by the&lt;br /&gt;// &#160; &#160; caller.&lt;br /&gt;//&lt;br /&gt;// &#160; param:&lt;br /&gt;// &#160; &#160; The additional input parameters.&lt;br /&gt;public virtual WorkflowResults RunWorkflow(string name, bool throwException, Dictionary&amp;lt;string, object&amp;gt; param);&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;For my situation setting IsIgnoreProcessPayment to true when running the CartCheckout workflow, this is my simplified code that was required:&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;var workflowParams = new Dictionary&amp;lt;string, object&amp;gt; { { &quot;IsIgnoreProcessPayment&quot;, true } }&lt;br /&gt;var results = cartHelper.Cart.RunWorkflow(OrderGroupWorkflowManager.CartCheckOutWorkflowName, true, workflowParams);&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;I hunted for examples of how to set IsIgnoreProcessPayment so thought it deserved a blog post.&lt;br /&gt;&lt;/p&gt;</id><updated>2015-09-04T02:05:29.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Implementing IPriceService with default IPriceService as its dependency</title><link href="http://vu3lo.tumblr.com/post/128292580916" /><id>&lt;p&gt;In EPiServer Commerce prices are loaded via the IPriceService and IPriceDetailService. I needed to customise the IPriceService logic but just to tweak the price filtering and still intend to call the default IPriceService internally to reuse the base functionality.&lt;/p&gt;&lt;p&gt;This is where confusion ensues, how does one configure the dependency resolver (StructureMap) to return my custom price service implementation which itself has a dependency on the same IPriceService interface? Turns out StructureMap has a method called EnrichWith to achieve this.&lt;/p&gt;&lt;p&gt;So I have my implementation called “CustomPriceService” and the default EPiServer implmentation is “PriceServiceDatabase“. My CustomPriceService constructor looks like this:&lt;br /&gt;&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;public CustomPriceService(IPriceService defaultPriceService)&lt;br /&gt;{&lt;br /&gt;    this._defaultPriceService = defaultPriceService;&lt;br /&gt;}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Now I have the local field _defaultPriceService that I can call for default functionality throughout my custom implementation and it still retains the injected abstraction for unit testing purposes.&lt;/p&gt;&lt;p&gt;To configure StructureMap all that is needed is:&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;container.For&amp;lt;IPriceService&amp;gt;().Use&amp;lt;PriceServiceDatabase&amp;gt;().EnrichWith((context, systemPriceService) =&amp;gt; new CustomPriceService(systemPriceService));&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;When an IPriceService dependency is resolved StructureMap will get the default EPiServer Commerce “PriceServiceDatabase” and then create my “CustomPriceService” passing the PriceServiceDatabase into the constructor.&lt;/p&gt;&lt;p&gt;If your constructor needs other dependencies you can use the “IContext” that EnrichWith provides, for example:&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;container.For&amp;lt;IPriceService&amp;gt;().Use&amp;lt;PriceServiceDatabase&amp;gt;().EnrichWith((context, systemPriceService) =&amp;gt; new CustomPriceService(systemPriceService, context.GetInstance&amp;lt;ICurrentMarket&amp;gt;()));&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Hopefully this will help anyone trying to figure out how to get StructureMap to configure a dependency for a given type to itself have a dependency on the same type.&lt;/p&gt;</id><updated>2015-09-04T01:11:54.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>EPiServer 7 &amp; 8 overriding editor UI language values</title><link href="http://vu3lo.tumblr.com/post/120151401126" /><id>&lt;p&gt;&lt;strong&gt;Update (28 Dec 2015):&lt;/strong&gt; I have since noticed that this information now seems to be officially documented at &lt;a href=&quot;/link/c783c321595d46cbb797392079692b0c.aspx&quot;&gt;http://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/9/Globalization/localizing-the-user-interface/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It could be something I simply missed, but I spent a fair amount of time searching the web for how to override the text an EPiServer editor sees for content types and properties. Perhaps this is so obvious that no one else needed documentation or examples on the web to figure it out? Ultimately though, I found the answer in the Alloy sample website code.&lt;/p&gt;&lt;p&gt;I’m currently using EPiServer 8 (8.2 to be precise) and found placing the following in a lang xml file will override a custom content type and properties:&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;contenttypes&amp;gt;
  &amp;lt;HomePage&amp;gt;
    &amp;lt;name&amp;gt;Hemsida&amp;lt;/name&amp;gt;
    &amp;lt;description&amp;gt;Startsidan f&#246;r webbplatsen&amp;lt;/description&amp;gt;
    &amp;lt;properties&amp;gt;
      &amp;lt;MainContentArea&amp;gt;
        &amp;lt;help&amp;gt;Huvudinneh&#229;llsomr&#229;det till att omfatta hemsidan widgets&amp;lt;/help&amp;gt;
      &amp;lt;/MainContentArea&amp;gt;
    &amp;lt;/properties&amp;gt;
  &amp;lt;/HomePage&amp;gt;
  &amp;lt;ContentMetadataBlock&amp;gt;
    &amp;lt;name&amp;gt;Inneh&#229;ll Metadata Block&amp;lt;/name&amp;gt;
    &amp;lt;properties&amp;gt;
      &amp;lt;Description&amp;gt;
        &amp;lt;caption&amp;gt;Beskrivning&amp;lt;/caption&amp;gt;
        &amp;lt;help&amp;gt;Meta beskrivning taggar arbetar med titeln att locka bes&#246;kare till dina sidor. Standard SEO regeln &#228;r att h&#229;lla dina metabeskrivningar till 150 tecken eller mindre.&amp;lt;/help&amp;gt;
      &amp;lt;/Description&amp;gt;
    &amp;lt;/properties&amp;gt;
  &amp;lt;/ContentMetadataBlock&amp;gt;
&amp;lt;/contenttypes&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;In this case I’m overriding the HomePage’s “name”,&#160;“description” and its “MainContentArea” properties&#160;“help” text with the Swedish language version. And below this I demonstrate a block having similar text overridden.&lt;/p&gt;&lt;p&gt;Now an editor with the UI set to Swedish will find property names and descriptions have been customised for them.&lt;/p&gt;&lt;p&gt;From what I see in the Alloy site, you can also do generic overrides for common properties throughout your codebase by using a base type or even an interface, such as IContentData:&lt;/p&gt;&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;contenttypes&amp;gt;
  &amp;lt;icontentdata&amp;gt;
    &amp;lt;properties&amp;gt;
      &amp;lt;!-- SitePageData --&amp;gt;
      &amp;lt;disableindexing&amp;gt;
        &amp;lt;caption&amp;gt;Disable indexing&amp;lt;/caption&amp;gt;
        &amp;lt;help&amp;gt;Prevents the page from being indexed by search engines&amp;lt;/help&amp;gt;
      &amp;lt;/disableindexing&amp;gt;        
      &amp;lt;!-- Common properties--&amp;gt;
      &amp;lt;mainbody&amp;gt;
        &amp;lt;caption&amp;gt;Main body&amp;lt;/caption&amp;gt;
        &amp;lt;help&amp;gt;Main editorial content of the page&amp;lt;/help&amp;gt;
      &amp;lt;/mainbody&amp;gt;
    &amp;lt;/properties&amp;gt;
  &amp;lt;/icontentdata&amp;gt;
&amp;lt;/contenttypes&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Hopefully this helps someone else to more easily discover this.&lt;/p&gt;</id><updated>2015-05-29T03:58:23.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>EPiServer log4net stopped working</title><link href="http://vu3lo.tumblr.com/post/68832237155" /><id>&lt;p&gt;An EPiServer website I worked on had logging working well until it [seemingly] randomly stopped working. I reviewed changes in our configurations and could not trace a cause for the sudden failure.&lt;/p&gt;
&lt;p&gt;I proceeded to enable log4net&amp;rsquo;s own logging which is done by adding this to your web.config:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;appSettings&amp;gt;&lt;br /&gt; &amp;lt;add key=&quot;log4net.Internal.Debug&quot; value=&quot;true&quot;/&amp;gt;&lt;br /&gt;&amp;lt;/appSettings&amp;gt;&lt;br /&gt;&amp;lt;system.diagnostics&amp;gt;&lt;br /&gt; &amp;lt;trace autoflush=&quot;true&quot;&amp;gt;&lt;br /&gt; &amp;lt;listeners&amp;gt;&lt;br /&gt; &amp;lt;add&lt;br /&gt; name=&quot;textWriterTraceListener&quot;&lt;br /&gt; type=&quot;System.Diagnostics.TextWriterTraceListener&quot;&lt;br /&gt; initializeData=&quot;C:\log4net.txt&quot; /&amp;gt;&lt;br /&gt; &amp;lt;/listeners&amp;gt;&lt;br /&gt; &amp;lt;/trace&amp;gt;&lt;br /&gt;&amp;lt;/system.diagnostics&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This log revealed the following:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;log4net: XmlConfigurator: configuring repository [log4net-default-repository] using file [C:\Dev\Project1\Trunk\Src\Web\web.config]&lt;br /&gt;log4net: XmlConfigurator: configuring repository [log4net-default-repository] using stream&lt;br /&gt;log4net: XmlConfigurator: loading XML configuration&lt;br /&gt;log4net: XmlConfigurator: XML configuration does not contain a &amp;lt;log4net&amp;gt; element. Configuration Aborted.&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;With EPiServer, this should be using it&amp;rsquo;s default EPiServerLog.config rather than log4net&amp;rsquo;s default web.config location - hence why it&amp;rsquo;s not finding the &amp;lt;log4net&amp;gt; element.&lt;/p&gt;
&lt;p&gt;It took me a little experimentation and searching before I realised the problem was caused because I referenced log4net in our Global.asax.cs. This causes it to setup log4net prior to EPiServer determining the EPiServerLog.config file. Once I removed that, it all worked again!&lt;/p&gt;</id><updated>2013-12-03T02:17:00.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Web deploy ignoring config transforms</title><link href="http://vu3lo.tumblr.com/post/61563764777" /><id>&lt;p&gt;If you have an annoying issue where your CI (TeamCity) web deployments were not transforming some configs, you’re not alone. And I might have found a reason why:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mine in particular was transforming a few configs (web.config, episerverlog.config etc) whilst not transforming some (connectionstrings.config, episerverframework.config and episerver.config).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It turns out that the Web.csproj file had them specified differently. The ones that were working looked like this:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerLog.config&quot;&amp;gt;&lt;br /&gt; &amp;lt;SubType&amp;gt;Designer&amp;lt;/SubType&amp;gt;&lt;br /&gt; &amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt;&lt;br /&gt;&amp;lt;/Content&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While the configs that did not work had only:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerFramework.config&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So I’ve added in the&#160;&amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt; and they now work :)&lt;/p&gt;</id><updated>2013-09-18T06:18:20.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Web deploy ignoring config transforms</title><link href="http://vu3lo.tumblr.com/post/61563764777" /><id>&lt;p&gt;If you have an annoying issue where your CI (TeamCity) web deployments were not transforming some configs, you’re not alone. And I might have found a reason why:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mine in particular was transforming a few configs (web.config, episerverlog.config etc) whilst not transforming some (connectionstrings.config, episerverframework.config and episerver.config).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It turns out that the Web.csproj file had them specified differently. The ones that were working looked like this:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerLog.config&quot;&amp;gt;&lt;br /&gt; &amp;lt;SubType&amp;gt;Designer&amp;lt;/SubType&amp;gt;&lt;br /&gt; &amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt;&lt;br /&gt;&amp;lt;/Content&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While the configs that did not work had only:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerFramework.config&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So I’ve added in the&#160;&amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt; and they now work :)&lt;/p&gt;</id><updated>2013-09-18T06:18:20.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Web deploy ignoring config transforms</title><link href="http://vu3lo.tumblr.com/post/61563764777" /><id>&lt;p&gt;If you have an annoying issue where your CI (TeamCity) web deployments were not transforming some configs, you’re not alone. And I might have found a reason why:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mine in particular was transforming a few configs (web.config, episerverlog.config etc) whilst not transforming some (connectionstrings.config, episerverframework.config and episerver.config).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It turns out that the Web.csproj file had them specified differently. The ones that were working looked like this:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerLog.config&quot;&amp;gt;&lt;br /&gt; &amp;lt;SubType&amp;gt;Designer&amp;lt;/SubType&amp;gt;&lt;br /&gt; &amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt;&lt;br /&gt;&amp;lt;/Content&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While the configs that did not work had only:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerFramework.config&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So I’ve added in the&#160;&amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt; and they now work :)&lt;/p&gt;</id><updated>2013-09-18T06:18:20.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Web deploy ignoring config transforms</title><link href="http://vu3lo.tumblr.com/post/61563764777" /><id>&lt;p&gt;If you have an annoying issue where your CI (TeamCity) web deployments were not transforming some configs, you’re not alone. And I might have found a reason why:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mine in particular was transforming a few configs (web.config, episerverlog.config etc) whilst not transforming some (connectionstrings.config, episerverframework.config and episerver.config).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It turns out that the Web.csproj file had them specified differently. The ones that were working looked like this:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerLog.config&quot;&amp;gt;&lt;br /&gt; &amp;lt;SubType&amp;gt;Designer&amp;lt;/SubType&amp;gt;&lt;br /&gt; &amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt;&lt;br /&gt;&amp;lt;/Content&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While the configs that did not work had only:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerFramework.config&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So I’ve added in the&#160;&amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt; and they now work :)&lt;/p&gt;</id><updated>2013-09-18T06:18:20.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Web deploy ignoring config transforms</title><link href="http://vu3lo.tumblr.com/post/61563764777" /><id>&lt;p&gt;If you have an annoying issue where your CI (TeamCity) web deployments were not transforming some configs, you’re not alone. And I might have found a reason why:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mine in particular was transforming a few configs (web.config, episerverlog.config etc) whilst not transforming some (connectionstrings.config, episerverframework.config and episerver.config).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It turns out that the Web.csproj file had them specified differently. The ones that were working looked like this:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerLog.config&quot;&amp;gt;&lt;br /&gt; &amp;lt;SubType&amp;gt;Designer&amp;lt;/SubType&amp;gt;&lt;br /&gt; &amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt;&lt;br /&gt;&amp;lt;/Content&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While the configs that did not work had only:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerFramework.config&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So I’ve added in the&#160;&amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt; and they now work :)&lt;/p&gt;</id><updated>2013-09-18T06:18:20.0000000Z</updated><summary type="html">Blog post</summary></entry> <entry><title>Web deploy ignoring config transforms</title><link href="http://vu3lo.tumblr.com/post/61563764777" /><id>&lt;p&gt;If you have an annoying issue where your CI (TeamCity) web deployments were not transforming some configs, you’re not alone. And I might have found a reason why:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mine in particular was transforming a few configs (web.config, episerverlog.config etc) whilst not transforming some (connectionstrings.config, episerverframework.config and episerver.config).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It turns out that the Web.csproj file had them specified differently. The ones that were working looked like this:&lt;/span&gt;&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerLog.config&quot;&amp;gt;&lt;br /&gt; &amp;lt;SubType&amp;gt;Designer&amp;lt;/SubType&amp;gt;&lt;br /&gt; &amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt;&lt;br /&gt;&amp;lt;/Content&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;While the configs that did not work had only:&lt;/p&gt;
&lt;pre class=&quot;prettyprint&quot;&gt;&lt;code&gt;&amp;lt;Content Include=&quot;EPiServerFramework.config&quot; /&amp;gt;&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So I’ve added in the&#160;&amp;lt;TransformOnBuild&amp;gt;true&amp;lt;/TransformOnBuild&amp;gt; and they now work :)&lt;/p&gt;</id><updated>2013-09-18T06:18:20.0000000Z</updated><summary type="html">Blog post</summary></entry></feed>