public IHttpActionResult Install(PluginInfoModel model)
        {
            //first find the plugin
            var pluginInfo = _pluginFinderService.FindPlugin(model.SystemName);

            if (pluginInfo == null)
            {
                //was it a correct plugin?
                VerboseReporter.ReportError("The plugin doesn't exist", "plugin");
                return(RespondFailure());
            }

            //install the plugin
            _pluginInstallerService.Install(pluginInfo);

            VerboseReporter.ReportSuccess("The plugin has been installed", "plugin");
            return(RespondSuccess());
        }
Ejemplo n.º 2
0
        public void FillRequiredSeedData(string defaultUserEmail, string defaultUserPassword, string installDomain)
        {
            //first the settings
            SeedSettings(installDomain);

            if (!IntegrationManager.HasIntegrationMap <RoleMap>())
            {
                //seed the roles
                SeedRoles();
            }

            if (!IntegrationManager.HasIntegrationMap <UserMap>())
            {
                //then the user
                SeedDefaultUser(defaultUserEmail, defaultUserPassword);
            }

            //seed email account
            SeedEmailAccount(installDomain);

            //seed email templates
            SeedEmailTemplates(defaultUserEmail, installDomain);

            //notification emails
            SeedNotificationEvents();

            //install all the plugins as well
            var plugins = PluginEngine.Plugins.Where(x => !x.Installed);

            foreach (var plugin in plugins)
            {
                _pluginInstallerService.Install(plugin);
            }

            //update config file
            UpdateWebConfig();
        }