This commit is contained in:
Simon Martens
2023-06-21 16:32:08 +02:00
parent fdaffb2f91
commit e18f053865
14 changed files with 220223 additions and 56 deletions

3
HaWeb/.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "HaWeb.sln"
}

25
HaWeb/HaWeb.sln Normal file
View File

@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.001.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HaWeb", "HaWeb.csproj", "{3FDCF678-C8B9-410D-8229-BEB69195D27C}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3FDCF678-C8B9-410D-8229-BEB69195D27C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3FDCF678-C8B9-410D-8229-BEB69195D27C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3FDCF678-C8B9-410D-8229-BEB69195D27C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3FDCF678-C8B9-410D-8229-BEB69195D27C}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7ED50D02-358C-467B-AB41-CF0F0D6D1627}
EndGlobalSection
EndGlobal

View File

@@ -1,24 +0,0 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": ".NET Core Launch (console)",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"program": "${workspaceFolder}/bin/Debug/netcoreapp3.0/HamannPrinter.dll",
"args": [],
"cwd": "${workspaceFolder}",
"console": "internalConsole",
"stopAtEntry": false
},
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach"
}
]
}

3
HamannPrinter/.vscode/settings.json vendored Normal file
View File

@@ -0,0 +1,3 @@
{
"dotnet.defaultSolution": "HamannPrinter.sln"
}

View File

@@ -32,9 +32,8 @@
"args": [
"watch",
"run",
"${workspaceFolder}/HamannPrinter.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
"--project",
"${workspaceFolder}/HamannPrinter.csproj"
],
"problemMatcher": "$msCompile"
}

View File

@@ -450,14 +450,14 @@ namespace HamannPrinter
}
else
{
if (comment.Entry.Length > 0)
if (comment.Element.Length > 0)
{
counter++;
if (counter < 1)
{
var xLemma = StringToXElement(comment.Lemma + " ");
ParseComment(xLemma, para, counter);
var xComment = StringToXElement(comment.Entry);
var xComment = StringToXElement(comment.Element);
ParseComment(xComment, para, counter);
}
else
@@ -469,7 +469,7 @@ namespace HamannPrinter
}
else
{
Logger.Out("der Comment:\n" + comment.Entry + "\n für \n" + xelem + "\n ist leer");
Logger.Out("der Comment:\n" + comment.Element + "\n für \n" + xelem + "\n ist leer");
}
}
}
@@ -1414,7 +1414,7 @@ namespace HamannPrinter
Paragraph lemmaDescription = lemmaPara.InsertAfterSelf(new Paragraph());
ApplyParaStyle(lemmaDescription, "doppeleinzug");
lemmaDescription.ParagraphProperties.AppendChild(new SpacingBetweenLines() { After = SmallDistance });
ParseComment(XElement.Parse(metaComm.Entry), lemmaDescription);
ParseComment(XElement.Parse(metaComm.Element), lemmaDescription);
if (commReferences.ContainsKey(metaComm.Index))
{
var commReference = commReferences[metaComm.Index];
@@ -1436,7 +1436,7 @@ namespace HamannPrinter
{
foreach (var comm in metaComm.Kommentare)
{
if (!String.IsNullOrWhiteSpace(comm.Value.Entry)) {
if (!String.IsNullOrWhiteSpace(comm.Value.Element)) {
var subLemmaPara = GetLastPara(commDoc).InsertAfterSelf(new Paragraph());
ApplyParaStyle(subLemmaPara, "doppeleinzug");
ParseComment(XElement.Parse(comm.Value.Lemma), subLemmaPara);
@@ -1444,7 +1444,7 @@ namespace HamannPrinter
var subEintragPara = subLemmaPara.InsertAfterSelf(new Paragraph());
ApplyParaStyle(subEintragPara, "doppeleinzug");
subEintragPara.ParagraphProperties.AppendChild(new SpacingBetweenLines() { After = SmallDistance });
ParseComment(XElement.Parse(RemoveWhiteSpaceLinebreak(comm.Value.Entry)), subEintragPara);
ParseComment(XElement.Parse(RemoveWhiteSpaceLinebreak(comm.Value.Element)), subEintragPara);
if (commReferences.ContainsKey(metaComm.Index) && commReferences[metaComm.Index].ContainsKey(comm.Key))
{
subEintragPara.ParagraphProperties.AppendChild(new SpacingBetweenLines() { After = SmallDistance });
@@ -1680,7 +1680,7 @@ namespace HamannPrinter
volume = Int32.Parse(Letters.Metas[marg.Letter].ZH.Volume);
var place = new Place(volume, marg.Letter, ConvertNumber(marg.Page), Int32.Parse(marg.Line), marg.Page);
XElement comm = XElement.Parse(marg.Element);
foreach (var link in comm.Elements().Where(x => x.Name.LocalName == "link"))
foreach (var link in comm.Elements().Where(x => x.Name.LocalName == "link" && (x.HasAttributes && (x.Attribute("ref") != null || x.Attribute("subref") != null))))
{
string refer = link.Attribute("ref").Value;
string subref = "0";

View File

@@ -2,13 +2,13 @@
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
<TargetFramework>net6.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\HaDocument\HaDocument.csproj" />
<ProjectReference Include="..\HaDocumentV6\HaDocumentV6.csproj" />
</ItemGroup>
<ItemGroup>

View File

@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.001.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HamannPrinter", "HamannPrinter.csproj", "{F6C929A3-B041-4F42-AF25-00D1E49B55ED}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{F6C929A3-B041-4F42-AF25-00D1E49B55ED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F6C929A3-B041-4F42-AF25-00D1E49B55ED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F6C929A3-B041-4F42-AF25-00D1E49B55ED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F6C929A3-B041-4F42-AF25-00D1E49B55ED}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {807CF64C-09D5-4447-9592-EE27ACC24590}
EndGlobalSection
EndGlobal

View File

@@ -277,6 +277,7 @@ namespace HamannPrinter
static public Comment GetComment(XElement xelem)
{
//ref und subref id beziehen
if (!xelem.HasAttributes || xelem.Attribute("ref") == null) return null;
string refer = xelem.Attribute("ref").Value;
string subref = xelem?.Attribute("subref")?.Value;
Comment comm;

View File

@@ -22,8 +22,8 @@
<TextBox x:Name="OutputDirBox" HorizontalAlignment="Left" Margin="267,95,0,0" Text="" TextWrapping="NoWrap" VerticalAlignment="Top" Width="342"/>
<Button x:Name="OutputDirButton" Content="suchen" HorizontalAlignment="Left" Margin="627,95,0,0" VerticalAlignment="Top" Click="OutputDirButton_Click"/>
<Button Content="Dokumente erzeugen" HorizontalAlignment="Left" Margin="550,0,0,19" VerticalAlignment="Bottom" Click="Button_Click"/>
<TextBox x:Name="StartYearTextBox" HorizontalAlignment="Left" Margin="106,105,0,0" Text="1751" TextWrapping="Wrap" VerticalAlignment="Top" Width="56" RenderTransformOrigin="0.474,0.709" TextInput="TextBox_TextInput"/>
<TextBox x:Name="EndYearTextBox" HorizontalAlignment="Left" Margin="106,128,0,0" Text="1788" TextWrapping="Wrap" VerticalAlignment="Top" Width="56" RenderTransformOrigin="0.474,0.709" MaxLength="6" TextInput="EndYearTextBox_TextInput"/>
<TextBox x:Name="StartYearTextBox" HorizontalAlignment="Left" Margin="106,105,0,0" Text="1700" TextWrapping="Wrap" VerticalAlignment="Top" Width="56" RenderTransformOrigin="0.474,0.709" TextInput="TextBox_TextInput"/>
<TextBox x:Name="EndYearTextBox" HorizontalAlignment="Left" Margin="106,128,0,0" Text="1800" TextWrapping="Wrap" VerticalAlignment="Top" Width="56" RenderTransformOrigin="0.474,0.709" MaxLength="6" TextInput="EndYearTextBox_TextInput"/>
<Label Content="und" HorizontalAlignment="Left" Margin="44,124,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left"/>
<Label Content="zwischen" HorizontalAlignment="Left" Margin="44,102,0,0" VerticalAlignment="Top" HorizontalContentAlignment="Left" RenderTransformOrigin="0.418,1.293"/>
</Grid>

View File

@@ -25,12 +25,12 @@ namespace HamannPrinter
{
InitializeComponent();
RegisterDocs.IsChecked = true;
VolumeDocs.IsChecked = false;
StartYearTextBox.Text = "1751";
EndYearTextBox.Text = "1762"; // DEV
XmlFileBox.Text = @"D:\dev\source\hamann-ausgabe-core\XML\XML"; // DEV
OutputDirBox.Text = @"D:\dev\source\hamann-ausgabe-core\XML\Ausg"; // DEV
//Act(); // DEV
VolumeDocs.IsChecked = true;
StartYearTextBox.Text = "1700";
EndYearTextBox.Text = "1800"; // DEV
XmlFileBox.Text = @"D:\Simon\source\inp"; // DEV
OutputDirBox.Text = @"D:\Simon\source\ausg"; // DEV
Act(); // DEV
}
private void SingleDocChanged(object sender, RoutedEventArgs e)
@@ -214,11 +214,11 @@ namespace HamannPrinter
if (File.Exists(file))
{
// DEV
// var answer = System.Windows.MessageBox.Show("HAMANN.xml gefunden. \nZuletzt bearbeitet: " + File.GetLastWriteTime(file) + "\n\nSoll diese Datei verwendet werden, ohne eine neue aus den Einzeldokumenten zusammenzusetzen?",
// "Confirmation",
// MessageBoxButton.YesNo,
// MessageBoxImage.Question);
// if (answer == MessageBoxResult.Yes) return file;
var answer = System.Windows.MessageBox.Show("HAMANN.xml gefunden. \nZuletzt bearbeitet: " + File.GetLastWriteTime(file) + "\n\nSoll diese Datei verwendet werden, ohne eine neue aus den Einzeldokumenten zusammenzusetzen?",
"Confirmation",
MessageBoxButton.YesNo,
MessageBoxImage.Question);
if (answer == MessageBoxResult.Yes) return file;
File.Delete(file);
}
return new Concatinator(MakePath(XmlFileBox.Text)).HamannXmlFile;

View File

@@ -14,10 +14,10 @@ namespace HamannPrinter
class Options : IHaDocumentOptions
{
public string HamannXMLFilePath { get; set; }
public string[] AvailableVolumes { get; set; } = { "1", "2", "3", "4", "5", "6", "7" };
public string[] AvailableVolumes { get; set; } = { };
public bool NormalizeWhitespace { get; set; } = true;
public (int, int) AvailableYearRange {get; set; } = (1751, 1788);
public (int, int) AvailableYearRange {get; set; } = (1700, 1800);
public Options(string HamannXmlPath)
{
@@ -75,11 +75,19 @@ namespace HamannPrinter
public void MakeDocuments(Confix confix)
{
var hamannDoc = Document.Create(new Options(confix.HamannXmlPath));
DocOptions docOpt = new DocOptions(confix.Years, confix.OutputPath, confix.Editionsrichtlinien);
CheckXML(confix, docOpt, hamannDoc);
Coordinator(docOpt, hamannDoc, hamannDoc, docOpt.Years, confix.VolumeDocx, confix.RegisterDocx);
// DEV Helper.Ok("Fertig!");
// try {
var hamannDoc = Document.Create(new Options(confix.HamannXmlPath));
DocOptions docOpt = new DocOptions(confix.Years, confix.OutputPath, confix.Editionsrichtlinien);
CheckXML(confix, docOpt, hamannDoc);
Coordinator(docOpt, hamannDoc, hamannDoc, docOpt.Years, confix.VolumeDocx, confix.RegisterDocx);
// DEV Helper.Ok("Fertig!");
// } catch (Exception ex) {
// Console.WriteLine("Quelle: " + ex.Source);
// Console.WriteLine("Msg: " + ex.Message);
// Console.WriteLine("Trace: " + ex.StackTrace);
// Console.ReadKey();
// }
Environment.Exit(0);
}

Binary file not shown.

220127
HamannPrinter/inp/HAMANN.xml Normal file

File diff suppressed because it is too large Load Diff