Setting up EPiServer find demo index – The remote server returned an error: (413) Request Entity Too Large. 

When running indexing for EPiServer find, the “EPiServer Find Content Indexing Job” in admin tools. The episerver find logs were filling up with these errors:

The remote server returned an error: (413) Request Entity Too Large. 

Problem connected to restrictions for the developer demo index.
I added this setup method as last setup line to the FindInitializationModule:

	    private static void DemoIndexSetting()
	    {
	        string demoIndexSettings = ConfigurationManager.AppSettings["EnableEPiServerFindDemoIndexSettings"];
	        bool demoIndexEnabled = false;
	        if (bool.TryParse(demoIndexSettings, out demoIndexEnabled))
	        {
	            if (demoIndexEnabled)
	            {
                    /* 
                     * demo index has the following limitations:
                        Maximum 10000 documents
                        Maximum 5MB request size
                        Maximum 25 queries per second
                        The index will be removed after 90 days
                     */
                    ContentIndexer.Instance.Conventions.ForInstancesOf<IContentMedia>().ShouldIndex(x => false); //dont index any mediafiles, size limit is 5MB 
                    ContentIndexer.Instance.MediaBatchSize = 3; //default 5
	                ContentIndexer.Instance.ContentBatchSize = 20; //default 100, but demo has limit of 25 
	            }
	        }
	    }

Also added this setting to web.config to enable this feature for certain environments. (dev, test etc. using transformations)

<appSettings>
    ...
    <add key="EnableEPiServerFindDemoIndexSettings" value="true" />

Demo developer services:

https://find.episerver.com/

Elasticsearch for .NET and EPiServer developers

Ealasticsearch Tutorial:
https://www.toptal.com/dot-net/elasticsearch-dot-net-developers

Vulcan is an EPiServer lightweight (free) alternative to EPiServer find, based on Elasticsearch as well:
https://world.episerver.com/blogs/Dan-Matthews/Dates/2016/4/introducing-vulcan-the-lightweight-elasticsearch-client-for-episerver/

https://world.episerver.com/blogs/Dan-Matthews/Dates/2017/1/vulcan-comes-of-age/

Creating EPiServer admin tool plugins using MVC

Creating the tool:
EPiServer – How to create gui plugins using MVC – Dejan Caric
I had to configure the route initialization like this to make it work:

        public void Initialize(InitializationEngine context)
        {
            //ContentLanguagePlugin
            RouteTable.Routes.MapRoute("ContentLanguagePlugin", "admin-tools/content-language-plugin/{action}/{id}",
                new
                {
                    controller = "ContentLanguagePlugin",
                    action = "Index",
                    id = UrlParameter.Optional
                },
                new
                {
                    controller = "ContentLanguagePlugin"
                });

        }

I added EPiServer resources in <head> for EPiServer CSS feeling to it:
(_Layout.cshtml file)

@using EPiServer.Framework.Web.Resources
<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
    <title>Content Language Tool</title>

    <!-- Shell -->
    @Html.Raw(ClientResources.RenderResources("ShellCore"))
    @Html.Raw(ClientResources.RenderResources("ShellWidgets"))

    <!-- LightTheme -->
    @Html.Raw(ClientResources.RenderResources("ShellCoreLightTheme"))

    <!-- Navigation -->
    @Html.Raw(ClientResources.RenderResources("Navigation"))

    <!-- Dojo Dashboard -->
    @Html.Raw(ClientResources.RenderResources("DojoDashboardCompatibility", new[] { ClientResourceType.Style }))
    
    <style>
        a {
            color: blue !important;
        }
        a:hover {
            text-decoration: underline !important;
        }
    </style>
</head>

<body>
    <div class="epi-padding epi-contentArea">
        <div>
            @RenderBody()
        </div>

    </div>
</body>
</html>

Some info regarding the EPiServer CSS classes etc:
https://www.epinova.no/en/blog/creating-a-consistent-look-in-episerver-plugins/

 

How to define default values for pages and blocks in EPiServer CMS 7+

Source: How to define default values for pages and blocks in EPiServer CMS 7

Also see this: using [DefaultValue] attribute:
Default property values on content in EPiServer are set by overriding SetDefaultValues. In an attempt to make my model classes a bit tidier, by not having to do the override in lots of places, I wrote a little piece of code which enables the use of the DefaultValue attribute (found in System.Component)

from: http://world.episerver.com/blogs/Per-Magne-Skuseth/Dates/2014/3/Attribute-based-default-values/

Set available buttons for TinyMCE Editor in EPiServer 8+

From this guide:
http://world.episerver.com/documentation/Items/Developers-Guide/Episerver-CMS/9/Content/Properties/Property-settings/

A toolbar looking like this (quite many buttons available):
Image 20160517 145713 001

Uses this TinyMCESettings C# code:

using EPiServer.Core.PropertySettings;
using EPiServer.Editor.TinyMCE;
using EPiServer.ServiceLocation;

namespace MySolution.Core.ContentEditing
{
    [ServiceConfiguration(ServiceType = typeof(PropertySettings))]
    public class DefaultTinyMCESettings : PropertySettings<TinyMCESettings>
    {
        public DefaultTinyMCESettings()
        {
            IsDefault = true;
            DisplayName = "Default settings";
            Description = "Default configuration as defined by the developers.";
        }

        public override TinyMCESettings GetPropertySettings()
        {
            var settings = new TinyMCESettings();

            settings.ToolbarRows.Add(new ToolbarRow(new string[]
            {
                TinyMCEButtons.EPiServerLink, TinyMCEButtons.Unlink, TinyMCEButtons.Image, TinyMCEButtons.EPiServerImageEditor, TinyMCEButtons.EPiServerPersonalizedContent, TinyMCEButtons.Separator,
                TinyMCEButtons.PasteText, TinyMCEButtons.PasteWord, TinyMCEButtons.RemoveFormat, TinyMCEButtons.Separator,
                TinyMCEButtons.TableButtons.Table, TinyMCEButtons.Separator,
                TinyMCEButtons.TableButtons.RowProperties, TinyMCEButtons.TableButtons.CellProperties, TinyMCEButtons.Separator,
                TinyMCEButtons.TableButtons.InsertRowBefore, TinyMCEButtons.TableButtons.InsertRowAfter, TinyMCEButtons.TableButtons.DeleteRow, TinyMCEButtons.Separator,
                TinyMCEButtons.TableButtons.InsertColumnBefore, TinyMCEButtons.TableButtons.InsertColumnsAfter, TinyMCEButtons.TableButtons.DeleteColumns, TinyMCEButtons.Separator,
                TinyMCEButtons.TableButtons.SplitCells, TinyMCEButtons.TableButtons.MergeCells
            }));
            settings.ToolbarRows.Add(new ToolbarRow(new string[]
            {
                TinyMCEButtons.Bold, TinyMCEButtons.Italic, TinyMCEButtons.EPiServerQuote, TinyMCEButtons.Separator,
                TinyMCEButtons.JustifyLeft, TinyMCEButtons.JustifyCenter, TinyMCEButtons.Separator,
                TinyMCEButtons.SuperScript, TinyMCEButtons.SubScript, TinyMCEButtons.BulletedList, TinyMCEButtons.NumericList, TinyMCEButtons.CharacterMap, TinyMCEButtons.Outdent, TinyMCEButtons.Indent, TinyMCEButtons.Separator,
                TinyMCEButtons.StyleSelect, TinyMCEButtons.Separator,
                TinyMCEButtons.Undo, TinyMCEButtons.Redo, TinyMCEButtons.Separator,
                TinyMCEButtons.Search, TinyMCEButtons.Replace, TinyMCEButtons.Separator,
                TinyMCEButtons.Code, TinyMCEButtons.Separator,
                TinyMCEButtons.Fullscreen
            }));

            // Add the default non-visual plugins that replaces built in functionality with EPiServer specifics.
            settings.NonVisualPlugins.Add("advimage");
            settings.NonVisualPlugins.Add("epifilebrowser");

            //if (PrincipalInfo.CurrentPrincipal.IsInRole("administrators"))
            //{
            //    //Chance to personalize. Let's allow administrators to access the html editor.
            //    settings.ToolbarRows[1].Buttons.Add("code");
            //}

            settings.Height = 200;
            settings.Width = 600;
            return settings;
        }

        public override System.Guid ID
        {
            get { return new System.Guid("a6fe936f-190d-45e2-b83c-ccc0501a7312"); }
        }
    }
}

 

Troubleshooting EPiServer 7+ search indexing-service

Search index is located at:
directoryPath=”[appDataPath]\Index”
Index folder can be deleted, an then triggered by this tool (click start indexing).
Url: http://[mysite]/EPiServer/CMS/Admin/IndexContent.aspx
The index folder should now be created if all configuration is correct.

Troubleshooting: Troubleshooting EPiServer search indexing-service | Hans Kindberg

Setup and configuration for search: Svein Aandahl’s Blog: How to install EPiServer Search for EPiServer CMS 7