/// <summary> /// /ノーツ設計情報を出力する /// </summary> /// <param name="task"></param> private void ExportNotesInfo(IMigrateTask task) { //データベース接続 Reporter.SetStep(5, 1, RS.Informations.NotesDbConnecting, task.NotesDbTitle); NotesAccessor nsAccessor = GetNotesAccessor(); IDatabase db = null; if (task.CurrentDb == null && !string.IsNullOrEmpty(task.NotesFilePath)) { db = nsAccessor.GetDataBase(task.NotesFilePath, task.NotesServer); task.CurrentDb = db; } //出力フォルダ Reporter.SetStep(10, 2, RS.Informations.NotesDbExporting, task.NotesDbTitle); string baseDir = System.IO.Path.Combine(Config.ExportFolder, task.TaskId); if (System.IO.Directory.Exists(baseDir)) { System.IO.Directory.Delete(baseDir, true); } System.IO.Directory.CreateDirectory(baseDir); //データベースフォルダ string databaseDir = System.IO.Path.Combine(baseDir, "Database"); if (!System.IO.Directory.Exists(databaseDir)) { System.IO.Directory.CreateDirectory(databaseDir); } //アイコン出力する Reporter.ReportStep(RS.Informations.NotesDbExporting, true, task.NotesDbTitle); ExportDBIcon(nsAccessor, task, databaseDir); //DXLファイルを出力する Reporter.ReportStep(RS.Informations.NotesDbExporting, true, task.NotesDbTitle); IDxlReader dxlReader = nsAccessor.ExportDatabaseDxl(db, databaseDir); //イメージソースを出力する Reporter.SetStep(10, 1, RS.Informations.ImageResourceExporting); string imageDir = System.IO.Path.Combine(baseDir, "ImageResource"); dxlReader.SaveImageResources(imageDir, false); //フォームDXLを出力する Reporter.SetStep(5, task.TargetForms.Count * 2, RS.Informations.FormDesignExportStart); ExportFormDxl(task, dxlReader, baseDir); }
/// <summary> /// フォームDXLを出力する /// </summary> /// <param name="task"></param>q /// <param name="dxlReader"></param> private void ExportFormDxl(IMigrateTask task, IDxlReader dxlReader, string baseDir) { string formDir = System.IO.Path.Combine(baseDir, "form"); if (!System.IO.Directory.Exists(formDir)) { System.IO.Directory.CreateDirectory(formDir); } foreach (IForm form in task.TargetForms) { string fileName = CheckFileName(form.DisplayName) ? form.DisplayName : "form" + form.FormNo; string dxlFileName = System.IO.Path.Combine(formDir, fileName + ".dxl"); string formDxl = dxlReader.GetFormDxl(form.Name); System.IO.File.WriteAllText(dxlFileName, formDxl, System.Text.Encoding.UTF8); Reporter.ReportStep(RS.Informations.FormDesignExporting, true, form.DisplayName); TransferFormDxl(task, form, dxlFileName); Reporter.ReportStep(RS.Informations.FormDesignConverting, true, form.DisplayName); } }