Skip to content

Commit

Permalink
Fremdschlüsselname mit ausgeben
Browse files Browse the repository at this point in the history
===============================
in der Konfiguration 
im Excerpt
sowie im XSL
  • Loading branch information
Chlara committed Sep 27, 2016
1 parent 0e05e8e commit 9af4eb3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1644,6 +1644,8 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn
String referencedProv = "";
String referencedTableProv = "";
String referencedColumnProv = "";
String subKeyNameProv = "";
String subKeyName = "";
String subName = "";
String subFolder = "";
String subKeyCell = "";
Expand All @@ -1654,6 +1656,7 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn
// NodeList nlFK = docConfig.getElementsByTagName( "foreignKey" );
for ( int x = 0; x < nlFK.getLength(); x++ ) {
referencedTableProv = "";
subKeyNameProv = "";
referencedColumnProv = "";
referencedProv = "";
Node nodeFK = nlFK.item( x );
Expand All @@ -1663,6 +1666,8 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn
Node subNodeFK = childNodesFK.item( y );
if ( subNodeFK.getNodeName().equals( "referencedTable" ) ) {
referencedTableProv = new String( subNodeFK.getTextContent() );
} else if ( subNodeFK.getNodeName().equals( "name" ) ) {
subKeyNameProv = new String( subNodeFK.getTextContent() );
} else if ( subNodeFK.getNodeName().equals( "reference" ) ) {
NodeList nlRef = subNodeFK.getChildNodes();
for ( int z = 0; z < nlRef.getLength(); z++ ) {
Expand All @@ -1680,9 +1685,11 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn
// System.out.println( valueMainname + " =? " + referencedTableProv );
if ( valueMainname.equals( referencedTableProv ) && valuePKname.equals( referencedProv ) ) {
// referencedTable = referencedTableProv;
subKeyName = subKeyNameProv;
referencedColumn = referencedColumnProv;
// referenced = referencedProv;
referencedTableProv = "";
subKeyNameProv = "";
referencedColumnProv = "";
referencedProv = "";
Node nodeParentFK = nodeFK.getParentNode();
Expand Down Expand Up @@ -1717,7 +1724,8 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn
}
if ( column && subKeyCellProv != "" ) {
subKeyCell = subKeyCellProv;
subName = " <subtable><name>" + subName + "</name>";
subName = " <subtable><keyname>" + subKeyName + "</keyname><name>"
+ subName + "</name>";
subFolder = "<folder>" + subFolder + "</folder>";
subKeyCell = "<foreignkeycell>" + subKeyCell
+ "</foreignkeycell></subtable></subtables>";
Expand Down Expand Up @@ -1745,6 +1753,7 @@ public boolean validate( File siardDatei, File configFileHard, String inputMainn

} else {
referencedTableProv = "";
subKeyNameProv = "";
referencedColumnProv = "";
referencedProv = "";
column = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ public boolean validate( File siardDatei, File outFile, String excerptString )
+ File.separator + "metadata.xml" );
String content = "";

// Record aus Maintable herausholen
// TODO: Record aus Maintable herausholen
try {
if ( tempOutFile.exists() ) {
Util.deleteDir( tempOutFile );
Expand Down Expand Up @@ -323,7 +323,7 @@ public boolean validate( File siardDatei, File outFile, String excerptString )

// Ende MainTable

// grep der SubTables
// TODO: grep der SubTables
try {
// String name = null;
String folder = null;
Expand All @@ -346,6 +346,7 @@ public boolean validate( File siardDatei, File outFile, String excerptString )
folder = subtable.getChild( "folder", ns ).getText();
cell = subtable.getChild( "foreignkeycell", ns ).getText();
String tabfolder = "";
String tabkeyname = subtable.getChild( "keyname", ns ).getText();
String tabname = "";
String tabdescription = "";
String tabdescriptionProv = "";
Expand Down Expand Up @@ -456,6 +457,8 @@ public boolean validate( File siardDatei, File outFile, String excerptString )
getTextResourceService().getText( MESSAGE_XML_TEXT, tabname, "tabname" ) );
getMessageService().logError(
getTextResourceService().getText( MESSAGE_XML_TEXT, tabfolder, "tabfolder" ) );
getMessageService().logError(
getTextResourceService().getText( MESSAGE_XML_TEXT, tabkeyname, "tabkeyname" ) );
getMessageService().logError(
getTextResourceService().getText( MESSAGE_XML_TEXT, tabdescription,
"tabdescription" ) );
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 @@ -36,7 +36,7 @@ message.xml.element.content = {0}
message.xml.element.close = </{0}>

# ************* AutoXSL *************************************************************************
auto.xsl.table.start = <xsl:for-each select="table/{0}"><br/><h2><xsl:value-of select="tabname"/> (<xsl:value-of select="tabfolder"/>)</h2><h3><xsl:value-of select="tabdescription"/></h3><div><table border="1" width="100%">\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.table.start = <xsl:for-each select="table/{0}"><br/><h2><xsl:value-of select="tabname"/> (<xsl:value-of select="tabfolder"/>) <xsl:value-of select="tabkeyname"/></h2><h3><xsl:value-of select="tabdescription"/></h3><div><table border="1" width="100%">\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.column = \t<xsl:if test="name/c{0}"><tr><td><xsl:value-of select="description/c{0}"/> (<xsl:value-of select="name/c{0}"/>):</td><xsl:for-each select="row"><td border="1" class="caption"><xsl:value-of select="c{0}"/></td></xsl:for-each></tr></xsl:if>\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.table.end = </table></div></xsl:for-each>\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.footer = <br/><hr noshade="noshade" size="1" /><br/><p class="footer">Dieser Record stammt vom <xsl:value-of select="table/Infos/Start" /> aus dem <xsl:value-of select="table/Infos/Archive" />.</p><p class="footer"><xsl:value-of select="table/Infos/Info" /></p><br/>\n</body></html></xsl:template></xsl:stylesheet>
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 @@ -36,7 +36,7 @@ message.xml.element.content = {0}
message.xml.element.close = </{0}>

# ************* AutoXSL *************************************************************************
auto.xsl.table.start = <xsl:for-each select="table/{0}"><br/><h2><xsl:value-of select="tabname"/> (<xsl:value-of select="tabfolder"/>)</h2><h3><xsl:value-of select="tabdescription"/></h3><div><table border="1" width="100%">\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.table.start = <xsl:for-each select="table/{0}"><br/><h2><xsl:value-of select="tabname"/> (<xsl:value-of select="tabfolder"/>) <xsl:value-of select="tabkeyname"/></h2><h3><xsl:value-of select="tabdescription"/></h3><div><table border="1" width="100%">\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.column = \t<xsl:if test="name/c{0}"><tr><td><xsl:value-of select="description/c{0}"/> (<xsl:value-of select="name/c{0}"/>):</td><xsl:for-each select="row"><td border="1" class="caption"><xsl:value-of select="c{0}"/></td></xsl:for-each></tr></xsl:if>\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.table.end = </table></div></xsl:for-each>\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.footer = <br/><hr noshade="noshade" size="1" /><br/><p class="footer">Dieser Record stammt vom <xsl:value-of select="table/Infos/Start" /> aus dem <xsl:value-of select="table/Infos/Archive" />.</p><p class="footer"><xsl:value-of select="table/Infos/Info" /></p><br/>\n</body></html></xsl:template></xsl:stylesheet>
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 @@ -36,7 +36,7 @@ message.xml.element.content = {0}
message.xml.element.close = </{0}>

# ************* AutoXSL *************************************************************************
auto.xsl.table.start = <xsl:for-each select="table/{0}"><br/><h2><xsl:value-of select="tabname"/> (<xsl:value-of select="tabfolder"/>)</h2><h3><xsl:value-of select="tabdescription"/></h3><div><table border="1" width="100%">\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.table.start = <xsl:for-each select="table/{0}"><br/><h2><xsl:value-of select="tabname"/> (<xsl:value-of select="tabfolder"/>) <xsl:value-of select="tabkeyname"/></h2><h3><xsl:value-of select="tabdescription"/></h3><div><table border="1" width="100%">\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.column = \t<xsl:if test="name/c{0}"><tr><td><xsl:value-of select="description/c{0}"/> (<xsl:value-of select="name/c{0}"/>):</td><xsl:for-each select="row"><td border="1" class="caption"><xsl:value-of select="c{0}"/></td></xsl:for-each></tr></xsl:if>\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.table.end = </table></div></xsl:for-each>\n</body></html></xsl:template></xsl:stylesheet>
auto.xsl.footer = <br/><hr noshade="noshade" size="1" /><br/><p class="footer">Dieser Record stammt vom <xsl:value-of select="table/Infos/Start" /> aus dem <xsl:value-of select="table/Infos/Archive" />.</p><p class="footer"><xsl:value-of select="table/Infos/Info" /></p><br/>\n</body></html></xsl:template></xsl:stylesheet>
Expand Down

0 comments on commit 9af4eb3

Please sign in to comment.