-
Updated Exception enrichment functionality for added safety
Here is an improved version of the Exception enrichment functionality described in the article Enriching your exceptions with information from Episerver. Updates has been made in order to make it more robust in regards to usage of abstract classes that may in some cases throw NotImplementedException, causing the enrichment code to terminate.
-
Allow only certain number of items in ContentAreas in Optimizely
Here is a validation attribute that I wrote in order to limit the number of items that editors may put in Optimizely ContentAreas to a specific set of numbers, instead of having max and min values. The part that may be of interest to highlight is the possibility to skip validation in certain cases, for…
-
Hiding and showing edit mode properties on same content type in Optimizely CMS depending on context
At my current client we have the need to hide or show properties for editors in Optimizely edit mode, on the same page type, depending on where/how the page type is used. Our structure consists of global pages, and local instances of the same pages. There are times when global editors should be able to…
-
Changing Optimizely property return type yields MissingMethodException on getter
I was faced with a somewhat unexpected MissingMethodException changing a property type from string to XhtmlString while making changes to an Optimizely website for my current client. I’ve done this sort of change on mant occations, and moving from a string to an XhtmlString should not cause a problem. The exception seemed to be thrown…
-
Object reference not set to an instance of an object in EPiServer.Shell.Web.Mvc.HttpContextBaseExtensions.SetCulture method
I ran in to this problem setting up an older Optimizely website running on .Net Framework. The view mode of the website worked just fine, however, when trying to access the edit mode via /episerver/cms, the following exception was thrown. Getting at least some hints from the post Object Reference while trying to access epicms…
-
Injecting Fragments in Optimizely XHtmlStrings
Injecting fragments in Optimizely XHtmlStrings is quite easy using a custom display template to render the property. Here is an example on how you can inject custom data based on Optimizely blocks dropped in the XHtmlString property. I’ve been using an approach similar to this to inject ids used for anchor tag navigation also within…
-
Clearing output cache in a multi server environment
This is a follow up to the previous Acting on Optimizely Remote Events article. While still working with the older Optimizely 11 you may rely on the Remote Event functionality to clear cache. However, in some cases you may need to build on this functionality to clear the output cache on other servers manually. In…
-
Prevent certain Optimizely visitor groups from being used in content areas
At my current client we had the need to prevent the use of certain visitor groups in some of the content areas. I.e. some areas were only to support national content, and other areas only regional content (where each region had a different visitor group). Here is a solution making use of ValidationAttribute. The visitor…
-
System.Data.SqlClient.SqlException: Invalid column name ‘IsApproved’, ‘IsLockedOut’, ‘Comment’, ‘CreationDate’, ‘LastLoginDate’, ‘LastLockoutDate’
Got this SqlException again moving a database from a client’s production environment into development. Thought I’d write a short note on resolving it. Check the migration history table: It is likely that the initial create of the tables used Microsoft.AspNet.Identity.EntityFramework.IdentityUser instead of the expected EPiServer.Cms.UI.AspNetIdentity.ApplicationUser. The ContextKey column would contain EPiServer.Cms.UI.AspNetIdentity.ApplicationDbContext`1 [Microsoft.AspNet.Identity.EntityFramework.IdentityUser] rather than EPiServer.Cms.UI.AspNetIdentity.ApplicationDbContext`1…
-
Acting on Optimizely Remote Events
Just a short piece on how to act on Optimizely‘s remote events. While in later versions you may use for instance RabbitMQ or ActiveMQ, still being on 11 will have you using the older event distribution. For attaching your own handlers to the received event, you will need to get an instance of the IEventProviderAccessor…
-
Using ActiveMQ with Optimizely 12
Whilst setting up Optimizely 12 to work with RabbitMQ is rather straight forward, making it use ActiveMQ for transport instead requires a bit more configuration on our part. Here is a short article on how to set up Optimizely 12 to use MassTransit (EPiServer.Events.MassTransit) with ActiveMQ. For a short instruction on how to set up…
-
ActiveMQ tester application with topic support
I’ve updated the ActiveMQ tester application with topic support as it is required by the Optimizely on-prem event provider (EPiServer.Events.MassTransit). Otherwise, the usage is as before (see ActiveMQ connection tester application). Source code at GitHub.
-
ActiveMQ connection tester application
While moving our client’s Optimizely 12 website to a new hosting provider we had to abandon our RabbitMQ installation in favour of a new ActiveMQ one, also supported by the on-prem event provider (EPiServer.Events.MassTransit). To make it easier setting this up I rewrote the old RabbitMQ connection tester application into a new one working with…
-
Episerver Remote Events tester console application for framework 4.8 and Optimizely 11
My current client is moving their Optimizely 11 websites to a new hosting provider and we need an easy way to test the remote event replication system. I remember that there was an old console application for this back in the day, but when I found a copy of it I realized that it required…
-
RabbitMQ connection tester application
We set up Optimizely‘s new on-prem event provider (EPiServer.Events.MassTransit) for my current client’s Optimizely 12 website the other week. At current date it is still in beta until there are enough uses for there to be a production release. For the mass transit we set up RabbitMQ. For earlier Optimizely (Episerver) versions built on ASP.NET…
-
Getting the root PageReference of the imported pages in Episerver
In our work to automate export and import of the production database into our test environment we had to maintain a test node in the Episerver page tree. This ment that we had to export it before replacing the database, and then import it again. Please see Exporting Episerver content programmatically through an ApiController and…
-
Importing Episerver content programmatically through an ApiController
Importing the test node package that we exported earlier (see article Exporting Episerver content programmatically through an ApiController) would be the next step in our automated transfer of the production database to the testing environment. I extended our ApiController with an import endpoint for this purpose. Note that this code is never intended to be…