Skip to content

Commit

Permalink
SIARDexcerpt v 0.9.0 (Teil1)
Browse files Browse the repository at this point in the history
============================
Version 0.9.0 erstellt
Erweiterung mit eCH-0233 (ersetzt TAXAR)
Bugfix 

ToDo
----
Handbücher
  • Loading branch information
Chlara committed Jul 11, 2019
1 parent 0d28fca commit f27256f
Show file tree
Hide file tree
Showing 15 changed files with 1,310 additions and 1,076 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* == SIARDexcerpt ==============================================================================
* The SIARDexcerpt v0.1.1 application is used for excerpt a record from a SIARD-File. Copyright (C)
* The SIARDexcerpt v0.9.0 application is used for excerpt a record from a SIARD-File. Copyright (C)
* 2016-2019 Claire Roethlisberger (KOST-CECO)
* -----------------------------------------------------------------------------------------------
* SIARDexcerpt is a development of the KOST-CECO. All rights rest with the KOST-CECO. This
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,27 +157,33 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn
/* Element number = docConfigInit.createElement("number"); number.setTextContent( "c" +
* (1) ); nodeColumns.appendChild(number); */
NodeList nlColumn = nodeColumns.getChildNodes();
int counter = 0;
// System.out.println( "Anzahl Column: " + (nlColumn.getLength()+1)/2 );
for ( int y = 0; y < nlColumn.getLength(); y++ ) {
int counter = (y + 1) / 2;
Node nodeColumn = nlColumn.item( y );
NodeList nlColumnDetail = nodeColumn.getChildNodes();
Element number = docConfig.createElement( "number" );
number.setTextContent( "c" + counter );
for ( int z = 0; z < nlColumnDetail.getLength(); z++ ) {
Node subNode = nlColumnDetail.item( z );
if ( subNode.getNodeName().equals( "type" ) ) {
// nodeColumn.appendChild(number);
nodeColumn.insertBefore( number, subNode );
Node subNodeColumns = nlColumn.item( y );
if ( subNodeColumns.getNodeName().equals( "column" ) ) {
// nur Column mit nummer erweitern und nicht auch Kommentare
counter = counter + 1;
Node nodeColumn = nlColumn.item( y );
NodeList nlColumnDetail = nodeColumn.getChildNodes();
Element number = docConfig.createElement( "number" );
number.setTextContent( "c" + counter );
for ( int z = 0; z < nlColumnDetail.getLength(); z++ ) {
Node subNode = nlColumnDetail.item( z );
if ( subNode.getNodeName().equals( "type" ) ) {
// nodeColumn.appendChild(number);
nodeColumn.insertBefore( number, subNode );
}
}
}
for ( int z = 0; z < nlColumnDetail.getLength(); z++ ) {
Node subNode = nlColumnDetail.item( z );
if ( subNode.getNodeName().equals( "number" ) ) {
// System.out.println( "number " + subNode.getTextContent() );
for ( int z = 0; z < nlColumnDetail.getLength(); z++ ) {
Node subNode = nlColumnDetail.item( z );
if ( subNode.getNodeName().equals( "number" ) ) {
// System.out.println( "number " + subNode.getTextContent() );
}
}
} else {
// Kommentar wird nicht mit number ergänzt
}

}
}
NodeList nlFK = docConfig.getElementsByTagName( "foreignKey" );
Expand Down Expand Up @@ -506,6 +512,7 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn

// TODO (..) oder tabelle hat nicht existiert -> boolMainname=false
if ( !boolMainname ) {
// System.out.println( "(..) oder tabelle hat nicht existiert -> boolMainname=false" );
if ( nlPK.getLength() == 0 ) {
/* kein Primärschlüssel. if pkInt = 0 dann jene Tabelle mit den meisten column. Der
* Schlüssel ist die erste Spalte, welche nicht Nullable sein darf oder die erste. Keine
Expand Down Expand Up @@ -1383,6 +1390,21 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn
Node nodeParentPK = nodePK.getParentNode();
// nodeParentPK = table
NodeList childNodesTablePK = nodeParentPK.getChildNodes();

// Schema name und folder herauslesen
Node mainTable = nodeParentPK.getParentNode();
Node mainTables = mainTable.getParentNode();
NodeList nlTablesChild = mainTables.getChildNodes();
for ( int x2 = 0; x2 < nlTablesChild.getLength(); x2++ ) {
// für jedes Subelement der Tabelle (name, folder, description...) ...
Node subNode = nlTablesChild.item( x2 );
if ( subNode.getNodeName().equals( "name" ) ) {
mainschemaname = subNode.getTextContent();
} else if ( subNode.getNodeName().equals( "folder" ) ) {
mainschemafolder = subNode.getTextContent();
}
}

for ( int y = 0; y < childNodesTablePK.getLength(); y++ ) {
Node subNodeTablePK = childNodesTablePK.item( y );
if ( subNodeTablePK.getNodeName().equals( "name" ) ) {
Expand All @@ -1397,14 +1419,6 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn
Node subNodeII = childNodesColumns.item( y1 );
NodeList childNodesColumn = subNodeII.getChildNodes();
for ( int z = 0; z < childNodesColumn.getLength(); z++ ) {
if ( primarykeynameProv.equals( primarykeyname ) ) {
primarykeycell = primarykeycellProv;
primarykeynameProv = "";
primarykeycellProv = "";
} else {
primarykeynameProv = "";
primarykeycellProv = "";
}
// für jedes Subelement der Zelle (name, description...) ...
Node subNodeIII = childNodesColumn.item( z );
if ( subNodeIII.getNodeName().equals( "name" ) ) {
Expand All @@ -1418,6 +1432,9 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn
typeProv = subNodeIII.getTextContent();
}
}
if ( primarykeynameProv.equals( primarykeyname ) ) {
primarykeycell = primarykeycellProv;
}

/* Höchste Prio (1) für "CHARACTER VARYING", "CHARACTER" und "DATE".
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -385,23 +385,30 @@ public boolean validate( File siardDatei, File outFile, String excerptString,
// System.out.println( "tabdescription: "+tabdescription );
} else if ( subNodeI.getNodeName().equals( "columns" ) ) {
NodeList childNodesColumns = subNodeI.getChildNodes();
int counter = 0;
for ( int y = 0; y < childNodesColumns.getLength(); y++ ) {
Node subNodeII = childNodesColumns.item( y );
NodeList childNodesColumn = subNodeII.getChildNodes();
for ( int z = 0; z < childNodesColumn.getLength(); z++ ) {
int cellNumber = (y + 1) / 2;
// System.out.println( "Zelle Nr " + cellNumber );
Node subNodeIII = childNodesColumn.item( z );
if ( subNodeIII.getNodeName().equals( "name" ) ) {
// System.out.println( subNodeIII.getNodeName()+": "+subNodeIII.getTextContent()
// );
cellname = cellname + "<c" + cellNumber + ">" + subNodeIII.getTextContent()
+ "</c" + cellNumber + ">";
} else if ( subNodeIII.getNodeName().equals( "description" ) ) {
// System.out.println( subNodeIII.getNodeName()+": "+subNodeIII.getTextContent()
// );
celldescription = celldescription + "<c" + cellNumber + ">"
+ new String( subNodeIII.getTextContent() ) + "</c" + cellNumber + ">";
if ( subNodeII.getNodeName().equals( "column" ) ) {
// nur Column mit nummer erweitern und nicht auch Kommentare
counter = counter + 1;
NodeList childNodesColumn = subNodeII.getChildNodes();
for ( int z = 0; z < childNodesColumn.getLength(); z++ ) {
int cellNumber = counter;
// System.out.println( "Zelle Nr " + cellNumber );
Node subNodeIII = childNodesColumn.item( z );
if ( subNodeIII.getNodeName().equals( "name" ) ) {
// System.out.println(
// subNodeIII.getNodeName()+": "+subNodeIII.getTextContent()
// );
cellname = cellname + "<c" + cellNumber + ">" + subNodeIII.getTextContent()
+ "</c" + cellNumber + ">";
} else if ( subNodeIII.getNodeName().equals( "description" ) ) {
// System.out.println(
// subNodeIII.getNodeName()+": "+subNodeIII.getTextContent()
// );
celldescription = celldescription + "<c" + cellNumber + ">"
+ new String( subNodeIII.getTextContent() ) + "</c" + cellNumber + ">";
}
}
}
}
Expand Down Expand Up @@ -777,23 +784,26 @@ public boolean validate( File siardDatei, File outFile, String excerptString,
}
} else if ( subNodeI.getNodeName().equals( "columns" ) ) {
NodeList childNodesColumns = subNodeI.getChildNodes();
int counter = 0;
for ( int y = 0; y < childNodesColumns.getLength(); y++ ) {
// für jede Zelle (column) ...
Node subNodeII = childNodesColumns.item( y );
NodeList childNodesColumn = subNodeII.getChildNodes();
for ( int z = 0; z < childNodesColumn.getLength(); z++ ) {
// für jedes Subelement der Zelle (name, description...) ...
int cellNumber = (y + 1) / 2;
// System.out.println( "Zelle Nr " + cellNumber );
Node subNodeIII = childNodesColumn.item( z );
if ( subNodeIII.getNodeName().equals( "name" ) ) {
cellname = cellname + "<c" + cellNumber + ">"
+ subNodeIII.getTextContent() + "</c" + cellNumber + ">";
// System.out.println( cellname );
} else if ( subNodeIII.getNodeName().equals( "description" ) ) {
celldescription = celldescription + "<c" + cellNumber + ">"
+ new String( subNodeIII.getTextContent() ) + "</c" + cellNumber
+ ">";
if ( subNodeII.getNodeName().equals( "column" ) ) {
// nur Column mit nummer erweitern und nicht auch Kommentare
counter = counter + 1;
NodeList childNodesColumn = subNodeII.getChildNodes();
for ( int z = 0; z < childNodesColumn.getLength(); z++ ) {
int cellNumber = counter;
// System.out.println( "Zelle Nr " + cellNumber );
Node subNodeIII = childNodesColumn.item( z );
if ( subNodeIII.getNodeName().equals( "name" ) ) {
cellname = cellname + "<c" + cellNumber + ">"
+ subNodeIII.getTextContent() + "</c" + cellNumber + ">";
// System.out.println( cellname );
} else if ( subNodeIII.getNodeName().equals( "description" ) ) {
celldescription = celldescription + "<c" + cellNumber + ">"
+ new String( subNodeIII.getTextContent() ) + "</c"
+ cellNumber + ">";
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion SIARDexcerpt/src/main/resources/de_messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ error.special.character = Der Pfad "{0}" enthaelt ein Sonderzeichen "{1}", welc
message.xml.header = <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="{0}"?><table>
message.xml.start = <Infos><Start>{0}</Start>
message.xml.text = <{1}>{0}</{1}>
message.xml.info = <Info>SIARDexcerpt v0.1.1, Copyright (C) 2016-2019 Claire Roethlisberger (KOST-CECO). This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see GPL-3.0_COPYING.txt for details</Info></Infos>
message.xml.info = <Info>SIARDexcerpt v0.9.0, Copyright (C) 2016-2019 Claire Roethlisberger (KOST-CECO). This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see GPL-3.0_COPYING.txt for details</Info></Infos>
message.xml.logend = </table>
message.xml.title = Suchergebnis aus der Tabelle {0}:

Expand Down
2 changes: 1 addition & 1 deletion SIARDexcerpt/src/main/resources/en_messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ error.special.character = The path "{0}" contains a special character "{1}", wh
message.xml.header = <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="{0}"?><table>
message.xml.start = <Infos><Start>{0}</Start>
message.xml.text = <{1}>{0}</{1}>
message.xml.info = <Info>SIARDexcerpt v0.1.1, Copyright (C) 2016-2019 Claire Roethlisberger (KOST-CECO). This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see GPL-3.0_COPYING.txt for details</Info></Infos>
message.xml.info = <Info>SIARDexcerpt v0.9.0, Copyright (C) 2016-2019 Claire Roethlisberger (KOST-CECO). This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see GPL-3.0_COPYING.txt for details</Info></Infos>
message.xml.logend = </table>
message.xml.title = Search result from the table {0}:

Expand Down
2 changes: 1 addition & 1 deletion SIARDexcerpt/src/main/resources/fr_messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ error.special.character = Le lien "{0}" contient un caractere special "{1}", qu
message.xml.header = <?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="{0}"?><table>
message.xml.start = <Infos><Start>{0}</Start>
message.xml.text = <{1}>{0}</{1}>
message.xml.info = <Info>SIARDexcerpt v0.1.1, Copyright (C) 2016-2019 Claire Roethlisberger (KOST-CECO). This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see GPL-3.0_COPYING.txt for details</Info></Infos>
message.xml.info = <Info>SIARDexcerpt v0.9.0, Copyright (C) 2016-2019 Claire Roethlisberger (KOST-CECO). This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions; see GPL-3.0_COPYING.txt for details</Info></Infos>
message.xml.logend = </table>
message.xml.title = Resultat de la recherche de la table {0}:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; The name of the installer
Name "SIARDexcerpt v0.1.1"
Name "SIARDexcerpt v0.9.0"
; Sets the icon of the installer
Icon "excerpt.ico"
; remove the text 'Nullsoft Install System vX.XX' from the installer window
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; The name of the installer
Name "SIARDexcerpt v0.1.1"
Name "SIARDexcerpt v0.9.0"
; Sets the icon of the installer
Icon "excerpt.ico"
; remove the text 'Nullsoft Install System vX.XX' from the installer window
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
; The name of the installer
Name "SIARDexcerpt v0.1.1"
Name "SIARDexcerpt v0.9.0"
; Sets the icon of the installer
Icon "excerpt.ico"
; remove the text 'Nullsoft Install System vX.XX' from the installer window
Expand Down
Binary file modified SIARDexcerpt/src/main/resources_notJar/SIARDexcerpt_de.exe
Binary file not shown.
Binary file modified SIARDexcerpt/src/main/resources_notJar/SIARDexcerpt_en.exe
Binary file not shown.
Binary file modified SIARDexcerpt/src/main/resources_notJar/SIARDexcerpt_fr.exe
Binary file not shown.
Loading

0 comments on commit f27256f

Please sign in to comment.