private void ExportToZip_Connection()
        {
            // Save configuration
            this.Save_SourceConfiguration();

            IReportServerReader    reader             = null;
            DataSourceItemExporter dataSourceExporter = null;
            FolderItemExporter     folderExporter     = null;
            ReportItemExporter     reportExporter     = null;
            IBundler    zipBundler = null;
            IFileSystem fileSystem = null;

            // Test the source connection
            this.TestSourceConnection(true);

            string version = this.GetSourceServerVersion();

            reader = this.mKernel.Get <IReportServerReader>(version);

            dataSourceExporter = this.mKernel.Get <DataSourceItemExporter>();
            folderExporter     = this.mKernel.Get <FolderItemExporter>();
            reportExporter     = this.mKernel.Get <ReportItemExporter>();

            zipBundler = this.mKernel.Get <IBundler>();
            fileSystem = this.mKernel.Get <IFileSystem>();

            this.PerformExportToZip(this.txtSrcPath.Text,
                                    this.txtExportZipFilename.Text,
                                    reader,
                                    folderExporter,
                                    reportExporter,
                                    dataSourceExporter,
                                    zipBundler,
                                    fileSystem);
        }
        private void ExportToDisk_Connection()
        {
            // Save configuration
            this.Save_SourceConfiguration();

            IReportServerReader    reader             = null;
            DataSourceItemExporter dataSourceExporter = null;
            FolderItemExporter     folderExporter     = null;
            ReportItemExporter     reportExporter     = null;

            // Test the source connection
            this.TestSourceConnection(true);

            string version = this.GetSourceServerVersion();

            reader = this.mKernel.Get <IReportServerReader>(version);

            dataSourceExporter = this.mKernel.Get <DataSourceItemExporter>();
            folderExporter     = this.mKernel.Get <FolderItemExporter>();
            reportExporter     = this.mKernel.Get <ReportItemExporter>();

            this.PerformExportToDisk(this.txtSrcPath.Text,
                                     this.txtExportDiskFolderName.Text,
                                     reader,
                                     folderExporter,
                                     reportExporter,
                                     dataSourceExporter);
        }
        public void TestFixtureSetUp()
        {
            // Setup expected FolderItems
            expectedFolderItem = new FolderItem()
            {
                Name = "Reports",
                Path = "/SSRSMigrate_AW_Tests/Reports",
            };

            expectedFolderItems = new List <FolderItem>()
            {
                expectedFolderItem,
                new FolderItem()
                {
                    Name = "Sub Folder",
                    Path = "/SSRSMigrate_AW_Tests/Reports/Sub Folder",
                },
                new FolderItem()
                {
                    Name = "Data Sources",
                    Path = "/SSRSMigrate_AW_Tests/Data Sources",
                }
            };

            reader = TestKernel.Instance.Get <IReportServerReader>("2005-SRC");
        }
示例#4
0
        public ExportDiskForm(string sourceRootPath,
                              string destinationPath,
                              IReportServerReader reader,
                              FolderItemExporter folderExporter,
                              ReportItemExporter reportExporter,
                              DataSourceItemExporter dataSourceExporter,
                              ILoggerFactory loggerFactory)
        {
            if (string.IsNullOrEmpty(sourceRootPath))
            {
                throw new ArgumentException("sourceRootPath");
            }

            if (string.IsNullOrEmpty(destinationPath))
            {
                throw new ArgumentException("destinationPath");
            }

            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            if (folderExporter == null)
            {
                throw new ArgumentNullException("folderExporter");
            }

            if (reportExporter == null)
            {
                throw new ArgumentNullException("reportExporter");
            }

            if (dataSourceExporter == null)
            {
                throw new ArgumentNullException("dataSourceExporter");
            }

            if (loggerFactory == null)
            {
                throw new ArgumentNullException("loggerFactory");
            }

            InitializeComponent();

            this.mSourceRootPath        = sourceRootPath;
            this.mExportDestinationPath = destinationPath;
            this.mReportServerReader    = reader;
            this.mFolderExporter        = folderExporter;
            this.mReportExporter        = reportExporter;
            this.mDataSourceExporter    = dataSourceExporter;
            this.mLoggerFactory         = loggerFactory;

            this.mLogger      = mLoggerFactory.GetCurrentClassLogger();
            this.mSummaryForm = new SummaryForm();
        }
示例#5
0
        public ExportZipForm(string sourceRootPath,
            string destinationFilename,
            IReportServerReader reader,
            FolderItemExporter folderExporter,
            ReportItemExporter reportExporter,
            DataSourceItemExporter dataSourceExporter,
            IBundler zipBundler,
            ILoggerFactory loggerFactory,
            IFileSystem fileSystem)
        {
            if (string.IsNullOrEmpty(sourceRootPath))
                throw new ArgumentException("sourceRootPath");

            if (string.IsNullOrEmpty(destinationFilename))
                throw new ArgumentException("destinationFilename");

            if (reader == null)
                throw new ArgumentNullException("reader");

            if (folderExporter == null)
                throw new ArgumentNullException("folderExporter");

            if (reportExporter == null)
                throw new ArgumentNullException("reportExporter");

            if (dataSourceExporter == null)
                throw new ArgumentNullException("dataSourceExporter");

            if (zipBundler == null)
                throw new ArgumentNullException("zipBundler");

            if (loggerFactory == null)
                throw new ArgumentNullException("loggerFactory");

            if (fileSystem == null)
                throw new ArgumentNullException("fileSystem");

            InitializeComponent();

            this.mSourceRootPath = sourceRootPath;
            this.mExportDestinationFilename = destinationFilename;
            this.mReportServerReader = reader;
            this.mFolderExporter = folderExporter;
            this.mReportExporter = reportExporter;
            this.mDataSourceExporter = dataSourceExporter;
            this.mZipBundler = zipBundler;
            this.mLoggerFactory = loggerFactory;
            this.mFileSystem = fileSystem;

            this.mLogger = mLoggerFactory.GetCurrentClassLogger();

            this.mExportOutputTempDirectory = this.GetTemporaryExportOutputFolder("SSRSMigrate_ExportZip");
            this.CreateExportOutputFolder(this.mExportOutputTempDirectory);
            this.mSummaryForm = new SummaryForm();
        }
        private void PerformDirectMigrate(
            string sourceServerUrl,
            string sourceRootPath,
            string destinationServerUrl,
            string destinationRootPath,
            IReportServerReader reader,
            IReportServerWriter writer,
            PythonEngine engine)
        {
            DataSourceEditForm dataSourceEditForm = this.mKernel.Get <DataSourceEditForm>();

            //TODO This is dumb. Should be resolving all of the forms from the IoC kernel but I don't feel like refactoring atm...
            MigrateForm migrateForm = new MigrateForm(
                sourceRootPath,
                sourceServerUrl,
                destinationRootPath,
                destinationServerUrl,
                dataSourceEditForm,
                reader,
                writer,
                this.mLoggerFactory,
                engine);

            // If 'Execute Script' is checked, load script
            if (chkExecuteScript.Checked)
            {
                try
                {
                    string scriptFile = txtScriptPath.Text;

                    mLogger.Info("Loading script '{0}'...", scriptFile);

                    migrateForm.LoadScript(scriptFile);

                    mLogger.Info("Script '{0}' loaded!", scriptFile);
                }
                catch (Exception er)
                {
                    mLogger.Error(er, "Error loading script");

                    MessageBox.Show(er.Message,
                                    "Error Loading Script",
                                    MessageBoxButtons.OK,
                                    MessageBoxIcon.Error);

                    return;
                }
            }

            migrateForm.DebugForm = this.mDebugForm;
            migrateForm.Show();
        }
        public void TestFixtureSetUp()
        {
            EnvironmentSetup();
            outputPath = GetOutPutPath();
            SetupExpectedValues();

            // Create the IItemExporter objects
            reportExporter     = TestKernel.Instance.Get <ReportItemExporter>();
            dataSourceExporter = TestKernel.Instance.Get <DataSourceItemExporter>();
            folderExporter     = TestKernel.Instance.Get <FolderItemExporter>();

            reader = TestKernel.Instance.Get <IReportServerReader>("2005-SRC");
        }
示例#8
0
        public PythonEngine(
            IReportServerReader reportServerReader,
            IReportServerWriter reportServerWriter,
            IReportServerRepository reportServerRepository,
            IFileSystem fileSystem,
            ILogger logger,
            ILogger scriptLogger)
        {
            if (reportServerReader == null)
            {
                throw new ArgumentNullException("reportServerReader");
            }

            if (reportServerWriter == null)
            {
                throw new ArgumentNullException("reportServerWriter");
            }

            if (reportServerRepository == null)
            {
                throw new ArgumentNullException("reportServerRepository");
            }

            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }

            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }

            if (scriptLogger == null)
            {
                throw new ArgumentNullException("scriptLogger");
            }

            this.mReportServerReader     = reportServerReader;
            this.mReportServerWriter     = reportServerWriter;
            this.mReportServerRepository = reportServerRepository;
            this.mFileSystem             = fileSystem;
            this.mLogger       = logger;
            this.mScriptLogger = scriptLogger;

            this.mAppDomain    = AppDomain.CreateDomain("sandbox");
            this.mScriptEngine = Python.CreateEngine();
            this.mScriptEngine.Runtime.ImportModule("clr");

            this.mEnginePath = Environment.CurrentDirectory;
        }
        public void TestFixtureSetUp()
        {
            // Setup expected DataSourceItems
            expectedDataSourceItems = new List <DataSourceItem>()
            {
                new DataSourceItem()
                {
                    Description                          = null,
                    VirtualPath                          = null,
                    Name                                 = "AWDataSource",
                    Path                                 = "/SSRSMigrate_AW_Tests/Data Sources/AWDataSource",
                    ConnectString                        = "Data Source=(local);Initial Catalog=AdventureWorks2008",
                    CredentialsRetrieval                 = "Integrated",
                    Enabled                              = true,
                    EnabledSpecified                     = true,
                    Extension                            = "SQL",
                    ImpersonateUser                      = false,
                    ImpersonateUserSpecified             = true,
                    OriginalConnectStringExpressionBased = false,
                    Password                             = null,
                    Prompt                               = "Enter a user name and password to access the data source:",
                    UseOriginalConnectString             = false,
                    UserName                             = null,
                    WindowsCredentials                   = false
                },
                new DataSourceItem()
                {
                    Description                          = null,
                    VirtualPath                          = null,
                    Name                                 = "Test Data Source",
                    Path                                 = "/SSRSMigrate_AW_Tests/Data Sources/Test Data Source",
                    ConnectString                        = "Data Source=(local);Initial Catalog=AdventureWorks2008",
                    CredentialsRetrieval                 = "Integrated",
                    Enabled                              = true,
                    EnabledSpecified                     = true,
                    Extension                            = "SQL",
                    ImpersonateUser                      = false,
                    ImpersonateUserSpecified             = true,
                    OriginalConnectStringExpressionBased = false,
                    Password                             = null,
                    Prompt                               = "Enter a user name and password to access the data source:",
                    UseOriginalConnectString             = false,
                    UserName                             = null,
                    WindowsCredentials                   = false
                },
            };

            reader = TestKernel.Instance.Get <IReportServerReader>("2010-SRC");
        }
示例#10
0
        public MigrateForm(
            string sourceRootPath,
            string sourceServerUrl,
            string destinationRootPath,
            string destinationServerUrl,
            IReportServerReader reader,
            IReportServerWriter writer,
            ILoggerFactory loggerFactory)
        {
            if (string.IsNullOrEmpty(sourceRootPath))
                throw new ArgumentException("sourceRootPath");

            if (string.IsNullOrEmpty(sourceServerUrl))
                throw new ArgumentException("sourceServerUrl");

            if (string.IsNullOrEmpty(destinationServerUrl))
                throw new ArgumentException("destinationServerUrl");

            if (string.IsNullOrEmpty(sourceServerUrl))
                throw new ArgumentException("sourceServerUrl");

            if (reader == null)
                throw new ArgumentNullException("reader");

            if (writer == null)
                throw new ArgumentNullException("writer");

            if (loggerFactory == null)
                throw new ArgumentNullException("loggerFactory");

            InitializeComponent();

            this.mSourceRootPath = sourceRootPath;
            this.mSourceServerUrl = sourceServerUrl;
            this.mDestinationRootPath = destinationRootPath;
            this.mDestinationServerUrl = destinationServerUrl;
            this.mReportServerReader = reader;
            this.mReportServerWriter = writer;
            this.mLoggerFactory = loggerFactory;

            this.mLogger = mLoggerFactory.GetCurrentClassLogger();

            this.mLogger.Info("sourceRootPath: {0}", this.mSourceRootPath);
            this.mLogger.Info("sourceServerUrl: {0}", this.mSourceServerUrl);
            this.mLogger.Info("destinationRootPath: {0}", this.mDestinationRootPath);
            this.mLogger.Info("destinationServerUrl: {0}", this.mDestinationServerUrl);
            this.mSummaryForm = new SummaryForm();
        }
示例#11
0
        private void PerformExportToDisk(string sourceRootPath,
                                         string destinationPath,
                                         IReportServerReader reader,
                                         FolderItemExporter folderExporter,
                                         ReportItemExporter reportExporter,
                                         DataSourceItemExporter dataSourceExporter)
        {
            ExportDiskForm exportDiskForm = new ExportDiskForm(sourceRootPath,
                                                               destinationPath,
                                                               reader,
                                                               folderExporter,
                                                               reportExporter,
                                                               dataSourceExporter,
                                                               this.mLoggerFactory);

            exportDiskForm.DebugForm = this.mDebugForm;
            exportDiskForm.Show();
        }
示例#12
0
        public ExportDiskForm(string sourceRootPath,
            string destinationPath,
            IReportServerReader reader,
            FolderItemExporter folderExporter,
            ReportItemExporter reportExporter,
            DataSourceItemExporter dataSourceExporter,
            ILoggerFactory loggerFactory)
        {
            if (string.IsNullOrEmpty(sourceRootPath))
                throw new ArgumentException("sourceRootPath");

            if (string.IsNullOrEmpty(destinationPath))
                throw new ArgumentException("destinationPath");

            if (reader == null)
                throw new ArgumentNullException("reader");

            if (folderExporter == null)
                throw new ArgumentNullException("folderExporter");

            if (reportExporter == null)
                throw new ArgumentNullException("reportExporter");

            if (dataSourceExporter == null)
                throw new ArgumentNullException("dataSourceExporter");

            if (loggerFactory == null)
                throw new ArgumentNullException("loggerFactory");

            InitializeComponent();

            this.mSourceRootPath = sourceRootPath;
            this.mExportDestinationPath = destinationPath;
            this.mReportServerReader = reader;
            this.mFolderExporter = folderExporter;
            this.mReportExporter = reportExporter;
            this.mDataSourceExporter = dataSourceExporter;
            this.mLoggerFactory = loggerFactory;

            this.mLogger = mLoggerFactory.GetCurrentClassLogger();
            this.mSummaryForm = new SummaryForm();
        }
示例#13
0
        private void PerformExportToZip(string sourceRootPath,
                                        string destinationFilename,
                                        IReportServerReader reader,
                                        FolderItemExporter folderExporter,
                                        ReportItemExporter reportExporter,
                                        DataSourceItemExporter dataSourceExporter,
                                        IBundler zipBunder,
                                        IFileSystem fileSystem)
        {
            ExportZipForm exportZipForm = new ExportZipForm(
                sourceRootPath,
                destinationFilename,
                reader,
                folderExporter,
                reportExporter,
                dataSourceExporter,
                zipBunder,
                this.mLoggerFactory,
                fileSystem);

            exportZipForm.DebugForm = this.mDebugForm;
            exportZipForm.Show();
        }
示例#14
0
        private void PerformExportToZip(string sourceRootPath,
            string destinationFilename,
            IReportServerReader reader,
            FolderItemExporter folderExporter,
            ReportItemExporter reportExporter,
            DataSourceItemExporter dataSourceExporter,
            IBundler zipBunder,
            IFileSystem fileSystem)
        {
            ExportZipForm exportZipForm = new ExportZipForm(
                sourceRootPath,
                destinationFilename,
                reader,
                folderExporter,
                reportExporter,
                dataSourceExporter,
                zipBunder,
                this.mLoggerFactory,
                fileSystem);

            exportZipForm.DebugForm = this.mDebugForm;
            exportZipForm.Show();
        }
示例#15
0
        private void PerformExportToDisk(string sourceRootPath,
            string destinationPath,
            IReportServerReader reader,
            FolderItemExporter folderExporter,
            ReportItemExporter reportExporter,
            DataSourceItemExporter dataSourceExporter)
        {
            ExportDiskForm exportDiskForm = new ExportDiskForm(sourceRootPath,
                destinationPath,
                reader,
                folderExporter,
                reportExporter,
                dataSourceExporter,
                this.mLoggerFactory);

            exportDiskForm.DebugForm = this.mDebugForm;
            exportDiskForm.Show();
        }
示例#16
0
        private void PerformDirectMigrate(
            string sourceServerUrl,
            string sourceRootPath,
            string destinationServerUrl,
            string destinationRootPath,
            IReportServerReader reader,
            IReportServerWriter writer)
        {
            MigrateForm migrateForm = new MigrateForm(
                sourceRootPath,
                sourceServerUrl,
                destinationRootPath,
                destinationServerUrl,
                reader,
                writer,
                this.mLoggerFactory);

            migrateForm.DebugForm = this.mDebugForm;
            migrateForm.Show();
        }
示例#17
0
        public void TestFixtureSetUp()
        {
            EnvironmentSetup();
            outputPath = GetOutPutPath();
            SetupExpectedValues();

            // Create the IItemExporter objects
            reportExporter = TestKernel.Instance.Get<ReportItemExporter>();
            dataSourceExporter = TestKernel.Instance.Get<DataSourceItemExporter>();
            folderExporter = TestKernel.Instance.Get<FolderItemExporter>();

            reader = TestKernel.Instance.Get<IReportServerReader>("2005-SRC");
        }
 public void TestFixtureTearDown()
 {
     reader = null;
 }
        public void TestFixtureSetUp()
        {
            SetupExpectedResults();

            reader = TestKernel.Instance.Get<IReportServerReader>("2005-SRC");
        }
 public void TestFixtureTearDown()
 {
     reader = null;
 }
示例#21
0
        public ExportZipForm(string sourceRootPath,
                             string destinationFilename,
                             IReportServerReader reader,
                             FolderItemExporter folderExporter,
                             ReportItemExporter reportExporter,
                             DataSourceItemExporter dataSourceExporter,
                             IBundler zipBundler,
                             ILoggerFactory loggerFactory,
                             IFileSystem fileSystem)
        {
            if (string.IsNullOrEmpty(sourceRootPath))
            {
                throw new ArgumentException("sourceRootPath");
            }

            if (string.IsNullOrEmpty(destinationFilename))
            {
                throw new ArgumentException("destinationFilename");
            }

            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            if (folderExporter == null)
            {
                throw new ArgumentNullException("folderExporter");
            }

            if (reportExporter == null)
            {
                throw new ArgumentNullException("reportExporter");
            }

            if (dataSourceExporter == null)
            {
                throw new ArgumentNullException("dataSourceExporter");
            }

            if (zipBundler == null)
            {
                throw new ArgumentNullException("zipBundler");
            }

            if (loggerFactory == null)
            {
                throw new ArgumentNullException("loggerFactory");
            }

            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }

            InitializeComponent();

            this.mSourceRootPath            = sourceRootPath;
            this.mExportDestinationFilename = destinationFilename;
            this.mReportServerReader        = reader;
            this.mFolderExporter            = folderExporter;
            this.mReportExporter            = reportExporter;
            this.mDataSourceExporter        = dataSourceExporter;
            this.mZipBundler    = zipBundler;
            this.mLoggerFactory = loggerFactory;
            this.mFileSystem    = fileSystem;

            this.mLogger = mLoggerFactory.GetCurrentClassLogger();

            this.mExportOutputTempDirectory = this.GetTemporaryExportOutputFolder("SSRSMigrate_ExportZip");
            this.CreateExportOutputFolder(this.mExportOutputTempDirectory);
            this.mSummaryForm = new SummaryForm();
        }
        public void TestFixtureSetUp()
        {
            // Setup expected DataSourceItems
            expectedDataSourceItems = new List<DataSourceItem>()
            {
                new DataSourceItem()
                {
                    Description = null,
                    VirtualPath = null,
                    Name = "AWDataSource",
                    Path = "/SSRSMigrate_AW_Tests/Data Sources/AWDataSource",
                    ConnectString = "Data Source=(local);Initial Catalog=AdventureWorks2008",
                    CredentialsRetrieval = "Integrated",
                    Enabled = true,
                    EnabledSpecified = true,
                    Extension = "SQL",
                    ImpersonateUser = false,
                    ImpersonateUserSpecified = true,
                    OriginalConnectStringExpressionBased = false,
                    Password = null,
                    Prompt = "Enter a user name and password to access the data source:",
                    UseOriginalConnectString = false,
                    UserName = null,
                    WindowsCredentials = false
                },
               new DataSourceItem()
                {
                    Description = null,
                    VirtualPath = null,
                    Name = "Test Data Source",
                    Path = "/SSRSMigrate_AW_Tests/Data Sources/Test Data Source",
                    ConnectString = "Data Source=(local);Initial Catalog=AdventureWorks2008",
                    CredentialsRetrieval = "Integrated",
                    Enabled = true,
                    EnabledSpecified = true,
                    Extension = "SQL",
                    ImpersonateUser = false,
                    ImpersonateUserSpecified = true,
                    OriginalConnectStringExpressionBased = false,
                    Password = null,
                    Prompt = "Enter a user name and password to access the data source:",
                    UseOriginalConnectString = false,
                    UserName = null,
                    WindowsCredentials = false
                },
            };

            reader = TestKernel.Instance.Get<IReportServerReader>("2010-SRC");
        }
示例#23
0
        public MigrateForm(
            string sourceRootPath,
            string sourceServerUrl,
            string destinationRootPath,
            string destinationServerUrl,
            DataSourceEditForm dataSourceEditForm,
            IReportServerReader reader,
            IReportServerWriter writer,
            ILoggerFactory loggerFactory,
            PythonEngine pythonEngine)
        {
            if (string.IsNullOrEmpty(sourceRootPath))
            {
                throw new ArgumentException("sourceRootPath");
            }

            if (string.IsNullOrEmpty(sourceServerUrl))
            {
                throw new ArgumentException("sourceServerUrl");
            }

            if (string.IsNullOrEmpty(destinationServerUrl))
            {
                throw new ArgumentException("destinationServerUrl");
            }

            if (string.IsNullOrEmpty(sourceServerUrl))
            {
                throw new ArgumentException("sourceServerUrl");
            }

            if (dataSourceEditForm == null)
            {
                throw new ArgumentNullException("dataSourceEditForm");
            }

            if (reader == null)
            {
                throw new ArgumentNullException("reader");
            }

            if (writer == null)
            {
                throw new ArgumentNullException("writer");
            }

            if (loggerFactory == null)
            {
                throw new ArgumentNullException("loggerFactory");
            }

            if (pythonEngine == null)
            {
                throw new ArgumentNullException("pythonEngine");
            }

            InitializeComponent();

            this.mSourceRootPath       = sourceRootPath;
            this.mSourceServerUrl      = sourceServerUrl;
            this.mDestinationRootPath  = destinationRootPath;
            this.mDestinationServerUrl = destinationServerUrl;
            this.mDataSourceEditForm   = dataSourceEditForm;
            this.mReportServerReader   = reader;
            this.mReportServerWriter   = writer;
            this.mLoggerFactory        = loggerFactory;
            this.mEngine = pythonEngine;
            this.mLogger = mLoggerFactory.GetCurrentClassLogger();

            this.mLogger.Info("sourceRootPath: {0}", this.mSourceRootPath);
            this.mLogger.Info("sourceServerUrl: {0}", this.mSourceServerUrl);
            this.mLogger.Info("destinationRootPath: {0}", this.mDestinationRootPath);
            this.mLogger.Info("destinationServerUrl: {0}", this.mDestinationServerUrl);
            this.mSummaryForm = new SummaryForm();
        }
示例#24
0
        public void TestFixtureSetUp()
        {
            SetupExpectedResults();

            reader = TestKernel.Instance.Get <IReportServerReader>("2005-SRC");
        }
        public void TestFixtureSetUp()
        {
            // Setup expected FolderItems
            expectedFolderItem = new FolderItem()
            {
                Name = "Reports",
                Path = "/SSRSMigrate_AW_Tests/Reports",
            };

            expectedFolderItems = new List<FolderItem>()
            {
                expectedFolderItem,
                new FolderItem()
                {
                    Name = "Sub Folder",
                    Path = "/SSRSMigrate_AW_Tests/Reports/Sub Folder",
                },
                new FolderItem()
                {
                    Name = "Data Sources",
                    Path = "/SSRSMigrate_AW_Tests/Data Sources",
                }
            };

            reader = TestKernel.Instance.Get<IReportServerReader>("2005-SRC");
        }
示例#26
0
        private void DirectMigration_Connection()
        {
            // Save configuration
            this.Save_SourceConfiguration();
            this.Save_DestinationConfiguration();

            IReportServerReader reader = null;
            IReportServerWriter writer = null;
            string srcVersion          = "2005-SRC";
            string destVersion         = "2005-SRC";

            if (this.cboSrcVersion.SelectedIndex > this.cboDestVersion.SelectedIndex)
            {
                throw new Exception("Source server is newer than destination server.");
            }

            if (this.cboSrcVersion.SelectedIndex == 0)
            {
                srcVersion = "2005-SRC";
            }
            else
            {
                srcVersion = "2010-SRC";
            }

            if (this.cboDestVersion.SelectedIndex == 0)
            {
                destVersion = "2005-DEST";
            }
            else
            {
                destVersion = "2010-DEST";
            }

            // If source server is the same as the destination server and the root paths are the same, throw exception
            if (this.txtSrcUrl.Text.ToLower() == this.txtDestUrl.Text.ToLower() &&
                this.txtSrcPath.Text.ToLower() == this.txtDestPath.Text.ToLower())
            {
                throw new Exception("You cannot migrate to the same path on the same server.");
            }

            // Test the source connection
            this.TestSourceConnection(true);

            // Test the destination connection
            this.TestDestinationConnection(true);

            reader = this.mKernel.Get <IReportServerReader>(srcVersion);
            writer = this.mKernel.Get <IReportServerWriter>(destVersion);

            // Check source and destination server versions through the reader and writer
            SSRSVersion sourceVersion      = reader.GetSqlServerVersion();
            SSRSVersion destinationVersion = writer.GetSqlServerVersion();

            // If the destination version is older than the source version, prevent migration.
            if ((int)destinationVersion < (int)sourceVersion)
            {
                throw new Exception("Destination server is using an older version of SQL Server than the source server.");
            }

            writer.Overwrite = this.cbkDestOverwrite.Checked;

            // Resolve PythonEngine from kernel
            PythonEngine engine = this.mKernel.Get <PythonEngine>(destVersion);

            this.PerformDirectMigrate(
                this.txtSrcUrl.Text,
                this.txtSrcPath.Text,
                this.txtDestUrl.Text,
                this.txtDestPath.Text,
                reader,
                writer,
                engine);
        }