Exemplo n.º 1
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            //Initializes ABP framework.
            app.UseAbp(options =>
            {
                options.UseAbpRequestLocalization = false; //used below: UseAbpRequestLocalization
            });

            app.UseCors(DefaultCorsPolicyName); //Enable CORS!

            app.UseAuthentication();
            app.UseJwtTokenMiddleware();

            if (bool.Parse(_appConfiguration["IdentityServer:IsEnabled"]))
            {
                app.UseJwtTokenMiddleware("IdentityBearer");
                app.UseIdentityServer();
            }

            app.UseStaticFiles();

            if (DatabaseCheckHelper.Exist(_appConfiguration["ConnectionStrings:Default"]))
            {
                app.UseAbpRequestLocalization();
            }

#if FEATURE_SIGNALR
            //Integrate to OWIN
            app.UseAppBuilder(ConfigureOwinServices);
#endif

            //Hangfire dashboard & server (Enable to use Hangfire instead of default job manager)
            //app.UseHangfireDashboard("/hangfire", new DashboardOptions
            //{
            //    Authorization = new[] { new AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_HangfireDashboard)  }
            //});
            //app.UseHangfireServer();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "defaultWithArea",
                    template: "{area}/{controller=Home}/{action=Index}/{id?}");

                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            // Enable middleware to serve generated Swagger as a JSON endpoint
            app.UseSwagger();
            // Enable middleware to serve swagger-ui assets (HTML, JS, CSS etc.)

            app.UseSwaggerUI(options =>
            {
                options.SwaggerEndpoint("/swagger/v1/swagger.json", "CRM API V1");
                options.IndexStream = () => Assembly.GetExecutingAssembly()
                                      .GetManifestResourceStream("CRM.Web.wwwroot.swagger.ui.index.html");
            }); //URL: /swagger
        }
Exemplo n.º 2
0
 public InstallController(
     IInstallAppService installAppService,
     IHostApplicationLifetime applicationLifetime,
     DatabaseCheckHelper databaseCheckHelper)
 {
     _installAppService   = installAppService;
     _applicationLifetime = applicationLifetime;
     _databaseCheckHelper = databaseCheckHelper;
 }
Exemplo n.º 3
0
 public InstallAppService(AbpZeroDbMigrator migrator,
                          LogInManager logInManager,
                          SignInManager signInManager,
                          DatabaseCheckHelper databaseCheckHelper)
 {
     _migrator            = migrator;
     _logInManager        = logInManager;
     _signInManager       = signInManager;
     _databaseCheckHelper = databaseCheckHelper;
 }
        private bool CheckDatabaseInternal()
        {
            var connectionString = GetConnectionString();

            if (string.IsNullOrEmpty(connectionString))
            {
                return(false);
            }

            return(DatabaseCheckHelper.Exist(connectionString));
        }
        private bool CheckDatabaseInternal()
        {
            var connectionString = GetAppSettingsJson().ConnectionString;

            if (string.IsNullOrEmpty(connectionString))
            {
                return(false);
            }

            return(DatabaseCheckHelper.Exist(GetAppSettingsJson().ConnectionString));
        }
 public InstallController(
     IInstallAppService installAppService,
     IHostApplicationLifetime applicationLifetime,
     DatabaseCheckHelper databaseCheckHelper,
     IAppConfigurationAccessor appConfigurationAccessor)
 {
     _installAppService   = installAppService;
     _applicationLifetime = applicationLifetime;
     _databaseCheckHelper = databaseCheckHelper;
     _appConfiguration    = appConfigurationAccessor.Configuration;
 }
 public InstallAppService(AbpZeroDbMigrator migrator,
                          LogInManager logInManager,
                          SignInManager signInManager,
                          DatabaseCheckHelper databaseCheckHelper,
                          IAppConfigurationAccessor appConfigurationAccessor,
                          IAppConfigurationWriter appConfigurationWriter)
 {
     _migrator               = migrator;
     _logInManager           = logInManager;
     _signInManager          = signInManager;
     _databaseCheckHelper    = databaseCheckHelper;
     _appConfiguration       = appConfigurationAccessor.Configuration;
     _appConfigurationWriter = appConfigurationWriter;
 }
Exemplo n.º 8
0
        public override void PostInitialize()
        {
            if (!DatabaseCheckHelper.Exist(_appConfiguration["ConnectionStrings:Default"]))
            {
                return;
            }

            if (IocManager.Resolve <IMultiTenancyConfig>().IsEnabled)
            {
                var workManager = IocManager.Resolve <IBackgroundWorkerManager>();
                workManager.Add(IocManager.Resolve <SubscriptionExpirationCheckWorker>());
                workManager.Add(IocManager.Resolve <SubscriptionExpireEmailNotifierWorker>());
            }

            ConfigureExternalAuthProviders();
        }
Exemplo n.º 9
0
        public ActionResult Index()
        {
            var appSettings = _installAppService.GetAppSettingsJson();

            if (DatabaseCheckHelper.Exist(appSettings.ConnectionString))
            {
                return(RedirectToAction("Index", "Home"));
            }

            var model = new InstallViewModel
            {
                Languages       = DefaultLanguagesCreator.InitialLanguages,
                AppSettingsJson = appSettings
            };

            return(View(model));
        }
Exemplo n.º 10
0
        public override void PostInitialize()
        {
            if (!DatabaseCheckHelper.Exist(_appConfiguration["ConnectionStrings:Default"]))
            {
                return;
            }

            if (IocManager.Resolve <IMultiTenancyConfig>().IsEnabled)
            {
                var workManager = IocManager.Resolve <IBackgroundWorkerManager>();
                workManager.Add(IocManager.Resolve <SubscriptionExpirationCheckWorker>());
                workManager.Add(IocManager.Resolve <SubscriptionExpireEmailNotifierWorker>());
            }

            // create job
            IScheduler scheduler = Configuration.Modules.AbpQuartz().Scheduler;
            var        job       = scheduler.GetJobDetail(new JobKey("OrderGenerator", "Order")).GetAwaiter().GetResult();

            if (job == null)
            {
                job = JobBuilder.Create <OrderGenerator>()
                      .WithIdentity("OrderGeneratorJob", "Order")
                      .WithDescription("OrderGenerator")
                      .StoreDurably(true)
                      .Build();

                scheduler.AddJob(job, true);

                var trigger = TriggerBuilder.Create()
                              .WithIdentity("OrderGeneratorTrigger", "Order")
                              .StartNow()
                              .WithSimpleSchedule(x => x
                                                  .WithIntervalInSeconds(60)
                                                  .RepeatForever())
                              .ForJob(job)
                              .Build();

                scheduler.ScheduleJob(trigger);
            }
        }
Exemplo n.º 11
0
 public QiProcureDemoDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
Exemplo n.º 12
0
 public AttendanceDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
Exemplo n.º 13
0
 public BreedDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
Exemplo n.º 14
0
 private bool CheckDatabaseInternal()
 {
     return(DatabaseCheckHelper.Exist(GetAppSettingsJson().ConnectionString));
 }
 public CoreOSRDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
Exemplo n.º 16
0
 public DynasysSolutionDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
Exemplo n.º 17
0
 public CIC_EPDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
 public ProjectsNGDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
 public MMHDemoDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
 public PortalDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
 public BukStoreDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
Exemplo n.º 22
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            //Initializes ABP framework.
            app.UseAbp(options =>
            {
                options.UseAbpRequestLocalization = false; //used below: UseAbpRequestLocalization
            });

            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }
            else
            {
                app.UseStatusCodePagesWithRedirects("~/Error?statusCode={0}");
                app.UseExceptionHandler("/Error");
            }

            app.UseAuthentication();

            if (bool.Parse(_appConfiguration["Authentication:JwtBearer:IsEnabled"]))
            {
                app.UseJwtTokenMiddleware();
            }

            if (bool.Parse(_appConfiguration["IdentityServer:IsEnabled"]))
            {
                app.UseJwtTokenMiddleware("IdentityBearer");
                app.UseIdentityServer();
            }

            app.UseStaticFiles();

            if (DatabaseCheckHelper.Exist(_appConfiguration["ConnectionStrings:Default"]))
            {
                app.UseAbpRequestLocalization();
            }

#if FEATURE_SIGNALR
            //Integrate to OWIN
            app.UseAppBuilder(ConfigureOwinServices);
#endif

            //Hangfire dashboard & server (Enable to use Hangfire instead of default job manager)
            //app.UseHangfireDashboard("/hangfire", new DashboardOptions
            //{
            //    Authorization = new[] { new AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_HangfireDashboard)  }
            //});
            //app.UseHangfireServer();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "defaultWithArea",
                    template: "{area}/{controller=Home}/{action=Index}/{id?}");

                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            // Enable middleware to serve generated Swagger as a JSON endpoint
            //app.UseSwagger();
            // Enable middleware to serve swagger-ui assets (HTML, JS, CSS etc.)
            //app.UseSwaggerUI(options =>
            //{
            //    options.SwaggerEndpoint("/swagger/v1/swagger.json", "AbpZeroTemplate API V1");
            //}); //URL: /swagger
        }
 public CruisePMSDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
Exemplo n.º 24
0
 public SdiscoDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
Exemplo n.º 25
0
 public AbpZeroTemplateDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
 public PharmacyDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
 public PodEZTemplateDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
Exemplo n.º 28
0
 public HinnovaDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }
Exemplo n.º 29
0
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            //Initializes ABP framework.
            app.UseAbp(options =>
            {
                options.UseAbpRequestLocalization = false; //used below: UseAbpRequestLocalization
            });
            app.UseAuthentication();

            app.UseJwtTokenMiddleware();

            if (bool.Parse(_appConfiguration["IdentityServer:IsEnabled"]))
            {
                app.UseJwtTokenMiddleware("IdentityBearer");
                app.UseIdentityServer();
            }

#if FEATURE_SIGNALR
            // Integrate with OWIN
            app.UseAppBuilder(ConfigureOwinServices);
#elif FEATURE_SIGNALR_ASPNETCORE
            app.UseSignalR(routes =>
            {
                routes.MapHub <AbpCommonHub>("/signalr", options => options.WebSockets.SubProtocolSelector = requestedProtocols =>
                {
                    return(requestedProtocols.Count > 0 ? requestedProtocols[0] : null);
                });
#if CHATNOANNOY
                routes.MapHub <Chat.ChatNoAnnoy.ChatNoAnnoy>("/chatNoAnnoy", options =>
                                                             options.WebSockets.SubProtocolSelector = requestedProtocols =>
                {
                    return(requestedProtocols.Count > 0 ? requestedProtocols[0] : null);
                });
#endif
            });
#endif
            app.UseCors(DefaultCorsPolicyName); //Enable CORS!



            app.UseStaticFiles();

            if (DatabaseCheckHelper.Exist(_appConfiguration["ConnectionStrings:Default"]))
            {
                app.UseAbpRequestLocalization();
            }

#if FEATURE_SIGNALR
            //Integrate to OWIN
            app.UseAppBuilder(ConfigureOwinServices);
#endif

            //Hangfire dashboard & server (Enable to use Hangfire instead of default job manager)
            app.UseHangfireDashboard("/hangfire", new DashboardOptions
            {
                // Authorization = new[] { new AbpHangfireAuthorizationFilter(AppPermissions.Pages_Administration_HangfireDashboard) }
                Authorization = new[] { new CustomAuthorizeFilter() }
            });
            app.UseHangfireServer();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "defaultWithArea",
                    template: "{area}/{controller=Home}/{action=Index}/{id?}");

                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            // Enable middleware to serve generated Swagger as a JSON endpoint
            app.UseSwagger();
            // Enable middleware to serve swagger-ui assets (HTML, JS, CSS etc.)
            app.UseSwaggerUI(options =>
            {
                options.SwaggerEndpoint("/swagger/v1/swagger.json", "Banch API V1");
            }); //URL: /swagger
#if EXTERNLOGIN
            //开启后台hangfire作业
            //BackgroundJob.Schedule<IHangfireJobAppSevice>(r => r.StartHangfire(), TimeSpan.FromMinutes(1));
#endif
        }
 public FintrakERPIMSDemoDbContextHealthCheck(DatabaseCheckHelper checkHelper)
 {
     _checkHelper = checkHelper;
 }