Exemplo n.º 1
0
        protected void btnMigrateFiles_Click(object sender, EventArgs e)
        {
            IFilesStorageProviderV30 from = Collectors.FilesProviderCollector.GetProvider(lstFilesSource.SelectedValue);
            IFilesStorageProviderV30 to   = Collectors.FilesProviderCollector.GetProvider(lstFilesDestination.SelectedValue);

            Log.LogEntry("Files data migration requested from " + from.Information.Name + " to " + to.Information.Name, EntryType.General, SessionFacade.CurrentUsername);

            DataMigrator.MigrateFilesStorageProviderData(from, to, Settings.Provider);

            lblMigrateFilesResult.CssClass = "resultok";
            lblMigrateFilesResult.Text     = Properties.Messages.DataMigrated;
        }
Exemplo n.º 2
0
        protected void btnCopySettings_Click(object sender, EventArgs e)
        {
            ISettingsStorageProviderV30 to = null;

            ISettingsStorageProviderV30[] allProviders = ProviderLoader.LoadAllSettingsStorageProviders(Settings.Provider);
            foreach (ISettingsStorageProviderV30 prov in allProviders)
            {
                if (prov.GetType().ToString() == lstSettingsDestination.SelectedValue)
                {
                    to = prov;
                    break;
                }
            }

            Log.LogEntry("Settings data copy requested to " + to.Information.Name, EntryType.General, SessionFacade.CurrentUsername);

            try {
                to.Init(Host.Instance, txtSettingsDestinationConfig.Text);
            }
            catch (InvalidConfigurationException ex) {
                Log.LogEntry("Provider rejected configuration: " + ex, EntryType.Error, Log.SystemUsername);
                lblCopySettingsResult.CssClass = "resulterror";
                lblCopySettingsResult.Text     = Properties.Messages.ProviderRejectedConfiguration;
                return;
            }

            // Find namespaces
            List <string> namespaces = new List <string>(5);

            foreach (NamespaceInfo ns in Pages.GetNamespaces())
            {
                namespaces.Add(ns.Name);
            }

            DataMigrator.CopySettingsStorageProviderData(Settings.Provider, to, namespaces.ToArray(), Collectors.GetAllProviders());

            lblCopySettingsResult.CssClass = "resultok";
            lblCopySettingsResult.Text     = Properties.Messages.DataCopied;
        }