Beispiel #1
0
        private static Container InitializeContainer()
        {
            Container container = SitecoreSidekick.Bootstrap.Container;

            // Register components here
            container.Register <IContentMigrationManagerService, ContentMigrationManagerService>();
            container.RegisterFactory <IRemoteContentService>(args =>
            {
                var registration = container.Resolve <IScsRegistrationService>();
                return(new RemoteContentService(registration));
            });
            container.Register <ISitecoreDataAccessService, SitecoreDataAccessService>();
            container.Register <ILoggingService, LoggingService>();
            container.RegisterFactory <IDataStore>(args =>
            {
                IDefaultDeserializerLogger logger = (IDefaultDeserializerLogger)args.FirstOrDefault(a => a is IDefaultDeserializerLogger);
                var deserializer = new DefaultDeserializer(logger, new DefaultFieldFilter());
                return(new SitecoreDataStore(deserializer));
            });
            container.RegisterFactory <IContentItemPuller>(args => new ContentItemPuller());
            container.RegisterFactory <IContentItemInstaller>(args => new ContentItemInstaller());
            container.RegisterFactory <IDefaultLogger>(args => new DefaultLogger());
            container.RegisterFactory <ISignatureService>(args => new SignatureService((string)args[0]));
            container.RegisterFactory <IItemComparer>(args => new DefaultItemComparer());
            container.RegisterFactory <IYamlSerializationService>(args => new YamlSerializationService());

            return(container);
        }
		public DefaultDeserializer(IDefaultDeserializerLogger logger, IFieldFilter fieldFilter)
		{
			Assert.ArgumentNotNull(logger, "logger");
			Assert.ArgumentNotNull(fieldFilter, "fieldFilter");

			_logger = logger;
			_fieldFilter = fieldFilter;
		}
        public DefaultDeserializer(IDefaultDeserializerLogger logger, IFieldFilter fieldFilter)
        {
            Assert.ArgumentNotNull(logger, "logger");
            Assert.ArgumentNotNull(fieldFilter, "fieldFilter");

            _logger      = logger;
            _fieldFilter = fieldFilter;
        }
Beispiel #4
0
        public DefaultDeserializer(bool ignoreBranchId, IDefaultDeserializerLogger logger, IFieldFilter fieldFilter)
        {
            Assert.ArgumentNotNull(logger, "logger");
            Assert.ArgumentNotNull(fieldFilter, "fieldFilter");

            // In reference to issue 283. https://github.com/SitecoreUnicorn/Unicorn/issues/283
            IgnoreBranchId = ignoreBranchId;

            _logger      = logger;
            _fieldFilter = fieldFilter;
        }
Beispiel #5
0
        private static Container InitializeContainer()
        {
            Container container = SitecoreSidekick.Bootstrap.Container;

            // Register components here
            container.Register <IContentMigrationManagerService, ContentMigrationManagerService>();
            container.RegisterFactory <IRemoteContentService>(args =>
            {
                var registration = container.Resolve <IScsRegistrationService>();
                return(new RemoteContentService(registration));
            });
            container.Register <ISitecoreDataAccessService, SitecoreDataAccessService>();
            container.Register <ILoggingService, LoggingService>();
            container.RegisterFactory <IDataStore>(args =>
            {
                IDefaultDeserializerLogger logger = (IDefaultDeserializerLogger)args.FirstOrDefault(x => x is IDefaultDeserializerLogger);
                Assembly a = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(x => x.GetName().Name == "Rainbow.Storage.Sc");
                Type t     = a?.GetType("Rainbow.Storage.Sc.Deserialization.DefaultDeserializer");
                foreach (var constructor in t?.GetConstructors().Where(x => x.GetParameters().Length == 2) ?? Enumerable.Empty <ConstructorInfo>())
                {
                    return(new SitecoreDataStore((DefaultDeserializer)constructor.Invoke(new object[] { logger, new DefaultFieldFilter() })));
                }
                foreach (var constructor in t?.GetConstructors().Where(x => x.GetParameters().Length == 3) ?? Enumerable.Empty <ConstructorInfo>())
                {
                    return(new SitecoreDataStore((DefaultDeserializer)constructor.Invoke(new object[] { false, logger, new DefaultFieldFilter() })));
                }

                return(null);
            });
            container.Register <IDatastoreSaver, DatastoreSaver>();
            container.RegisterFactory <IContentItemPuller>(args => new ContentItemPuller());
            container.RegisterFactory <IContentItemInstaller>(args => new ContentItemInstaller());
            container.RegisterFactory <IDefaultLogger>(args => new DefaultLogger());
            container.RegisterFactory <ISignatureService>(args => new SignatureService((string)args[0]));
            container.RegisterFactory <IItemComparer>(args => new DefaultItemComparer());
            container.RegisterFactory <IYamlSerializationService>(args => new YamlSerializationService());
            container.Register <IChecksumManager, ChecksumManager>();

            return(container);
        }
Beispiel #6
0
 public UnicornDeserializer(IDefaultDeserializerLogger logger, IFieldFilter fieldFilter) : base(logger, fieldFilter)
 {
 }
Beispiel #7
0
 // Overload constructor, implemented for keeping compatibility with external tools that may not yet have updated their codebase to support the branchId switch (e.g. SideKick)
 // ReSharper disable once UnusedMember.Global
 public DefaultDeserializer(IDefaultDeserializerLogger logger, IFieldFilter fieldFilter) : this(true, logger, fieldFilter)
 {
 }
Beispiel #8
0
 public UnicornDeserializer(IDefaultDeserializerLogger logger, IFieldFilter fieldFilter)
     : base(logger, fieldFilter)
 {
 }
 public UnicornDeserializer(bool ignoreBranchId, IDefaultDeserializerLogger logger, IFieldFilter fieldFilter) : base(ignoreBranchId, logger, fieldFilter)
 {
 }