Exemplo n.º 1
0
        public override object GetData(ITabContext context)
        {
            try
            {
                var sitecoreData = _sitecoreRequest.GetData();

                if (!sitecoreData.HasData())
                {
                    return(null);
                }

                var analyicsOverviewSection = new AnalyicsOverviewSection(sitecoreData).Create();
                var analticsSummary         = new AnalticsSummary(sitecoreData).Create();

                if ((string.IsNullOrEmpty(analticsSummary)) || (analyicsOverviewSection == null))
                {
                    return(null);
                }

                var plugin = Plugin.Create("Visitor", analticsSummary);
                plugin.AddRow().Column("Overview").Column(analyicsOverviewSection).Selected();

                var profilesSection  = new ProfilesSection(sitecoreData).Create();
                var goalsSection     = new GoalsSection(sitecoreData).Create();
                var pageViewsSection = new PageViewsSection(sitecoreData).Create();

                if (profilesSection != null)
                {
                    plugin.Section("Profiles", profilesSection);
                }

                if (goalsSection != null)
                {
                    plugin.AddRow().Column("Goals").Column(goalsSection).Info();
                }

                if (pageViewsSection != null)
                {
                    plugin.AddRow().Column("Page Views").Column(pageViewsSection).Quiet();
                }

                return(plugin);
            }
            catch (Exception ex)
            {
                return(new { Exception = ex });
            }
        }
Exemplo n.º 2
0
        public override object GetData(ITabContext context)
        {
            try
            {
                var sitecoreData = _sitecoreRequest.GetData();

                if (!sitecoreData.HasData())
                {
                    return(null);
                }

                var itemSummary = new ItemSummary(sitecoreData).Create();

                if (string.IsNullOrEmpty(itemSummary))
                {
                    return(null);
                }

                var plugin = Plugin.Create("Item", itemSummary);

                var itemSection    = new ItemSection(sitecoreData).Create();
                var contextSection = new ContextSection(sitecoreData).Create();
                var serverSection  = new ServerSection(sitecoreData).Create();

                if (itemSection != null)
                {
                    plugin.AddRow().Column("Item").Column(itemSection).Selected();
                }

                if (contextSection != null)
                {
                    plugin.AddRow().Column("Context").Column(contextSection).Quiet();
                }

                if (serverSection != null)
                {
                    plugin.AddRow().Column("Server").Column(serverSection).Quiet();
                }

                return(plugin);
            }
            catch (Exception ex)
            {
                return(new { Exception = ex });
            }
        }
Exemplo n.º 3
0
        public override object GetData(ITabContext context)
        {
            try
            {
                var stopWatch = new System.Diagnostics.Stopwatch();
                stopWatch.Start();

                return(new object[] {
                    new object[] { "Sitecore.Glimpse" },
                    new object[] { _sitecoreRequest.GetData() },
                    new object[] { string.Format("Execution Time: {0}ms", stopWatch.ElapsedMilliseconds) }
                });
            }
            catch (Exception ex)
            {
                return(new object[] {
                    new object[] { "Exception" },
                    new object[] { ex }
                });
            }
        }