Skip to content

Commit

Permalink
Low quality rendering was always being used when multiple schemas wer…
Browse files Browse the repository at this point in the history
…e being analyzed. Now honors -hq or -lq from command-line.
  • Loading branch information
johncurrier committed Feb 9, 2011
1 parent 1143a7f commit c18fb7d
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 18 deletions.
9 changes: 9 additions & 0 deletions dist/releaseNotes.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ <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>Low quality rendering was always being used when multiple schemas
were being analyzed.
Now honors -hq or -lq from command-line in for multiples.<br>
rev 620
</li>
<li>Now makes sure XML-defined FKs point to PKs.
If not then assumes it should have been a PK (with a warning).<br>
rev 619
</li>
<li>While trying to resolve <a href="https://sourceforge.net/projects/schemaspy/forums/forum/462850/topic/3232728">
a problem with MySQL's cross-schema foreign keys</a> I discovered that MySQL uses
catalogs as a namespace mechanism from the perspective of the JDBC metadata
Expand Down
39 changes: 27 additions & 12 deletions src/net/sourceforge/schemaspy/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,9 @@ public class Config
private boolean populating = false;
public static final String DOT_CHARSET = "UTF-8";
private static final String ESCAPED_EQUALS = "\\=";
private static final String DEFAULT_TABLE_INCLUSION = ".*"; // match everything
private static final String DEFAULT_TABLE_EXCLUSION = ""; // match nothing
private static final String DEFAULT_COLUMN_EXCLUSION = "[^.]"; // match nothing

/**
* Default constructor. Intended for when you want to inject properties
Expand Down Expand Up @@ -849,7 +852,7 @@ public Pattern getColumnExclusions() {
if (columnExclusions == null) {
String strExclusions = pullParam("-X");
if (strExclusions == null)
strExclusions = "[^.]"; // match nothing
strExclusions = DEFAULT_COLUMN_EXCLUSION;

columnExclusions = Pattern.compile(strExclusions);
}
Expand Down Expand Up @@ -877,7 +880,7 @@ public Pattern getIndirectColumnExclusions() {
if (indirectColumnExclusions == null) {
String strExclusions = pullParam("-x");
if (strExclusions == null)
strExclusions = "[^.]"; // match nothing
strExclusions = DEFAULT_COLUMN_EXCLUSION;

indirectColumnExclusions = Pattern.compile(strExclusions);
}
Expand All @@ -902,7 +905,7 @@ public Pattern getTableInclusions() {
if (tableInclusions == null) {
String strInclusions = pullParam("-i");
if (strInclusions == null)
strInclusions = ".*"; // match anything
strInclusions = DEFAULT_TABLE_INCLUSION;

try {
tableInclusions = Pattern.compile(strInclusions);
Expand Down Expand Up @@ -931,7 +934,7 @@ public Pattern getTableExclusions() {
if (tableExclusions == null) {
String strExclusions = pullParam("-I");
if (strExclusions == null)
strExclusions = ""; // match nothing
strExclusions = DEFAULT_TABLE_EXCLUSION;

try {
tableExclusions = Pattern.compile(strExclusions);
Expand Down Expand Up @@ -1613,6 +1616,8 @@ public List<String> asList() throws IOException {
params.add(String.valueOf(getFontSize()));
params.add("-t");
params.add(getDbType());
isHighQuality(); // query to set renderer correctly
isLowQuality(); // query to set renderer correctly
params.add("-renderer"); // instead of -hq and/or -lq
params.add(getRenderer());
value = getDescription();
Expand Down Expand Up @@ -1687,14 +1692,24 @@ public List<String> asList() throws IOException {
params.add(getLogLevel().toString().toLowerCase());
params.add("-sqlFormatter");
params.add(getSqlFormatter().getClass().getName());
params.add("-i");
params.add(getTableInclusions().pattern());
params.add("-I");
params.add(getTableExclusions().pattern());
params.add("-x");
params.add(getColumnExclusions().pattern());
params.add("-X");
params.add(getIndirectColumnExclusions().pattern());
// conditional hack to reduce likelihood of cmd interpreter
// expanding these into filenames
if (!getTableInclusions().pattern().equals(DEFAULT_TABLE_INCLUSION)) {
params.add("-i");
params.add(getTableInclusions().pattern());
}
if (!getTableExclusions().pattern().equals(DEFAULT_TABLE_EXCLUSION)) {
params.add("-I");
params.add(getTableExclusions().pattern());
}
if (!getColumnExclusions().pattern().equals(DEFAULT_COLUMN_EXCLUSION)) {
params.add("-x");
params.add(getColumnExclusions().pattern());
}
if (!getIndirectColumnExclusions().pattern().equals(DEFAULT_COLUMN_EXCLUSION)) {
params.add("-X");
params.add(getIndirectColumnExclusions().pattern());
}
params.add("-dbthreads");
params.add(String.valueOf(getMaxDbThreads()));
params.add("-maxdet");
Expand Down
13 changes: 7 additions & 6 deletions src/net/sourceforge/schemaspy/util/Dot.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,17 @@ private Dot() {
} else {
if (Config.getInstance().isHtmlGenerationEnabled()) {
System.err.println();
System.err.println("Invalid dot configuration detected. '" +
logger.warning("Invalid dot configuration detected. '" +
getDisplayableCommand(dotCommand) + "' returned:");
System.err.println(" " + versionLine);
logger.warning(" " + versionLine);
}
}
} catch (Exception validDotDoesntExist) {
if (Config.getInstance().isHtmlGenerationEnabled()) {
System.err.println("Failed to query Graphviz version information");
System.err.println(" with: " + getDisplayableCommand(dotCommand));
System.err.println(" " + validDotDoesntExist);
System.err.println();
logger.warning("Failed to query Graphviz version information");
logger.warning(" with: " + getDisplayableCommand(dotCommand));
logger.warning(" " + validDotDoesntExist);
}
}

Expand Down Expand Up @@ -216,7 +217,7 @@ public boolean supportsRenderer(@SuppressWarnings("hiding") String renderer) {
}

if (!validatedRenderers.contains(renderer)) {
//System.err.println("\nFailed to validate " + getFormat() + " renderer '" + renderer + "'. Reverting to detault renderer for " + getFormat() + '.');
logger.info("Failed to validate " + getFormat() + " renderer '" + renderer + "'. Reverting to default renderer for " + getFormat() + '.');
invalidatedRenderers.add(renderer);
return false;
}
Expand Down

0 comments on commit c18fb7d

Please sign in to comment.