Example #1
0
        public static DashboardEntity GetHomePageDashboard()
        {
            var result = GetDashboard(false, null);

            if (result == null)
            {
                return(null);
            }

            using (ViewLogLogic.LogView(result.ToLite(), "GetHomePageDashboard"))
                return(result);
        }
Example #2
0
        public static UserChartEntity RetrieveUserChart(this Lite <UserChartEntity> userChart)
        {
            using (ViewLogLogic.LogView(userChart, "UserChart"))
            {
                var result = UserCharts.Value.GetOrThrow(userChart);

                var isAllowed = Schema.Current.GetInMemoryFilter <UserChartEntity>(userInterface: false);
                if (!isAllowed(result))
                {
                    throw new EntityNotFoundException(userChart.EntityType, userChart.Id);
                }

                return(result);
            }
        }
Example #3
0
        public static DashboardEntity RetrieveDashboard(this Lite <DashboardEntity> dashboard)
        {
            using (ViewLogLogic.LogView(dashboard, "Dashboard"))
            {
                var result = Dashboards.Value.GetOrThrow(dashboard);

                var isAllowed = Schema.Current.GetInMemoryFilter <DashboardEntity>(userInterface: true);
                if (!isAllowed(result))
                {
                    throw new EntityNotFoundException(dashboard.EntityType, dashboard.Id);
                }

                return(result);
            }
        }
Example #4
0
        public static DashboardEntity GetEmbeddedDashboard(Type entityType)
        {
            var isAllowed = Schema.Current.GetInMemoryFilter <DashboardEntity>(userInterface: true);

            var result = DashboardsByType.Value.TryGetC(entityType).EmptyIfNull().Select(Dashboards.Value.GetOrThrow)
                         .Where(d => d.EmbeddedInEntity.Value != DashboardEmbedededInEntity.None && isAllowed(d))
                         .OrderByDescending(a => a.DashboardPriority).FirstOrDefault();

            if (result == null)
            {
                return(null);
            }

            using (ViewLogLogic.LogView(result.ToLite(), "GetEmbeddedDashboard"))
                return(result);
        }
Example #5
0
        public static List <DashboardEntity> GetEmbeddedDashboards(Type entityType)
        {
            var isAllowed = Schema.Current.GetInMemoryFilter <DashboardEntity>(userInterface: false);

            var result = DashboardsByType.Value.TryGetC(entityType).EmptyIfNull().Select(lite => Dashboards.Value.GetOrThrow(lite))
                         .Where(d => d.EmbeddedInEntity != DashboardEmbedededInEntity.None && isAllowed(d))
                         .OrderByDescending(a => a.DashboardPriority)
                         .ToList();

            if (!result.Any())
            {
                return(result);
            }

            foreach (var item in result)
            {
                using (ViewLogLogic.LogView(item.ToLite(), "GetEmbeddedDashboards"))
                {
                }
            }
            return(result);
        }
Example #6
0
 static IDisposable Manager_RetrievingForView(Lite <Entity> lite)
 {
     return(ViewLogLogic.LogView(lite, "WebRetrieve"));
 }
Example #7
0
 private static IDisposable?ExecutionMode_OnApiRetrieved(Entity entity, string url)
 {
     return(ViewLogLogic.LogView(entity.ToLite(), url));
 }