Installing SiteCron through NuGet and Configuring

watch-header2Last week I needed to run a Job to perform a daily task within Sitecore so I decided that SiteCron would be the perfect fit for this. SiteCron allows you to run Jobs on a schedule within Sitecore using Cron expressions (under the hood it uses Quartz.NET). I’ve used SiteCron on 3 or 4 projects in the past and really like how reliable and configurable it is for these kind of requirements.

Each time I install it though I forget the steps (especially if doing it via NuGet) so I thought I’d give an overview of this below, including the Unicorn config I used.

Wait, where is the SiteCron version for Sitecore 9+?

Unfortunately the latest version at the time was 3.4 which was compiled against .Net 4.5.2 for Sitecore 7 – 8.3.
The client I was working with use Sitecore 9.3 which requires .Net 4.7.1.
So I compiled a new version (3.5) from the Source on Github for Sitecore 9.3 and created a Nuget package. I noticed that João Neto had also created a branch with an upgraded version that should work with Sitecore 10.1 so created a NuGet package for that too (3.6). Akshay (who created SiteCron) kindly uploaded them to NuGet for me.

sitecron-tweet

What version of SiteCron should I use and How do I install it?

You can download Sitecron from the Marketplace however only 3.2 is released there currently. So I’d advise you install it from Nuget instead. Also generally this is a better way to manage the installation and deployment of Modules in Projects.

Here are the versions of SiteCron you should install for each Sitecore version:

  • Sitecore 7-8.2 –> use SiteCron 3.4
  • Sitecore 9.1-9.3 –> use SiteCron 3.5
  • Sitecore 10.1 –> use SiteCron 3.6

    What about Sitecore 9.0 and 10.0?
    – well 3.4 might work with Sitecore 9 and 3.6 may work with Sitecore 10 but I’m not sure, I’ve not tested them.
    If you try them and they don’t work please pull the source, update the .Net version and compile one or let me know and I’ll try and help.

Install Process via NuGet and Unicorn

  1. Within the project you want to install Sitecon in, either use the NuGet package manger in Visual Studio or run the Install-Package command with the version you need:
    Install-Package SiteCron -Version 3.5.0
  2. Once you’ve installed the package you will see the following have been installed in your project:
    +---App_Config
    | \---Include
    | \---Z.SiteCron
    | SiteCron.config
    | SiteCronJobs.config
    | 
    +---sitecore
    | \---admin
    | SiteCron.aspx
    | 
    \---SitecorePackage
     Konabos.Minions.RunMinion.dll
     Konabos.Minions.RunMinion.Help.txt
     SiteCron FULL Sitecore Package.zip
     SiteCron Items Only Sitecore Package.zip

    You should see there are two packages installed from NuGet along with some config, dlls and an admin page.

  3. Next I’d recommend installing the ‘SiteCron Items Only Sitecore Package.zip’ on your local Sitecore instance. This will install just Sitecore items that are required to run the module but no other files.install-sitecron-items-only-package
    Once you’ve installed the package you should see something like the following:
    sitecron-after-install
  4. Next, if your using Unicorn you should configure settings similar to below to ensure the items you just installed get Serialized to disk and deployed to other environments. Were using Helix Base but if you are not the config will be quite similar to the below.

    After completing step 7 below you should serialize this config from the Unicorn control panel once it’s deployed locally.
  5. Review the settings in /Z.SiteCron/SiteCron.config and adjust as required.

  6. Tidy up – you can now remove the Sitecore zip packages from the project and if you are not using Commerce you can remove the Minion dlls too.
  7. Build and publish the Project.
  8. Finally enable one of the sample Jobs that are installed in the OOTB folder and check that it runs correctly. If it does not run then Check the logs.

Creating Custom Jobs using SiteCron

Akshay has written some info on creating Jobs and using it like this one here. I’ve written a few posts before on this too so check them out.

Contributing to SiteCron

If you’d like to contribute to the module then I’m sure Akshay would appreciate it. You can pull the source from here: https://github.com/akshaysura/Sitecron and branch it and then create a pull request.

Note that the active branch is master and that the current code-base has been updated for 10.1. Therefore if you are looking to update the code for an older version of Sitecore then you may need to branch from an older commit to master instead. It’s probably best to reach out to Akshay to be sure.

Once you’ve created an updated version of the Module make sure you also update the AsemblyInfo.cs file with the new version number. You can then run the following command to create a NuGet package and share it with Akshay too:

nuget pack Sitecron.csproj -version 3.7.0

 

Hopefully this is useful for anyone working with SiteCron in future and I’ll aim to update this for future releases if required.

Creating Microsites In Sitecore without SXA

dynamic-sites-globe2

I’ve not used SXA in anger but have heard good things about it. Unfortunately due to licencing and timeframes it was not an option for me on a recent project where I was required to recommend and deliver an mechanism for quickly creating Microsites in Sitecore.

TLDR: If SXA is not an option then Dynamic Sites Manager might be a good alternative for you.

This meant I had 3 options:

1) Manual Configuration in the Sitecore Config
2) Use a Sitecore Microsite Module (such as the Multiple Sites Manager)
3) Write something custom to support adding Microsites dynamically

Manual Config wasn’t really an option as I knew that we had a number of Microsites to add and having a more flexible approach with less work and maintenance involved was important. I also didn’t want to write something custom as I knew this would be a time-sink involving solving problems other people have already had to with one of the Sitecore Modules available.

Dynamic Sites Manager To The Rescue

After a fair amount of research and experimentation I decided upon an lesser known Module called Dynamic Sites Manager built by Pete Navarra. As we are using Sitecore 8.2 I decided to use this specific version (1.9.1) from Github.
This happens to be the most recent release of the Module. It does work with Sitecore 9.0 too.

Pete has written one or two posts on the Dynamic Sites Manager but during the setup and of the module and configuration of the various sites I learned some useful tips I thought I’d share. On the project I’m currently working on we have two Sites that are live using the Dynamic Sites Module so far and both are functioning well.
Pete was also really helpful on Slack fielding all my questions so I wanted to return the favour and blog about it.

Reasons I chose Dynamic Sites Manager

  • It’s been written for performance, it uses the Site Provider Pattern and doesn’t just hook into the HttpBeginRequest pipeline (like the Multiple Sites Manager does) – this can cause caching issues
  • Microsites an be added and (most) configuration implemented purely within Sitecore
  • Each Microsite has a number of settings that mimic native Sitecore config for a Site
  • Content for the Microsites can be created wherever you wish
  • Roles can be configured for Microsite content as normal in Sitecore
  • Existing Layouts, Components and functionality already created in Sitecore can be used in Microsites
  • The module works with Sitecore 8.2, has been around for a few years and has had 8 releases so is quite mature.
  • I tested the module with Sitecore 9.0 today and it works so when we upgrade to 9.x It should continue to work correctly.
  • The code is open source on Github so we can fork it and change anything if we need to
  • It has been battle-tested on large sites with 100s of Microsites

Installing the Module

The first step is to download and install the Module. You can download it from the Market Place. The direct link for 1.9.1 is here.

Install the module using the package installation wizard as normal.

dynamic-sites-1.9-install-2

Once the module installation has completed open the DynamicSites.config.example config file  here: /App_Config/Includes/X.SharedSourceModules and rename  to DynamicSites.config.

dynamic-sites-1.9-install-3

 

 

 

 

 

This will enable the module and configure the default settings for the module, as defined at the top of the file this config file adds:

1) Event Handlers to Update Custom Chosen Templates with Dynamic Sites Base Template
2) Site Providers for both Dynamic Sites as well as a Switcher Provider.
3) Dyanamic Site Default Settings. All Dynamic Sites will inherit from these default properties.
4) 4 Sitecore Settings.

I’d recommend leaving this as it is for now and coming back to tweak settings if you need to.

Module Configuration

The next steps are to configure the module settings within Sitecore and create your first Dynamic Site.

You can set some general settings if you wish for the module here: /sitecore/System/Modules/Dynamic Sites/Dynamic Site Settings. You will probably find you can just leave most of the default settings here ‘as is’.

One thing you may want to consider doing is updating the Site Definition Template. The dropdown highlighted below allows you to set a custom template as the Site Definition template. This adds a Dynamic Site Definition Base template to the item and allows site configuration to occur on the item level:

dynamic-sites-1.9-install-4

This will likely be if you wish to customise the configuration settings in future.

For now you can just continue with using the Site Definition Template that ships out of the box with the Module.

Creating A Dynamic Site

For this example I’m going to do this on my local machine but if this was on another environment the process would be very similar. I have a site called ‘Demo Site 1’ which I’ll use for this example:

dynamic-sites-1.9-install-6

  1. Go to: /sitecore/system/Modules/Dynamic Sites/Sites
  2. Right click on the folder to Insert a new Dynamic Site Definition (I called mine ‘Demo Site 1’)
  3. Configure the Key Settings for your Site such as:
    – Hostname – the url which will be used for your Site
    Home Item – the Home item of your site (In my case: /sitecore/content/Demo Site 1)
    Port – this will be (I hope!) 443 for Live but locally you may be using Port 80 perhaps. If you using a self signed cert locally you can use 443 locally too.
    Database – this will likely be web for local testing (depending on if you want to view the published or un-published content)dynamic-sites-1.9-install-7

    Dynamic Site Custom Properties – you can over-ride any settings you wish that are usually on the <site> node in the Sitecore config here or you can add any custom properties you need to support. For example I had a custom cdn url property that I added which you can see below.dynamic-sites-1.9-install-8
  4. Add your binding in IIS to your Sitecore site, this is my local Sitecore 8.2 u7 instance:
    dynamic-sites-1.9-install-9
  5. Add a host file entry to the Site (on another environment this would obviously be handled with a DNS).
  6. Ensure your Website Homepage is in it’s final workflow step and Published. If all is well you should then see the webpage if you visit it in your browser (e.g: http://demosite1.local)

dynamic-sites-1.9-install-5

Supporting Preview / Published Sites

Our content editors wanted to be able to preview their content on the CM (Master) before publishing to CD (Web). I wasn’t sure on how best to handle this scenario so I reached out to Pete on Slack and he was really Helpful.

It turns out the best way to set this up is to create two Site Definition items, one for CM and one for CD. Both sites should have the Home Item set as the same (most other settings will be the same also).

The CM Site Definition item needs to be at the top of the list (above the CD Site Definition item – so it resolves first on the CM) and be set as un-publishable. Note I’ve pre-fixed my Site Definitions with CM and CD to easily identify them:

dynamic-sites-1.9-install-11

 

You then need to configure a different hostname for the CM Site (e.g: master.demosite1.local). If all is well you should be able to view the master site and see differences in the Master content:

dynamic-sites-1.9-install-12

Other Considerations

WFFM

One of the stumbling blocks I came across is that when configuring the default Web Forms For Marketeers form folder I got an error as it couldn’t find an ID. The issue was that I was including the brackets within the config in the Site Definition. Therefore ensure you remove the brackets like so:

dynamic-wffm

Unicorn

If you use Unicorn to sync your Sitecore items across environments. You may wish to sync your Dynamic sites and content via Uncorn. I settled on 2 different configurations to handle this.

A new items only configuration to deploy the Main Site Home Item only one like so (this is redacted):

<configuration name="Dynamic Sites New Items Only" description="Unicorn Config for new Dynamic sites items only (Existing items, deleted items or changed items are ignored)">
 <evaluator type="Unicorn.Evaluators.NewItemOnlyEvaluator, Unicorn" singleInstance="true"/>
 <dataProviderConfiguration enableTransparentSync="false" />
 <predicate>
 <include name="DynamicSitesNewItemsOnlyDemoSite1" database="master" path="/sitecore/content/Demo Site 1/Home">
 <exclude children="true"/>
 </include>
 </predicate>
 <dataProviderConfiguration enableTransparentSync="false" />
 <syncConfiguration updateLinkDatabase="true" updateSearchIndex="true" />
</configuration>

A main configuration to deploy component content folders and setting items to the site likes so (this is redacted):

<configuration name="DynamicSites" description="Unicorn Config for DynamicSites Items">
<predicate>
 <exclude path="/sitecore/content/Demo Site 1/Home" />
 <exclude childrenOfPath="/sitecore/content/Demo Site 1">
 <except name="Forms" includeChildren="false"/>
 <except name="Components" includeChildren="false"/>
 </exclude>
 <exclude childrenOfPath="/sitecore/content/Demo Site 1/Components/Banners" />
 <exclude childrenOfPath="/sitecore/content/Demo Site 1/Components/Promos" />
 <include name="DynamicSitesMediaFolders" database="master" path="/sitecore/media library/DynamicSites" includeChildren="true">
 <exclude childrenOfPath="/sitecore/media library/DynamicSites/Demo Site 1/Images"/>
 <exclude childrenOfPath="/sitecore/media library/DynamicSites/Demo Site 1/Files"/>
 </include>
</predicate>
<!--exclude the dynamic sites fields that will be different for each environment-->
<fieldFilter type="Rainbow.Filtering.ConfigurationFieldFilter, Rainbow">
 <exclude fieldID="{2E6EA147-39B4-48B9-B729-89DB73646518}" note="'Hostname'" key="Hostname" />
 <exclude fieldID="{671F0A96-8270-49C6-B25C-17A4A4EE5730}" note="'Port'" key="Port" />
 <exclude fieldID="{A9B6C54F-88CB-4A9F-9250-6B2B1D26B79C}" note="'Properties'" key="Properties" />
 <exclude fieldID="{E6869EFC-46EB-458E-9990-3DBF914E6F85}" note="'Database'" key="Database" />
</fieldFilter>
<dataProviderConfiguration enableTransparentSync="false" />
<syncConfiguration updateLinkDatabase="true" updateSearchIndex="true" />
</configuration>

Note the use fieldFilter usage here to exclude deployment of the environment specific fields such as the Hostname.

Caching

The caching for the Dynamic Sites module has been implemented using a custom Sitecore cache and therefore shows up in the Sitecore Cache.aspx page viewer. If you want to explore what is in the cache to debug any issues with Caching then you might want to use an tool to do so. I used this Cache Viewer SPE Module and it worked really well for seeing the cache for each Site. The cache key used is DynamicSites.SiteCache.

dynamic-cacheviewer

You should find that if you clear the cache then any settings you update should update and be reflected.

Default Context Database Issue

We had some issues serving some Dynamic Sites from the CD Server. The error we were seeing was:

ERROR An error while Initializing occurred
Exception: System.InvalidOperationException
Message: Could not find configuration node: databases/database[@id='master']
Source: Sitecore.Kernel
 at Sitecore.Configuration.DefaultFactory.GetConfigNode(String xpath, Boolean assert)
 at Sitecore.Configuration.DefaultFactory.CreateObject(String configPath, String[] parameters, Boolean assert)
 at Sitecore.Configuration.DefaultFactory.GetDatabase(String name, Boolean assert)
 at Sitecore.Configuration.DefaultFactory.GetDatabase(String name)
 at Sitecore.SharedSource.DynamicSites.Utilities.DynamicSiteSettings.get_GetCurrentDatabase()
 at Sitecore.SharedSource.DynamicSites.Utilities.DynamicSiteSettings.get_GetSettingsItem()
 at Sitecore.SharedSource.DynamicSites.Utilities.DynamicSiteSettings.get_SitesFolder()
 at Sitecore.SharedSource.DynamicSites.Utilities.DynamicSiteManager.GetDynamicSitesDictionary(Site defaultSite)
 at Sitecore.SharedSource.DynamicSites.Sites.DynamicSitesProvider.InitializeSites()
 at Sitecore.SharedSource.DynamicSites.Sites.DynamicSitesProvider.GetSites()

After some further digging into the DynamicSiteSettings class It turned out that for some reason the module was not finding the context database and so was falling back to Master in this block of code:

public static Database GetCurrentDatabase
 {
 get
 {
 return Context.ContentDatabase ?? Context.Database ?? Database.GetDatabase("master");
 }
 }

Our CD servers do not have access to the Master database so thats why the error only occurred on CD. To resolve this I branched the module and added a setting for the database fall-back instead of a hard coded ‘master’ value. This is set like so in the config:

<!-- Dynamic Sites - Fallback Current Database
 The database to fallback to when getting the current database 
 if Context.ContentDatabase & Context.Database are null
 -->
 <setting name="DynamicSites.FallbackCurrentDatabase" value="master" />

On our CD servers we set this to Pub where our published live content exists and this resolved the issue. This issue doesn’t seem to occur on an out of the box install of 8.2 u7 or 9.0 so It may be a nuance of our specific setup but if you come across if feel free to use my patched version.

Conclusion

We’ve only launched two Sites using the Dynamic Sites Manager Module so far but it’s working really well. Obviously you don’t get a bunch of pre-built components and some of the other Bells and Whistles you get with SXA but if you need  flexible, simple, well implemented, and full-featured Microsite/Dynamic Site solution which allows you to use your existing page templates and components then I can highly recommend it.

Thanks again to Pete for his hard work on this and his assistance. I’ll try not to ask him any more questions…

Excluding Specific Fields from Unicorn Serialisation (Field Filter)

unicorn

This week I had a situation where I needed to include some Sitecore Items in Unicorns Sync but exclude certain fields from those items.  In my case these were navigation items which had a link on them. I wanted to maintain the ids of the navigation item across environments but not the link – as it changes per environment.

I’ve used Unicorn a lot in quite a few Sitecore projects but I’ve never had to do this before so I wasn’t sure if it was possible or not.

It turns out it is, Unicorn has an feature called a ‘Field Filter’.

I can’t work out exactly when this became available but it looks like since version 4.0 Unicorn supports config based filtering.

Luckily we are on Unicorn 4.0.8 so we didn’t need to upgrade.

How do you use it?

Field filters are actually used in the <defaults> node in the Unicorn.config that is provided by default by Unicorn, here is an example of the Last run field being excluded:

<fieldFilter type=”Rainbow.Filtering.ConfigurationFieldFilter, Rainbow” singleInstance=”true”>
<exclude fieldID=”{B1E16562-F3F9-4DDD-84CA-6E099950ECC0}” note=”‘Last run’ field on Schedule template (used to register tasks)” />
</fieldFilter>

Adding the fieldFilter for a specific Configuration

Anything in Unicorn defaults can be overridden/defined at a configuration level  in my case this is what I wanted to do, here is how my custom configuration looks after adding in the exclusion rule for the Home Link field on my Navigation items:

After deploying this update and running Reserialize on this config I could see that the Home Link field had been excluded in the YAML file written to disk :-).

I couldn’t find much on this so thought this might help others who need to do this in future.

Further Options in Unicorn 4.1 – Field Transforms

After posting this Mark Cassidy (who works on Unicorn) tweeted me to remind me about a feature that has just been released and he blogged about it last week:

marks-tweet  

Essentially allowing you to keep certain fields under Source Control, but giving you much more control over what happens to the field values in specific environments using filters.

I haven’t tested this but it looks like this could be used like so to exclude my Home Link field:

In this case I’ve chosen to put the fieldTransforms on the <include> node but if you wanted to apply the filter to the whole config by adding it to the <predicate> instead.

When we’ve upgraded Unicorn to 4.1 I’ll test this and see how it works out.

 

My thoughts on SUGCON 2016 – Day 2

badgeThere was an early start for Day 2 (especially after a late-ish night involving a few strong Danish Beers), but I knew there were some intriguing talks today so didn’t want to miss anything.

You can read about Day 1 here if you missed it.

The first session that caught my interest was Nick Wesselmans talk on how Active Commerce use SIM, Powershell, Octopus Deploy and Azure to automate product builds.

Using SIM, Powershell, Octopus Deploy and Azure to automate product builds.

Nick gave an overview of how they created a PowerShell wrapper for SIM to automate Sitecore instances for product builds for their Active Commerce product.

IMG_5762

He also talked about how they use Sitecore Power Shell Extensions (SPE) to do things like automate publishing, rebuild the links database and initialise Sitecore Zip package builds. I’ve experimented with SPE but I’ve not used it in anger and this has given me ideas for how I might use it more on current or future projects.

IMG_5764

Finally, he talked about their use of Octopus for deployment of packages and invoking PowerShell scripts and Azure IaaS and Azure Blob Storage and AzCopy which is used for quickly spinning up VMs for hosting the product build and test environments. I liked the idea of these being scripted to only run during business hours.

IMG_5768

The Active Commerce team also use Bamboo for their build server (but are thinking of moving to Team City). Nick showed us that their build pipeline looks like this:

IMG_5773

It was nice to see some familiar approaches here, albeit with different tools in some instances and some new ideas too.

You Me and Sitecore MVC

After a short break Kern Herskind delivered and entertaining (and Circus themed) presentation on Sitecore MVC. He even rode a unicycle at the end!

IMG_5777

Kern gave a general overview on MVC for those not familiar with the concepts and then how Sitecore MVC works and whats available out of the box. Not much of this was new to me but it was good get a refresher anyway.

Then Kern talked through some of the downfalls of Sitecore MVC and how he has gone about solving them. Things like renderings not being able to alter any HTML that is rendered prior to them being rendered and multiple form posting issues.

IMG_5781

IMG_5782

IMG_5783

We then go a sneaky peak of what coming up for Sitecore MVC, such as abstract base classes and better ServiceLocator and DI support:

IMG_5869-3

IMG_5873

Kern finished by talking about the future of Sitecore MVC and expectations for the future.

IMG_5787

Good to see better documentation and closing feature gaps on the list of improvements.

IMG_5788

The key message here being that Sitecore MVC is going to continue to be the preferred UI Framework.

Hedgehog then did a quick talk on their TDS product and helped to answer the question a lot of developers might have, “why should I pay for TDS instead of using Unicorn”.  The answer is probably in these two slides, maybe go and show them to your Boss :-).

IMG_5791

Essentially it does a lot more besides just syncing items between sitecore instances:

IMG_5792

I haven’t used it but I’ve head good things about it from other Sitecore Developers.

After lunch (which was excellent by the way) I opted to attend two talks on Sitecore Habitat. One by Ruud Van Falier called Introducing Sitecore Habitat and the 2nd by Anders Laub on Practical Habitat: Embrace the Architecture.

Introducing Sitecore Habitat

For those who don’t know what Habit is, it is an Architecture approach for Sitecore development and is designed to give best practice guidance on how to structure your Sitecore projects. I have taken a look at it a few times but not really used it and the feedback from other Sitecore developers I’d spoken to was that it was quite complicated, so I was interested in finding out more about it.

Ruud was presenting to a packed room with quite a few developers stood up at the back, obviously as keen as me to know more. He started with the basic concepts of Habitat, explaining how all modules are self-contained and that there should be no communication that goes upwards between modules.

IMG_5796

He also explained the the 3 layers of Habitat: Foundation, Features, Projects.

layers

Ruud then discussed examples of elements that might live in these layers and how the dependencies flows downwards.

IMG_5806

He then showed the technology stack, which are probably familiar tools to most of you. Sitecore 8.2,  MVC,  Dynamic Placeholders, Unicorn, Bootstrap, JQuery, Sass and Gulp.

A run-through of the Habitat solution structure then followed and an explanation of the different build tasks used.

build

There was then a more in-depth explanation regarding Modules:

IMG_5816

IMG_5818

IMG_5820

And then more detail on layers:

IMG_5822

IMG_5828

IMG_5832

IMG_5834

Finally, a pros and cons slide and questions:
IMG_5836

Ruud was honest about the fact that Habitat is in the early stages and is changing every day, he also said it’s not meant to be taken as a ‘Boiler Plate’ for Sitecore solutions – more a guideline. However, I left the session will a lot of things to investigate further and will definitely be taking a closer look at Habitat and how some of It’s concepts can be applied to the projects I am working on.

Practical Habitat: Embrace the Architecture

With my appetite now whetted for Habitat I went straight to the next session on embracing the architecture.

Anders talk started with a general discussion around Architecture and then moved to Habitat and why Pentia use it as an architecture for their solution:

IMG_5837

He then dived into a demo of their solution and explained how it differs to the default Habitat setup. I have a video of this somewhere which I’ll try and add here when I get a minute.

He then discussed a few foundation modules they have created and how it really works well for them as an approach.

IMG_5840

Anders took some tough questions from the crowd well (such as the number of projects in Habitat – which is many) and I think by the end of the session most of the room will be taking another look at Habitat.

Ladies and gentlemen start your testing.

Testing in Sitecore can be notoriously difficult and for some Sitecore developers this means that unit and integration tests that involve the Sitecore context or items are sometimes skipped.  I was interested to see if Alastair had some other ways to implement testing and I wasn’t disappointed :-).

IMG_5844

Alastair Deneys ran us through 4 ways in which to Unit test with Sitecore. The first was an interesting one and was to essentially install Sitecore in your application and then run the tests from an asp.net web page test runner.

The 2nd and 3rd were to add a minimal or full Sitecore config files and the Sitecore dlls you need to your nunit test project and run It. This worked pretty well but as Alastair said, isn’t proper unit testing as it’s using real data.

The 4th was to use FakeDb to mock the Sitecore items you need to run your tests. I’d heard about FakeDb before but not used it so it was nice to see an example of how this is done.

IMG_5855

Alastair also showed us how Sitecore.LiveTesting can be used to spin up an instance of Sitecore in a container in the background to test against.

IMG_5856

IMG_5863

It was a bit slow but seemed really cool and definitely something I’m going to experiment with.

IMG_5868

The key message here was, whatever you do make sure you create tests and don’t get hung up on if they are real unit tests or actually integration tests.

Sadly it was now time to head to get our flight home so I missed out on the last talk of the day by Martina Welander on refactoring doc.sitecore.net, hopefully I can find it on Google Hangout.

SUGCON was a great experience and It has given me a whole lot of ideas and things to look into for current and future Sitecore projects. Thanks to the Sitecore Community and the sponsors for putting on the event.

My only regret is not having chance to chat to any of the MVPs who have been so helpful on Slack and on their blogs, but I’ll definitely be back next year so I’ll buy you a beer or two then instead.

Till next time.

IMG_5878

My thoughts on SUGCON 2016 – Day 1

SUGCON Venue

I was lucky enough to arrive at my very first SUGCON a day early and see at bit of the Copenhagen. It’s beautiful, everyone is very friendly and the food and beer is impeccable, if you get chance to go then you definitely should.

 

Opening Keynote

Day 1 of SUGCON kicked off on Monday afternoon with an opening Keynote from Lars Nielsen (Sitecore Co-Founder & Chief Development Officer). This was to prove one of the most intriguing presentations of the conference as Lars revealed a number of new features coming in Sitecore 8.2.

8.2

One bug-bear for a lot of Sitecore clients is the upgrade process, Lars assured us that in 8.2 (using the Express Migration Tool) this is going to be much easier and won’t involve upgrading in multiple steps (as is currently the case) and that is should be possible to move from 6.5 > 8.2 in one automated step. This is great news for those running 6.5 and 7 solutions as it should make the process a whole lot easier and quicker.

Lars then followed this with an overview of 8.3 features (sorry It’s blury):

8.3

The most interesting for me (and clients I work with) was the Webforms for Marketers is going to be removed in 8.3 and replaced by an out of the box module, which will look something like this:

forms

This looks a whole lot better than WFFM which as most Sitecore developers know can be a pain to customise and is pretty clunky to use.

This was reflected by the attendees as there was a round of applause from the room when this was announced. It will work in the experience editor allowing in-place editing – just like other Sitecore components, so content editors should find the experience simpler and more intuitive. There will be integrations with automation plans too:

forms2

In summary these are the Roadmap themes:

roadmap

This was a great start with lots of useful info about the future releases coming up!.

 

Serialise all the things with Unicorn

Next up was Kam Figy, an MVP at Connective DX and the lead developer of Unicorn – a tool for serializing your Sitecore Items to disk so you can check them in to source control alongside your code.

unicorn

Kam ran through a demo of Unicorn 3 which I’ve already used, but it was nice to see a full demo and find out more information about other options the we could potentially make use of.

He then showed us a project he’d done for the Sitecore hack-a-thon, which allows unicorn to sync Roles and Users as well as Items. This could be useful for future projects and is now available in Unicorn 3.2 (https://www.nuget.org/packages/Unicorn).

sync

Kam’s talk was entertaining and he managed to handle the slightly awkward Hedgehog vs Unicorn questions afterwards pretty well too :-).

 

After a short break the talks split off into different tracks for the rest of the afternoon and I went with these 3:
Atomic Design Talk by Tim Braga, Design Patterns by Mike Reynolds and then Building Large Scale Sitecore solutions by Mike Edwards.

Atom Design to the MAX

Tim talked through the different approaches to building Sitecore Sites and then explained why instead of just going down to component level (as most Sitecore developers do) his team now breaking every element of a component down further into Atoms and making these separate renderings.

atomic

This allows for more control over functionality, layout and personalisation/testing on a more granular level – e.g. A/B testing on just a single button. Below is an example of this for the Hero that Collette created:

hero

There were however some performance issues found though with Experience Editor and it does add time for development, testing and content entry. Tim went over the pros and cons and what they have carried out to try and work-around some of them:

proscons

I like some of the concepts but I’m not yet convinced this is the way to go for most Sitecore builds, unless there really is call for this level of control.

 

Design Patterns

I wasn’t sure what to expect with this talk but I was a bit surprised to see it was less Sitecore focused and more around Design patterns and their usage in programming in general.

design patterns

Still it was good to see examples of their usage with Sitecore from Mike and the pros and cons of each approach.

pattern

 

Building Large Sitecore Solutions

This talk by Mike Edwards was really good. Mike gave and overview of the infrastructure and architecture of Sitecore solutions as they grow and require more CD servers and xDB provisioning.

scale

He talked about blue/green deployments and the importance of trying to have zero downtime for client sites during deployments. He also discussed load balancing strategies and the pros and cons of the different approaches.

blue-green

I’ve had first-hand experience of doing this for a few clients and it’s good to see some of the ideas we’ve used re-enforced by Mike, such as having two web databases in place so that one can be used for deployment whilst the other is live.

The architecture with xDB included looks pretty crazy but this demonstrates the number of servers and considerations involved with xDB:

xDB

After this (and a short talk by Coveo regarding their Search product) it was time to drink beer, eat food 🙂 and chat to some other Sitecore people.

There were also awards given out for the Sitecore MVPs (well done guys) and a Sitecore quiz with beer to be won.

All in all a great first day and some really informative sessions. I was really looking forward to Day 2.