Exemplo n.º 1
0
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <ContextModel> args)
        {
            var item = args.DataModel.Item;
            var list = new List <SectionModel>();

            list.Add(new SectionModel()
            {
                Icon  = this.GetImage(item),
                Api   = "Sitecore.Context.Item",
                Key   = "Item",
                Value = item.Paths.Path
            });
            list.Add(new SectionModel()
            {
                Icon  = this.GetImage(item),
                Api   = "Sitecore.Context.Item.ID",
                Key   = "Item ID",
                Value = item.ID.ToString()
            });
            list.Add(new SectionModel()
            {
                Icon  = this.GetImage(item.Template.InnerItem),
                Api   = "Sitecore.Context.Item.Template",
                Key   = "Template",
                Value = item.Template.InnerItem.Paths.Path
            });
            return(list);
        }
Exemplo n.º 2
0
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <AnalyticsModel> args)
        {
            var defaultIcon = this.GetImage("People/16x16/megaphone.png");
            var visit       = args.DataModel.Visitor.CurrentVisit;
            var list        = new List <SectionModel>();

            if (visit != null)
            {
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.AspNetSessionId",
                    Key   = "Asp.NET session ID",
                    Value = visit.AspNetSessionId
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.HasGeoIpData",
                    Key   = "Has geo IP data",
                    Value = visit.HasGeoIpData.ToString()
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.Ip",
                    Key   = "IP address",
                    Value = new IPAddress(visit.Ip).ToString()
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.Referrer",
                    Key   = "Referrer",
                    Value = visit.Referrer
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.StartDateTime",
                    Key   = "Visit start",
                    Value = visit.StartDateTime.ToString()
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = null,
                    Key   = "Visit duration",
                    Value = DateTime.Now.Subtract(visit.StartDateTime).ToString(@"d\.h\:mm\:ss")
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.VisitId",
                    Key   = "Visit ID",
                    Value = visit.VisitId.ToString()
                });
            }
            return(list);
        }
Exemplo n.º 3
0
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <ContextModel> args)
        {
            var page = args.DataModel.Page;
            var list = new List <SectionModel>();

            list.Add(new SectionModel()
            {
                Icon  = this.GetImage(args.DataModel.Device.Icon),
                Api   = "Sitecore.Context.Device",
                Key   = "Device",
                Value = args.DataModel.Device.Name
            });
            list.Add(new SectionModel()
            {
                Icon  = this.GetImage("Applications/16x16/window.png"),
                Api   = "Sitecore.Context.Page.FilePath",
                Key   = "Layout file",
                Value = page.FilePath
            });
            list.Add(new SectionModel()
            {
                Icon  = this.GetImage("Business/16x16/table_selection_block.png"),
                Api   = "Sitecore.Context.Page.Placeholders",
                Key   = "Placeholders",
                Value = String.Join("\n", page.Placeholders.Select(ph => ph.ContextKey).ToArray())
            });
            return(list);
        }
Exemplo n.º 4
0
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <ContextModel> args)
        {
            var model = args.DataModel;
            var list  = new List <SectionModel>();

            list.Add(new SectionModel()
            {
                Icon  = this.GetImage("Business/16x16/data.png"),
                Api   = "Sitecore.Context.Database",
                Key   = "Database",
                Value = model.Database.Name
            });
            list.Add(new SectionModel()
            {
                Icon  = this.GetImage(args.DataModel.Device.Icon),
                Api   = "Sitecore.Context.Device",
                Key   = "Device",
                Value = args.DataModel.Device.Name
            });
            list.Add(new SectionModel()
            {
                Icon  = this.GetImage(model.Language, model.Database),
                Api   = "Sitecore.Context.Language",
                Key   = "Language",
                Value = model.Language.Name
            });
            list.Add(new SectionModel()
            {
                Icon  = this.GetImage("Network/16x16/home.png"),
                Api   = "Sitecore.Context.Site",
                Key   = "Site",
                Value = model.Site.Name
            });
            return(list);
        }
Exemplo n.º 5
0
        /// <summary>
        /// Gets the section data.
        /// </summary>
        /// <param name="args">The arguments.</param>
        /// <returns>List of rendering section models.</returns>
        protected override List <RenderingSectionItemModel> GetSectionData(GlimpsePipelineArgs <MvcPageModel> args)
        {
            var renderings = args.DataModel.Page.PageDefinition.Renderings;
            var list       = new List <RenderingSectionItemModel>();

            foreach (var rendering in renderings)
            {
                if (string.IsNullOrWhiteSpace(rendering.Placeholder))
                {
                    continue;
                }

                var item    = rendering.RenderingItem.InnerItem;
                var details = new RenderingDetailsModel()
                {
                    RenderingPath = item.Paths.FullPath,
                    UniqueId      = rendering.UniqueId.ToString()
                };
                list.Add(new RenderingSectionItemModel()
                {
                    Icon        = this.GetImage(item),
                    Name        = rendering.RenderingItem.Name,
                    Placeholder = rendering.Placeholder,
                    DataSource  = rendering.DataSource,
                    Details     = details
                });
            }

            return(list);
        }
        protected override List <RawOutputSectionModel> GetSectionData(GlimpsePipelineArgs <ProfilesModel> args)
        {
            var model = args.DataModel;
            var list  = new List <RawOutputSectionModel>();

            foreach (var profile in model.Profiles.OrderBy(row => row.ProfileName))
            {
                var rows = new List <string>();
                rows.Add(GetMatchingPatternLabel(profile, model.Database));
                rows.AddRange(GetProfileKeyLabels(profile, model.Database));
                rows.Remove(string.Empty);
                var sectionModel = new RawOutputSectionModel()
                {
                    SectionHeader = GetProfileLabel(profile, model.Database),
                    SectionBody   = rows.Aggregate((s1, s2) => s1 + s2)
                };
                list.Add(sectionModel);
            }
            if (list.Count == 0)
            {
                var sectionModel = new RawOutputSectionModel()
                {
                    SectionHeader = Translate.Text("No profile information"),
                    SectionBody   = Translate.Text("The visitor has not visited any pages that result in profile values being set.")
                };
                list.Add(sectionModel);
            }
            return(list);
        }
Exemplo n.º 7
0
        public override object GetData(ITabContext context)
        {
            var args = new GlimpsePipelineArgs <TDataModel>();

            CorePipeline.Run(this.DataPipelineName, args);
            return(args.TabData);
        }
        public void Process(GlimpsePipelineArgs <AnalyticsModel> args)
        {
            Assert.ArgumentNotNull(args, "args");
            var data = new AnalyticsModel();

            args.TabData = data;
        }
        protected override List <RenderingSectionItemModel> GetSectionData(GlimpsePipelineArgs <PageModel> args)
        {
            var renderings = args.DataModel.Page.Renderings;
            var list       = new List <RenderingSectionItemModel>();

            foreach (RenderingReference rendering in renderings)
            {
                var item    = rendering.RenderingItem.InnerItem;
                var details = new RenderingDetailsModel()
                {
                    RenderingPath = item.Paths.FullPath,
                    UniqueId      = rendering.UniqueId,
                    AddedToPage   = rendering.AddedToPage
                };
                list.Add(new RenderingSectionItemModel()
                {
                    Icon        = this.GetImage(item),
                    Name        = rendering.RenderingItem.Name,
                    Placeholder = rendering.Placeholder,
                    DataSource  = rendering.Settings.DataSource,
                    Details     = details,
                    Settings    = rendering.Settings
                });
            }
            return(list);
        }
        public override object Convert(TModel model)
        {
            var args = new GlimpsePipelineArgs <TModel>();

            args.DataModel = model;
            CorePipeline.Run(this.PipelineName, args);
            return(args.TabObject.Build());
        }
Exemplo n.º 11
0
        public override object GetLayout()
        {
            var args = new GlimpsePipelineArgs <TDataModel>();

            if (!string.IsNullOrEmpty(this.LayoutPipelineName))
            {
                CorePipeline.Run(this.LayoutPipelineName, args);
                if (args.TabLayout != null)
                {
                    return(args.TabLayout.Build());
                }
            }
            return(null);
        }
Exemplo n.º 12
0
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <ContextModel> args)
        {
            var defaultIcon = this.GetImage("People/16x16/user1_view.png");
            var profile     = args.DataModel.User.Profile;
            var list        = new List <SectionModel>();

            var names = profile.GetCustomPropertyNames();

            foreach (var name in names)
            {
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = string.Format("Sitecore.Context.User.Profile.GetCustomProperty(\"{0}\")", name),
                    Key   = name,
                    Value = profile.GetCustomProperty(name)
                });
            }
            return(list);
        }
Exemplo n.º 13
0
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <ContextModel> args)
        {
            var user = args.DataModel.User;
            var list = new List <SectionModel>();

            list.Add(new SectionModel()
            {
                Icon  = this.GetImage(user.Profile.Portrait),
                Api   = "Sitecore.Context.User",
                Key   = "User",
                Value = user.Name
            });
            list.Add(new SectionModel()
            {
                Icon  = this.GetImage("Network/16x16/id_cards.png"),
                Api   = "Sitecore.Context.User.Roles",
                Key   = "Roles",
                Value = String.Join("\n", user.Roles.Select(role => role.Name).ToArray())
            });
            return(list);
        }
Exemplo n.º 14
0
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <AnalyticsModel> args)
        {
            var defaultIcon = this.GetImage("Applications/16x16/preferences.png");
            var model       = args.DataModel;
            var list        = new List <SectionModel>();

            list.Add(new SectionModel()
            {
                Icon  = defaultIcon,
                Api   = "Sitecore.Analytics.Configuration.AnalyticsSettings.DisableDatabase",
                Key   = "Database disabled",
                Value = AnalyticsSettings.DisableDatabase.ToString()
            });
            list.Add(new SectionModel()
            {
                Icon  = defaultIcon,
                Api   = "Sitecore.Analytics.Configuration.AnalyticsSettings.Enabled",
                Key   = "Analytics enabled",
                Value = AnalyticsSettings.Enabled.ToString()
            });
            return(list);
        }
Exemplo n.º 15
0
        protected override List <GoalSectionModel> GetSectionData(GlimpsePipelineArgs <AnalyticsModel> args)
        {
            var context = args.DataModel.DataContext;
            var list    = new List <GoalSectionModel>();

            if (context != null)
            {
                var groupedPageEvents = context.PageEvents.GroupBy(row => row.PageEventDefinition).OrderBy(rows => rows.Key.Name);
                foreach (var pageEvents in groupedPageEvents)
                {
                    var def = pageEvents.Key;
                    if (def.IsGoal)
                    {
                        var events = new List <GoalEventModel>();
                        var i      = 0;
                        foreach (var pageEvent in pageEvents.OrderBy(pe => pe.Timestamp))
                        {
                            events.Add(new GoalEventModel()
                            {
                                Count    = ++i,
                                Data     = pageEvent.Data,
                                DataCode = pageEvent.DataCode,
                                DataKey  = pageEvent.DataKey,
                                DateTime = pageEvent.DateTime.ToLocalTime().ToString("g"),
                                Text     = pageEvent.Text
                            });
                        }
                        list.Add(new GoalSectionModel()
                        {
                            Icon       = GetImage(def),
                            Name       = def.Name,
                            Count      = events.Count,
                            GoalEvents = events
                        });
                    }
                }
            }
            return(list);
        }
Exemplo n.º 16
0
        /// <summary>
        /// Gets the section data.
        /// </summary>
        /// <param name="args">The arguments.</param>
        /// <returns>The section model.</returns>
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <MvcPageModel> args)
        {
            var layout = args.DataModel.Layout;
            var page   = args.DataModel.Page;

            return(new List <SectionModel>
            {
                new SectionModel
                {
                    Icon = this.GetImage("Applications/16x16/window.png"),
                    Api = "Sitecore.Context.Page.FilePath",
                    Key = "Layout file",
                    Value = layout
                },
                new SectionModel
                {
                    Icon = this.GetImage("Business/16x16/table_selection_block.png"),
                    Api = "PageContext.Current.PageDefinition.Renderings.Select(r => r.Placeholder)",
                    Key = "Placeholders",
                    Value = string.Join("\n", page.PageDefinition.Renderings.Where(r => !string.IsNullOrWhiteSpace(r.Placeholder)).Select(r => r.Placeholder).Distinct())
                }
            });
        }
Exemplo n.º 17
0
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <AnalyticsModel> args)
        {
            var defaultIcon = this.GetImage("People/16x16/megaphone.png");
            var visit       = args.DataModel.Visitor.CurrentVisit;
            var list        = new List <SectionModel>();

            if (visit != null)
            {
                var browser = visit.Browser;
                if (browser != null)
                {
                    list.Add(new SectionModel()
                    {
                        Icon  = defaultIcon,
                        Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.Browser.BrowserId",
                        Key   = "Browser ID",
                        Value = browser.BrowserId.ToString()
                    });
                    list.Add(new SectionModel()
                    {
                        Icon  = defaultIcon,
                        Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.Browser.MajorName",
                        Key   = "Major name",
                        Value = browser.MajorName
                    });
                    list.Add(new SectionModel()
                    {
                        Icon  = defaultIcon,
                        Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.Browser.MinorName",
                        Key   = "Minor name",
                        Value = browser.MinorName
                    });
                }
            }
            return(list);
        }
Exemplo n.º 18
0
 public void Process(GlimpsePipelineArgs <AnalyticsModel> args)
 {
     Assert.ArgumentNotNull(args, "args");
     Assert.ArgumentNotNull(args.TabData, "args.TabData");
     Tracker.Visitor.LoadAll(VisitLoadOptions.PageEvents, VisitorOptions.Visitor);
 }
Exemplo n.º 19
0
 /// <summary>
 /// Processes the specified arguments.
 /// </summary>
 /// <param name="args">The arguments.</param>
 public void Process(GlimpsePipelineArgs <MvcPageModel> args)
 {
     Assert.ArgumentNotNull(args, "args");
     args.TabData = new MvcPageModel();
 }
Exemplo n.º 20
0
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <AnalyticsModel> args)
        {
            var defaultIcon = this.GetImage("People/16x16/megaphone.png");
            var visitor     = args.DataModel.Visitor;
            var list        = new List <SectionModel>();

            list.Add(new SectionModel()
            {
                Icon  = defaultIcon,
                Api   = "Sitecore.Analytics.Tracker.Visitor.AuthenticationLevel",
                Key   = "Authentication level",
                Value = visitor.AuthenticationLevel.ToString()
            });
            list.Add(new SectionModel()
            {
                Icon  = defaultIcon,
                Api   = "Sitecore.Analytics.Tracker.Visitor.CookieVisitId",
                Key   = "Visit ID (cookie)",
                Value = visitor.CookieVisitId.ToString()
            });
            list.Add(new SectionModel()
            {
                Icon  = defaultIcon,
                Api   = "Sitecore.Analytics.Tracker.Visitor.ExternalUser",
                Key   = "External user",
                Value = visitor.ExternalUser
            });
            list.Add(new SectionModel()
            {
                Icon  = defaultIcon,
                Api   = "Sitecore.Analytics.Tracker.Visitor.HasCurrentVisit",
                Key   = "Has current visit",
                Value = visitor.HasCurrentVisit.ToString()
            });
            list.Add(new SectionModel()
            {
                Icon  = defaultIcon,
                Api   = "Sitecore.Analytics.Tracker.Visitor.IsSubmitDisabled",
                Key   = "Submit disabled",
                Value = visitor.IsSubmitDisabled.ToString()
            });
            if (visitor.HasCurrentVisit)
            {
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.VisitorId",
                    Key   = "Visitor ID",
                    Value = visitor.VisitorId.ToString()
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.VisitCount",
                    Key   = "Visit count",
                    Value = visitor.VisitCount.ToString()
                });
                //list.Add(new SectionItemModel()
                //{
                //    //Icon = ThemeManager.GetLanguageImage(model.Language, model.Database, 16, 16),
                //    Api = "Sitecore.Analytics.Tracker.Visitor.Settings.IsFirstRequest",
                //    Key = "IsFirstRequest",
                //    Value = visitor.Settings.IsFirstRequest.ToString()
                //});
                //list.Add(new SectionItemModel()
                //{
                //    //Icon = ThemeManager.GetLanguageImage(model.Language, model.Database, 16, 16),
                //    Api = "Sitecore.Analytics.Tracker.Visitor.Settings.IsNew",
                //    Key = "IsNew",
                //    Value = visitor.Settings.IsNew.ToString()
                //});
                //list.Add(new SectionItemModel()
                //{
                //    //Icon = ThemeManager.GetLanguageImage(model.Language, model.Database, 16, 16),
                //    Api = "Sitecore.Analytics.Tracker.Visitor.Settings.IsTransient",
                //    Key = "IsTransient",
                //    Value = visitor.Settings.IsTransient.ToString()
                //});
                //list.Add(new SectionItemModel()
                //{
                //    //Icon = ThemeManager.GetLanguageImage(model.Language, model.Database, 16, 16),
                //    Api = "Sitecore.Analytics.Tracker.Visitor.Settings.IsVisitorClassificationGuessed",
                //    Key = "IsVisitorClassificationGuessed",
                //    Value = visitor.Settings.IsVisitorClassificationGuessed.ToString()
                //});
                //
            }
            return(list);
        }
Exemplo n.º 21
0
        protected override List <SectionModel> GetSectionData(GlimpsePipelineArgs <AnalyticsModel> args)
        {
            var defaultIcon = this.GetImage("People/16x16/megaphone.png");
            var visit       = args.DataModel.Visitor.CurrentVisit;
            var list        = new List <SectionModel>();

            if (visit != null && visit.HasGeoIpData)
            {
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.AreaCode",
                    Key   = "Area code",
                    Value = visit.AreaCode
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.City",
                    Key   = "City",
                    Value = visit.City
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.Country",
                    Key   = "Country",
                    Value = visit.Country
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.IspName",
                    Key   = "ISP name",
                    Value = visit.IspName
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.Latitude",
                    Key   = "Latitude",
                    Value = visit.Latitude.ToString()
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.LocationId",
                    Key   = "Location ID",
                    Value = visit.LocationId.ToString()
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.Longitude",
                    Key   = "Longitude",
                    Value = visit.Longitude.ToString()
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.MetroCode",
                    Key   = "Metro code",
                    Value = visit.MetroCode
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.PostalCode",
                    Key   = "Postal code",
                    Value = visit.PostalCode
                });
                list.Add(new SectionModel()
                {
                    Icon  = defaultIcon,
                    Api   = "Sitecore.Analytics.Tracker.Visitor.CurrentVisit.Region",
                    Key   = "Region",
                    Value = visit.Region
                });
            }
            return(list);
        }