Example #1
0
        public virtual string GetConfiguration(Dictionary <string, string> options)
        {
            //Schedule settings have lowest priority, because there is currently no setup
            SetupSchedule(options);

            //Now setup the environment
            ApplicationSettings appSet = new ApplicationSettings(this.Task.DataParent);

            if (this.Task.ExistsInDb && appSet.SignatureCacheEnabled && !string.IsNullOrEmpty(appSet.SignatureCachePath))
            {
                options["signature-cache-path"] = System.IO.Path.Combine(System.Environment.ExpandEnvironmentVariables(appSet.SignatureCachePath), this.Task.Schedule.ID.ToString());
            }

            if (!string.IsNullOrEmpty(appSet.TempPath))
            {
                string tempdir = System.Environment.ExpandEnvironmentVariables(appSet.TempPath);
                if (!System.IO.Directory.Exists(tempdir))
                {
                    System.IO.Directory.CreateDirectory(tempdir);
                }

                options["tempdir"] = tempdir;
            }

            Dictionary <string, string> env = appSet.CreateDetachedCopy();

            //Inject the encryption, backend and compression module names into the environment
            env["encryption-module"]  = this.Task.EncryptionModule;
            env["compression-module"] = this.Task.CompressionModule;
            env["backend-module"]     = this.Task.Service;

            //If there are any control extensions, let them modify the environment
            foreach (Library.Interface.ISettingsControl ic in Library.DynamicLoader.SettingsControlLoader.Modules)
            {
                ic.GetConfiguration(env, SettingExtension.GetExtensions(this.Task.Schedule.DataParent, ic.Key), options);
            }

            //Setup encryption module
            SetupEncryptionModule(env, this.Task.EncryptionSettingsLookup, options);

            //Setup compression module
            SetupCompressionModule(env, this.Task.CompressionSettingsLookup, options);

            //Next is the actual backend setup
            string destination = SetupBackend(env, options);

            //Setup any task options
            SetupTask(options);

            //Setup any task extension options
            SetupTaskExtensions(options);

            //Override everything set in the overrides, this is placed last so it cannot be overriden elsewhere
            foreach (TaskOverride ov in this.Task.TaskOverrides)
            {
                options[ov.Name] = ov.Value;
            }

            return(destination);
        }
Example #2
0
 public static void SaveExtensionSettings(IDataFetcher connection, IDictionary <string, string> env)
 {
     //If there are any control extensions, let them modify the environement
     foreach (Library.Interface.ISettingsControl ic in Library.DynamicLoader.SettingsControlLoader.Modules)
     {
         ic.EndEdit(env, SettingExtension.GetExtensions(connection, ic.Key));
     }
 }
Example #3
0
        public static Dictionary <string, string> GetApplicationSettings(IDataFetcher connection)
        {
            Dictionary <string, string> env = new ApplicationSettings(connection).CreateDetachedCopy();

            //If there are any control extensions, let them modify the environement
            foreach (Library.Interface.ISettingsControl ic in Library.DynamicLoader.SettingsControlLoader.Modules)
            {
                ic.BeginEdit(env, SettingExtension.GetExtensions(connection, ic.Key));
            }

            return(env);
        }