示例#1
0
        public void Setup()
        {
            var basic = new SitecoreClass <GeneralFluentFixtureNS.BasicTemplate>()
                        .Fields(x =>
            {
                x.Field(y => y.Checkbox);
                x.Field(y => y.Date);
            })
                        .Infos(x =>
            {
                x.Info(y => y.ContentPath).InfoType(SitecoreInfoType.ContentPath);
                x.Info(y => y.DisplayName).InfoType(SitecoreInfoType.DisplayName);
            })
                        .Queries(x =>
            {
                x.Query(y => y.Query).Query("/sitecore/content/Glass/*[@@TemplateName='BasicTemplate']");
            });


            basic.Id(x => x.Id);

            //basic.Field(x => x.Checkbox);
            //basic.Field(x => x.Date);
            basic.Field(x => x.DateTime);
            basic.Field(x => x.File);
            basic.Field(x => x.Image);
            basic.Field(x => x.Integer);
            basic.Field(x => x.Float);
            basic.Field(x => x.Double);
            basic.Field(x => x.Decimal);
            basic.Field(x => x.MultiLineText);
            basic.Field(x => x.Number);
            basic.Field(x => x.Password);
            basic.Field(x => x.RichText).Setting(SitecoreFieldSettings.RichTextRaw);
            basic.Field(x => x.SingleLineText);

            basic.Field(x => x.CheckList);
            basic.Field(x => x.DropList);
            basic.Field(x => x.GroupedDropLink);
            basic.Field(x => x.GroupedDropList);
            basic.Field(x => x.MultiList);
            basic.Field(x => x.Treelist);
            basic.Field(x => x.TreeListEx);

            basic.Field(x => x.DropLink);
            basic.Field(x => x.DropTree);
            basic.Field(x => x.GeneralLink);

            basic.Field(x => x.Icon);
            basic.Field(x => x.TriState);

            basic.Field(x => x.Attachment);


            basic.Info(x => x.FullPath).InfoType(SitecoreInfoType.FullPath);
            basic.Info(x => x.Key).InfoType(SitecoreInfoType.Key);
            basic.Info(x => x.MediaUrl).InfoType(SitecoreInfoType.MediaUrl);
            basic.Info(x => x.Path).InfoType(SitecoreInfoType.Path);
            basic.Info(x => x.TemplateId).InfoType(SitecoreInfoType.TemplateId);
            basic.Info(x => x.TemplateName).InfoType(SitecoreInfoType.TemplateName);
            basic.Info(x => x.Url).InfoType(SitecoreInfoType.Url);
            basic.Info(x => x.Version).InfoType(SitecoreInfoType.Version);

            basic.Children(x => x.Children);

            basic.Parent(x => x.Parent);


            var subClass = new SitecoreClass <GeneralFluentFixtureNS.SubClass>();

            subClass.Id(x => x.Id);

            FluentConfigurationLoader loader = new FluentConfigurationLoader(
                basic, subClass
                );

            _context = new Context(loader, new AbstractSitecoreDataHandler[] {});
            global::Sitecore.Context.Site = global::Sitecore.Configuration.Factory.GetSite("website");

            _sitecore = new SitecoreService("master");
            _db       = global::Sitecore.Configuration.Factory.GetDatabase("master");

            _test1 = _db.GetItem("/sitecore/content/Glass/Test1");
            _test2 = _db.GetItem("/sitecore/content/Glass/Test2");
            _test3 = _db.GetItem("/sitecore/content/Glass/Test1/Test3");
        }
        public void Setup()
        {

            var basic = new SitecoreClass<GeneralFluentFixtureNS.BasicTemplate>()
            .Fields(x =>
                {
                    x.Field(y => y.Checkbox);
                    x.Field(y => y.Date);
                })
            .Infos(x =>
                {
                    x.Info(y => y.ContentPath).InfoType(SitecoreInfoType.ContentPath);
                    x.Info(y => y.DisplayName).InfoType(SitecoreInfoType.DisplayName);
                })
            .Queries(x =>
                {
                    x.Query(y => y.Query).Query("/sitecore/content/Configuration/Fluent/GeneralFluent/Query/*[@@TemplateName='BasicTemplate']");

                });

            
            basic.Id(x => x.Id);

            //basic.Field(x => x.Checkbox);
            //basic.Field(x => x.Date);
            basic.Field(x => x.DateTime);
            basic.Field(x => x.File);
            basic.Field(x => x.Image);
            basic.Field(x => x.Integer);
            basic.Field(x => x.Float);
            basic.Field(x => x.Double);
            basic.Field(x => x.Decimal);
            basic.Field(x => x.MultiLineText);
            basic.Field(x => x.Number);
            basic.Field(x => x.Password);
            basic.Field(x => x.RichText).Setting(SitecoreFieldSettings.RichTextRaw);
            basic.Field(x => x.SingleLineText);

            basic.Field(x => x.CheckList);
            basic.Field(x => x.DropList);
            basic.Field(x => x.GroupedDropLink);
            basic.Field(x => x.GroupedDropList);
            basic.Field(x => x.MultiList);
            basic.Field(x => x.Treelist);
            basic.Field(x => x.TreeListEx);

            basic.Field(x => x.DropLink);
            basic.Field(x => x.DropTree);
            basic.Field(x => x.GeneralLink);

            basic.Field(x => x.Icon);
            basic.Field(x => x.TriState);

            basic.Field(x => x.Attachment);

            
            basic.Info(x => x.FullPath).InfoType(SitecoreInfoType.FullPath);
            basic.Info(x => x.Key).InfoType(SitecoreInfoType.Key);
            basic.Info(x => x.MediaUrl).InfoType(SitecoreInfoType.MediaUrl);
            basic.Info(x => x.Path).InfoType(SitecoreInfoType.Path);
            basic.Info(x => x.TemplateId).InfoType(SitecoreInfoType.TemplateId);
            basic.Info(x => x.TemplateName).InfoType(SitecoreInfoType.TemplateName);
            basic.Info(x => x.Url).InfoType(SitecoreInfoType.Url);
            basic.Info(x => x.Version).InfoType(SitecoreInfoType.Version);

            basic.Children(x => x.Children);

            basic.Parent(x => x.Parent);


            var subClass = new SitecoreClass<GeneralFluentFixtureNS.SubClass>();
            subClass.Id(x => x.Id);

            FluentConfigurationLoader loader = new FluentConfigurationLoader(
              basic, subClass                  
                             );

            _context = new Context(loader, new AbstractSitecoreDataHandler[] {});
            global::Sitecore.Context.Site = global::Sitecore.Configuration.Factory.GetSite("website");

            _sitecore = new SitecoreService("master");
            _db = global::Sitecore.Configuration.Factory.GetDatabase("master");
            using (new SecurityDisabler())
            {
                _query1 = _db.GetItem("/sitecore/content/Configuration/Fluent/GeneralFluent/Query/Item1");
                _query2 = _db.GetItem("/sitecore/content/Configuration/Fluent/GeneralFluent/Query/Item2");
                _test3 = _db.GetItem("/sitecore/content/Glass/Test1/Test3");

                _check1 = _db.GetItem("/sitecore/content/Lookups/CheckList/Check1");
                _check2 = _db.GetItem("/sitecore/content/Lookups/CheckList/Check2");

                _multiList1 = _db.GetItem("/sitecore/content/Lookups/Multilist/MultiList1");
                _multiList2 = _db.GetItem("/sitecore/content/Lookups/Multilist/MultiList2");

                _treeList1 = _db.GetItem("/sitecore/content/Lookups/TreeList/TreeList1");
                _treeList2 = _db.GetItem("/sitecore/content/Lookups/TreeList/TreeList2");

                _link1 = _db.GetItem("/sitecore/content/Lookups/Links/Link1");
                _link2 = _db.GetItem("/sitecore/content/Lookups/Links/Link2");
                _link3 = _db.GetItem("/sitecore/content/Lookups/Links/Link3");
            }
        }
示例#3
0
        public static void Map(SitecoreFluentConfigurationLoader loader)
        {
            var basic = new SitecoreClass <BasicTemplate>()
                        .Fields(x =>
            {
                x.Field(y => y.Checkbox);
                x.Field(y => y.Date);
            })
                        .Infos(x =>
            {
                x.Info(y => y.ContentPath).InfoType(SitecoreInfoType.ContentPath);
                x.Info(y => y.DisplayName).InfoType(SitecoreInfoType.DisplayName);
            })
                        .Queries(x =>
            {
                x.Query(y => y.Query).Query("/sitecore/content/Configuration/Fluent/GeneralFluent/Query/*[@@TemplateName='BasicTemplate']");
            });


            basic.Id(x => x.Id);

            //basic.Field(x => x.Checkbox);
            //basic.Field(x => x.Date);
            basic.Field(x => x.DateTime);
            basic.Field(x => x.File);
            basic.Field(x => x.Image);
            basic.Field(x => x.Integer);
            basic.Field(x => x.Float);
            basic.Field(x => x.Double);
            basic.Field(x => x.Decimal);
            basic.Field(x => x.MultiLineText);
            basic.Field(x => x.Number);
            basic.Field(x => x.Password);
            basic.Field(x => x.RichText).Setting(SitecoreFieldSettings.RichTextRaw);
            basic.Field(x => x.SingleLineText);

            basic.Field(x => x.CheckList);
            basic.Field(x => x.DropList);
            basic.Field(x => x.GroupedDropLink);
            basic.Field(x => x.GroupedDropList);
            basic.Field(x => x.MultiList);
            basic.Field(x => x.Treelist);
            basic.Field(x => x.TreeListEx);

            basic.Field(x => x.DropLink);
            basic.Field(x => x.DropTree);
            basic.Field(x => x.GeneralLink);

            basic.Field(x => x.Icon);
            basic.Field(x => x.TriState);

            basic.Field(x => x.Attachment);


            basic.Info(x => x.FullPath).InfoType(SitecoreInfoType.FullPath);
            basic.Info(x => x.Key).InfoType(SitecoreInfoType.Key);
            basic.Info(x => x.MediaUrl).InfoType(SitecoreInfoType.MediaUrl);
            basic.Info(x => x.Path).InfoType(SitecoreInfoType.Path);
            basic.Info(x => x.TemplateId).InfoType(SitecoreInfoType.TemplateId);
            basic.Info(x => x.TemplateName).InfoType(SitecoreInfoType.TemplateName);
            basic.Info(x => x.Url).InfoType(SitecoreInfoType.Url);
            basic.Info(x => x.Version).InfoType(SitecoreInfoType.Version);

            basic.Children(x => x.Children);

            basic.Parent(x => x.Parent);


            var subClass = new SitecoreClass <SubClass>();

            subClass.Id(x => x.Id);

            loader.Add(subClass);
            loader.Add(basic);
        }
示例#4
0
        public static void Map(SitecoreFluentConfigurationLoader loader)
        {
            var basic = new SitecoreClass<BasicTemplate>()
            .Fields(x =>
            {
                x.Field(y => y.Checkbox);
                x.Field(y => y.Date);
            })
            .Infos(x =>
            {
                x.Info(y => y.ContentPath).InfoType(SitecoreInfoType.ContentPath);
                x.Info(y => y.DisplayName).InfoType(SitecoreInfoType.DisplayName);
            })
            .Queries(x =>
            {
                x.Query(y => y.Query).Query("/sitecore/content/Configuration/Fluent/GeneralFluent/Query/*[@@TemplateName='BasicTemplate']");

            });


            basic.Id(x => x.Id);

            //basic.Field(x => x.Checkbox);
            //basic.Field(x => x.Date);
            basic.Field(x => x.DateTime);
            basic.Field(x => x.File);
            basic.Field(x => x.Image);
            basic.Field(x => x.Integer);
            basic.Field(x => x.Float);
            basic.Field(x => x.Double);
            basic.Field(x => x.Decimal);
            basic.Field(x => x.MultiLineText);
            basic.Field(x => x.Number);
            basic.Field(x => x.Password);
            basic.Field(x => x.RichText).Setting(SitecoreFieldSettings.RichTextRaw);
            basic.Field(x => x.SingleLineText);

            basic.Field(x => x.CheckList);
            basic.Field(x => x.DropList);
            basic.Field(x => x.GroupedDropLink);
            basic.Field(x => x.GroupedDropList);
            basic.Field(x => x.MultiList);
            basic.Field(x => x.Treelist);
            basic.Field(x => x.TreeListEx);

            basic.Field(x => x.DropLink);
            basic.Field(x => x.DropTree);
            basic.Field(x => x.GeneralLink);

            basic.Field(x => x.Icon);
            basic.Field(x => x.TriState);

            basic.Field(x => x.Attachment);


            basic.Info(x => x.FullPath).InfoType(SitecoreInfoType.FullPath);
            basic.Info(x => x.Key).InfoType(SitecoreInfoType.Key);
            basic.Info(x => x.MediaUrl).InfoType(SitecoreInfoType.MediaUrl);
            basic.Info(x => x.Path).InfoType(SitecoreInfoType.Path);
            basic.Info(x => x.TemplateId).InfoType(SitecoreInfoType.TemplateId);
            basic.Info(x => x.TemplateName).InfoType(SitecoreInfoType.TemplateName);
            basic.Info(x => x.Url).InfoType(SitecoreInfoType.Url);
            basic.Info(x => x.Version).InfoType(SitecoreInfoType.Version);

            basic.Children(x => x.Children);

            basic.Parent(x => x.Parent);


            var subClass = new SitecoreClass<SubClass>();
            subClass.Id(x => x.Id);

            loader.Add(subClass);
            loader.Add(basic);
        }