public static void Start(bool toExcelPlain, bool excelReport, bool excelAttachment) { if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod())) { ToExcelPlain = toExcelPlain; ExcelReport = excelReport; Navigator.RegisterArea(typeof(ExcelClient)); if (excelReport) { if (!Navigator.Manager.EntitySettings.ContainsKey(typeof(FileEmbedded))) { throw new InvalidOperationException("Call FileEmbedded first"); } if (!Navigator.Manager.EntitySettings.ContainsKey(typeof(QueryEntity))) { Navigator.Manager.EntitySettings.Add(typeof(QueryEntity), new EntitySettings <QueryEntity>()); } Navigator.AddSetting(new EntitySettings <ExcelReportEntity> { PartialViewName = _ => ViewPrefix.FormatWith("ExcelReport") }); } if (toExcelPlain || excelReport) { ButtonBarQueryHelper.RegisterGlobalButtons(ButtonBarQueryHelper_GetButtonBarForQueryName); } if (excelAttachment) { Navigator.AddSetting(new EntitySettings <ExcelAttachmentEntity> { PartialViewName = _ => ViewPrefix.FormatWith("ExcelAttachment") }); } } }
public static void Start() { if (!Navigator.Manager.EntitySettings.ContainsKey(typeof(FileEntity))) { throw new InvalidOperationException("Call FileClient.Start first with FileEntity"); } if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod())) { Navigator.RegisterArea(typeof(ChartClient)); Navigator.AddSettings(new List <EntitySettings> { new ModelEntitySettings <ChartRequest>(), new EmbeddedEntitySettings <ChartParameterEmbedded>(), new EmbeddedEntitySettings <ChartColumnEmbedded> { PartialViewName = _ => ViewPrefix.FormatWith("ChartColumn") }, new EmbeddedEntitySettings <ChartScriptColumnEmbedded> { PartialViewName = _ => ViewPrefix.FormatWith("ChartScriptColumn") }, new EmbeddedEntitySettings <ChartScriptParameterEmbedded> { PartialViewName = _ => ViewPrefix.FormatWith("ChartScriptParameter") }, new EntitySettings <ChartScriptEntity> { PartialViewName = _ => ViewPrefix.FormatWith("ChartScript") }, }); ButtonBarQueryHelper.RegisterGlobalButtons(ButtonBarQueryHelper_GetButtonBarForQueryName); RouteTable.Routes.MapRoute(null, "ChartFor/{webQueryName}", new { controller = "Chart", action = "Index", webQueryName = "" }); UserChartClient.Start(); ChartColorClient.Start(); } }
public static void Start(string imageFolder, string baseUrl) { if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod())) { HelpUrls.BaseUrl = baseUrl; HelpUrls.ImagesFolder = imageFolder; Navigator.RegisterArea(typeof(HelpClient)); Navigator.AddSettings(new List <EntitySettings> { new EntitySettings <EntityHelpEntity>(), new EntitySettings <QueryHelpEntity>(), new EntitySettings <AppendixHelpEntity>(), new EntitySettings <NamespaceHelpEntity>(), new EmbeddedEntitySettings <PropertyRouteHelpEmbedded>(), new EntitySettings <OperationHelpEntity>(), new EmbeddedEntitySettings <QueryColumnHelpEmbedded>(), }); Navigator.EmbeddedEntitySettings <PropertyRouteHelpEmbedded>().MappingDefault.AsEntityMapping() .SetProperty(a => a.Property, ctx => { var type = ctx.FindParent <EntityHelpEntity>().Value.Type.ToType(); return(PropertyRoute.Parse(type, ctx.Input).ToPropertyRouteEntity()); }); RegisterHelpRoutes(); Common.CommonTask += Common_CommonTask; WidgetsHelper.GetWidget += WidgetsHelper_GetWidget; ButtonBarQueryHelper.RegisterGlobalButtons(ButtonBarQueryHelper_RegisterGlobalButtons); } }
public static void Start() { if (Navigator.Manager.NotDefined(MethodInfo.GetCurrentMethod())) { QueryClient.Start(); Navigator.RegisterArea(typeof(UserQueriesClient)); UserAssetsClient.Start(); UserAssetsClient.RegisterExportAssertLink <UserQueryEntity>(); LinksClient.RegisterEntityLinks <UserQueryEntity>((lite, ctx) => new[] { new QuickLinkAction(UserQueryMessage.Preview, RouteHelper.New().Action <UserQueriesController>(cc => cc.View(lite, null, null))) { IsVisible = UserQueryPermission.ViewUserQuery.IsAuthorized() } }); RouteTable.Routes.MapRoute(null, "UQ/{webQueryName}/{lite}", new { controller = "UserQueries", action = "View" }); Navigator.AddSettings(new List <EntitySettings> { new EntitySettings <UserQueryEntity> { PartialViewName = e => ViewPrefix.FormatWith("UserQuery"), IsCreable = EntityWhen.Never }, new EmbeddedEntitySettings <QueryFilterEmbedded> { PartialViewName = e => ViewPrefix.FormatWith("QueryFilter"), MappingDefault = new EntityMapping <QueryFilterEmbedded>(false) .SetProperty(a => a.Token, QueryTokenMapping(SubTokensOptions.CanAnyAll | SubTokensOptions.CanElement)) .CreateProperty(a => a.Operation) .CreateProperty(a => a.ValueString) }, new EmbeddedEntitySettings <QueryColumnEmbedded> { PartialViewName = e => ViewPrefix.FormatWith("QueryColumn"), MappingDefault = new EntityMapping <QueryColumnEmbedded>(false) .SetProperty(a => a.Token, QueryTokenMapping(SubTokensOptions.CanElement)) .CreateProperty(a => a.DisplayName) }, new EmbeddedEntitySettings <QueryOrderEmbedded> { PartialViewName = e => ViewPrefix.FormatWith("QueryOrder"), MappingDefault = new EntityMapping <QueryOrderEmbedded>(false) .SetProperty(a => a.Token, QueryTokenMapping(SubTokensOptions.CanElement)) .CreateProperty(a => a.OrderType) }, }); ButtonBarQueryHelper.RegisterGlobalButtons(ButtonBarQueryHelper_GetButtonBarForQueryName); OperationClient.AddSettings(new List <OperationSettings> { new EntityOperationSettings <UserQueryEntity>(UserQueryOperation.Delete) { Click = ctx => Module["deleteUserQuery"](ctx.Options(), Finder.FindRoute(((UserQueryEntity)ctx.Entity).Query.ToQueryName())), } }); LinksClient.RegisterEntityLinks <Entity>((entity, ctrl) => { if (!UserQueryPermission.ViewUserQuery.IsAuthorized()) { return(null); } return(UserQueryLogic.GetUserQueriesEntity(entity.EntityType) .Select(cp => new UserQueryQuickLink(cp, entity)).ToArray()); }); } }