JavaScript, Node

Create Episerver Find index using Puppeteer

Currently working with many clients who utilise Episerver CMS to managed their content. Almost all of then use Episerver Find to index content.

Episerver do not provide an API to automate the creation of new indices. As I was messing around with Puppeteer and headless Chrome, I thought I’d knock up a tool to do this. You can find the code in my Github repo.

Using your favourite shell, clone the repo:

git clone
cd create-episerver-find-index

Install dependencies:

npm install

You’ll need to create a developer account for Find. Once this is done, you can create an index with the following:

node createindex.js --username [username] --password [password] --indexname [indexname]

The script returns the configuration for the newly created index, or an existing index if it already exists.

Ultimately I hope to use something like this within a continuous integration, or deployment pipeline, to make certain a valid index is available for the application.

Hope this helps someone.

Linux, Solr

Install Solr 5 and Zookeeper in a production environment

Recently I had to set up three Solr servers in an AWS environment. I couldn’t find anything specific to help me, so had to locate all the information separately. Hopefully the following may be of use to anyone who has to go through the same. In my situation, I have 3 servers that will sit behind a load balancer. The following describes how I set up each server.

Initially I thought it best to update all packages on each Amazon Linux AMI. I was using a green field environment. You might not be in that situation, so may not want to do the following.

sudo yum clean all
sudo yum update

Solr 5 requires a newer version of Java that was pre-installed on the server. So we need to obtained an updated Java package, and select it as the default version.

sudo yum install java-1.7.0-openjdk
sudo alternatives --config java

Continue reading


TypeScript Sublime Text integration

Something interesting has happened in the world of JavaScript development. Of all people, the folk at Microsoft have developed TypeScript.  If you’re in to such things, I don’t need to explain further.  There is a Visual Studio 2012 plugin, but these days I’ve fallen in love with Sublime Text.  Here’s a quick howto on TypeScript development with Sublime Text, specifically on Windows 7.

First install the Node.js msi package.  Once installed, open a command prompt and type the following to install the TypeScript compiler:

npm install -g typescript

Now grab the Sublime Text syntax hightlight definition file from MSDN. Open the zip and copy the typescript.tmplanguage file to your Sublime Text user packages directory. Mine is located in:

C:\Users\arowland\AppData\Roaming\Sublime Text 2\Packages\User\

Now open Sublime Text. Select Tools -> Build System -> New Build System. Paste in the following:

"selector": "source.ts",
"cmd": ["tsc.cmd", "$file"],
"file_regex": "^(.+?) \\((\\d+),(\\d+)\\): (.+)$"

Save this file. Now you can create a new JavaScript file, and save with the .ts extension. The editor will highlight TypeScript code, and allow you to compile to JavaScript by pressing Ctrl+B.  The build process will create the compiled JavaScript file in the same directory as the source TypeScript.


Entity Framework quick start

Microsoft’s Entity Framework has been around a while, but with it’s latest incarnation it is really shaping up nicely. I’ve been enjoying the ‘code first’ approach in version 4.1 of the framework. This allows you start your application design from POCOs, allowing the framework to infer the database design for you. For example, take the following Member entity model:

	class Member
		public int Id { get; set; }
		public string FirstName { get; set; }
		public string LastName { get; set; }

Continue reading

Codeigniter, PHP

Wolf CMS: Related pages plugin

For many small projects I’ve been using Wolf CMS.  a really nice and fairly lightweight application for managing content.  What I like about it is that the core code is quite minimal, but allows you to extend using plugins.

Recently I’ve been asked to build a site that requires a the ability to relate other pages to the one an editor is currently editing.

The plugin can be downloaded here. Note: This version is for Wolf 0.7.2 and above. The older plugin for Wolf 0.6 is also available. Once installed in the plugins directory and enabled in the administration screen, the following tab is now available when editing pages: Once installed in the plugins directory and enabled in the admininistration screen, the following tab is now available when editing pages:

Related pages plug-in screenshot

See the documention screen for sample frontend code which lists the related pages.

Please be aware that I really did knock this together rather quickly, but it works for me.  If anyone finds any bugs, please let me know.