<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alexander Smagin on Medium]]></title>
        <description><![CDATA[Stories by Alexander Smagin on Medium]]></description>
        <link>https://medium.com/@true_shoorik?source=rss-675c5c848a14------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*t4HCpQLVcfKLze1O.jpeg</url>
            <title>Stories by Alexander Smagin on Medium</title>
            <link>https://medium.com/@true_shoorik?source=rss-675c5c848a14------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 03:25:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@true_shoorik/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Sitecore Continuous Integration, part 1]]></title>
            <link>https://medium.com/sitecore-tips-tricks/sitecore-continuous-integration-part-1-2b531ee3611c?source=rss-675c5c848a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b531ee3611c</guid>
            <dc:creator><![CDATA[Alexander Smagin]]></dc:creator>
            <pubDate>Tue, 16 Dec 2014 03:20:01 GMT</pubDate>
            <atom:updated>2014-12-16T03:20:01.451Z</atom:updated>
            <content:encoded><![CDATA[<p>Usually during standard process of development you would have several environments like DEV, QA, UAT/STAGING and so on. The more environments you have — the more cases and differences in deployment you will need to implement. In this post I would try to describe how you could simplify your life implementing CI for Sitecore based projects.</p><p>Almost immediately you would face a question of content synchronizations. There are a lot of options that you could use:</p><ul><li>Content Package — the most obvious variant one could come up with however you cannot automate it out of the box. Automation of content packages deployment is quite complex task as you need invent versioning for them, need to store in them in VCS</li><li><a href="https://github.com/kamsar/Unicorn">Unicorn project</a> — solution based on content <a href="http://sdn.sitecore.net/upload/sitecore7/70/serialization_guide_sc70-a4.pdf">serialization</a>. You will need to integrate some event handlers on content changes in order to keep sitecore serialization folder up to date. It will allow you to update content via http call from CI as well.</li><li><a href="https://www.hhogdev.com/products/team-development-for-sitecore/overview.aspx">Hedgehog TDS</a> — this is an extension to Visual Studio that does a lot more that just serialization. You could merge content, sync from VS generate code based on templates and so on. With CI it could be integrates quite easily as you just need to build project with specific setting.</li><li>Database project — more or less standard variant when it came to DB sync, but with Sitecore it would not work as good as expected. You will not have any control of sync of sitecore items and after some period of time it will be extremely long operation especially if you have some media items in DB.</li></ul><p>From my practice TDS — is the most useful tools, but it is not free so you need to decide for yourself.</p><p>Moreover, when it comes to users and role synchronization — none of this tools will, except DB project (but I would not recommend it due to reasons above). To solve this issue I’ve come up with several pipelines that could be started on Sitecore init and check roles needed or even create them. The most suitable place for this operation is <strong>initialize </strong>pipeline.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/08a261fb2399a735191a893bd8570014/href">https://medium.com/media/08a261fb2399a735191a893bd8570014/href</a></iframe><p>Processor implementation for this pipeline is quite simple — we just check and create roles if the do not exist (see gist below). Users creation is little bit more complex and require different configurations for each environment. To do this you will need transforms for include configurations. I will describe tools and approach in following articles.</p><p><strong>Tags</strong>: #ci #roles #sitecore #sitecore7 #tds #users</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b531ee3611c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sitecore-tips-tricks/sitecore-continuous-integration-part-1-2b531ee3611c">Sitecore Continuous Integration, part 1</a> was originally published in <a href="https://medium.com/sitecore-tips-tricks">Sitecore Tips &amp; Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sitecore — Round Image Processor]]></title>
            <link>https://medium.com/sitecore-tips-tricks/sitecore-round-image-processor-93b614d8094f?source=rss-675c5c848a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/93b614d8094f</guid>
            <dc:creator><![CDATA[Alexander Smagin]]></dc:creator>
            <pubDate>Wed, 21 May 2014 20:41:17 GMT</pubDate>
            <atom:updated>2014-05-26T13:23:46.742Z</atom:updated>
            <content:encoded><![CDATA[<h4>How to create round images</h4><blockquote>Post moved to Blogger, due to better code snippets facilities<br><a href="http://alexander-smagin.blogspot.com/2014/05/sitecore-round-image-processor.html">http://alexander-smagin.blogspot.com/2014/05/sitecore-round-image-processor.html</a></blockquote><p>When you are creating a marketing site with a lot of visual on it very likely that you will need to process images that you need to display.</p><p>Fortunately, Sitecore provide you with some basic operation that you would need like resize or grayscale image. Moreover it will think for about caching images on server side after processing, so that processing of the image for specific page will happen only once. ( <em>for more information about images params see </em><a href="http://briancaos.wordpress.com/2011/02/28/sitecore-image-parameters/"><em>this link</em></a><em>. </em>)</p><p>In my case there was a specific request to get round images:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*BCpcvzEUpD9bSsfpGu2dXg.png" /></figure><p>To add this functionality to Sitecore we need to intercept MediaStream pipeline and make our changes. It is important that we add our processor before the image would be resized, as it our processor will not be able to get original dimensions of image.</p><pre>Source: <a href="https://gist.github.com/asmagin/4132e7ddb00c5be9b124#file-config-xml">part of web.config</a></pre><p>When we identify correct place to add handler we need to add some code for processing.</p><pre>Source: <a href="https://gist.github.com/asmagin/4132e7ddb00c5be9b124#file-imageprocessor-cs">ImageProcessor.cs</a></pre><p>First of all we should skip processing if flag <strong>args.Options.Thumbnail</strong> is set to <strong>true</strong> or <strong>OutputStream </strong>is not set previously.</p><p>Then we need to check some parameter (in my case <strong>rnd</strong>) in <strong>args.Options.CustomOptions</strong> to define whether we should apply our transformations and finally to check if a content of the stream is an image.</p><p>When all conditions are satisfied we could run our transformation functions and assign returned stream to <strong>args.OutputStream</strong>, so that resize or grayscale processors will use our rounded image.</p><p>Image transformation is quite straightforward: we read image data from the stream and fill ellipse with it. Image background we should fill with default background color or transparent in case of png-files.</p><p><strong>Tags</strong>: #sitecore #images #processors #media</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93b614d8094f" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sitecore-tips-tricks/sitecore-round-image-processor-93b614d8094f">Sitecore — Round Image Processor</a> was originally published in <a href="https://medium.com/sitecore-tips-tricks">Sitecore Tips &amp; Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sitecore MVC — fallback device]]></title>
            <link>https://medium.com/sitecore-tips-tricks/sitecore-mvc-fallback-device-a9618641fdf3?source=rss-675c5c848a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/a9618641fdf3</guid>
            <dc:creator><![CDATA[Alexander Smagin]]></dc:creator>
            <pubDate>Thu, 15 May 2014 06:51:50 GMT</pubDate>
            <atom:updated>2014-05-26T13:24:34.378Z</atom:updated>
            <content:encoded><![CDATA[<h4>Implementation of layout fallback device in Sitecore MVC </h4><blockquote>Post moved to Blogger, due to better code snippets facilities<br><a href="http://alexander-smagin.blogspot.com/2014/05/sitecore-mvc-fallback-device.html">http://alexander-smagin.blogspot.com/2014/05/sitecore-mvc-fallback-device.html</a></blockquote><p>Sometimes when you creating mobile versions of a site, you could decide to show some page from desktop version and do not create mobile layout for them (e.g. they are less important than other pages or not visited frequently). Sitecore has setting for that called <strong>Fallback Device. </strong>However, when you are working with MVC layout it is not really working. Nice moment over here is that it is really easy to enable it.</p><h4>MVC layout background</h4><p>In order to add fix you need to understand how Sitecore understands that you need to switch to MVC and find right place for fix. All magic starts in <strong>httpRequestBegin </strong>processors section</p><pre> &lt;processor type=&quot;Sitecore.Mvc.Pipelines.HttpRequest.TransferMvcLayout, Sitecore.Mvc&quot; patch:after=&quot;processor[<a href="http://twitter.com/type">@type</a>=&#39;Sitecore.Pipelines.HttpRequest.LayoutResolver, Sitecore.Kernel&#39;]&quot; /&gt;</pre><p>When you page item is resolved and we could get information about its layout Sitecore understands that you are using .cshtml layout and transfer processing to MVC.</p><p>During the processing Sitecore MVC execute following section:</p><pre>&lt;mvc.getPageRendering&gt;<br>    &lt;processor type=&quot;Sitecore.Mvc.Pipelines.Response.GetPageRendering.GetLayoutRendering, Sitecore.Mvc&quot;/&gt;<br>&lt;/mvc.getPageRendering&gt;</pre><p>This is exactly the code we were searching for ☺</p><p><strong>Pipeline upgrade</strong></p><pre>Source code: <a href="https://gist.github.com/asmagin/70336fb5982fdf139579#file-getlayoutrenderingwithfallback-cs">GetLayoutRenderingWithFallback</a>.cs</pre><p>We inherit our pipeline from sitecore one and add some logic to handle cases when base implementation was not able to resolve layout (see source).</p><p>And the last thing that we need to do is to replace standard pipeline with Sitecore config patch. We are done.</p><p><strong>Tags</strong>: #sitecore #mvc #layout #fallback #device</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a9618641fdf3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sitecore-tips-tricks/sitecore-mvc-fallback-device-a9618641fdf3">Sitecore MVC — fallback device</a> was originally published in <a href="https://medium.com/sitecore-tips-tricks">Sitecore Tips &amp; Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sitecore 7 & Solr spell check]]></title>
            <link>https://medium.com/sitecore-tips-tricks/sitecore-7-solr-spell-check-4e024c829624?source=rss-675c5c848a14------2</link>
            <guid isPermaLink="false">https://medium.com/p/4e024c829624</guid>
            <dc:creator><![CDATA[Alexander Smagin]]></dc:creator>
            <pubDate>Tue, 13 May 2014 07:48:46 GMT</pubDate>
            <atom:updated>2014-05-26T13:26:00.402Z</atom:updated>
            <content:encoded><![CDATA[<h4>Extending Sitecore ContentSearch provider with Solr spell check</h4><blockquote>Post moved to Blogger, due to better code snippets facilities<a href="http://alexander-smagin.blogspot.com/2014/05/sitecore-solr-spell-check.html"><br>http://alexander-smagin.blogspot.com/2014/05/sitecore-solr-spell-check.html</a></blockquote><p>During one of our projects we faced with a problem that Sitecore 7 does not support out of the box some cool features of Solr like spell check and similar results , which were in great demand on one of our projects.</p><p>After some time of investigation with reflector we found out that this kind of customization would not be easy, as a lot of classes in Sitecore provider to Solr wasn&#39;t designed to support third party customization. There are a lot of internal classes and important properties hidden in private properties.</p><h3>Enable spell check on Solr side</h3><p>First of all you should <a href="http://wiki.apache.org/solr/SpellCheckComponent">configure spellcheck component</a> in solrconfig.xml (for our solution it was enough to change spellchecker.field).</p><pre>&lt;lst name=”<strong>spellchecker</strong>”&gt;<br>  ...<br>  &lt;str name=”field”&gt;<strong>field_name</strong>&lt;/str&gt;<br>  ...<br>&lt;/lst&gt;</pre><p>Then you should enable this component for <strong>select </strong>handler in order to be able to get the component results in response to query generated from Sitecore..</p><pre>&lt;requestHandler name=&quot;/select&quot; class=&quot;solr.SearchHandler&quot;&gt;<br>  ...<br>  &lt;arr name=&quot;last-components&quot;&gt; <br>    ...<br>    &lt;str&gt;<strong>spellcheck</strong>&lt;/str&gt;<br>  &lt;/arr&gt;<br>&lt;/requestHandler&gt;</pre><p>After that you could check if your configuration is working by querying link similar to that:</p><pre>http://<em>&lt;core url&gt;/select?spellcheck=true&amp;spellcheck.q=wroong+word&amp;spellcheck.collate=true</em></pre><p>Solr is ready and we could move forward to Sitecore.</p><h3>Solr provider in Sitecore</h3><p>As usual process of Sitecore extension starts with digging into sources through <strong>ILSpy </strong>or similar tools, this time was not an exception.</p><p>When we working with ContentSearch we are getting results by calling <strong>GetResults </strong>or <strong>GetFasets </strong>functions, which are implemented as an extension to <strong>IQueriable&lt;&gt; </strong>interface and add required node to Linq calls chain.</p><p>However, if we go further we will see that ContentSearch Linq parser and mapper understand only limited set of functions (defined by enum) and have no values reserved for the future, so the only possible way is get closer to <strong>SolrNet</strong> queries.</p><h4>Extending Solr Provider</h4><p>In order to do this we need to create an extension for IQueryable&lt;&gt; and pass search context and spell check query in it. Within the extension we create <strong>QueryOptions </strong>object from <strong>SolrNet </strong>and configure spell check.</p><pre><a href="https://gist.github.com/asmagin/85834218e66f0e9dc40c/raw/56a75d708fe73cf9504c04259a1cc87a4847128e/IQueryable%3C%3E%20extension">Source code: IQueryable&lt;&gt; extension</a></pre><p>Than <strong>QueryOptions </strong>should be added to as a property to a type inherited from <strong>SolrCompositeQuery</strong>.</p><pre><a href="https://gist.github.com/asmagin/85834218e66f0e9dc40c#file-extendedcompositequery">Source code: ExtendedCompositeQuery</a></pre><p>Composite query could be executed with help of <strong>LinqToSolrIndex&lt;&gt;</strong> class, but standard realization of this class will not recognize our <strong>QueryOptions</strong>, so it should be used as a base class for <strong>CustomLinqToSolrIndex</strong>&lt;&gt;.</p><pre><a href="https://gist.github.com/asmagin/85834218e66f0e9dc40c#file-customlinqtosolrindex">Source code: CustomLinqToSolrIndex&lt;&gt;</a></pre><p>In the class above we need to create <strong>Execute </strong>method that will take our <strong>ExtendedCompositeQuery</strong> as param and call overwritten logic (internal method <strong>SolrQueryResults</strong>) when we returning extended <strong>SearchResults </strong>(with <strong>SpellCheckedResponse </strong>field) and base in all other cases.<br>We also need to make some tweaks with reflection implementing new query execute logic like:</p><ul><li>getting <strong>ISolrOperations</strong>, <strong>SelectMethod </strong>and <strong>FacetResults </strong>from private field of base class</li><li>duplicate source code for <strong>SearchResults </strong>and <strong>SolrSearchResults </strong>classes, as original is sealed or internal ☹</li></ul><p><em>*** These point are definitely not the best options ever but as it was already mentioned ContentSearch.Solr.Provider was not designed for easy extensibility.</em></p><p>When all changes above are implemented we could call our extension and process results.</p><pre>var query = context.GetQueryable&lt;T&gt;()<br>    .Filter( &lt;filter query predicate&gt; );<br>var checked = query<br>    .CheckSpelling(context, &quot; &lt; phrase to check&gt; &quot;);</pre><p>This call will make separate call to Solr and will not return any mutch results and QueryOptions define amount or results rows = 0. To get search results or fasets you could call required method after calling <strong>CheckSpelling.</strong></p><p><strong>Tags</strong>: #sitecore7 #solr #search #provider #contentsearch #linq</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4e024c829624" width="1" height="1" alt=""><hr><p><a href="https://medium.com/sitecore-tips-tricks/sitecore-7-solr-spell-check-4e024c829624">Sitecore 7 &amp; Solr spell check</a> was originally published in <a href="https://medium.com/sitecore-tips-tricks">Sitecore Tips &amp; Tricks</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>