Blog about tips & tricks for CMS enhancement

eric.petersson

Updating Amesto.AutoConnect to Episerver 11


If you have been using the third party tool Amesto AutoConnect for keeping your Episerver translation workflow provided at someone else's hands, you could have been in issue with upgrading the dependencies from a lower version.

UPDATE 2020-02-16!

If you're having trouble with these dependencies for EpiserverCommerce13 solution - check the bottom of this post for solution.


Recently a client of ours wanted us to upgrade to the latest versions (since the old Episerver 10 dlls were out of function). Here are some common pitfalls to keep track of when upgrading:

Edit mode errors

In edit mode you may receive a dependency registration of some missing services when viewing the translation view like the following:

In that case, register the following in your dependency resolver of your application:

using Amesto.AutoConnect.EpiserverCommerce11.Settings;
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
using YourNameSpace;
using Semantix.AutoConnect.Core.Services.Contracts;
using Semantix.AutoConnect.Data.NoSql.Services;
using StructureMap;
using System.Web.Mvc;

namespace YourNameSpace
{
    [InitializableModule]
    [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
    public class DependencyResolverInitialization : IConfigurableModule
    {
        public void ConfigureContainer(ServiceConfigurationContext context)
        {
            context.StructureMap().Configure(ConfigureContainer);
            DependencyResolver.SetResolver(new StructureMapDependencyResolver(context.StructureMap()));
        }

        private static void ConfigureContainer(ConfigurationExpression container)
        {
            // Register Amesto AutoConnect Translations for Episerver
            container.For<ITranslationDataService>().Use(locator => new TranslationDataService(AmestoTranslationSettings.Instance.DatabasePath));
            container.For<IErrorMessageService>().Use(locator => new ErrorMessageService(AmestoTranslationSettings.Instance.DatabasePath));
        }

        public void Initialize(InitializationEngine context)
        {
        }

        public void Uninitialize(InitializationEngine context)
        {
        }

        public void Preload(string[] parameters)
        {
        }
    }
}

Basically you add the ITranslationDataService and combine it with IErrorMessageService for providing the proper services. You can see that I am refering to the EpiserverCommerce11 package provided from Amesto. This is for both CMS and Commerce translations if so needed.

There are different ways to store your data that should be sent to Semantix for translations. Either in the default NoSql database path, which is App_Data/AmestoAutoConnect. You could however install this in a separate database path as well. There are two packages to choose from in the NuGet store - pick the one that suits you the best:
Semantix.AutoConnect.Data.NoSql
Semantix.AutoConnect.Data.Sql

You should as a total have the following dependencies in your project when upgrading to Episerver 11 compability:
* Amesto.AutoConnect.EPiServer11 or Amesto.AutoConnect.EPiServerCommerce11
* Semantix.AutoConnect.Core
* Semantix.AutoConnect.Data.NoSql or Semantix.AutoConnect.Data.Sql

Scheduled jobs not working


If you should happen to be interfered with the provided scheduled jobs not working out as intended from Amesto, you should also have a look in the database and make sure you wipe out old scheduled job references from previous installations (e.g. Episerver9 or Episerver10 packages).

This is because of the obscure "Episerver-missing-GUID-for-scheduled-jobs" which Māris Krivtežs explains a bit further here. A quick look at the Amesto dlls revealed that the scheduled jobs indeed missed the GUID.

So today was just a small checklist of things you could bump into when handling with the later versions of Amesto's Translations tools for Episerver.

Updated 2020-02-16

If you are using the EpiserverCommerce13 package of Semantix, then use this initialization configuration.

using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using EPiServer.ServiceLocation;
using YourNameSpace;
using Semantix.AutoConnect.Core.Services.Contracts;
using Semantix.AutoConnect.Data.NoSql.Services;
using Semantix.AutoConnect.EpiserverCommerce13.Settings;
using StructureMap;
using System.Web.Mvc;

namespace YourNameSpace
{
    [InitializableModule]
    [ModuleDependency(typeof(EPiServer.Web.InitializationModule))]
    public class DependencyResolverInitialization : IConfigurableModule
    {
        public void ConfigureContainer(ServiceConfigurationContext context)
        {
            context.StructureMap().Configure(ConfigureContainer);
            DependencyResolver.SetResolver(new StructureMapDependencyResolver(context.StructureMap()));
        }

        private static void ConfigureContainer(ConfigurationExpression container)
        {
            // Register Amesto AutoConnect Translations for Episerver
container.For<ITranslationDataService>().Use(locator =>
                new TranslationDataService(Semantix.AutoConnect.EpiserverCommerce13.Settings.SemantixTranslationSettings.Instance.DatabasePath));
            container.For<IErrorMessageService>().Use(locator =>
                new ErrorMessageService(Semantix.AutoConnect.EpiserverCommerce13.Settings.SemantixTranslationSettings.Instance.DatabasePath))
            

        public void Initialize(InitializationEngine context)
        {
        }

        public void Uninitialize(InitializationEngine context)
        {
        }

        public void Preload(string[] parameters)
        {
        }
    }
}