# HG changeset patch # User Felix Wolfsteller # Date 1318941842 0 # Node ID fb4fb1c67c35827050f0ac6cddbb8e070664ac03 # Parent eb35570df0e8daa41ac678464df6e9ac4dc68d0b Added WKmsFactory. flys-artifacts/trunk@3004 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r eb35570df0e8 -r fb4fb1c67c35 flys-artifacts/ChangeLog --- a/flys-artifacts/ChangeLog Tue Oct 18 12:31:36 2011 +0000 +++ b/flys-artifacts/ChangeLog Tue Oct 18 12:44:02 2011 +0000 @@ -1,3 +1,16 @@ +2011-10-18 Felix Wolfsteller + + Add WKMsFactory to access 'static' wst-data. + + * src/main/java/de/intevation/flys/artifacts/model/StaticWKmsCacheKey.java: + Cache Key for the static WKms data. + + * src/main/java/de/intevation/flys/artifacts/model/WKmsFactory.java: + New, creates WKms from wst-id and column. Does not yet fetch the + name. + + * doc/conf/cache.xml: Added cache configuration for static wkms data. + 2011-10-18 Felix Wolfsteller Cosmetics, docs. diff -r eb35570df0e8 -r fb4fb1c67c35 flys-artifacts/doc/conf/cache.xml --- a/flys-artifacts/doc/conf/cache.xml Tue Oct 18 12:31:36 2011 +0000 +++ b/flys-artifacts/doc/conf/cache.xml Tue Oct 18 12:44:02 2011 +0000 @@ -56,6 +56,16 @@ memoryStoreEvictionPolicy="LRU" /> + + + results = sqlQuery.list(); + + // TODO Fetch name in a separate query. + String name = "todo"; + + WKmsImpl wkms = new WKmsImpl(name); + double kms [] = new double[results.size()]; + double ws [] = new double[results.size()]; + + int lastColumn = Integer.MAX_VALUE; + + for (int i = 0; i < results.size(); i++) { + Object[] row = results.get(i); + wkms.add((Double) row[0], (Double) row[1]); + } + + return wkms; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :