Skip to content

Commit

Permalink
Links to remote tables now also have direct links to the schema too.
Browse files Browse the repository at this point in the history
  • Loading branch information
johncurrier committed Feb 13, 2011
1 parent fabb9bc commit 18c612b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 16 deletions.
3 changes: 3 additions & 0 deletions dist/releaseNotes.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ <h3><a href='http://schemaspy.sourceforge.net'>SchemaSpy</a> Release Notes</h3>

<li class='release'>x.x.x - xx/xx/xxxx - Subversion revision 596
<ul>
<li>Links to remote tables now also have direct links to the schema too.<br>
rev 629
</li>
<li>Added a summary of remote tables to the tables tab to quickly
identify remote relationships.<br>
rev 628
Expand Down
23 changes: 12 additions & 11 deletions src/net/sourceforge/schemaspy/view/HtmlMainIndexPage.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ public int compare(Table table1, Table table2) {

if (!remotes.isEmpty()) {
writeRemotesHeader(database, showIds, hasComments, html);

for (Table table : remotes) {
writeLineItem(table, showIds, html);
}

writeRemotesFooter(html);
}

Expand Down Expand Up @@ -235,26 +235,27 @@ private void writeLineItem(Table table, boolean showIds, LineWriter html) throws
html.write(" <td class='detail'>");

String tableName = table.getName();

if (table.isRemote() && !Config.getInstance().isOneOfMultipleSchemas()) {
html.write(table.getContainer());
html.write('.');
html.write(tableName);
} else {
if (table.isRemote()) {
html.write("<a href='../" + urlEncode(table.getContainer()) + "/index.html'>");
html.write(table.getContainer());
html.write("</a>.");
}
html.write("<a href='tables/");
if (table.isRemote()) {
html.write("../../" + table.getContainer() + "/tables/");
html.write("../../" + urlEncode(table.getContainer()) + "/tables/");
}
html.write(urlEncode(tableName));
html.write(".html'>");
if (table.isRemote()) {
html.write(table.getContainer());
html.write('.');
}
html.write(tableName);
html.write("</a>");
}

html.writeln("</td>");

if (showIds) {
Expand Down Expand Up @@ -342,12 +343,12 @@ protected void writeLocalsFooter(int numTables, int numTableCols, int numViews,
html.writeln("</tbody>");
html.writeln("</table>");
}

protected void writeRemotesFooter(LineWriter html) throws IOException {
html.writeln("</tbody>");
html.writeln("</table>");
}

@Override
protected boolean isMainIndex() {
return true;
Expand Down
13 changes: 8 additions & 5 deletions src/net/sourceforge/schemaspy/view/HtmlTablePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -258,17 +258,20 @@ private void writeRelatives(TableColumn baseRelative, boolean dumpParents, Strin
out.write('.');
out.write(columnTableName);
} else {
if (columnTable.isRemote()) {
out.write("<a href='");
out.write(path);
out.write("../../" + urlEncode(columnTable.getContainer()) + "/index.html'>");
out.write(columnTable.getContainer());
out.write("</a>.");
}
out.write("<a href='");
out.write(path);
if (columnTable.isRemote()) {
out.write("../../" + columnTable.getContainer() + "/tables/");
out.write("../../" + urlEncode(columnTable.getContainer()) + "/tables/");
}
out.write(urlEncode(columnTableName));
out.write(".html'>");
if (columnTable.isRemote()) {
out.write(columnTable.getContainer());
out.write('.');
}
out.write(columnTableName);
out.write("</a>");
}
Expand Down

0 comments on commit 18c612b

Please sign in to comment.