# HG changeset patch # User Ingo Weinzierl # Date 1347874800 0 # Node ID 8e713e9bb4d7237976baafeda37656d8eea36f7c # Parent 7fa38f8bcd8d3c74f59100a7e788d7bddb926a0e Defined colors for bed quality themes. flys-artifacts/trunk@5488 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 7fa38f8bcd8d -r 8e713e9bb4d7 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/ChangeLog Mon Sep 17 09:40:00 2012 +0000 @@ -1,3 +1,13 @@ +2012-09-17 Ingo Weinzierl + + * doc/conf/second-themes.xml, + doc/conf/default-themes.xml: Defined initial colors. + + * src/main/java/de/intevation/flys/exports/OutputHelper.java, + src/main/java/de/intevation/flys/themes/ThemeFactory.java, + src/main/java/de/intevation/flys/themes/ThemeMapping.java: Added more + debug output to understand why theme mappings don't match to facets. + 2012-09-17 Raimund Renkert * src/main/java/de/intevation/flys/artifacts/access/BedQualityAccess.java: diff -r 7fa38f8bcd8d -r 8e713e9bb4d7 flys-artifacts/doc/conf/default-themes.xml --- a/flys-artifacts/doc/conf/default-themes.xml Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/doc/conf/default-themes.xml Mon Sep 17 09:40:00 2012 +0000 @@ -1068,6 +1068,10 @@ + + + @@ -1075,6 +1079,10 @@ + + + @@ -1082,6 +1090,10 @@ + + + @@ -1089,6 +1101,10 @@ + + + @@ -1096,6 +1112,10 @@ + + + @@ -1103,6 +1123,10 @@ + + + @@ -1110,6 +1134,10 @@ + + + diff -r 7fa38f8bcd8d -r 8e713e9bb4d7 flys-artifacts/doc/conf/second-themes.xml --- a/flys-artifacts/doc/conf/second-themes.xml Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/doc/conf/second-themes.xml Mon Sep 17 09:40:00 2012 +0000 @@ -1069,6 +1069,10 @@ + + + @@ -1076,6 +1080,10 @@ + + + @@ -1083,6 +1091,10 @@ + + + @@ -1090,6 +1102,10 @@ + + + @@ -1097,6 +1113,10 @@ + + + @@ -1104,6 +1124,10 @@ + + + @@ -1111,6 +1135,10 @@ + + + diff -r 7fa38f8bcd8d -r 8e713e9bb4d7 flys-artifacts/src/main/java/de/intevation/flys/exports/OutputHelper.java --- a/flys-artifacts/src/main/java/de/intevation/flys/exports/OutputHelper.java Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/exports/OutputHelper.java Mon Sep 17 09:40:00 2012 +0000 @@ -457,11 +457,16 @@ pattern, outName, "default"); + if (t != null) { + log.debug("found theme for facet '" + facet + "'"); t.setFacet(facet); t.setIndex(index); } + else { + log.warn("unable to find theme for facet '" + facet + "'"); + } return t; } diff -r 7fa38f8bcd8d -r 8e713e9bb4d7 flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeFactory.java --- a/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeFactory.java Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeFactory.java Mon Sep 17 09:40:00 2012 +0000 @@ -102,6 +102,7 @@ } if (group == null) { + logger.warn("No theme group found: '" + groupName + "'"); return null; } @@ -128,7 +129,10 @@ && tm.masterAttrMatches(artifact) && tm.outputMatches(output)) { - return t.get(tm.getTo()); + String target = tm.getTo(); + + logger.debug("Found theme '" + target + "'"); + return t.get(target); } } diff -r 7fa38f8bcd8d -r 8e713e9bb4d7 flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeMapping.java --- a/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeMapping.java Mon Sep 17 09:16:20 2012 +0000 +++ b/flys-artifacts/src/main/java/de/intevation/flys/themes/ThemeMapping.java Mon Sep 17 09:40:00 2012 +0000 @@ -88,7 +88,16 @@ return true; } Matcher m = pattern.matcher(text); - return m.matches(); + + if (m.matches()) { + logger.debug("Pattern matches: " + text); + return true; + } + else { + logger.debug( + "Pattern '"+ text + "' does not match: " + this.patternStr); + return false; + } } @@ -116,7 +125,14 @@ } // Test. - return artifact.getDataAsString(parts[0]).equals(parts[1]); + if (artifact.getDataAsString(parts[0]).equals(parts[1])) { + logger.debug("Matches master Attribute."); + return true; + } + else { + logger.debug("Does not match master Attribute."); + return false; + } } @@ -129,7 +145,14 @@ return true; } - return this.output.equals(output); + if (this.output.equals(output)) { + logger.debug("Output matches this mapping: " + output); + return true; + } + else { + logger.debug("Output '"+ output +"' does not match: "+ this.output); + return false; + } } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :