internal static void WriteNestedDomainData(IProgress progress, bool writeVerbose, string rootDir, IDictionary <string, XElement> wellUsedElements, IDictionary <string, SortedDictionary <string, byte[]> > classData, Dictionary <string, string> guidToClassMapping) { var anthropologyBaseDir = Path.Combine(rootDir, SharedConstants.Anthropology); if (!Directory.Exists(anthropologyBaseDir)) { Directory.CreateDirectory(anthropologyBaseDir); } FLExProjectSplitter.CheckForUserCancelRequested(progress); if (writeVerbose) { progress.WriteVerbose("Writing the anthropology data...."); } else { progress.WriteMessage("Writing the anthropology data...."); } AnthropologyBoundedContextService.NestContext(anthropologyBaseDir, wellUsedElements, classData, guidToClassMapping); }
internal static void WriteNestedDomainData(IProgress progress, bool writeVerbose, string rootDir, IDictionary <string, XElement> wellUsedElements, IDictionary <string, SortedDictionary <string, byte[]> > classData, Dictionary <string, string> guidToClassMapping) { var generalBaseDir = Path.Combine(rootDir, SharedConstants.General); if (!Directory.Exists(generalBaseDir)) { Directory.CreateDirectory(generalBaseDir); } FLExProjectSplitter.CheckForUserCancelRequested(progress); if (writeVerbose) { progress.WriteVerbose("Writing the general data...."); progress.WriteVerbose("Writing user-defined list data...."); } else { progress.WriteMessage("Writing the general data...."); progress.WriteMessage("Writing user-defined list data...."); } UserDefinedListsBoundedContextService.NestContext(generalBaseDir, wellUsedElements, classData, guidToClassMapping); FLExProjectSplitter.CheckForUserCancelRequested(progress); if (writeVerbose) { progress.WriteVerbose("Writing language project data...."); } else { progress.WriteMessage("Writing language project data...."); } GeneralDomainBoundedContext.NestContext(generalBaseDir, wellUsedElements, classData, guidToClassMapping); }
internal static void WriteNestedDomainData(IProgress progress, bool writeVerbose, string rootDir, IDictionary <string, XElement> wellUsedElements, IDictionary <string, SortedDictionary <string, byte[]> > classData, Dictionary <string, string> guidToClassMapping) { var linguisticsBaseDir = Path.Combine(rootDir, SharedConstants.Linguistics); if (!Directory.Exists(linguisticsBaseDir)) { Directory.CreateDirectory(linguisticsBaseDir); } FLExProjectSplitter.CheckForUserCancelRequested(progress); if (writeVerbose) { progress.WriteVerbose("Writing the linguistics data...."); progress.WriteVerbose("Writing reversal data...."); } else { progress.WriteMessage("Writing the linguistics data...."); progress.WriteMessage("Writing reversal data...."); } ReversalBoundedContextService.NestContext(linguisticsBaseDir, wellUsedElements, classData, guidToClassMapping); FLExProjectSplitter.CheckForUserCancelRequested(progress); if (writeVerbose) { progress.WriteVerbose("Writing morphology and syntax data...."); } else { progress.WriteMessage("Writing morphology and syntax data...."); } MorphologyAndSyntaxBoundedContextService.NestContext(linguisticsBaseDir, wellUsedElements, classData, guidToClassMapping); // Both ReversalBoundedContextService and MorphologyAndSyntaxBoundedContextService abscond with some stuff owned by LexDb. :-( FLExProjectSplitter.CheckForUserCancelRequested(progress); if (writeVerbose) { progress.WriteVerbose("Writing lexical data...."); } else { progress.WriteMessage("Writing lexical data...."); } LexiconBoundedContextService.NestContext(linguisticsBaseDir, wellUsedElements, classData, guidToClassMapping); FLExProjectSplitter.CheckForUserCancelRequested(progress); if (writeVerbose) { progress.WriteVerbose("Writing text corpus data...."); } else { progress.WriteMessage("Writing text corpus data...."); } TextCorpusBoundedContextService.NestContext(linguisticsBaseDir, wellUsedElements, classData, guidToClassMapping); FLExProjectSplitter.CheckForUserCancelRequested(progress); if (writeVerbose) { progress.WriteVerbose("Writing wordform and punctuation data...."); } else { progress.WriteMessage("Writing wordform and punctuation data...."); } WordformInventoryBoundedContextService.NestContext(linguisticsBaseDir, wellUsedElements, classData, guidToClassMapping); FLExProjectSplitter.CheckForUserCancelRequested(progress); if (writeVerbose) { progress.WriteVerbose("Writing discourse data...."); } else { progress.WriteMessage("Writing discourse data...."); } FLExProjectSplitter.CheckForUserCancelRequested(progress); DiscourseAnalysisBoundedContextService.NestContext(linguisticsBaseDir, wellUsedElements, classData, guidToClassMapping); if (writeVerbose) { progress.WriteVerbose("Writing phonology data...."); } else { progress.WriteMessage("Writing phonology data...."); } PhonologyBoundedContextService.NestContext(linguisticsBaseDir, wellUsedElements, classData, guidToClassMapping); }
internal static void WriteNestedDomainData(IProgress progress, bool writeVerbose, string rootDir, IDictionary <string, XElement> wellUsedElements, IDictionary <string, SortedDictionary <string, byte[]> > classData, Dictionary <string, string> guidToClassMapping) { /* * BC 1. ScrRefSystem (no owner) * Books prop owns seq of ScrBookRef (which has all basic props). * No other props. * [Put all in one file in a subfolder of Scripture?] * [[Nesting]] * * BC 2. CheckLists prop on LP that holds col of CmPossibilityList items. * Each CmPossibilityList will hold ChkTerm (called ChkItem in model file) objects (derived from CmPossibility) * [Store each list in a file. Put all lists in subfolder.] * [[Nesting]] * * BC 3. Scripture (owned by LP) * Leave in: * Resources prop owns col of CmResource. [Leave.] * Extract: * BC 4. ArchivedDrafts prop owns col of ScrDraft. [Each ScrDraft goes in its own file. Archived stuff goes into subfolder of Scripture.] * BC 5. Styles props owns col of StStyle. [Put styles in subfolder and one for each style.] * BC 6. ImportSettings prop owns col of ScrImportSet. [Put sets in subfolder and one for each set.] * BC 7. NoteCategories prop owns one CmPossibilityList [Put list in its own file.] * BC 8. ScriptureBooks prop owns seq of ScrBook. [Put each book in its own folder (named for its cononical order number).] * BC 9. BookAnnotations prop owns seq of ScrBookAnnotations. [Put each ScrBookAnnotations in corresponding subfolder along with optional book.] */ var scriptureBaseDir = Path.Combine(rootDir, SharedConstants.Other); if (!Directory.Exists(scriptureBaseDir)) { Directory.CreateDirectory(scriptureBaseDir); } FLExProjectSplitter.CheckForUserCancelRequested(progress); if (writeVerbose) { progress.WriteVerbose("Writing the other data...."); } else { progress.WriteMessage("Writing the other data...."); } ScriptureReferenceSystemBoundedContextService.NestContext(scriptureBaseDir, classData, guidToClassMapping); var langProj = wellUsedElements[SharedConstants.LangProject]; FLExProjectSplitter.CheckForUserCancelRequested(progress); ScriptureCheckListsBoundedContextService.NestContext(langProj, scriptureBaseDir, classData, guidToClassMapping); // These are intentionally out of order from the above numbering scheme. var scrAsBytes = classData[SharedConstants.Scripture].Values.FirstOrDefault(); // // Lela Teli-3 has null. if (scrAsBytes != null) { var scripture = Utilities.CreateFromBytes(scrAsBytes); FLExProjectSplitter.CheckForUserCancelRequested(progress); ArchivedDraftsBoundedContextService.NestContext(scripture.Element(SharedConstants.ArchivedDrafts), scriptureBaseDir, classData, guidToClassMapping); FLExProjectSplitter.CheckForUserCancelRequested(progress); ScriptureStylesBoundedContextService.NestContext(scripture.Element(SharedConstants.Styles), scriptureBaseDir, classData, guidToClassMapping); FLExProjectSplitter.CheckForUserCancelRequested(progress); ImportSettingsBoundedContextService.NestContext(scripture.Element(SharedConstants.ImportSettings), scriptureBaseDir, classData, guidToClassMapping); FLExProjectSplitter.CheckForUserCancelRequested(progress); ScriptureBoundedContextService.NestContext(langProj, scripture, scriptureBaseDir, classData, guidToClassMapping); } RemoveFolderIfEmpty(scriptureBaseDir); }