Example #1
0
        public static void RunScenarios()
        {
            using (new SampleScenarioScope("Composer"))
            {
                var context = new CsrSheila().Context;
                context.Environment = EnvironmentConstants.AdventureWorksAuthoring;
                _authoringContainer = context.ShopsContainer();

                var templates = GetComposerTemplates();
                GetComposerTemplate(templates.FirstOrDefault().Id);
            }
        }
        public static void RunScenarios()
        {
            using (new SampleScenarioScope("Composer UX"))
            {
                var partial = $"{Guid.NewGuid():N}".Substring(0, 5);
                _templateId              = $"Entity-ComposerTemplate-MyConsoleTemplate{partial}";
                _composerViewName        = $"MyConsoleView{partial}";
                _composerViewDisplayName = $"My Console View {partial}";
                _templateName            = $"MyConsoleTemplate{partial}";

                _entityId = $"ConsoleComposerProduct{partial}".ToEntityId <Plugin.Catalog.SellableItem>();
                EngineExtensions.AddSellableItem(_entityId, CatalogName.ToEntityId <Sitecore.Commerce.Plugin.Catalog.Catalog>(), CatalogName, CatalogName);

                var context = new CsrSheila().Context;
                context.Environment = EnvironmentConstants.AdventureWorksAuthoring;
                _authoringContainer = context.ShopsContainer();

                var composerEntityViewItemId = AddChildView();
                AddProperties(composerEntityViewItemId, _entityId);
                EditView(composerEntityViewItemId, _entityId);
                AddMinMaxPropertyConstraint(composerEntityViewItemId, _entityId);
                AddSelectionOptionPropertyConstraint(composerEntityViewItemId, _entityId);
                RemoveProperty(composerEntityViewItemId, _entityId);
                RemoveView(composerEntityViewItemId, _entityId);

                composerEntityViewItemId = AddChildView();
                MakeTemplate(composerEntityViewItemId);
                RemoveView(composerEntityViewItemId, _entityId);

                composerEntityViewItemId = AddChildViewFromTemplate();
                RemoveView(composerEntityViewItemId, _entityId);

                var composerTemplateViewItemId = GetTemplateViews();
                ManageTemplateTags();
                LinkTemplateToEntities();
                AddProperties(composerTemplateViewItemId, _templateId);
                EditView(composerTemplateViewItemId, _templateId);
                AddMinMaxPropertyConstraint(composerTemplateViewItemId, _templateId);
                AddSelectionOptionPropertyConstraint(composerTemplateViewItemId, _templateId);
                RemoveProperty(composerTemplateViewItemId, _templateId);
                RemoveTemplate();

                CreateTemplate();
            }
        }
        public static void RunScenarios()
        {
            var watch = new Stopwatch();

            watch.Start();

            System.Console.WriteLine("Begin Composer");

            var context = new CsrSheila().Context;

            context.Environment = "AdventureWorksAuthoring";
            _authoringContainer = context.ShopsContainer();

            var composerEntityViewItemId = AddChildView();

            AddProperties(composerEntityViewItemId, EntityId);
            EditView(composerEntityViewItemId, EntityId);
            AddMinMaxPropertyConstraint(composerEntityViewItemId, EntityId);
            AddSelectionOptionPropertyConstraint(composerEntityViewItemId, EntityId);
            RemoveProperty(composerEntityViewItemId, EntityId);
            RemoveView(composerEntityViewItemId, EntityId);

            composerEntityViewItemId = AddChildView();
            MakeTemplate(composerEntityViewItemId);
            RemoveView(composerEntityViewItemId, EntityId);

            composerEntityViewItemId = AddChildViewFromTemplate();
            RemoveView(composerEntityViewItemId, EntityId);

            var composerTemplateViewItemId = GetTemplateViews();

            ManageTemplateTags();
            LinkTemplateToEntities();
            AddProperties(composerTemplateViewItemId, TemplateId);
            EditView(composerTemplateViewItemId, TemplateId);
            AddMinMaxPropertyConstraint(composerTemplateViewItemId, TemplateId);
            AddSelectionOptionPropertyConstraint(composerTemplateViewItemId, TemplateId);
            RemoveProperty(composerTemplateViewItemId, TemplateId);
            RemoveTemplate();

            watch.Stop();

            System.Console.WriteLine($"End Composer :{watch.ElapsedMilliseconds} ms");
        }
        public static void RunScenarios()
        {
            var watch = new Stopwatch();

            watch.Start();

            Console.WriteLine("Begin Composer");

            var context = new CsrSheila().Context;

            context.Environment = "AdventureWorksAuthoring";
            _authoringContainer = context.ShopsContainer();

            GetComposerTemplate("MyConsoleTemplate");
            GetComposerTemplates();

            watch.Stop();

            Console.WriteLine($"End PricingBooksAndCards :{watch.ElapsedMilliseconds} ms");
        }