# HG changeset patch # User Tom Gottfried # Date 1370430988 -7200 # Node ID 1298c1c2dadf97c31818360a32a318badc36b6b0 # Parent 6a4f530a2af7a4f02bb8c4c9cb9331d4da0d8af4# Parent dc166b225775a7de31a8a3cdf4514d16727b46fd merged diff -r dc166b225775 -r 1298c1c2dadf .hgtags --- a/.hgtags Fri May 24 16:26:41 2013 +0200 +++ b/.hgtags Wed Jun 05 13:16:28 2013 +0200 @@ -50,3 +50,4 @@ b740f0c4179edb5238d27013b25a0b3cc52e4e7f 3.0.3 5f34e4cb80952b94e4683d90dbaab59e9da3711a 3.0.4 1a169e10c0f3e1f33990a91dd294512ac97d1a70 3.0.5 +b689d2b9d1675739778083b2bcba336abb33f70c 3.0.6 diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/artifacts/minfo.xml --- a/artifacts/doc/conf/artifacts/minfo.xml Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/doc/conf/artifacts/minfo.xml Wed Jun 05 13:16:28 2013 +0200 @@ -229,7 +229,6 @@ - @@ -257,7 +256,6 @@ - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/jasper/sqrelation.jasper Binary file artifacts/doc/conf/jasper/sqrelation.jasper has changed diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/jasper/sqrelation_en.jasper Binary file artifacts/doc/conf/jasper/sqrelation_en.jasper has changed diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/mapserver/barrier_lines_class.vm --- a/artifacts/doc/conf/mapserver/barrier_lines_class.vm Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/doc/conf/mapserver/barrier_lines_class.vm Wed Jun 05 13:16:28 2013 +0200 @@ -30,3 +30,11 @@ OUTLINECOLOR "#800000" END END +CLASS + NAME "Ringdeich" + EXPRESSION ("[TYP]"="Ringdeich") + STYLE + SIZE 5 + OUTLINECOLOR "#800000" + END +END diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/mapserver/mapfile.vm --- a/artifacts/doc/conf/mapserver/mapfile.vm Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/doc/conf/mapserver/mapfile.vm Wed Jun 05 13:16:28 2013 +0200 @@ -14,7 +14,7 @@ END DEBUG 5 - CONFIG "MS_ERRORFILE" "/tmp/flys-user-wms.log" + CONFIG "MS_ERRORFILE" "d4e-wms.log" WEB METADATA diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/meta-data.xml --- a/artifacts/doc/conf/meta-data.xml Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/doc/conf/meta-data.xml Wed Jun 05 13:16:28 2013 +0200 @@ -5,8 +5,12 @@ User specific part ------------------ + This is a hack because we currently have no way to supress empty + folders (either in the client or in the datacage). - + @@ -32,7 +36,7 @@ - + @@ -255,7 +259,7 @@ - + @@ -272,949 +276,641 @@ - - - - - - Recommendations (client shall load immediately). - - - - - - - - - - - - Non Recommendations - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + Recommendations (user) + + + + + + + + + + + + Non Recommendations (user) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - SELECT a.gid AS aid, - f.id AS fid, - f.name AS facet_name, - f.num AS facet_num, - f.description AS facet_description - FROM artifacts a - JOIN outs o ON o.artifact_id = a.id - JOIN facets f ON f.out_id = o.id - WHERE a.id = ${a_id} - AND f.name = ${facet_type} - + + - + + + + + - - - - - - - - - - - - + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SELECT id AS out_id - FROM outs - WHERE artifact_id = ${a_id} AND name = 'cross_section' - - - - - - - SELECT name AS facet_name, num AS facet_num, description AS facet_description - FROM facets - WHERE out_id = ${out_id} - ORDER BY num ASC, name DESC - - - - - - - - - - - - - - - - - - - - - - - SELECT id AS out_id - FROM outs - WHERE artifact_id = ${a_id} - AND name = 'longitudinal_section' - - - - - - - SELECT name AS facet_name, - num AS facet_num, - description AS facet_description - FROM facets - WHERE out_id = ${out_id} - ORDER BY num ASC, name DESC - - - - - - - - - - - - - - - - - - - - - - - SELECT id AS out_id - FROM outs - WHERE artifact_id = ${a_id} - AND name = 'fix_longitudinal_section_curve' - - - - - - - SELECT name AS facet_name, - num AS facet_num, - description AS facet_description - FROM facets - WHERE out_id = ${out_id} AND ( - name LIKE 'fix_deviation_ls%' OR - name LIKE 'fix_sector_average_ls%' OR - name LIKE 'fix_analysis_events_ls%' OR - name LIKE 'fix_reference_events_ls%') - ORDER BY num ASC, name DESC - - - - - - - - - - - - - - - - - - - - - - - SELECT id AS out_id - FROM outs - WHERE artifact_id = ${a_id} - AND name = 'fix_deltawt_curve' - - - - - - - SELECT name AS facet_name, - num AS facet_num, - description AS facet_description - FROM facets - WHERE out_id = ${out_id} and ( - name LIKE 'fix_sector_average_dwt%' OR - name LIKE 'fix_deviation_dwt%' OR - name = 'fix_analysis_events_dwt' OR - name = 'fix_reference_events_dwt' OR - name = 'fix_analysis_periods_dwt') - ORDER BY num ASC, name DESC - - - - - - - - - - - - - - - - - - - - - - - SELECT id AS out_id - FROM outs - WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve' - - - - - - - SELECT name AS facet_name, num AS facet_num, description AS facet_description - FROM facets - WHERE out_id = ${out_id} and ( - name LIKE 'fix_sector_average_dwt%' OR - name LIKE 'fix_deviation_dwt%') - ORDER BY num ASC, name DESC - - - - - - - - - - - - - - - - - - - - - - - SELECT id AS out_id - FROM outs - WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve' - - - - - - - SELECT name AS facet_name, num AS facet_num, description AS facet_description - FROM facets - WHERE out_id = ${out_id} and name = 'fix_derivate_curve' - ORDER BY num ASC, name DESC - - - - - - - - - - - - - - - - - - - - - - - SELECT id AS out_id - FROM outs - WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve' - - - - - - - SELECT name AS facet_name, num AS facet_num, description AS facet_description - FROM facets - WHERE out_id = ${out_id} and ( - name LIKE 'fix_sector_average_wq%' OR - name = 'fix_wq_curve' OR - name LIKE 'fix_analysis_events_wq%' OR - name LIKE 'fix_reference_events_wq%' ) - ORDER BY num ASC, name DESC - - - - - - - - - - - - - - - - - - - - - - - SELECT a.gid AS aid, - f.id AS fid, - f.name AS facet_name, - f.num AS facet_num, - f.description AS facet_description - FROM outs AS o, facets AS f, artifacts AS a - WHERE - (f.name = 'duration_curve.q' OR f.name = 'duration_curve.w') AND - f.out_id = o.id AND - o.artifact_id = ${a_id} AND - a.id = ${a_id} - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Aheinecke: Why is this grouping different from the rest? + + + + + + + + + + + + + + + + + + + + + + + + Aheinecke: Why is this grouping different from the rest? + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - TODO doesnt work nicely for fix/wq-diags. + TODO doesnt work nicely for fix/wq-diags. Aheinecke (27.5.2013): Why? - - - SELECT id AS out_id - FROM outs - WHERE artifact_id = ${a_id} AND name = 'longitudinal_section' - + - - - - SELECT name AS facet_name, num AS facet_num, description AS facet_description - FROM facets - WHERE out_id = ${out_id} and name = 'longitudinal_section.w' - ORDER BY num ASC, name DESC - - - - - - - - - - - - - - + + + + + + + + + + + + + + - + - - - SELECT id AS out_id - FROM outs - WHERE artifact_id = ${a_id} AND name = 'floodmap' - - - - - SELECT name AS facet_name, - num AS facet_num, - description AS facet_description - FROM facets - WHERE out_id = ${out_id} AND name = 'floodmap.usershape' - ORDER BY num ASC, name DESC - - - - - - - - - - - - - - - + No grouping in this? + + + + + + + + + + + + + + - - - SELECT id AS oid - FROM outs AS o - WHERE - o.artifact_id = ${a_id} AND - o.name='bed_longitudinal_section' - + - - - - - SELECT a.gid AS aid, - f.id AS fid, - f.name AS facet_name, - f.num AS facet_num, - f.description AS facet_description - FROM outs AS o, facets AS f, artifacts AS a - WHERE - (f.name = 'bed_longitudinal_section.bed_diameter_toplayer' - OR f.name = 'bed_longitudinal_section.bed_diameter_sublayer') AND - f.out_id = o.id AND - o.artifact_id = ${a_id} AND - a.id = ${a_id} - - - - - - - - - - - + + + + + + + + + + + + - + - + - - - SELECT id AS oid - FROM outs AS o - WHERE - o.artifact_id = ${a_id} AND - o.name='bed_longitudinal_section' - + - - - - - SELECT a.gid AS aid, - f.id AS fid, - f.name AS facet_name, - f.num AS facet_num, - f.description AS facet_description - FROM outs AS o, facets AS f, artifacts AS a - WHERE - f.name = 'bed_longitudinal_section.bedload_diameter' AND - f.out_id = o.id AND - o.artifact_id = ${a_id} AND - a.id = ${a_id} - - - - - - - - - - - + + + + + + + + + + + + - + - + - - - SELECT id AS oid - FROM outs AS o - WHERE - o.artifact_id = ${a_id} AND - o.name='bed_longitudinal_section' - + - - - - - SELECT a.gid AS aid, - f.id AS fid, - f.name AS facet_name, - f.num AS facet_num, - f.description AS facet_description - FROM outs AS o, facets AS f, artifacts AS a - WHERE - (f.name = 'bed_longitudinal_section.sediment_density_toplayer' OR - f.name = 'bed_longitudinal_section.sediment_density_sublayer') AND - f.out_id = o.id AND - o.artifact_id = ${a_id} AND - a.id = ${a_id} - - - - - - - - - - - + + + + + + + + + + + + - + - + - - - SELECT id AS oid - FROM outs AS o - WHERE - o.artifact_id = ${a_id} AND - o.name='bed_longitudinal_section' - + - - - - - SELECT a.gid AS aid, - f.id AS fid, - f.name AS facet_name, - f.num AS facet_num, - f.description AS facet_description - FROM outs AS o, facets AS f, artifacts AS a - WHERE - (f.name = 'bed_longitudinal_section.porosity_toplayer' OR - f.name = 'bed_longitudinal_section.porosity_sublayer') AND - f.out_id = o.id AND - o.artifact_id = ${a_id} AND - a.id = ${a_id} - - - - - - - - - - - + + + + + + + + + + + + - + - + - - - SELECT id AS oid - FROM outs AS o - WHERE - o.artifact_id = ${a_id} and o.name='flow_velocity' - + - - - - - SELECT a.gid AS aid, - f.id AS fid, - f.name AS facet_name, - f.num AS facet_num, - f.description AS facet_description - FROM outs AS o, facets AS f, artifacts AS a - WHERE - (f.name = 'flow_velocity.totalchannel' OR - f.name = 'flow_velocity.mainchannel' OR - f.name = 'flow_velocity.totalchannel.filtered' OR - f.name = 'flow_velocity.mainchannel.filtered') AND - f.out_id = o.id AND - o.artifact_id = ${a_id} AND - a.id = ${a_id} - - - - - - - - - - - + + + + + + + + + + + + - + - + - - - SELECT id AS oid - FROM outs AS o - WHERE - o.artifact_id = ${a_id} and o.name='sedimentload_ls' - + - - - - - SELECT a.gid AS aid, - f.id AS fid, - f.name AS facet_name, - f.num AS facet_num, - f.description AS facet_description - FROM outs AS o, facets AS f, artifacts AS a - WHERE f.name LIKE 'sedimentload%' AND - f.out_id = o.id AND - o.artifact_id = ${a_id} AND - a.id = ${a_id} - - - - - - - - - - - + + + + + + + + + + + + - + - + - - - SELECT id AS oid, - name AS o_name - FROM outs AS o - WHERE - o.artifact_id = ${a_id} AND - (o.name = 'bed_difference_year' OR - o.name = 'bed_differnece_epoch') - + - - - - - SELECT a.gid AS aid, - f.id AS fid, - f.name AS facet_name, - f.num AS facet_num, - f.description AS facet_description - FROM outs AS o, facets AS f, artifacts AS a - WHERE (f.name LIKE 'bedheight_difference.year%' OR - f.name LIKE 'bedheight_difference.epoch%') AND - f.out_id = o.id AND - o.artifact_id = ${a_id} AND - a.id = ${a_id} - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - + - + - - - SELECT id AS oid - FROM outs AS o - WHERE - o.artifact_id = ${a_id} AND - o.name = 'discharge_longitudinal_section' - + - - - - - SELECT a.gid AS aid, - f.id AS fid, - f.name AS facet_name, - f.num AS facet_num, - f.description AS facet_description - FROM outs AS o, facets AS f, artifacts AS a - WHERE f.name = 'discharge_longitudinal_section.w' AND - f.out_id = o.id AND - o.artifact_id = ${a_id} AND - a.id = ${a_id} - - - - - - - - - - - + + + + + + + + + + + + - + - + - + - - + + @@ -1232,7 +928,7 @@ + factory="crosssections" target_out="{$out}" /> @@ -1251,9 +947,9 @@ AND he.km BETWEEN ${fromkm} AND ${tokm} - + factory="hyk" target_out="{$out}" /> @@ -1279,7 +975,7 @@ @@ -1288,7 +984,7 @@ @@ -1302,7 +998,7 @@ @@ -1321,7 +1017,7 @@ @@ -1340,7 +1036,7 @@ @@ -1369,7 +1065,7 @@ @@ -1382,7 +1078,7 @@ - + SELECT id AS anno_id, name AS anno_description @@ -1390,7 +1086,7 @@ @@ -1406,7 +1102,7 @@ @@ -1425,7 +1121,7 @@ @@ -1444,7 +1140,7 @@ @@ -1466,7 +1162,7 @@ @@ -1488,15 +1184,15 @@ - + - + - + @@ -1517,7 +1213,7 @@ FROM bed_height_single WHERE river_id = ${river_id} - @@ -1535,7 +1231,7 @@ FROM bed_height_epoch WHERE river_id = ${river_id} - @@ -1556,7 +1252,7 @@ TODO: Why has this an id and factory? + factory="flowvelocity" target_out="{$out}" > SELECT id, description, station, datetime, v, w, q @@ -1567,7 +1263,7 @@ + factory="flowvelocity" target_out="{$out}" /> @@ -1597,7 +1293,7 @@ + factory="morph-width" target_out="{$out}" /> @@ -1617,7 +1313,7 @@ - @@ -1646,7 +1342,7 @@ @@ -1655,7 +1351,7 @@ @@ -1680,7 +1376,7 @@ @@ -1689,7 +1385,7 @@ @@ -1733,10 +1429,10 @@ FIXME: Following two macros look identical to me. - + - + @@ -1750,21 +1446,22 @@ d.name AS name, t.start_time AS start_time, t.stop_time AS stop_time, - 'Projektion: ' || d.projection || '$' || - 'Rasterweite: ' || d.resolution || 'm$' || - 'Format: ' || d.format || '$' || + 'Projektion: ' || d.projection || '<BR>' || + 'Rasterweite: ' || d.resolution || 'm<BR>' || + 'Format: ' || d.format || '<BR>' || 'Zeitraum: ' AS info FROM dem d JOIN ranges r ON d.range_id = r.id LEFT JOIN time_intervals t ON d.time_interval_id = t.id - WHERE d.river_id = ${river_id} - - - + + + info="{$info}{dc:date-format('yyyy', $start_time)} - {dc:date-format('yyyy', $stop_time)}"/> @@ -1774,7 +1471,7 @@ - + @@ -1861,7 +1558,7 @@ AND kind = 2 - @@ -1875,7 +1572,7 @@ AND kind = 2 - @@ -1896,7 +1593,7 @@ - @@ -1921,7 +1618,7 @@ @@ -1941,7 +1638,7 @@ @@ -1959,7 +1656,7 @@ @@ -1990,7 +1687,7 @@ - @@ -2006,7 +1703,7 @@ - @@ -2032,7 +1729,7 @@ - @@ -2049,7 +1746,7 @@ - @@ -2080,7 +1777,7 @@ ${source} - @@ -2110,19 +1807,21 @@ - - - - - - - + + + + + + + + @@ -2137,7 +1836,7 @@ - @@ -2268,7 +1967,7 @@ - @@ -2403,7 +2102,7 @@ @@ -2413,7 +2112,7 @@ - @@ -2421,10 +2120,10 @@ - - - - + + + + @@ -2445,7 +2144,7 @@ + factory="riveraxis" target_out="{$out}" /> @@ -2453,7 +2152,7 @@ + factory="riveraxis" target_out="{$out}" /> @@ -2468,7 +2167,7 @@ SELECT DISTINCT 1 FROM river_axes_km WHERE river_id = ${river_id} - + @@ -2482,7 +2181,7 @@ GROUP BY name - @@ -2504,18 +2203,20 @@ - - - - - - + + + + + + + + @@ -2538,7 +2239,7 @@ @@ -2546,7 +2247,7 @@ @@ -2566,7 +2267,7 @@ @@ -2619,6 +2320,7 @@ + @@ -2640,7 +2342,7 @@ wc.position AS wst_column_position, wc.description AS info, w.description AS wst_description, - wc.name AS wst_column_name, + COALESCE(wc.name, '') AS wst_column_name, wr.a AS deffrom, wr.b AS defto FROM wst_columns wc @@ -2653,7 +2355,7 @@ - + Select collections and masterartifacts. @@ -2665,10 +2367,18 @@ COALESCE(ma.ld_mode, '') AS ld_m, COALESCE(ma.ld_locations, '') AS ld_l, COALESCE(ma.ld_from, '') AS ld_f, - COALESCE(ma.ld_to, '') AS ld_t + COALESCE(ma.ld_to, '') AS ld_t, + o.name AS out_name, + o.id AS out_id, + f.name AS facet_name, + f.num AS facet_num, + f.description AS facet_description, + f.id AS fid FROM users u JOIN collections c ON c.user_id = u.id JOIN master_artifacts_range ma ON ma.collection_id = c.id + JOIN outs o ON o.artifact_id = ma.id + JOIN facets f ON f.out_id = o.id WHERE u.gid = CAST(${user-id} AS UUID) AND ma.gid <> CAST(${artifact-id} AS uuid) AND EXISTS ( @@ -2678,41 +2388,24 @@ AND k = 'river' AND v = ${river}) - - - - - - - + + + + + - - - - - - SELECT COALESCE(ld_mode, '') AS ldm, - COALESCE(ld_locations, '') AS ldl, - COALESCE(ld_from, '') AS ldf, - COALESCE(ld_to, '') AS ldt - FROM master_artifacts_range - WHERE gid = CAST(${artifact-id} AS uuid) - - - - - - - - - - - - - - + + + + + + + + + + diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes.xml --- a/artifacts/doc/conf/themes.xml Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/doc/conf/themes.xml Wed Jun 05 13:16:28 2013 +0200 @@ -1,55 +1,13 @@ - - - - - - - - - - - - - - - - - - - - - + + ]> &virtual-themes; - - - &longitudinal-section; - &cross-section; - &discharge; - &duration; - &fixings; - &floodmap; - &historical-discharge; - &reference; - &sq-relation; - &general; - - - &longitudinal-section_sec; - &cross-section_sec; - &discharge_sec; - &duration_sec; - &fixings_sec; - &floodmap_sec; - &historical-discharge_sec; - &reference_sec; - &sq-relation_sec; - &general_sec; - + &default-themes; + &second-themes; + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/default/cross-section.xml --- a/artifacts/doc/conf/themes/default/cross-section.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/default/discharge.xml --- a/artifacts/doc/conf/themes/default/discharge.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/default/duration.xml --- a/artifacts/doc/conf/themes/default/duration.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/default/fixings.xml --- a/artifacts/doc/conf/themes/default/fixings.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,342 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/default/floodmap.xml --- a/artifacts/doc/conf/themes/default/floodmap.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/default/general.xml --- a/artifacts/doc/conf/themes/default/general.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,159 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/default/historical-discharge.xml --- a/artifacts/doc/conf/themes/default/historical-discharge.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/default/longitudinal-section.xml --- a/artifacts/doc/conf/themes/default/longitudinal-section.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,975 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/default/reference.xml --- a/artifacts/doc/conf/themes/default/reference.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/default/sq-relation.xml --- a/artifacts/doc/conf/themes/default/sq-relation.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,57 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/doc/conf/themes/second.xml Wed Jun 05 13:16:28 2013 +0200 @@ -0,0 +1,2062 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second/cross-section.xml --- a/artifacts/doc/conf/themes/second/cross-section.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second/discharge.xml --- a/artifacts/doc/conf/themes/second/discharge.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,112 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second/duration.xml --- a/artifacts/doc/conf/themes/second/duration.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,41 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second/fixings.xml --- a/artifacts/doc/conf/themes/second/fixings.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,342 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second/floodmap.xml --- a/artifacts/doc/conf/themes/second/floodmap.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second/general.xml --- a/artifacts/doc/conf/themes/second/general.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second/historical-discharge.xml --- a/artifacts/doc/conf/themes/second/historical-discharge.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,140 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second/longitudinal-section.xml --- a/artifacts/doc/conf/themes/second/longitudinal-section.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,945 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second/reference.xml --- a/artifacts/doc/conf/themes/second/reference.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/doc/conf/themes/second/sq-relation.xml --- a/artifacts/doc/conf/themes/second/sq-relation.xml Fri May 24 16:26:41 2013 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java Wed Jun 05 13:16:28 2013 +0200 @@ -145,8 +145,6 @@ addStringData(DATA_IS_NEWEST, newString); addStringData(DATA_IS_MASTER, newString); - StaticState state = (StaticState) getCurrentState(context); - if (!fs.isEmpty()) { addFacets(getCurrentStateId(), fs); } @@ -162,7 +160,7 @@ { D4EArtifact flys = (D4EArtifact) artifact; - RangeAccess rangeAccess = new RangeAccess(flys, null); + RangeAccess rangeAccess = new RangeAccess(flys); double[] range = rangeAccess.getKmRange(); double min = 0.0f; if (range != null && range.length > 0) { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java Wed Jun 05 13:16:28 2013 +0200 @@ -17,8 +17,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeMap; -import java.util.regex.Matcher; -import java.util.regex.Pattern; import javax.xml.xpath.XPathConstants; @@ -86,12 +84,11 @@ public static final String XPATH_FILTER = "/art:action/art:filter/art:out"; - public static final Pattern CONTAINS_OUT = - Pattern.compile( "^(.*):OUT=(.+)$"); - /** Path to 'ids' (data) in doc that comes from datacage. */ public static final String XPATH_IDS = "/art:action/art:ids/@value"; + /** Path to 'target_out' (data) in doc that comes from datacage. */ + public static final String XPATH_TARGET_OUT = "/art:action/art:target_out/@value"; /** The constant string that shows that an operation was successful. */ public static final String OPERATION_SUCCESSFUL = "SUCCESS"; @@ -120,7 +117,7 @@ */ protected Map> filterFacets; - protected String boundToOut; + private String boundToOut; /** @@ -194,11 +191,7 @@ CallMeta callMeta, Document data) { - boolean debug = log.isDebugEnabled(); - - if (debug) { - log.debug("Setup this artifact with the uuid: " + identifier); - } + log.debug("Setup this artifact with the uuid: " + identifier); super.setup(identifier, factory, context, callMeta, data); @@ -208,9 +201,7 @@ String name = getName(); - if (debug) { - log.debug("setup(): Set initial state for artifact '" + name + "'"); - } + log.debug("setup(): Set initial state for artifact '" + name + "'"); if (states == null) { log.error("No states found from which an initial " @@ -241,21 +232,13 @@ } protected void extractOut(Document data) { - log.debug("extractOut"); - String ids = XMLUtils.xpathString(data, XPATH_IDS, + String targetOut = XMLUtils.xpathString(data, XPATH_TARGET_OUT, ArtifactNamespaceContext.INSTANCE); + if (targetOut.isEmpty()) { + targetOut = null; + } - log.debug("ids: '" + ids + "'"); - if (ids != null) { - Matcher m = CONTAINS_OUT.matcher(ids); - if (m.matches()) { - boundToOut = m.group(2); - log.debug("Bound to out :'" + boundToOut + "'"); - } - else { - log.debug("does not match"); - } - } + setBoundToOut(targetOut); } /** @@ -264,17 +247,9 @@ * @return the id element value of data document. */ public static String getDatacageIDValue(Document data) { - String ids = XMLUtils.xpathString(data, XPATH_IDS, ArtifactNamespaceContext.INSTANCE); - if (ids != null) { - Matcher m = CONTAINS_OUT.matcher(ids); - if (m.matches()) { - ids = m.group(1); - } - } - return ids; } @@ -977,9 +952,18 @@ * @param facet that defines index and name of facet searched. * @return facet instance or null if not found. */ - public Facet getNativeFacet(Facet facet) { + public Facet getNativeFacet(Facet facet, String outName) { String name = facet.getName(); int index = facet.getIndex(); + if (getBoundToOut() != null && !getBoundToOut().isEmpty() && + !getBoundToOut().equals(outName)) { + log.debug(name + ": not returning facets for " + outName + + " because bound to " + getBoundToOut()); + return null; + } + log.debug("Facet: " + facet.getName()); + log.debug("Bound to out: " + getBoundToOut()); + log.debug("OutName: " + outName); for (List fs: facets.values()) { for (Facet f: fs) { @@ -1497,6 +1481,9 @@ * @param facets List of facets to be stored */ protected void addFacets(String id, List facets) { + for (Facet fac : facets) { + fac.setBoundToOut(getBoundToOut()); + } this.facets.put(id, facets); } @@ -1509,7 +1496,8 @@ // Include uuid, type, name log.debug(" - Name: " + getName()); log.debug(" - UUID: " + identifier()); - log.debug(" - Class: " + this.getClass().getName()); + log.debug(" - Class: " + getClass().getName()); + log.debug(" - BoundToOut: " + getBoundToOut()); log.debug("------ DUMP DATA ------"); Collection allData = data.values(); @@ -1545,6 +1533,7 @@ List fs = entry.getValue(); for (Facet f: fs) { log.debug(" # " + out + " : " + f.getName()); + log.debug(" # boundToOut : " + f.getBoundToOut()); } } @@ -1618,11 +1607,23 @@ * @return List of Facets belonging to the state identifier */ protected List getFacets(String stateid) { - return this.facets.get(stateid); + return facets.get(stateid); } public String getBoundToOut() { return boundToOut; } + + /** + * Binds this artifact and all its facet to an out + */ + public void setBoundToOut(String out) { + boundToOut = out; + for (List stateFacets: facets.values()) { + for (Facet fac: stateFacets) { + fac.setBoundToOut(out); + } + } + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java Wed Jun 05 13:16:28 2013 +0200 @@ -240,7 +240,7 @@ protected void initialize(Artifact artifact, Object context, CallMeta meta) { logger.debug("MainValuesArtifact.initialize"); D4EArtifact winfo = (D4EArtifact) artifact; - RangeAccess rangeAccess = new RangeAccess(winfo, null); + RangeAccess rangeAccess = new RangeAccess(winfo); double [] locations = rangeAccess.getKmRange(); if (locations != null) { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java Wed Jun 05 13:16:28 2013 +0200 @@ -18,6 +18,8 @@ import org.dive4elements.artifacts.ArtifactNamespaceContext; import org.dive4elements.artifacts.CallContext; +import org.dive4elements.artifacts.ArtifactFactory; +import org.dive4elements.artifacts.CallMeta; import org.dive4elements.artifactdatabase.data.StateData; import org.dive4elements.artifactdatabase.ProtocolUtils; @@ -125,5 +127,17 @@ return outs; } + + @Override + public void setup( + String identifier, + ArtifactFactory factory, + Object context, + CallMeta callMeta, + Document data) + { + logger.debug("StaticD4EArtifact.setup"); + super.setup(identifier, factory, context, callMeta, data); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java Wed Jun 05 13:16:28 2013 +0200 @@ -242,7 +242,7 @@ return error(new WQKms[0], "no.wst.for.selected.river"); } - RangeAccess rangeAccess = new RangeAccess(this, null); + RangeAccess rangeAccess = new RangeAccess(this); double [] range = rangeAccess.getKmRange(); if (range == null) { return error(new WQKms[0], "no.range.found"); @@ -321,7 +321,7 @@ return error(null, "no.gauge.selected"); } - RangeAccess rangeAccess = new RangeAccess(this, null); + RangeAccess rangeAccess = new RangeAccess(this); double[] locations = rangeAccess.getLocations(); if (locations == null) { @@ -379,7 +379,7 @@ return error(new WQKms[0], "no.river.selected"); } - RangeAccess rangeAccess = new RangeAccess(this, null); + RangeAccess rangeAccess = new RangeAccess(this); double[] locations = rangeAccess.getLocations(); if (locations == null) { @@ -677,7 +677,7 @@ return null; } - RangeAccess rangeAccess = new RangeAccess(this, null); + RangeAccess rangeAccess = new RangeAccess(this); double [] range = rangeAccess.getKmRange(); if (range == null) { logger.warn("no ranges found"); @@ -849,7 +849,7 @@ */ public double[] getKms() { if (isRange()) { - RangeAccess rangeAccess = new RangeAccess(this, null); + RangeAccess rangeAccess = new RangeAccess(this); double [] distance = rangeAccess.getKmRange(); return getKms(distance); @@ -864,7 +864,7 @@ if (!isRange()) { return null; } - RangeAccess rangeAccess = new RangeAccess(this, null); + RangeAccess rangeAccess = new RangeAccess(this); double [] fromTo = rangeAccess.getKmRange(); if (fromTo == null) { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -22,14 +22,14 @@ extends RiverAccess { private static Logger logger = Logger.getLogger(BedDifferencesAccess.class); - private String yearEpoch; - private String[] diffs; - private CallContext context; + private String yearEpoch; + private String [] diffs; - public BedDifferencesAccess(D4EArtifact artifact, CallContext context) { + private String [][] differenceArtifactIds; + + public BedDifferencesAccess(D4EArtifact artifact) { super(artifact); - this.context = context; } public String getYearEpoch() { @@ -37,20 +37,47 @@ return yearEpoch; } - public D4EArtifact[][] getDifferenceArtifacts() { - diffs = getString("diffids").split("#"); - logger.debug("diffs: " + Arrays.toString(diffs)); - D4EArtifact[][] artifacts = new D4EArtifact[diffs.length/2][2]; - for (int i = 0; i < diffs.length; i += 2) { - String diff1 = StringUtil.unbracket(diffs[0 + 2*i]); - String diff2 = StringUtil.unbracket(diffs[1 + 2*i]); - String[] diff1parts = diff1.split(";"); - String[] diff2parts = diff2.split(";"); - logger.debug("creating 2 artifacts." + diff1parts[0] + "; " + diff2parts[0]); - artifacts[i][0] = RiverUtils.getArtifact(diff1parts[0], context); - artifacts[i][1] = RiverUtils.getArtifact(diff2parts[0], context); + public String [] getDiffs() { + if (diffs == null) { + diffs = getString("diffids").split("#"); + if (logger.isDebugEnabled()) { + logger.debug("diffs: " + Arrays.toString(diffs)); + } } - return artifacts; + return diffs; + } + + public String[][] getDifferenceArtifactIds() { + + if (differenceArtifactIds == null) { + String [] diffs = getDiffs(); + differenceArtifactIds = new String[diffs.length/2][2]; + for (int i = 0; i < diffs.length; i += 2) { + String diff1 = StringUtil.unbracket(diffs[0 + 2*i]); + String diff2 = StringUtil.unbracket(diffs[1 + 2*i]); + String[] diff1parts = diff1.split(";"); + String[] diff2parts = diff2.split(";"); + if (logger.isDebugEnabled()) { + logger.debug("creating 2 artifacts." + diff1parts[0] + "; " + diff2parts[0]); + } + differenceArtifactIds[i][0] = diff1parts[0]; + differenceArtifactIds[i][1] = diff1parts[1]; + } + } + + return differenceArtifactIds; + } + + public int [][] extractHeightIds(CallContext context) { + String [][] artifactsIds = getDifferenceArtifactIds(); + int [][] ids = new int[artifactsIds.length][2]; + for (int i = 0; i < artifactsIds.length; ++i) { + D4EArtifact a1 = RiverUtils.getArtifact(artifactsIds[i][0], context); + D4EArtifact a2 = RiverUtils.getArtifact(artifactsIds[i][1], context); + ids[i][0] = getHeightId(a1); + ids[i][1] = getHeightId(a2); + } + return ids; } public static int getHeightId(D4EArtifact artifact) { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -10,8 +10,6 @@ import java.util.List; -import org.dive4elements.artifacts.CallContext; - import org.dive4elements.river.artifacts.D4EArtifact; import org.dive4elements.river.artifacts.model.minfo.BedHeight; import org.dive4elements.river.artifacts.model.minfo.BedHeightFactory; @@ -35,8 +33,8 @@ private String time; - public BedHeightAccess(D4EArtifact artifact, CallContext context) { - super(artifact, context); + public BedHeightAccess(D4EArtifact artifact) { + super(artifact); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedQualityAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedQualityAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedQualityAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -33,7 +33,7 @@ public BedQualityAccess(D4EArtifact artifact, CallContext context) { - super(artifact, context); + super(artifact); } public List getDateRanges() { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/Calculation4Access.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/Calculation4Access.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/Calculation4Access.java Wed Jun 05 13:16:28 2013 +0200 @@ -34,7 +34,7 @@ public Calculation4Access(D4EArtifact artifact) { - super(artifact, null); + super(artifact); } public List getSegments() { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -8,8 +8,6 @@ package org.dive4elements.river.artifacts.access; -import org.dive4elements.artifacts.CallContext; - import org.dive4elements.river.artifacts.D4EArtifact; import org.dive4elements.river.artifacts.model.RangeWithValues; @@ -38,8 +36,8 @@ protected List ranges; - public ExtremeAccess(D4EArtifact artifact, CallContext context) { - super(artifact, context); + public ExtremeAccess(D4EArtifact artifact) { + super(artifact); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -8,7 +8,6 @@ package org.dive4elements.river.artifacts.access; -import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.D4EArtifact; import java.util.Arrays; @@ -33,8 +32,8 @@ protected String function; - public FixAccess(D4EArtifact artifact, CallContext context) { - super(artifact, context); + public FixAccess(D4EArtifact artifact) { + super(artifact); } public Long getStart() { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAnalysisAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAnalysisAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAnalysisAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -9,7 +9,6 @@ package org.dive4elements.river.artifacts.access; import org.dive4elements.artifactdatabase.data.StateData; -import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.D4EArtifact; @@ -30,8 +29,8 @@ protected double [] qs; - public FixAnalysisAccess(D4EArtifact artifact, CallContext context) { - super(artifact, context); + public FixAnalysisAccess(D4EArtifact artifact) { + super(artifact); } public DateRange getReferencePeriod() { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixRealizingAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixRealizingAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixRealizingAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -8,7 +8,6 @@ package org.dive4elements.river.artifacts.access; -import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.D4EArtifact; import org.dive4elements.river.artifacts.model.Segment; @@ -28,8 +27,8 @@ protected List segments; - public FixRealizingAccess(D4EArtifact artifact, CallContext context) { - super(artifact, context); + public FixRealizingAccess(D4EArtifact artifact) { + super(artifact); } public Boolean isQ() { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/FlowVelocityAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FlowVelocityAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FlowVelocityAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -8,8 +8,6 @@ package org.dive4elements.river.artifacts.access; -import org.dive4elements.artifacts.CallContext; - import org.dive4elements.river.artifacts.D4EArtifact; @@ -21,8 +19,8 @@ private int[] mainChannels; private int[] totalChannels; - public FlowVelocityAccess(D4EArtifact artifact, CallContext context) { - super(artifact, context); + public FlowVelocityAccess(D4EArtifact artifact) { + super(artifact); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/GaugeAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/GaugeAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/GaugeAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -10,7 +10,6 @@ import org.apache.log4j.Logger; -import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.D4EArtifact; import org.dive4elements.river.utils.RiverUtils; @@ -21,8 +20,8 @@ { private static Logger logger = Logger.getLogger(GaugeAccess.class); - public GaugeAccess(D4EArtifact artifact, CallContext context) { - super(artifact, context); + public GaugeAccess(D4EArtifact artifact) { + super(artifact); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/MapAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/MapAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/MapAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -12,7 +12,6 @@ import java.util.Arrays; import java.util.List; -import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.D4EArtifact; @@ -20,8 +19,8 @@ extends RangeAccess { - public MapAccess(D4EArtifact artifact, CallContext context) { - super(artifact, context); + public MapAccess(D4EArtifact artifact) { + super(artifact); } public List getHWS() { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -8,10 +8,10 @@ package org.dive4elements.river.artifacts.access; +import gnu.trove.TDoubleArrayList; + import org.apache.log4j.Logger; -import gnu.trove.TDoubleArrayList; -import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.D4EArtifact; import org.dive4elements.river.artifacts.WINFOArtifact; @@ -25,8 +25,6 @@ { private static Logger logger = Logger.getLogger(RangeAccess.class); - private CallContext context; - public static enum KM_MODE { RANGE, LOCATIONS, NONE }; double[] kmRange; @@ -40,9 +38,8 @@ private KM_MODE mode; - public RangeAccess(D4EArtifact artifact, CallContext context) { + public RangeAccess(D4EArtifact artifact) { super(artifact); - this.context = context; } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java Wed Jun 05 13:16:28 2013 +0200 @@ -12,8 +12,6 @@ import org.apache.log4j.Logger; -import org.dive4elements.artifacts.CallContext; - import org.dive4elements.river.artifacts.D4EArtifact; @@ -22,14 +20,11 @@ { private static final Logger logger = Logger.getLogger(BedHeightAccess.class); - private int[] singleIDs; - private int[] epochIDs; - private String time; private String unit; - public SedimentLoadAccess(D4EArtifact artifact, CallContext context) { - super(artifact, context); + public SedimentLoadAccess(D4EArtifact artifact) { + super(artifact); } public Double getLowerKM() { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java Wed Jun 05 13:16:28 2013 +0200 @@ -257,6 +257,7 @@ new ArrayList(3); Connection userConnection = userId != null + || parameters.containsKey("ARTIFACT-ID") ? DBConfig .getInstance() .getDBConnection() diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java Wed Jun 05 13:16:28 2013 +0200 @@ -298,7 +298,7 @@ } catch (XPathExpressionException xee) { log.warn("unable to apply filter expression '" + - filter + "' to dataset."); + filter + "' to dataset.", xee); } finally { frames.leave(); @@ -517,6 +517,7 @@ String [] origColumns = rd.getColumnLabels(); int index = origColumns.length; String [] newColumns = Arrays.copyOf(origColumns, index+1); + newColumns[index] = name.toUpperCase(); ResultData result = new ResultData(newColumns); fillResult(result, rd, index, index+1, expr, returnType); return result; @@ -535,17 +536,15 @@ } protected void fillResult( - ResultData result, - ResultData rd, - int index, - int size, + ResultData result, + ResultData rd, + int index, + int size, XPathExpression expr, - QName returnType + QName returnType ) { - List rows = rd.getRows(); String [] origColumns = rd.getColumnLabels(); - for (int i = 0, R = rows.size(); i < R; ++i) { - Object [] row = rows.get(i); + for (Object [] row: rd.getRows()) { frames.enter(); try { frames.put(origColumns, row); @@ -769,23 +768,11 @@ /** Get macro node children, not resolving bodies. */ protected NodeList getMacroChildren(String name) { - NodeList macros = template.getElementsByTagNameNS( - DC_NAMESPACE_URI, "macro"); - - Element macro = null; - for (int i = 0, N = macros.getLength(); i < N; ++i) { - Element m = (Element) macros.item(i); - if (name.equals(m.getAttribute("name"))) { - macro = m; - break; - } - } - - if (macro != null) { - return macro.getChildNodes(); - } - return null; + Element macro = macros.get(name); + return macro != null + ? macro.getChildNodes() + : null; } protected void ifClause(Node parent, Element current) diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java Wed Jun 05 13:16:28 2013 +0200 @@ -9,11 +9,11 @@ package org.dive4elements.river.artifacts.datacage.templating; import java.text.SimpleDateFormat; -import java.util.ArrayList; import java.util.Collection; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.HashMap; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; @@ -38,24 +38,32 @@ public static final double FAR_AWAY = 99999d; - public static final class Entry { + protected static final class Entry { - String name; + Entry next; XPathFunction function; int arity; - public Entry() { + public Entry(Entry next, XPathFunction function, int arity) { + this.next = next; + this.function = function; + this.arity = arity; } - public Entry(String name, XPathFunction function, int arity) { - this.name = name; - this.function = function; - this.arity = arity; + XPathFunction find(int arity) { + Entry current = this; + while (current != null) { + if (current.arity == arity) { + return current.function; + } + current = current.next; + } + return null; } } // class Entry /** List of functions. */ - protected List functions; + protected Map functions; protected Builder.BuildHelper buildHelper; @@ -67,7 +75,7 @@ public FunctionResolver(Builder.BuildHelper buildHelper) { this.buildHelper = buildHelper; - functions = new ArrayList(); + functions = new HashMap(); addFunction("contains", 2, new XPathFunction() { @Override @@ -97,6 +105,13 @@ } }); + addFunction("replace-all", 3, new XPathFunction() { + @Override + public Object evaluate(List args) throws XPathFunctionException { + return replaceAll(args); + } + }); + addFunction("has-result", 0, new XPathFunction() { @Override public Object evaluate(List args) throws XPathFunctionException { @@ -124,6 +139,18 @@ return FunctionResolver.this.buildHelper.frames.dump(); } }); + + addFunction("get", 1, new XPathFunction() { + @Override + public Object evaluate(List args) throws XPathFunctionException { + Object o = args.get(0); + if (o instanceof String) { + return FunctionResolver.this.buildHelper.frames.getNull( + (String)o, StackFrames.NULL); + } + return StackFrames.NULL; + } + }); } /** @@ -133,7 +160,15 @@ * @param function the function itself. */ public void addFunction(String name, int arity, XPathFunction function) { - functions.add(new Entry(name, function, arity)); + Entry entry = functions.get(name); + if (entry == null) { + entry = new Entry(null, function, arity); + functions.put(name, entry); + } + else { + Entry newEntry = new Entry(entry.next, function, arity); + entry.next = newEntry; + } } @Override @@ -143,14 +178,10 @@ return null; } - String name = functionName.getLocalPart(); - for (Entry entry: functions) { - if (entry.arity == arity && entry.name.equals(name)) { - return entry.function; - } - } - - return null; + Entry entry = functions.get(functionName.getLocalPart()); + return entry != null + ? entry.find(arity) + : null; } /** Implementation of case-ignoring dc:contains. */ @@ -203,11 +234,7 @@ Object locations = args.get(1); Object from = args.get(2); - if (!(mode instanceof String)){ - return -FAR_AWAY; - } - - if (mode.equals("locations")) { + if (mode instanceof String && mode.equals("locations")) { if (!(locations instanceof String)) { return -FAR_AWAY; } @@ -230,7 +257,7 @@ return -FAR_AWAY; } } - else if (mode.equals("distance")) { + else { if (!(from instanceof String)) { return -FAR_AWAY; } @@ -242,9 +269,6 @@ return -FAR_AWAY; } } - else { - return -FAR_AWAY; - } } /** Implementation for getting the maximum value of location or distance @@ -255,11 +279,7 @@ Object locations = args.get(1); Object to = args.get(2); - if (!(mode instanceof String)){ - return FAR_AWAY; - } - - if (mode.equals("locations")) { + if (mode instanceof String && mode.equals("locations")) { if (!(locations instanceof String)) { return FAR_AWAY; } @@ -282,7 +302,7 @@ return FAR_AWAY; } } - else if (mode.equals("distance")) { + else { if (!(to instanceof String)) { return FAR_AWAY; } @@ -291,14 +311,11 @@ try { return Double.parseDouble(t); } - catch(NumberFormatException nfe) { + catch (NumberFormatException nfe) { return FAR_AWAY; } } } - else { - return FAR_AWAY; - } } /** Implementation for doing a string replace @@ -309,14 +326,30 @@ Object needle = args.get(1); Object replacement = args.get(2); - if (needle instanceof String && - haystack instanceof String && - replacement instanceof String) { + if (needle instanceof String + && haystack instanceof String + && replacement instanceof String) { return ((String)haystack).replace( (String)needle, (String)replacement); - } else { - return haystack; } + return haystack; + } + + /** Implementation for doing a string replace + * dc:replace-all + */ + public Object replaceAll(List args) throws XPathFunctionException { + Object haystack = args.get(0); + Object needle = args.get(1); + Object replacement = args.get(2); + + if (needle instanceof String + && haystack instanceof String + && replacement instanceof String) { + return ((String)haystack).replaceAll( + (String)needle, (String)replacement); + } + return haystack; } public Object dateFormat(List args) throws XPathFunctionException { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/LinearInterpolated.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/LinearInterpolated.java Wed Jun 05 13:16:28 2013 +0200 @@ -0,0 +1,228 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + +package org.dive4elements.river.artifacts.model; + +import gnu.trove.TDoubleArrayList; + +import java.io.Serializable; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; + +import org.apache.commons.math.stat.descriptive.moment.StandardDeviation; + +import org.dive4elements.river.artifacts.math.Linear; + +import org.dive4elements.river.utils.EpsilonComparator; + +public class LinearInterpolated +implements Serializable +{ + public static final double EPSILON = 1e-5; + public static final double MULTIPLE_STD_DEV = 4d; + + public static final EpsilonComparator CMP = new EpsilonComparator(EPSILON); + + private TDoubleArrayList xs; + private TDoubleArrayList ys; + + private List gaps; + + public interface Operator { + double evaluate(double y1, double y2); + } // interface Operator + + public static final Operator SUB = new Operator() { + @Override + public double evaluate(double y1, double y2) { + return y1 - y2; + } + }; + + public static final Operator MAX = new Operator() { + @Override + public double evaluate(double y1, double y2) { + return Math.max(y1, y2); + } + }; + + public LinearInterpolated() { + xs = new TDoubleArrayList(); + ys = new TDoubleArrayList(); + } + + public LinearInterpolated(int capacity) { + xs = new TDoubleArrayList(capacity); + ys = new TDoubleArrayList(capacity); + } + + public void add(double x, double y) { + xs.add(x); + ys.add(y); + } + + public int size() { + return xs.size(); + } + + public void pointsInRange(double from, double to, Set points) { + if (from > to) { + double t = from; + from = to; + to = t; + } + for (int i = 0, S = size(); i < S; ++i) { + double x = xs.getQuick(i); + if (x >= from && x <= to) { + points.add(x); + } + } + } + + public boolean inGap(double x) { + if (gaps != null) { + for (Range gap: gaps) { + if (gap.inside(x)) { + return true; + } + } + } + return false; + } + + public void detectGaps(double threshold) { + List gabs = new ArrayList(); + for (int i = 1, S = size(); i < S; ++i) { + double x0 = xs.getQuick(i-1); + double x1 = xs.getQuick(i); + double minX, maxX; + if (x0 < x1) { minX = x0; maxX = x1; } + else { minX = x1; maxX = x0; } + double diff = maxX - minX - 2d*EPSILON; + if (diff > threshold) { + gaps.add(new Range(minX+EPSILON, maxX-EPSILON)); + } + } + this.gaps = gaps.isEmpty() ? null : gabs; + } + + public void resetGaps() { + gaps = null; + } + + public double guessGapThreshold() { + return guessGapThreshold(MULTIPLE_STD_DEV); + } + + public double guessGapThreshold(double scale) { + int S = size(); + if (S < 5) { // Too less points. + return Double.MAX_VALUE; + } + + StandardDeviation s = new StandardDeviation(); + + for (int i = 1; i < S; ++i) { + double diff = Math.abs(xs.getQuick(i-1) - xs.getQuick(i)); + s.increment(diff); + } + + return scale*s.getResult(); + } + + public double value(double x) { + for (int i = 0, S = size(); i < S; ++i) { + double x1 = xs.getQuick(i); + if (Math.abs(x1 - x) < EPSILON) { + return ys.getQuick(i); + } + if (i > 0) { + double x0 = xs.getQuick(i-1); + double minX, maxX; + if (x0 < x1) { minX = x0; maxX = x1; } + else { minX = x1; maxX = x0; } + if (x > minX && x < maxX) { + return Linear.linear( + x, + x0, x1, + ys.getQuick(i-1), ys.getQuick(i)); + } + } + } + return Double.NaN; + } + + public LinearInterpolated sub( + LinearInterpolated other, + double from, + double to + ) { + return apply(SUB, other, from, to); + } + + public LinearInterpolated max( + LinearInterpolated other, + double from, + double to + ) { + return apply(MAX, other, from, to); + } + + public boolean intersect(LinearInterpolated other) { + if (xs.isEmpty() || other.xs.isEmpty()) { + return false; + } + + double tMax = xs.max(); + double oMin = other.xs.min(); + if (tMax < oMin) { + return false; + } + + double tMin = xs.min(); + double oMax = other.xs.max(); + return !(tMin > oMax); + } + + public LinearInterpolated apply( + Operator operator, + LinearInterpolated other, + double from, + double to + ) { + LinearInterpolated result = new LinearInterpolated(); + if (!intersect(other)) { + return result; + } + + Set points = new TreeSet(CMP); + points.add(from); + points.add(to); + + this .pointsInRange(from, to, points); + other.pointsInRange(from, to, points); + + + for (double x: points) { + if (!inGap(x) && !other.inGap(x)) { + double y1 = this .value(x); + double y2 = other.value(x); + double y = operator.evaluate(y1, y2); + if (!Double.isNaN(y)) { + result.add(x, y); + } + } + } + + return result; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -24,13 +24,13 @@ * values are set directly on the Element, the other attributes aren't * touched. */ -public class ManagedDomFacet extends ManagedFacet { +public class ManagedDomFacet extends ManagedFacet +{ protected Element facet; public ManagedDomFacet(Element facet) { super(null, -1, null, null, -1, -1, -1); - this.facet = facet; } @@ -169,6 +169,29 @@ return this.uuid; } + @Override + public String getBoundToOut() { + if (boundToOut == null) { + String bondageAttr = this.facet.getAttributeNS( + ArtifactNamespaceContext.NAMESPACE_URI, + "boundToOut"); + if (bondageAttr != null && !bondageAttr.isEmpty()) { + boundToOut = bondageAttr; + } + } + return boundToOut; + } + + + @Override + public void setBoundToOut(String value) { + boundToOut = value; + + facet.setAttributeNS( + ArtifactNamespaceContext.NAMESPACE_URI, + ArtifactNamespaceContext.NAMESPACE_PREFIX + ":" + "boundToOut", + getBoundToOut()); + } /** * Import into document. diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -41,12 +41,18 @@ public ManagedFacet(String name, int index, String desc, String uuid, int pos, int active, int visible) { + this(name, index, desc, uuid, pos, active, visible, null); + } + + public ManagedFacet(String name, int index, String desc, String uuid, + int pos, int active, int visible, String boundToOut) { super(index, name, desc); this.uuid = uuid; this.position = pos; this.active = active; this.visible = visible; + this.boundToOut = boundToOut; } /** diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java Wed Jun 05 13:16:28 2013 +0200 @@ -46,7 +46,8 @@ uuid, pos, active, - visible); + visible, + facet.getBoundToOut()); this.facet = facet; } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -95,7 +95,7 @@ logger.debug("A curve at km = " + currentKm); Curve c = curveEntry.getValue(); // Find segment in which the curr. km is located. - ExtremeAccess access = new ExtremeAccess(flys, context); + ExtremeAccess access = new ExtremeAccess(flys); double[] ds = access.getValuesForRange(currentKm); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisPeriodsFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisPeriodsFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisPeriodsFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -13,8 +13,6 @@ import org.dive4elements.river.artifacts.D4EArtifact; -import org.dive4elements.river.artifacts.access.FixAnalysisAccess; - import org.dive4elements.river.artifacts.model.CalculationResult; import org.dive4elements.river.artifacts.model.DateRange; import org.dive4elements.river.artifacts.model.FacetTypes; @@ -69,7 +67,6 @@ if (artifact instanceof D4EArtifact) { D4EArtifact flys = (D4EArtifact)artifact; - FixAnalysisAccess access = new FixAnalysisAccess(flys, context); CalculationResult res = (CalculationResult) flys.compute(context, diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -13,8 +13,6 @@ import org.dive4elements.river.artifacts.D4EArtifact; -import org.dive4elements.river.artifacts.access.FixAnalysisAccess; - import org.dive4elements.river.artifacts.model.CalculationResult; import org.dive4elements.river.artifacts.model.FacetTypes; @@ -69,7 +67,6 @@ if (artifact instanceof D4EArtifact) { D4EArtifact flys = (D4EArtifact)artifact; - FixAnalysisAccess access = new FixAnalysisAccess(flys, context); CalculationResult res = (CalculationResult) flys.compute(context, diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDerivateFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDerivateFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDerivateFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -75,7 +75,7 @@ } D4EArtifact flys = (D4EArtifact)artifact; - FixAnalysisAccess access = new FixAnalysisAccess(flys, context); + FixAnalysisAccess access = new FixAnalysisAccess(flys); CalculationResult res = (CalculationResult) flys.compute(context, diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDeviationFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDeviationFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDeviationFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -12,7 +12,6 @@ import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.D4EArtifact; -import org.dive4elements.river.artifacts.access.FixAnalysisAccess; import org.dive4elements.river.artifacts.model.CalculationResult; import org.dive4elements.river.artifacts.model.FacetTypes; @@ -67,7 +66,6 @@ logger.debug("FixDeviationFacet.getData"); if (artifact instanceof D4EArtifact) { D4EArtifact flys = (D4EArtifact)artifact; - FixAnalysisAccess access = new FixAnalysisAccess(flys, context); CalculationResult res = (CalculationResult) flys.compute(context, diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixEventFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixEventFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixEventFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -50,7 +50,7 @@ public Object getData(Artifact artifact, CallContext context) { logger.debug("FixEventFacet.getData"); - FixRealizingAccess access = new FixRealizingAccess((D4EArtifact) artifact, context); + FixRealizingAccess access = new FixRealizingAccess((D4EArtifact) artifact); int wstColID = access.getEvents()[index]; return WQKmsFactory.getWQKmsCID(wstColID); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -13,8 +13,6 @@ import org.dive4elements.river.artifacts.D4EArtifact; -import org.dive4elements.river.artifacts.access.FixAnalysisAccess; - import org.dive4elements.river.artifacts.model.CalculationResult; import org.dive4elements.river.artifacts.model.DataFacet; import org.dive4elements.river.artifacts.model.FacetTypes; @@ -72,7 +70,6 @@ if (artifact instanceof D4EArtifact) { D4EArtifact flys = (D4EArtifact)artifact; - FixAnalysisAccess access = new FixAnalysisAccess(flys, context); CalculationResult res = (CalculationResult) flys.compute(context, diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -13,8 +13,6 @@ import org.dive4elements.river.artifacts.D4EArtifact; -import org.dive4elements.river.artifacts.access.FixAnalysisAccess; - import org.dive4elements.river.artifacts.model.CalculationResult; import org.dive4elements.river.artifacts.model.DataFacet; import org.dive4elements.river.artifacts.model.FacetTypes; @@ -72,7 +70,6 @@ if (artifact instanceof D4EArtifact) { D4EArtifact flys = (D4EArtifact)artifact; - FixAnalysisAccess access = new FixAnalysisAccess(flys, context); CalculationResult res = (CalculationResult) flys.compute(context, diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -69,7 +69,7 @@ logger.debug("getData"); if (artifact instanceof D4EArtifact) { D4EArtifact flys = (D4EArtifact)artifact; - FixAnalysisAccess access = new FixAnalysisAccess(flys, context); + FixAnalysisAccess access = new FixAnalysisAccess(flys); CalculationResult res = (CalculationResult) flys.compute(context, diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWS.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWS.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWS.java Wed Jun 05 13:16:28 2013 +0200 @@ -34,7 +34,6 @@ public HWS() { this.geom = null; - // TODO Auto-generated constructor stub } public HWS(String name) { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java Wed Jun 05 13:16:28 2013 +0200 @@ -5,18 +5,15 @@ * and comes with ABSOLUTELY NO WARRANTY! Check out the * documentation coming with Dive4Elements River for details. */ - package org.dive4elements.river.artifacts.model.minfo; import gnu.trove.TDoubleArrayList; import java.util.Date; -import java.util.LinkedList; -import java.util.List; import org.apache.log4j.Logger; -import org.dive4elements.river.artifacts.D4EArtifact; +import org.dive4elements.artifacts.CallContext; import org.dive4elements.river.artifacts.access.BedDifferencesAccess; import org.dive4elements.river.artifacts.model.Calculation; import org.dive4elements.river.artifacts.model.CalculationResult; @@ -25,25 +22,23 @@ public class BedDiffCalculation extends Calculation { + private static final Logger logger = + Logger.getLogger(BedDiffCalculation.class); - private static final Logger logger = Logger - .getLogger(BedDiffCalculation.class); - - protected String river; - protected String yearEpoch; - protected D4EArtifact[][] artifacts; + protected String river; + protected String yearEpoch; + protected int [][] heightIds; public BedDiffCalculation() { } - public CalculationResult calculate(BedDifferencesAccess access) { + public CalculationResult calculate(BedDifferencesAccess access, CallContext context) { logger.info("BedDiffCalculation.calculate"); - String river = access.getRiver(); - String yearEpoch = access.getYearEpoch(); - D4EArtifact[][] artifacts = access.getDifferenceArtifacts(); + String river = access.getRiver(); + String yearEpoch = access.getYearEpoch(); + int [][] heightIds = access.extractHeightIds(context); - logger.debug("got artifacts: " + artifacts.length + "; " + artifacts[0].length); if (river == null) { // TODO: i18n addProblem("minfo.missing.river"); @@ -53,14 +48,10 @@ addProblem("minfo.missing.year_epoch"); } - if (artifacts == null) { - addProblem("minfo.missing.differences"); - } - if (!hasProblems()) { - this.river = river; + this.river = river; this.yearEpoch = yearEpoch; - this.artifacts = artifacts; + this.heightIds = heightIds; return internalCalculate(); } @@ -70,115 +61,104 @@ private CalculationResult internalCalculate() { if (yearEpoch.equals("year")) { - List results = - new LinkedList(); + BedDiffYearResult [] results = new BedDiffYearResult[heightIds.length]; - for (int i = 0; i < artifacts.length; i++) { - BedHeight[] pair = - getHeightPair(artifacts[i][0], artifacts[i][1], "single"); - BedDiffYearResult res = calculateYearDifference(pair); - results.add(res); + for (int i = 0; i < heightIds.length; i++) { + BedHeight [] pair = getHeightPair(heightIds[i], "single"); + results[i] = calculateYearDifference(pair); } - return new CalculationResult( - results.toArray(new BedDiffYearResult[results.size()]), this); + return new CalculationResult(results, this); } + if (yearEpoch.equals("epoch")) { - List results = - new LinkedList(); - for (int i = 0; i < artifacts.length; i++) { - BedHeight[] pair = - getHeightPair(artifacts[i][0], artifacts[i][1], "epoch"); - BedDiffEpochResult res = calculateEpochDifference(pair); - results.add(res); + BedDiffEpochResult [] results = new BedDiffEpochResult[heightIds.length]; + + for (int i = 0; i < heightIds.length; i++) { + BedHeight[] pair = getHeightPair(heightIds[i], "epoch"); + results[i] = calculateEpochDifference(pair); } - return new CalculationResult( - results.toArray(new BedDiffEpochResult[results.size()]), this); + return new CalculationResult(results, this); } return new CalculationResult(); } - private BedHeight[] getHeightPair( - D4EArtifact art1, - D4EArtifact art2, - String type - ) { - int id1 = BedDifferencesAccess.getHeightId(art1); - int id2 = BedDifferencesAccess.getHeightId(art2); - - BedHeight[] heights = new BedHeight[2]; - heights[0] = BedHeightFactory.getHeight(type, id1, 0); - heights[1] = BedHeightFactory.getHeight(type, id2, 0); - return heights; + private static BedHeight [] getHeightPair(int [] ids, String type) { + return new BedHeight [] { + BedHeightFactory.getHeight(type, ids[0], 0), + BedHeightFactory.getHeight(type, ids[1], 0) + }; } private BedDiffEpochResult calculateEpochDifference(BedHeight[] pair) { - TDoubleArrayList stations = pair[0].getStations(); - TDoubleArrayList diffRes = new TDoubleArrayList(); - TDoubleArrayList kms = new TDoubleArrayList(); - TDoubleArrayList heights1 = new TDoubleArrayList(); - TDoubleArrayList heights2 = new TDoubleArrayList(); + BedHeight bh1 = pair[0]; + BedHeight bh2 = pair[1]; - for (int i = 0; i < stations.size(); i++) { - if (!Double.isNaN(pair[0].getHeight(stations.get(i))) && - !Double.isNaN(pair[1].getHeight(stations.get(i)))) { - double hDiff = - pair[0].getHeight(stations.get(i)) - - pair[1].getHeight(stations.get(i)); + TDoubleArrayList stations = bh1.getStations(); + int size = stations.size(); + + TDoubleArrayList diffRes = new TDoubleArrayList(size); + TDoubleArrayList kms = new TDoubleArrayList(size); + TDoubleArrayList heights1 = new TDoubleArrayList(size); + TDoubleArrayList heights2 = new TDoubleArrayList(size); + + for (int i = 0; i < size; i++) { + double station = stations.getQuick(i); + double h1 = bh1.getHeight(station); + double h2 = bh2.getHeight(station); + double hDiff = h1 - h2; + if (!Double.isNaN(hDiff)) { diffRes.add(hDiff); - kms.add(stations.get(i)); - heights1.add(pair[0].getHeight(stations.get(i))); - heights2.add(pair[1].getHeight(stations.get(i))); + kms.add(station); + heights1.add(h1); + heights2.add(h2); } } - Date start = ((BedHeightEpoch)pair[0]).getStart(); - Date end = ((BedHeightEpoch)pair[1]).getEnd(); + Date start = ((BedHeightEpoch)bh1).getStart(); + Date end = ((BedHeightEpoch)bh2).getEnd(); return new BedDiffEpochResult(kms, diffRes, heights1, heights2, start, end); } private BedDiffYearResult calculateYearDifference(BedHeight[] pair) { - TDoubleArrayList stations = pair[0].getStations(); - TDoubleArrayList diffRes = new TDoubleArrayList(); - TDoubleArrayList kms = new TDoubleArrayList(); - TDoubleArrayList morphs = new TDoubleArrayList(); - TDoubleArrayList absolute = new TDoubleArrayList(); - TDoubleArrayList gap = new TDoubleArrayList(); - TDoubleArrayList heights1 = new TDoubleArrayList(); - TDoubleArrayList heights2 = new TDoubleArrayList(); - BedHeightSingle s1 = (BedHeightSingle)pair[0]; BedHeightSingle s2 = (BedHeightSingle)pair[1]; - int range = s1.getYear() - s2.getYear(); - if (range < 0) { - range = range * -1; - } - for (int i = 0; i < stations.size(); i++) { - if (!Double.isNaN(s1.getHeight(stations.get(i))) && - !Double.isNaN(s2.getHeight(stations.get(i)))) { - double hDiff = - s1.getHeight(stations.get(i)) - - s2.getHeight(stations.get(i)); + + TDoubleArrayList stations = s1.getStations(); + int size = stations.size(); + + TDoubleArrayList diffRes = new TDoubleArrayList(size); + TDoubleArrayList kms = new TDoubleArrayList(size); + TDoubleArrayList morphs = new TDoubleArrayList(size); + TDoubleArrayList absolute = new TDoubleArrayList(size); + TDoubleArrayList gap = new TDoubleArrayList(size); + TDoubleArrayList heights1 = new TDoubleArrayList(size); + TDoubleArrayList heights2 = new TDoubleArrayList(size); + + int range = Math.abs(s1.getYear() - s2.getYear()); + + for (int i = 0; i < size; i++) { + double station = stations.getQuick(i); + double h1 = s1.getHeight(station); + double h2 = s2.getHeight(station); + double hDiff = h1 - h2; + + if (!Double.isNaN(hDiff)) { diffRes.add(hDiff); - double km = stations.get(i); - kms.add(km); - if (s1.getMorphWidth(km) > - s2.getMorphWidth(km)) { - morphs.add(s1.getMorphWidth(km)); - } - else { - morphs.add(s2.getMorphWidth(km)); - } - if (s1.getDataGap(km) > s2.getDataGap(km)) { - gap.add(s1.getDataGap(km)); - } - else { - gap.add(s2.getDataGap(km)); - } - absolute.add((hDiff / range) * 100); - heights1.add(s1.getHeight(km)); - heights2.add(s2.getHeight(km)); + kms.add(station); + + morphs.add(Math.max( + s1.getMorphWidth(station), + s2.getMorphWidth(station))); + + gap.add(Math.max( + s1.getDataGap(station), + s2.getDataGap(station))); + + absolute.add((hDiff / range) * 100d); + heights1.add(h1); + heights2.add(h2); } } return new BedDiffYearResult( diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java Wed Jun 05 13:16:28 2013 +0200 @@ -78,10 +78,8 @@ } public double getHeight(double station) { - if (this.station.indexOf(station) >= 0) { - return this.heights.get(this.station.indexOf(station)); - } - return Double.NaN; + int index = this.station.indexOf(station); + return index >= 0 ? heights.getQuick(index) : Double.NaN; } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java Wed Jun 05 13:16:28 2013 +0200 @@ -38,7 +38,7 @@ */ @Override public Object getData(Artifact artifact, CallContext context) { - BedHeightAccess access = new BedHeightAccess((D4EArtifact)artifact, context); + BedHeightAccess access = new BedHeightAccess((D4EArtifact)artifact); if (type.equals("singlevalues")) { return access.getSingleValues(); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java Wed Jun 05 13:16:28 2013 +0200 @@ -51,25 +51,21 @@ } public double getMorphWidth(int idx) { - return this.morphWidth.get(idx); + return this.morphWidth.getQuick(idx); } public double getDataGap(int idx) { - return this.data_gap.get(idx); + return this.data_gap.getQuick(idx); } public double getMorphWidth(double station) { - if (this.station.indexOf(station) >= 0) { - return this.morphWidth.get(this.station.indexOf(station)); - } - return Double.NaN; + int index = this.station.indexOf(station); + return index >= 0 ? morphWidth.getQuick(index): Double.NaN; } public double getDataGap(double station) { - if (this.station.indexOf(station) >= 0) { - return this.getDataGap(this.station.indexOf(station)); - } - return Double.NaN; + int index = this.station.indexOf(station); + return index >= 0 ? data_gap.getQuick(index) : Double.NaN; } public double[] getMorphWidths() { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java Wed Jun 05 13:16:28 2013 +0200 @@ -299,22 +299,25 @@ public double calculateDeviation(QualityMeasurement qm) { Map dm = qm.getAllDiameter(); - double phiM = 0; - double[] phis = new double[dm.size()]; - double[] ps = new double[dm.size()]; + int size = dm.size(); + + double phiM = 0; + double [] phis = new double[size]; + double [] ps = new double[size]; + double scale = -1d/Math.log(2d); + int i = 0; - for (String key : dm.keySet()) { - double d = dm.get(key); - double phi = -Math.log(d)/Math.log(2); + for (Map.Entry entry: dm.entrySet()) { + double phi = scale*Math.log(entry.getValue()); + double p = calculateWeight(qm, entry.getKey()); + phiM += phi * p; + ps[i] = p; phis[i] = phi; - double p = calculateWeight(qm, key); - ps[i] = p; - phiM += phi * p; i++; } double sig = 0d; - for (i = 0; i < dm.size(); i++) { + for (i = 0; i < size; i++) { sig += ps[i] * Math.exp(phis[i] - phiM); } double deviation = Math.sqrt(sig); @@ -331,7 +334,7 @@ double sum = 0d; for (Double d : dm.values()) { - sum =+ d.doubleValue(); + sum += d.doubleValue(); } double weight = sum/100*value; return weight; diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQRelationJRDataSource.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQRelationJRDataSource.java Wed Jun 05 13:16:28 2013 +0200 @@ -0,0 +1,100 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + +package org.dive4elements.river.artifacts.model.sq; + +import java.util.ArrayList; +import java.util.HashMap; + +import org.apache.log4j.Logger; + +import net.sf.jasperreports.engine.JRDataSource; +import net.sf.jasperreports.engine.JRException; +import net.sf.jasperreports.engine.JRField; + + +/** + * @author Raimund Renkert + */ +public class SQRelationJRDataSource implements JRDataSource +{ + /** The logger used in this exporter.*/ + private static Logger logger = Logger.getLogger(SQRelationJRDataSource.class); + + private ArrayList data; + private HashMap metaData; + + private int index = -1; + + public SQRelationJRDataSource() { + data = new ArrayList(); + metaData = new HashMap(); + } + + public void addData(String[] val) { + data.add(val); + } + + public void addMetaData(String key, String value) { + metaData.put(key, value); + } + + public boolean next() throws JRException { + index++; + return (index < data.size()); + } + + public Object getFieldValue(JRField field) throws JRException { + Object value = ""; + String fieldName = field.getName(); + if ("river".equals(fieldName)) { + value = metaData.get("river"); + } + else if ("date".equals(fieldName)) { + value = metaData.get("date"); + } + else if ("calculation".equals(fieldName)) { + value = metaData.get("calculation"); + } + else if ("location".equals(fieldName)) { + value = metaData.get("location"); + } + else if ("outliers".equals(fieldName)) { + value = metaData.get("outliers"); + } + else if ("outliertest".equals(fieldName)) { + value = metaData.get("outliertest"); + } + else if ("periods".equals(fieldName)) { + value = metaData.get("periods"); + } + else if ("km".equals(fieldName)) { + value = data.get(index)[0]; + } + else if ("param".equals(fieldName)) { + value = data.get(index)[1]; + } + else if ("a".equals(fieldName)) { + value = data.get(index)[2]; + } + else if ("b".equals(fieldName)) { + value = data.get(index)[3]; + } + else if ("total".equals(fieldName)) { + value = data.get(index)[4]; + } + else if ("out".equals(fieldName)) { + value = data.get(index)[5]; + } + else if ("variance".equals(fieldName)) { + value = data.get(index)[6]; + } + return value; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java Wed Jun 05 13:16:28 2013 +0200 @@ -79,7 +79,7 @@ } double[] minmax = getRequestedStartEnd(data, river); - Gauge gauge = river.maxOverlap(minmax[0], minmax[1]); + Gauge gauge = river.determineGauge(minmax[0], minmax[1]); if (gauge == null) { return error("no gauge found."); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/DischargeState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DischargeState.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DischargeState.java Wed Jun 05 13:16:28 2013 +0200 @@ -9,6 +9,8 @@ package org.dive4elements.river.artifacts.states; import java.util.List; +import java.util.Collections; +import java.util.Comparator; import org.apache.log4j.Logger; @@ -68,9 +70,16 @@ KVP[] kvp = new KVP[zones.size()]; - for (int i = 0, Z = zones.size(); i < Z; i++) { - DischargeZone zone = zones.get(i); + Collections.sort(zones, new Comparator() { + @Override + public int compare(DischargeZone a, DischargeZone b) { + return a.getValue().compareTo(b.getValue()); + } + }); + int i = 0; + + for (DischargeZone zone: zones) { String lower = zone.getLowerDischarge(); String upper = zone.getUpperDischarge(); @@ -80,6 +89,7 @@ else { kvp[i] = new KVP(zone.getId(), lower + " - " + upper); } + i++; } return kvp; diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/DistanceOnlySelect.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DistanceOnlySelect.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DistanceOnlySelect.java Wed Jun 05 13:16:28 2013 +0200 @@ -34,7 +34,7 @@ D4EArtifact flys = (D4EArtifact) artifact; try { - RangeAccess rangeAccess = new RangeAccess(flys, null); + RangeAccess rangeAccess = new RangeAccess(flys); double from = rangeAccess.getFrom(); double to = rangeAccess.getTo(); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/DurationCurveState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DurationCurveState.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DurationCurveState.java Wed Jun 05 13:16:28 2013 +0200 @@ -75,7 +75,7 @@ WQDay wqday = (WQDay)res.getData(); if (wqday != null && facets != null) { - RangeAccess rangeAccess = new RangeAccess(winfo, context); + RangeAccess rangeAccess = new RangeAccess(winfo); // Create an i18ed name for a (w or q) duration curve facet. Object[] args = new Object[] { RiverUtils.getRiver(winfo).getName(), diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java Wed Jun 05 13:16:28 2013 +0200 @@ -483,7 +483,7 @@ protected void setRange(D4EArtifact artifact, WSPLGENJob job) { - RangeAccess rangeAccess = new RangeAccess(artifact, null); + RangeAccess rangeAccess = new RangeAccess(artifact); double[] range = rangeAccess.getKmRange(); job.setStart(range[0]); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java Wed Jun 05 13:16:28 2013 +0200 @@ -70,7 +70,7 @@ List newFacets = new ArrayList(); - FlowVelocityAccess access = new FlowVelocityAccess(artifact, context); + FlowVelocityAccess access = new FlowVelocityAccess(artifact); CalculationResult res = old instanceof CalculationResult ? (CalculationResult) old diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java Wed Jun 05 13:16:28 2013 +0200 @@ -110,7 +110,7 @@ return null; } - MapAccess access = new MapAccess(artifact, context); + MapAccess access = new MapAccess(artifact); String river = access.getRiver(); HWSContainer hwsLines = HWSFactory.getHWSLines(river); HWSContainer hwsPoints = HWSFactory.getHWSPoints(river); @@ -219,7 +219,6 @@ } private boolean extractUserShp(File dir) { - // TODO Auto-generated method stub File archive = new File(dir, USER_RGD_ZIP); boolean exists = archive.exists(); logger.debug("Zip file exists: " + exists); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java Wed Jun 05 13:16:28 2013 +0200 @@ -46,7 +46,7 @@ List newFacets = new ArrayList(); - BedHeightAccess access = new BedHeightAccess(artifact, context); + BedHeightAccess access = new BedHeightAccess(artifact); CalculationResult res = old instanceof CalculationResult ? (CalculationResult) old diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java Wed Jun 05 13:16:28 2013 +0200 @@ -83,7 +83,7 @@ D4EArtifact flys = (D4EArtifact) artifact; try { - RangeAccess rangeAccess = new RangeAccess(flys, null); + RangeAccess rangeAccess = new RangeAccess(flys); double from = rangeAccess.getFrom(); double to = rangeAccess.getTo(); double step = rangeAccess.getStep(); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java Wed Jun 05 13:16:28 2013 +0200 @@ -137,7 +137,7 @@ D4EArtifact flysArtifact = (D4EArtifact) artifact; - RangeAccess rangeAccess = new RangeAccess(flysArtifact, context); + RangeAccess rangeAccess = new RangeAccess(flysArtifact); double[] dist = rangeAccess.getKmRange(); // TODO use Access to get River and gauges. River river = RiverUtils.getRiver(flysArtifact); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java Wed Jun 05 13:16:28 2013 +0200 @@ -61,7 +61,7 @@ CalculationResult res; - ExtremeAccess access = new ExtremeAccess(artifact, context); + ExtremeAccess access = new ExtremeAccess(artifact); if (old instanceof CalculationResult) { res = (CalculationResult)old; diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java Wed Jun 05 13:16:28 2013 +0200 @@ -86,7 +86,7 @@ D4EArtifact flysArtifact = (D4EArtifact) artifact; - ExtremeAccess access = new ExtremeAccess(flysArtifact, context); + ExtremeAccess access = new ExtremeAccess(flysArtifact); River river = RiverFactory.getRiver(access.getRiver()); WstValueTable wstValueTable = WstValueTableFactory.getTable(river); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java Wed Jun 05 13:16:28 2013 +0200 @@ -133,8 +133,7 @@ CalculationResult res; - FixAnalysisAccess access = - new FixAnalysisAccess(artifact, context); + FixAnalysisAccess access = new FixAnalysisAccess(artifact); if (old instanceof CalculationResult) { res = (CalculationResult)old; diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java Wed Jun 05 13:16:28 2013 +0200 @@ -71,8 +71,7 @@ CalculationResult res; - FixRealizingAccess access = - new FixRealizingAccess(artifact, context); + FixRealizingAccess access = new FixRealizingAccess(artifact); if (old instanceof CalculationResult) { res = (CalculationResult) old; diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferenceSelect.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferenceSelect.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferenceSelect.java Wed Jun 05 13:16:28 2013 +0200 @@ -63,7 +63,7 @@ CallContext context) { Element[] elements = new Element[1]; - BedHeightAccess bha = new BedHeightAccess((D4EArtifact)artifact, context); + BedHeightAccess bha = new BedHeightAccess((D4EArtifact)artifact); String time = bha.getYearEpoch(); elements[0] = createItem( ec, diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java Wed Jun 05 13:16:28 2013 +0200 @@ -71,11 +71,11 @@ List newFacets = new ArrayList(); - BedDifferencesAccess access = - new BedDifferencesAccess(artifact, context); + BedDifferencesAccess access = new BedDifferencesAccess(artifact); - CalculationResult res = old instanceof CalculationResult ? (CalculationResult) old - : new BedDiffCalculation().calculate(access); + CalculationResult res = old instanceof CalculationResult + ? (CalculationResult)old + : new BedDiffCalculation().calculate(access, context); if (facets == null || res == null) { return res; diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java Wed Jun 05 13:16:28 2013 +0200 @@ -55,7 +55,7 @@ List newFacets = new ArrayList(); - SedimentLoadAccess access = new SedimentLoadAccess(artifact, context); + SedimentLoadAccess access = new SedimentLoadAccess(artifact); CalculationResult res = old instanceof CalculationResult ? (CalculationResult) old : new SedimentLoadCalculation().calculate(access); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java --- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java Wed Jun 05 13:16:28 2013 +0200 @@ -44,7 +44,7 @@ public boolean validate(Artifact artifact) throws IllegalArgumentException { - SedimentLoadAccess access = new SedimentLoadAccess((D4EArtifact) artifact, null); + SedimentLoadAccess access = new SedimentLoadAccess((D4EArtifact) artifact); // Second year should be later than first. if (access.getPeriod() != null && access.getPeriod()[1] < access.getPeriod()[0]) diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java --- a/artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java Wed Jun 05 13:16:28 2013 +0200 @@ -188,18 +188,23 @@ logger.debug("Compatible facets are " + compatibleFacets); } - for (int i = 0; i < num; i++) { - ManagedFacet facet = (ManagedFacet) newFacets.get(i); + for (Facet fac: newFacets) { + ManagedFacet facet = (ManagedFacet) fac; if (debug) { logger.debug("Try to add Facet: " + facet.getName()); } if (!compatibleFacets.contains(facet.getName())) { - logger.warn("Have incompatible facet, skip: " + facet.getName()); + logger.debug("Have incompatible facet, skip: " + facet.getName()); continue; - } - else { + } else if (facet.getBoundToOut() != null && + !facet.getBoundToOut().equals(outputName)) { + logger.debug("Skip facet " + facet.getName() + + " because it is bound to: " + facet.getBoundToOut()); + continue; + } else { + logger.debug("Facet is bound to: " + facet.getBoundToOut()); logger.debug("Have compatible facet: " + facet.getName()); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java Wed Jun 05 13:16:28 2013 +0200 @@ -95,7 +95,7 @@ } River river = RiverUtils.getRiver(master); - RangeAccess rangeAccess = new RangeAccess(master, context); + RangeAccess rangeAccess = new RangeAccess(master); double[] kms = rangeAccess.getLocations(); Gauge gauge = river.determineGaugeByPosition(kms[0]); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -1432,7 +1432,7 @@ protected double[] getRange() { D4EArtifact flys = (D4EArtifact) master; - RangeAccess rangeAccess = new RangeAccess(flys, null); + RangeAccess rangeAccess = new RangeAccess(flys); return rangeAccess.getKmRange(); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java Wed Jun 05 13:16:28 2013 +0200 @@ -129,7 +129,7 @@ logger.debug("ComputedDischargeCurveExporter.writeCSVHeader"); String unit = RiverUtils.getRiver((D4EArtifact) master).getWstUnit().getName(); - RangeAccess access = new RangeAccess((D4EArtifact)master, context); + RangeAccess access = new RangeAccess((D4EArtifact)master); double[] km = access.getLocations(); String header = msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER, new Object[] { unit }); @@ -218,7 +218,7 @@ source.addMetaData("date", df.format(new Date())); - RangeAccess rangeAccess = new RangeAccess(flys, null); + RangeAccess rangeAccess = new RangeAccess(flys); double[] kms = rangeAccess.getKmRange(); source.addMetaData("range", String.valueOf(kms[0])); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveExporter.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveExporter.java Wed Jun 05 13:16:28 2013 +0200 @@ -227,7 +227,7 @@ source.addMetaData("date", df.format(new Date())); - RangeAccess rangeAccess = new RangeAccess(flys, null); + RangeAccess rangeAccess = new RangeAccess(flys); double[] kms = rangeAccess.getKmRange(); source.addMetaData("range", String.valueOf(kms[0])); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -240,13 +240,13 @@ } else if (getXBounds(0) == null && getDomainAxisRange() == null) { D4EArtifact artifact = (D4EArtifact)artifactAndFacet.getArtifact(); - FlowVelocityAccess access = new FlowVelocityAccess(artifact, context); + FlowVelocityAccess access = new FlowVelocityAccess(artifact); context.putContextValue("startkm", access.getLowerKM()); context.putContextValue("endkm", access.getUpperKM()); } else if (getXBounds(0) == null && getDomainAxisRange() != null){ D4EArtifact artifact = (D4EArtifact)artifactAndFacet.getArtifact(); - FlowVelocityAccess access = new FlowVelocityAccess(artifact, context); + FlowVelocityAccess access = new FlowVelocityAccess(artifact); Bounds b = new DoubleBounds(access.getLowerKM(), access.getUpperKM()); Bounds bounds = calculateZoom(b, getDomainAxisRange()); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -11,24 +11,33 @@ import java.util.Date; import org.apache.log4j.Logger; -import org.jfree.chart.plot.XYPlot; -import org.jfree.data.general.SeriesException; -import org.jfree.data.time.Day; -import org.jfree.data.time.RegularTimePeriod; -import org.jfree.data.time.TimeSeries; -import org.jfree.data.time.TimeSeriesCollection; -import org.w3c.dom.Document; import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; + import org.dive4elements.river.artifacts.D4EArtifact; + import org.dive4elements.river.artifacts.access.HistoricalDischargeAccess; + import org.dive4elements.river.artifacts.model.FacetTypes; import org.dive4elements.river.artifacts.model.HistoricalWQTimerange; import org.dive4elements.river.artifacts.model.Timerange; import org.dive4elements.river.artifacts.model.WQTimerange; + import org.dive4elements.river.jfree.StyledTimeSeries; + import org.dive4elements.river.utils.RiverUtils; +import org.jfree.chart.plot.XYPlot; + +import org.jfree.data.general.SeriesException; + +import org.jfree.data.time.FixedMillisecond; +import org.jfree.data.time.RegularTimePeriod; +import org.jfree.data.time.TimeSeries; +import org.jfree.data.time.TimeSeriesCollection; + +import org.w3c.dom.Document; + /** * @author Ingo Weinzierl @@ -249,18 +258,18 @@ } /** - * Creates an array that consists of two Minute periods [start, end]. + * Creates an array that consists of two FixedMillisecond periods [start, end]. * * @param timerange * Supports start and end time. * - * @return an array with two Minute periods [start, end]. + * @return an array with two FixedMillisecond periods [start, end]. */ protected RegularTimePeriod[] newRegularTimePeriod(Timerange timerange) { Date start = new Date(timerange.getStart()); Date end = new Date(timerange.getEnd() - 1000 * 60 * 60 * 24); - return new RegularTimePeriod[] { new Day(start), new Day(end) }; + return new RegularTimePeriod[] { new FixedMillisecond(start), new FixedMillisecond(end) }; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -8,8 +8,6 @@ package org.dive4elements.river.exports; -import com.vividsolutions.jts.geom.Envelope; - import org.dive4elements.artifactdatabase.data.StateData; import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; import org.dive4elements.artifactdatabase.state.Facet; @@ -41,6 +39,8 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; +import com.vividsolutions.jts.geom.Envelope; + public class MapGenerator implements OutGenerator, FacetTypes { @@ -102,7 +102,7 @@ String name = artifactFacet.getFacetName(); logger.debug("MapGenerator.doOut: " + - artifactFacet.getArtifact().identifier() + " | " + name); + artifactFacet.getArtifact().identifier() + " | " + name); D4EArtifact flys = (D4EArtifact) artifactFacet.getArtifact(); Facet nativeFacet = artifactFacet.getFacet(); @@ -161,12 +161,12 @@ mfg.createUeskLayer( flys, (WSPLGENLayerFacet) wms, - ThemeUtil.createDynamicMapserverStyle(attr, from, to, step), + ThemeUtil.createDynamicMapserverStyle(attr, from, to, step, context.getMeta()), context); } else { logger.warn("Cannot create WSPLGEN layer from: " + - wms.getClass()); + wms.getClass()); } } catch (IOException ioe) { @@ -225,9 +225,9 @@ if (wms instanceof WMSDBLayerFacet) { mfg.createDatabaseLayer( - flys, - (WMSDBLayerFacet) wms, - ThemeUtil.createMapserverStyle(attr)); + flys, + (WMSDBLayerFacet) wms, + ThemeUtil.createMapserverStyle(attr)); } else { logger.warn("Cannot create DB layer from: " + wms.getClass()); @@ -244,7 +244,7 @@ @Override public void generate() - throws IOException + throws IOException { logger.debug("MapGenerator.generate"); @@ -253,9 +253,9 @@ Document response = XMLUtils.newDocument(); ElementCreator c = new ElementCreator( - response, - ArtifactNamespaceContext.NAMESPACE_URI, - ArtifactNamespaceContext.NAMESPACE_PREFIX); + response, + ArtifactNamespaceContext.NAMESPACE_URI, + ArtifactNamespaceContext.NAMESPACE_PREFIX); Element root = c.create("floodmap"); Element layers = c.create("layers"); @@ -267,7 +267,7 @@ appendMapInformation(root, c); XMLUtils.toStream(response, out); - } + } protected void appendLayers(Element parent) { diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -31,7 +31,7 @@ * @author Ingo Weinzierl */ public class MiddleBedHeightGenerator -extends XYChartGenerator +extends XYChartGenerator implements FacetTypes { public enum YAXIS { @@ -148,7 +148,13 @@ * Get internationalized label for the y axis. */ protected String getHAxisLabel() { - return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); + D4EArtifact flys = (D4EArtifact) master; + + String unit = RiverUtils.getRiver(flys).getWstUnit().getName(); + + return msg(I18N_YAXIS_LABEL, + I18N_YAXIS_LABEL_DEFAULT, + new Object[] { unit }); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java Wed Jun 05 13:16:28 2013 +0200 @@ -26,6 +26,7 @@ import org.dive4elements.artifactdatabase.Backend; import org.dive4elements.artifactdatabase.Backend.PersistentArtifact; import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; +import org.dive4elements.artifactdatabase.state.Facet; import org.dive4elements.artifacts.Artifact; import org.dive4elements.artifacts.ArtifactDatabase; import org.dive4elements.artifacts.ArtifactDatabaseException; @@ -75,16 +76,11 @@ ThemeList themeList = new ThemeList(attributes); - int size = themeList.size(); - if (debug) { - log.debug("Output will contain " + size + " elements."); - } - List dataProviders = - doBlackboardPass(themeList, context); + doBlackboardPass(themeList, context, outName); try { - for (int i = 0; i < size; i++) { + for (int i = 0; i < themeList.size(); i++) { ManagedFacet theme = themeList.get(i); if (theme == null) { @@ -322,27 +318,40 @@ * @param context The "Blackboard". */ protected List doBlackboardPass( - ThemeList themeList, CallContext context + ThemeList themeList, CallContext context, String outname ) { ArrayList dataProviders = new ArrayList(); - int size = themeList.size(); try { // Collect all ArtifactAndFacets for blackboard pass. - for (int i = 0; i < size; i++) { + for (int i = 0; i < themeList.size(); i++) { + log.debug("BLackboard pass for: " + outname); ManagedFacet theme = themeList.get(i); if (theme == null) { log.warn("A ManagedFacet in ThemeList is null."); + themeList.remove(i); + i--; continue; } + String uuid = theme.getArtifact(); Artifact artifact = getArtifact(uuid, context); D4EArtifact flys = (D4EArtifact) artifact; + Facet face = flys.getNativeFacet(theme, outname); + log.debug("Looking for Native Facet for theme: " + theme + " and out: " + + outname + " in artifact: " + uuid + + face == null ? " Found. " : " Not Found. "); + if (face == null) { + log.warn("Theme " + theme.getName() + " for " + outname + " has no facets!. Removing theme."); + themeList.remove(i); + i--; + continue; + } ArtifactAndFacet artifactAndFacet = new ArtifactAndFacet( artifact, - flys.getNativeFacet(theme)); + face); // XXX HELP ME PLEASE artifactAndFacet.setFacetDescription(theme.getDescription()); @@ -515,6 +524,10 @@ return themes.get(idx); } + public void remove(int idx) { + themes.remove(idx); + } + public int size() { return themes.size(); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java Wed Jun 05 13:16:28 2013 +0200 @@ -346,7 +346,7 @@ new Object[] { RiverUtils.getRivername(flys) }) }); - RangeAccess rangeAccess = new RangeAccess(flys, null); + RangeAccess rangeAccess = new RangeAccess(flys); double[] kms = rangeAccess.getKmRange(); writer.writeNext(new String[] { Resources.getMsg( @@ -573,7 +573,7 @@ } else if (flys instanceof FixationArtifact) { // Get W/Q input per gauge for this case. - FixRealizingAccess fixAccess = new FixRealizingAccess(flys, getCallContext()); + FixRealizingAccess fixAccess = new FixRealizingAccess(flys); segments = fixAccess.getSegments(); if (segments != null && !segments.isEmpty()) { isFixRealize = true; @@ -772,7 +772,7 @@ source.addMetaData("date", df.format(new Date())); - RangeAccess rangeAccess = new RangeAccess(flys, null); + RangeAccess rangeAccess = new RangeAccess(flys); double[] kms = rangeAccess.getKmRange(); source.addMetaData("range", kms[0] + " - " + kms[kms.length-1]); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -159,7 +159,7 @@ @Override protected String getDefaultChartSubtitle() { - FixAnalysisAccess access = new FixAnalysisAccess(artifact, context); + FixAnalysisAccess access = new FixAnalysisAccess(artifact); DateRange dateRange = access.getDateRange(); DateRange refRange = access.getReferencePeriod(); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java Wed Jun 05 13:16:28 2013 +0200 @@ -62,7 +62,7 @@ logger.debug("No CalculationResult found for AT export."); return; } - FixAccess access = new FixAccess((D4EArtifact)this.master, context); + FixAccess access = new FixAccess((D4EArtifact)this.master); String f = access.getFunction(); if (f == null || f.length() == 0) { logger.debug("No function found for AT export."); @@ -80,7 +80,7 @@ Writer writer = new OutputStreamWriter(out, DEFAULT_CSV_CHARSET); - FixAccess access = new FixAccess((D4EArtifact)this.master, context); + FixAccess access = new FixAccess((D4EArtifact)this.master); FixATWriter atWriter = new FixATWriter(this.function, this.parameters); NodeList nodes = request.getElementsByTagName("km"); String km = nodes.item(0).getTextContent(); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -37,6 +37,7 @@ import org.jfree.chart.annotations.XYTextAnnotation; import org.jfree.data.time.Day; import org.jfree.data.time.RegularTimePeriod; +import org.jfree.data.time.FixedMillisecond; import org.jfree.data.time.TimeSeries; import org.jfree.data.time.TimeSeriesCollection; import org.w3c.dom.Document; @@ -118,7 +119,7 @@ @Override protected String getDefaultChartSubtitle() { - FixAnalysisAccess access = new FixAnalysisAccess(artifact, context); + FixAnalysisAccess access = new FixAnalysisAccess(artifact); DateRange dateRange = access.getDateRange(); DateRange refRange = access.getReferencePeriod(); return Resources.format( @@ -234,11 +235,11 @@ logger.debug("doReferencePeriodsOut()"); if (visible) { - FixAnalysisAccess access = new FixAnalysisAccess(artifact, context); + FixAnalysisAccess access = new FixAnalysisAccess(artifact); DateRange refRange = access.getReferencePeriod(); - RegularTimePeriod start = new Day(refRange.getFrom()); - RegularTimePeriod end = new Day(refRange.getTo()); + RegularTimePeriod start = new FixedMillisecond(refRange.getFrom()); + RegularTimePeriod end = new FixedMillisecond(refRange.getTo()); StyledDomainMarker marker = new StyledDomainMarker( start.getMiddleMillisecond(), end.getMiddleMillisecond(), @@ -264,7 +265,7 @@ if (qwd == null || qwd.qwd == null || qwd.dateRange == null) { return; } - RegularTimePeriod rtp = new Day(qwd.qwd.getDate()); + RegularTimePeriod rtp = new FixedMillisecond(qwd.qwd.getDate()); double value = qwd.qwd.getDeltaW(); // Draw a line spanning the analysis time. @@ -323,7 +324,7 @@ int idxInterpol = 0; int idxRegular = 0; - RegularTimePeriod rtp = new Day(qwd.getDate()); + RegularTimePeriod rtp = new FixedMillisecond(qwd.getDate()); double value = qwd.getDeltaW(); boolean interpolate = qwd.getInterpolated(); if (interpolate) { @@ -437,8 +438,8 @@ } for (int i = 0; i < ranges.length; i++) { logger.debug("creating domain marker"); - RegularTimePeriod start = new Day(ranges[i].getFrom()); - RegularTimePeriod end = new Day(ranges[i].getTo()); + RegularTimePeriod start = new FixedMillisecond(ranges[i].getFrom()); + RegularTimePeriod end = new FixedMillisecond(ranges[i].getTo()); StyledDomainMarker marker = new StyledDomainMarker(start.getMiddleMillisecond(), end.getMiddleMillisecond(), theme); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -554,7 +554,7 @@ @Override protected String getDefaultChartSubtitle() { - FixAnalysisAccess access = new FixAnalysisAccess(artifact, context); + FixAnalysisAccess access = new FixAnalysisAccess(artifact); DateRange dateRange = access.getDateRange(); DateRange refRange = access.getReferencePeriod(); @@ -586,7 +586,7 @@ StringBuilder buf = new StringBuilder(); // Add analysis periods as additional subtitle - FixAnalysisAccess access = new FixAnalysisAccess(artifact, context); + FixAnalysisAccess access = new FixAnalysisAccess(artifact); DateRange[] aperiods = access.getAnalysisPeriods(); buf.append(msg("fix.analysis.periods")); buf.append(": "); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDiffHeightYearGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDiffHeightYearGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDiffHeightYearGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -148,7 +148,9 @@ @Override protected String getDefaultXAxisLabel() { - return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); + return msg(I18N_XAXIS_LABEL, + I18N_XAXIS_LABEL_DEFAULT, + new Object[] { getRiverName() }); } @Override diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceEpochGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceEpochGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceEpochGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -29,6 +29,7 @@ import org.dive4elements.river.jfree.RiverAnnotation; import org.dive4elements.river.jfree.StyledXYSeries; import org.dive4elements.river.utils.DataUtil; +import org.dive4elements.river.utils.RiverUtils; public class BedDifferenceEpochGenerator @@ -113,13 +114,13 @@ } else if (getXBounds(0) == null && getDomainAxisRange() == null) { D4EArtifact artifact = (D4EArtifact)bundle.getArtifact(); - FlowVelocityAccess access = new FlowVelocityAccess(artifact, context); + FlowVelocityAccess access = new FlowVelocityAccess(artifact); context.putContextValue("startkm", access.getLowerKM()); context.putContextValue("endkm", access.getUpperKM()); } else if (getXBounds(0) == null && getDomainAxisRange() != null){ D4EArtifact artifact = (D4EArtifact)bundle.getArtifact(); - FlowVelocityAccess access = new FlowVelocityAccess(artifact, context); + FlowVelocityAccess access = new FlowVelocityAccess(artifact); Bounds b = new DoubleBounds(access.getLowerKM(), access.getUpperKM()); Bounds bounds = calculateZoom(b, getDomainAxisRange()); @@ -186,7 +187,9 @@ @Override protected String getDefaultXAxisLabel() { - return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); + return msg(I18N_XAXIS_LABEL, + I18N_XAXIS_LABEL_DEFAULT, + new Object[] {getRiverName()}); } @Override @@ -196,7 +199,11 @@ label = msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT); } else if (pos == YAXIS.H.idx) { - label = msg(I18N_SECOND_YAXIS_LABEL, I18N_SECOND_YAXIS_LABEL_DEFAULT); + D4EArtifact flys = (D4EArtifact) master; + label = msg(I18N_SECOND_YAXIS_LABEL, + I18N_SECOND_YAXIS_LABEL_DEFAULT, + new Object[] + { RiverUtils.getRiver(flys).getWstUnit().getName() }); } else if (pos == YAXIS.dW.idx) { return msg(I18N_DW_YAXIS_LABEL, I18N_DW_YAXIS_LABEL_DEFAULT); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceYearGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceYearGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceYearGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -14,6 +14,7 @@ import org.dive4elements.artifactdatabase.state.ArtifactAndFacet; import org.dive4elements.artifactdatabase.state.Facet; +import org.dive4elements.river.artifacts.D4EArtifact; import org.dive4elements.river.artifacts.model.FacetTypes; import org.dive4elements.river.artifacts.model.WKms; import org.dive4elements.river.artifacts.model.minfo.BedDiffYearResult; @@ -29,6 +30,7 @@ import org.dive4elements.river.jfree.RiverAnnotation; import org.dive4elements.river.jfree.StyledXYSeries; import org.dive4elements.river.utils.DataUtil; +import org.dive4elements.river.utils.RiverUtils; public class BedDifferenceYearGenerator @@ -232,7 +234,9 @@ @Override protected String getDefaultXAxisLabel() { - return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); + return msg(I18N_XAXIS_LABEL, + I18N_XAXIS_LABEL_DEFAULT, + new Object[] { getRiverName() }); } @Override @@ -245,7 +249,11 @@ label = msg(I18N_SECOND_YAXIS_LABEL, I18N_SECOND_YAXIS_LABEL_DEFAULT); } else if (pos == YAXIS.H.idx) { - label = msg(I18N_THIRD_YAXIS_LABEL, I18N_THIRD_YAXIS_LABEL_DEFAULT); + D4EArtifact flys = (D4EArtifact) master; + label = msg(I18N_THIRD_YAXIS_LABEL, + I18N_THIRD_YAXIS_LABEL_DEFAULT, + new Object[] + { RiverUtils.getRiver(flys).getWstUnit().getName() }); } else if (pos == YAXIS.dW.idx) { label = msg(I18N_DW_YAXIS_LABEL, I18N_DW_YAXIS_LABEL_DEFAULT); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -88,7 +88,9 @@ */ @Override protected String getDefaultXAxisLabel() { - return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT); + return msg(I18N_XAXIS_LABEL, + I18N_XAXIS_LABEL_DEFAULT, + new Object[] {getRiverName()}); } @Override diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java Wed Jun 05 13:16:28 2013 +0200 @@ -119,20 +119,20 @@ } else if (getXBounds(0) == null && getDomainAxisRange() == null) { D4EArtifact artifact = (D4EArtifact)bundle.getArtifact(); - RangeAccess access = new RangeAccess(artifact, context); + RangeAccess access = new RangeAccess(artifact); context.putContextValue("startkm", access.getFrom()); context.putContextValue("endkm", access.getTo()); } else if (getXBounds(0) == null && getDomainAxisRange() != null){ D4EArtifact artifact = (D4EArtifact)bundle.getArtifact(); - RangeAccess access = new RangeAccess(artifact, context); + RangeAccess access = new RangeAccess(artifact); Bounds b = new DoubleBounds(access.getFrom(), access.getTo()); Bounds bounds = calculateZoom(b, getDomainAxisRange()); context.putContextValue("startkm", bounds.getLower()); context.putContextValue("endkm", bounds.getUpper()); } - if (FacetTypes.IS.SEDIMENT_LOAD(SEDIMENT_LOAD_COARSE)) { + if (FacetTypes.IS.SEDIMENT_LOAD(name)) { doSedimentLoadOut( (double[][]) bundle.getData(context), bundle, @@ -226,7 +226,7 @@ protected String getDefaultYAxisLabel(int pos) { String label = "default"; if (pos == YAXIS.L.idx) { - SedimentLoadAccess access = new SedimentLoadAccess(artifact, context); + SedimentLoadAccess access = new SedimentLoadAccess(artifact); if (access.getUnit().equals("m3_per_a")) { label = msg(I18N_YAXIS_LABEL_2, I18N_YAXIS_LABEL_DEFAULT_2); } diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java --- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java Wed Jun 05 13:16:28 2013 +0200 @@ -11,21 +11,43 @@ import java.io.OutputStream; import java.util.ArrayList; import java.util.List; +import java.util.Map; +import java.util.HashMap; +import java.util.Date; +import java.util.Locale; +import java.text.DateFormat; import org.w3c.dom.Document; +import net.sf.jasperreports.engine.JasperExportManager; +import net.sf.jasperreports.engine.JasperFillManager; +import net.sf.jasperreports.engine.JasperPrint; +import net.sf.jasperreports.engine.JRException; + import au.com.bytecode.opencsv.CSVWriter; import org.dive4elements.artifacts.CallContext; +import org.dive4elements.artifacts.CallMeta; import org.dive4elements.river.artifacts.model.CalculationResult; - import org.dive4elements.river.artifacts.model.sq.SQFractionResult; import org.dive4elements.river.artifacts.model.sq.SQResult; +import org.dive4elements.river.artifacts.model.sq.SQRelationJRDataSource; import org.dive4elements.river.artifacts.model.Parameters; +import org.dive4elements.river.artifacts.model.DateRange; +import org.dive4elements.river.artifacts.access.SQRelationAccess; + +import org.dive4elements.river.artifacts.resources.Resources; + +import org.dive4elements.river.artifacts.D4EArtifact; import org.dive4elements.river.exports.AbstractExporter; +import org.dive4elements.river.utils.RiverUtils; +import org.dive4elements.river.utils.Formatter; + +import org.dive4elements.artifacts.common.utils.Config; + import org.apache.log4j.Logger; /** @@ -80,6 +102,14 @@ public static final String CSV_VARIANCE = "export.sqrelation.csv.header.variance"; + public static final String PDF_TITLE= + "export.sqrelation.pdf.title"; + + public static final String PDF_HEADER_MODE = + "export.sqrelation.pdf.mode"; + + public static final String JASPER_FILE = + "export.sqrelation.pdf.file"; protected List data; @@ -120,16 +150,14 @@ for (SQResult [] results: data) { for (SQResult result: results) { - data2CSV(writer, result); + writer.writeAll(data2StringArrays(result)); } } } - protected void data2CSV(CSVWriter writer, SQResult result) { - logger.debug("data2CSV"); - - // TODO: i18n + protected List data2StringArrays(SQResult result) { String km = String.valueOf(result.getKm()); + List retval = new ArrayList(); for (int i = 0; i < SQResult.NUMBER_FRACTIONS; ++i) { SQFractionResult fraction = result.getFraction(i); @@ -142,29 +170,97 @@ continue; } - double a = parameters.getValue(0, "a"); - double b = parameters.getValue(0, "b"); - double sd = Math.sqrt(parameters.getValue(0, "std_dev")); - int o = fraction.totalNumOutliers(); - int t = fraction.numMeasurements() + o; + String a, b, sd, o, t; + a = Formatter.getSQRelation(context).format(parameters.getValue(0, "a")); + b = Formatter.getSQRelation(context).format(parameters.getValue(0, "b")); + sd = Formatter.getVariance(context).format(Math.sqrt(parameters.getValue(0, "std_dev"))); - writer.writeNext(new String[] { + o = String.valueOf(fraction.totalNumOutliers()); + t = String.valueOf(fraction.numMeasurements() + o); + + retval.add(new String[] { km, name, - String.valueOf(a), - String.valueOf(b), - String.valueOf(t), - String.valueOf(o), - String.valueOf(sd) + a, + b, + t, + o, + sd }); } + return retval; } + protected SQRelationJRDataSource createJRData() { + SQRelationJRDataSource source = new SQRelationJRDataSource(); + + addMetaData(source); + for (SQResult [] results: data) { + for (SQResult result: results) { + for (String[] res: data2StringArrays(result)) { + source.addData(res); + } + } + } + return source; + } + + protected void addMetaData(SQRelationJRDataSource source) { + CallMeta meta = context.getMeta(); + + D4EArtifact arti = (D4EArtifact) master; + + source.addMetaData ("river", RiverUtils.getRivername(arti)); + + Locale locale = Resources.getLocale(meta); + DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale); + + source.addMetaData("date", df.format(new Date())); + + SQRelationAccess access = new SQRelationAccess(arti); + source.addMetaData("location", "KM " + getKmFormatter().format(access.getLocation())); + + DateRange period = access.getPeriod(); + source.addMetaData("periods", df.format(period.getFrom()) + " - " + + df.format(period.getTo())); + + source.addMetaData("outliertest", Resources.getMsg(meta, + access.getOutlierMethod(), + access.getOutlierMethod())); + source.addMetaData("outliers", access.getOutliers().toString()); + + source.addMetaData("calculation", Resources.getMsg( + locale, + PDF_HEADER_MODE, + "SQRelation")); + } + @Override protected void writePDF(OutputStream out) { - logger.debug("writePDF"); - logger.error("NOT IMPLEMENTED: writePDF"); + logger.debug("write PDF"); + SQRelationJRDataSource source = createJRData(); + + String jasperFile = Resources.getMsg( + context.getMeta(), + JASPER_FILE, + "/jasper/sqrelation_en.jasper"); + String confPath = Config.getConfigDirectory().toString(); + + + Map parameters = new HashMap(); + parameters.put("ReportTitle", Resources.getMsg( + context.getMeta(), PDF_TITLE, "Exported Data")); + try { + JasperPrint print = JasperFillManager.fillReport( + confPath + jasperFile, + parameters, + source); + JasperExportManager.exportReportToPdfStream(print, out); + } + catch(JRException je) { + logger.warn("Error generating PDF Report!", je); + } } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java Wed Jun 05 13:16:28 2013 +0200 @@ -11,6 +11,7 @@ import java.text.DateFormat; import java.text.NumberFormat; import java.text.SimpleDateFormat; +import java.text.DecimalFormat; import java.util.Locale; import org.dive4elements.artifacts.CallContext; @@ -87,6 +88,12 @@ public static final int FIX_DELTA_W_DELTA_Q_MIN_DIGITS = 0; public static final int FIX_DELTA_W_DELTA_Q_MAX_DIGITS = 2; + public static final int VARIANCE_MIN_DIGITS = 0; + public static final int VARIANCE_MAX_DIGITS = 4; + + // SQ Relation + public static final int SQ_RELATION_MAX_DIGITS = 8; + public static final int SQ_RELATION_MIN_DIGITS = 0; /** * Creates a localized NumberFormatter with given range of decimal digits. @@ -106,7 +113,6 @@ return nf; } - public static NumberFormat getFormatter(CallContext c, int min, int max){ return getFormatter(c.getMeta(), min, max); } @@ -124,6 +130,32 @@ return NumberFormat.getInstance(locale); } + /** + * Returns a formatter in engineering notation + */ + public static NumberFormat getEngFormatter(CallContext c) { + NumberFormat nf = getRawFormatter(c); + if (nf instanceof DecimalFormat) { + DecimalFormat df = (DecimalFormat)nf; + df.applyPattern("##0.#####E0"); + } + return nf; + } + + /** + * Returns a number formatter that uses an exponent after max digits + */ + public static NumberFormat getScientificFormater(CallContext c, int min, int max) { + NumberFormat nf = getRawFormatter(c); + if (nf instanceof DecimalFormat) { + DecimalFormat df = (DecimalFormat)nf; + df.applyPattern("0.0E0"); + df.setMaximumFractionDigits(max); + df.setMinimumFractionDigits(min); + } + return nf; + } + /** * Returns a date formatter with SHORT style. @@ -398,6 +430,21 @@ FIX_DELTA_W_DELTA_W_MAX_DIGITS); } + public static NumberFormat getVariance(CallContext context) { + return getFormatter( + context, + VARIANCE_MIN_DIGITS, + VARIANCE_MAX_DIGITS); + } + + public static NumberFormat getSQRelation(CallContext context) { + // Would be nice if E0 would not be shown + return getScientificFormater( + context, + SQ_RELATION_MIN_DIGITS, + SQ_RELATION_MAX_DIGITS); + } + public static NumberFormat getMeterFormat(CallContext context) { return getFormatter( context, diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java Wed Jun 05 13:16:28 2013 +0200 @@ -459,7 +459,7 @@ return null; } - RangeAccess rangeAccess = new RangeAccess(flys, null); + RangeAccess rangeAccess = new RangeAccess(flys); double[] dist = rangeAccess.getKmRange(); if (dist == null) { @@ -915,7 +915,7 @@ return null; } - RangeAccess rangeAccess = new RangeAccess(flys, null); + RangeAccess rangeAccess = new RangeAccess(flys); double[] dist = rangeAccess.getKmRange(); if (dist == null) { logger.debug("getGauges: no dist!"); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java --- a/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java Wed Jun 05 13:16:28 2013 +0200 @@ -8,15 +8,19 @@ package org.dive4elements.river.utils; +import org.dive4elements.artifacts.CallMeta; import org.dive4elements.artifacts.common.utils.XMLUtils; import org.dive4elements.river.artifacts.model.MapserverStyle; import org.dive4elements.river.artifacts.model.MapserverStyle.Clazz; import org.dive4elements.river.artifacts.model.MapserverStyle.Expression; import org.dive4elements.river.artifacts.model.MapserverStyle.Label; import org.dive4elements.river.artifacts.model.MapserverStyle.Style; +import org.dive4elements.river.artifacts.resources.Resources; import java.awt.Color; import java.awt.Font; +import java.text.NumberFormat; +import java.util.Locale; import org.apache.log4j.Logger; import org.w3c.dom.Document; @@ -669,7 +673,7 @@ * @return String representation of the MapserverStyle */ public static String createDynamicMapserverStyle(Document theme, - float from, float to, float step) + float from, float to, float step, CallMeta meta) { MapserverStyle ms = new MapserverStyle(); @@ -700,9 +704,10 @@ newColor.append(' '); newColor.append(startColor.getBlue() + Math.round(n * bd)); - String expr = createWSPLGENExpression(from + n * step, step, n + 1, numClasses); + String expr = createWSPLGENClassExpression(from + n * step, step, n + 1, numClasses); + String name = createWSPLGENClassName(from + n * step, step, n + 1, numClasses, meta); - Clazz c = new Clazz(expr); + Clazz c = new Clazz(name); Style s = new Style(); s.setColor(newColor.toString()); s.setSize(5); @@ -717,7 +722,7 @@ } - protected static String createWSPLGENExpression(float val, float step, int idx, int maxIdx) { + protected static String createWSPLGENClassExpression(float val, float step, int idx, int maxIdx) { if (idx < maxIdx) { return "[DIFF] >= " + val + " AND [DIFF] < " + (val + step); } @@ -726,6 +731,23 @@ } } + // FIXME: i18n + protected static String createWSPLGENClassName(float val, float step, int idx, int maxIdx, CallMeta meta) { + Locale locale = Resources.getLocale(meta); + NumberFormat nf = NumberFormat.getInstance(locale); + if (idx < maxIdx) { + return "[Differenz] >= " + + nf.format(val) + + " m UND [Differenz] < " + + nf.format(val + step) + + " m"; + } + else { + return "[Differenz] >= " + + nf.format(val) + " m"; + } + } + public static String createMapserverStyle(Document theme) { String symbol = getSymbol(theme); diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java --- a/artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java Wed Jun 05 13:16:28 2013 +0200 @@ -85,7 +85,7 @@ protected Envelope getWSPLGENBounds() { String river = getRiver(); - RangeAccess rangeAccess = new RangeAccess(artifact, null); + RangeAccess rangeAccess = new RangeAccess(artifact); double kms[] = rangeAccess.getKmRange(); logger.debug("### getWSPLGENBounds"); @@ -123,7 +123,7 @@ public void createWSPLGENFacet() { String river = getRiver(); - RangeAccess rangeAccess = new RangeAccess(artifact, null); + RangeAccess rangeAccess = new RangeAccess(artifact); double kms[] = rangeAccess.getKmRange(); WSPLGENLayerFacet wsplgen = new WSPLGENLayerFacet( diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/resources/messages.properties --- a/artifacts/src/main/resources/messages.properties Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/resources/messages.properties Wed Jun 05 13:16:28 2013 +0200 @@ -209,13 +209,13 @@ chart.fixings.analysis.title = Longitudinal section at km {0} chart.bedquality.title=Bed Longitudinal Section -chart.bedquality.xaxis.label=River-Km +chart.bedquality.xaxis.label={0}-km chart.bedquality.yaxis.label=Diameter [mm] chart.bedquality.yaxis.label.porosity=Porosity [%] chart.bedquality.yaxis.label.density=Density [t/m\u00b3] chart.bedheight_middle.section.title=Middle Bed Height -chart.bedheight_middle.section.yaxis.label=middle Bed Height [mm a NN] +chart.bedheight_middle.section.yaxis.label=middle Bed Height [{0}] chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung chart.flow_velocity.section.yaxis.label=Speed v [m/s] @@ -300,15 +300,15 @@ facet.morphologic.width = morphologic Width chart.beddifference.height.title = Bedheight Difference -chart.beddifference.height.xaxis.label = River-Km [km] +chart.beddifference.height.xaxis.label = {0}-km chart.beddifference.height.yaxis.label = Difference [cm/year] chart.beddifference.epoch.title = Bedheight Difference -chart.beddifference.xaxis.label = River-Km [km] +chart.beddifference.xaxis.label = {0}-km chart.beddifference.yaxis.label.diff = Difference [m] -chart.beddifference.yaxis.label.height = Absolute Height [m] +chart.beddifference.yaxis.label.height = Absolute Height [{0}] chart.beddifference.year.title = Bedheight Difference chart.beddifference.yaxis.label.morph = Width [m] -chart.beddifference.yaxis.label.heights = Absolute Height [m] +chart.beddifference.yaxis.label.heights = Absolute Height [{0}] export.waterlevel.csv.header.km = River-Km @@ -390,6 +390,8 @@ export.sqrelation.csv.header.c.duan = C (DUAN) export.sqrelation.csv.header.c.ferguson = C (FERGUSON) export.sqrelation.csv.header.variance = Standard variance +export.sqrelation.pdf.file = /jasper/sqrelation_en.jasper +export.sqrelation.pdf.mode = Load Discharge Relation export.minfo.bedquality.km = km export.minfo.bedquality.density_cap = Density Toplayer export.minfo.bedquality.density_sub = Density Sublayer @@ -616,6 +618,11 @@ gauge.discharge.service.chart.series.title = Discharge Curve {0,date,short} - {1,date,short} gauge.discharge.service.chart.series.title.master = Current Discharge Curve since {0,date,short} +bed.km.chart.label = Sedimentdata +bed.km.chart.title = Sedimentdata SedDB +bedload.km.chart.label = Geschiebedaten +bedload.km.chart.title = Geschiebedatenbestand SedDB + help.state.fix.river=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.river help.state.fix.calculation.mode=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.calculation.mode help.state.fix.location=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.location diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/resources/messages_de.properties --- a/artifacts/src/main/resources/messages_de.properties Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/resources/messages_de.properties Wed Jun 05 13:16:28 2013 +0200 @@ -210,13 +210,13 @@ chart.w_differences.yaxis.second.label = W [NN + m] chart.bedquality.title=Sohlen L\u00e4ngsschnitt -chart.bedquality.xaxis.label=Fluss-Km +chart.bedquality.xaxis.label={0}-km chart.bedquality.yaxis.label=Durchmesser [mm] chart.bedquality.yaxis.label.porosity=Porosit\u00e4t [%] chart.bedquality.yaxis.label.density=Dichte [t/m\u00b3] chart.bedheight_middle.section.title=Mittlere Sohlh\u00f6he -chart.bedheight_middle.section.yaxis.label=mittlere Sohlh\u00f6hen [mm\u00fcNN] +chart.bedheight_middle.section.yaxis.label=mittlere Sohlh\u00f6hen [{0}] chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung chart.flow_velocity.section.yaxis.label=Geschwindigkeit v [m/s] @@ -301,10 +301,10 @@ facet.morphologic.width = Morphologische Breite chart.beddifference.height.title = Sohlh\u00f6hendifferenz -chart.beddifference.height.xaxis.label = Fluss-Km [km] +chart.beddifference.height.xaxis.label = {0}-km chart.beddifference.height.yaxis.label = Differenz [cm/Jahr] chart.beddifference.epoch.title = Sohlh\u00f6hendifferenz -chart.beddifference.xaxis.label = Fluss-Km [km] +chart.beddifference.xaxis.label = {0}-km chart.beddifference.yaxis.label.diff = Differenz [m] chart.beddifference.yaxis.label.height = Absolute H\u00f6he [m] chart.beddifference.year.title = Sohlh\u00f6hendifferenz @@ -391,6 +391,8 @@ export.sqrelation.csv.header.c.duan = C (DUAN) export.sqrelation.csv.header.c.ferguson = C (FERGUSON) export.sqrelation.csv.header.variance = Standardabweichung +export.sqrelation.pdf.file = /jasper/sqrelation.jasper +export.sqrelation.pdf.mode = Transport-Abfluss Beziehung export.minfo.bedquality.km = km export.minfo.bedquality.density_cap = Sedimentdichte Deckschicht export.minfo.bedquality.density_sub = Sedimentdichte Unterschicht @@ -402,7 +404,7 @@ floodmap.wmsbackground = Hintergrundkarte floodmap.riveraxis = Flussachse -floodmap.uesk = \u00dcsg: {0}-km {1,number,####} - {2,number,####} +floodmap.uesk = \u00dcSG: {0}-km {1,number,####} - {2,number,####} floodmap.barriers = Digitalisierte Objekte floodmap.kms = Kilometrierung floodmap.qps = Querprofilspuren @@ -619,6 +621,11 @@ gauge.discharge.service.chart.series.title = Abflusskurve {0,date,short} - {1,date,short} gauge.discharge.service.chart.series.title.master = Aktuelle Abflusskurve ab {0,date,short} +bed.km.chart.label = Sohldaten +bed.km.chart.title = Sohldatenbestand SedDB +bedload.km.chart.label = Geschiebedaten +bedload.km.chart.title = Geschiebedatenbestand SedDB + help.state.fix.river=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.river help.state.fix.calculation.mode=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.calculation.mode help.state.fix.location=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.location diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/resources/messages_de_DE.properties --- a/artifacts/src/main/resources/messages_de_DE.properties Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/resources/messages_de_DE.properties Wed Jun 05 13:16:28 2013 +0200 @@ -207,13 +207,13 @@ chart.w_differences.yaxis.second.label = W [NN + m] chart.bedquality.title=Sohlen L\u00e4ngsschnitt -chart.bedquality.xaxis.label=Fluss-Km +chart.bedquality.xaxis.label={0}-km chart.bedquality.yaxis.label=Durchmesser [mm] chart.bedquality.yaxis.label.porosity=Porosit\u00e4t [%] chart.bedquality.yaxis.label.density=Dichte [t/m\u00b3] chart.bedheight_middle.section.title=Mittlere Sohlh\u00f6he -chart.bedheight_middle.section.yaxis.label=mittlere Sohlh\u00f6hen [mm\u00fcNN] +chart.bedheight_middle.section.yaxis.label=mittlere Sohlh\u00f6hen [{0}] chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung chart.flow_velocity.section.yaxis.label=Geschwindigkeit v [m/s] @@ -298,15 +298,15 @@ facet.morphologic.width = Morphologische Breite chart.beddifference.height.title = Sohlh\u00f6hendifferenz -chart.beddifference.height.xaxis.label = Fluss-Km [km] +chart.beddifference.height.xaxis.label = {0}-km chart.beddifference.height.yaxis.label = Differenz [cm/Jahr] chart.beddifference.epoch.title = Sohlh\u00f6hendifferenz -chart.beddifference.xaxis.label = Fluss-Km [km] +chart.beddifference.xaxis.label = {0}-km chart.beddifference.yaxis.label.diff = Differenz [m] -chart.beddifference.yaxis.label.height = Absolute H\u00f6he [m] +chart.beddifference.yaxis.label.height = Absolute H\u00f6he [{0}] chart.beddifference.year.title = Sohlh\u00f6hendifferenz chart.beddifference.yaxis.label.morph = Breite [m] -chart.beddifference.yaxis.label.heights = Absolute H\u00f6he [m] +chart.beddifference.yaxis.label.heights = Absolute H\u00f6he [{0}] export.waterlevel.csv.header.km = Fluss-Km export.waterlevel.csv.header.w = W [{0}] @@ -387,6 +387,8 @@ export.sqrelation.csv.header.c.duan = C (DUAN) export.sqrelation.csv.header.c.ferguson = C (FERGUSON) export.sqrelation.csv.header.variance = Standardabweichung +export.sqrelation.pdf.file = /jasper/sqrelation.jasper +export.sqrelation.pdf.mode = Transport-Abfluss Beziehung export.minfo.bedquality.km = km export.minfo.bedquality.density_cap = Sedimentdichte Deckschicht export.minfo.bedquality.density_sub = Sedimentdichte Unterschicht @@ -398,7 +400,7 @@ floodmap.wmsbackground = Hintergrundkarte floodmap.riveraxis = Flussachse -floodmap.uesk = \u00dcsg: {0}-km {1,number,####} - {2,number,####} +floodmap.uesk = \u00dcSG: {0}-km {1,number,####} - {2,number,####} floodmap.barriers = Digitalisierte Objekte floodmap.kms = Kilometrierung floodmap.qps = Querprofilspuren @@ -617,6 +619,11 @@ gauge.discharge.service.chart.series.title = Abflusskurve {0,date,short} - {1,date,short} gauge.discharge.service.chart.series.title.master = Aktuelle Abflusskurve ab {0,date,short} +bed.km.chart.label = Sohldaten +bed.km.chart.title = Sohldatenbestand SedDB +bedload.km.chart.label = Geschiebedaten +bedload.km.chart.title = Geschiebedatenbestand SedDB + help.state.fix.river=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.river help.state.fix.calculation.mode=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.calculation.mode help.state.fix.location=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.location diff -r dc166b225775 -r 1298c1c2dadf artifacts/src/main/resources/messages_en.properties --- a/artifacts/src/main/resources/messages_en.properties Fri May 24 16:26:41 2013 +0200 +++ b/artifacts/src/main/resources/messages_en.properties Wed Jun 05 13:16:28 2013 +0200 @@ -211,13 +211,13 @@ chart.w_differences.yaxis.second.label = W [NN + m] chart.bedquality.title=Bed Longitudinal Section -chart.bedquality.xaxis.label=River-Km +chart.bedquality.xaxis.label={0}-km chart.bedquality.yaxis.label=Diameter [mm] chart.bedquality.yaxis.label.porosity=Porosity [%] chart.bedquality.yaxis.label.density=Density [t/m\u00b3] chart.bedheight_middle.section.title=Middle Bed Height -chart.bedheight_middle.section.yaxis.label=middle Bed Height [mm a NN] +chart.bedheight_middle.section.yaxis.label=middle Bed Height [{0}] chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung chart.flow_velocity.section.yaxis.label=Speed v [m/s] @@ -303,10 +303,10 @@ facet.morphologic.width = morphologic Width chart.beddifference.height.title = Bedheight Difference -chart.beddifference.height.xaxis.label = River-Km [km] +chart.beddifference.height.xaxis.label = {0}-km chart.beddifference.height.yaxis.label = Difference [cm/year] chart.beddifference.epoch.title = Bedheight Difference -chart.beddifference.xaxis.label = River-Km [km] +chart.beddifference.xaxis.label = {0}-km chart.beddifference.yaxis.label.diff = Difference [m] chart.beddifference.yaxis.label.height = Absolute Height [m] chart.beddifference.year.title = Bedheight Difference @@ -392,6 +392,8 @@ export.sqrelation.csv.header.c.duan = C (DUAN) export.sqrelation.csv.header.c.ferguson = C (FERGUSON) export.sqrelation.csv.header.variance = Standard variance +export.sqrelation.pdf.file = /jasper/sqrelation_en.jasper +export.sqrelation.pdf.mode = Load Discharge Relation export.minfo.bedquality.km = km export.minfo.bedquality.density_cap = Density Toplayer export.minfo.bedquality.density_sub = Density Sublayer @@ -617,6 +619,11 @@ gauge.discharge.service.chart.series.title = Discharge Curve {0,date,short} - {1,date,short} gauge.discharge.service.chart.series.title.master = Current Discharge Curve since {0,date,short} +bed.km.chart.label = Sedimentdata +bed.km.chart.title = Sedimentdata SedDB +bedload.km.chart.label = Geschiebedaten +bedload.km.chart.title = Geschiebedatenbestand SedDB + help.state.fix.river=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.river help.state.fix.calculation.mode=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.calculation.mode help.state.fix.location=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.location diff -r dc166b225775 -r 1298c1c2dadf backend/doc/schema/oracle.sql --- a/backend/doc/schema/oracle.sql Fri May 24 16:26:41 2013 +0200 +++ b/backend/doc/schema/oracle.sql Wed Jun 05 13:16:28 2013 +0200 @@ -54,7 +54,6 @@ y NUMBER(38,2) NOT NULL, cross_section_line_id NUMBER(38,0) NOT NULL, PRIMARY KEY (id), - UNIQUE (cross_section_line_id, col_pos) ); @@ -430,7 +429,7 @@ JOIN ranges r ON wqr.range_id=r.id JOIN wst_column_values wcv - ON wcv.wst_column_id=wc.id AND wcv.position between r.a and r.b; + ON wcv.wst_column_id=wc.id AND wcv.position between r.a and r.b ORDER BY wcv.position ASC, wc.position DESC; diff -r dc166b225775 -r 1298c1c2dadf backend/doc/schema/postgresql.sql --- a/backend/doc/schema/postgresql.sql Fri May 24 16:26:41 2013 +0200 +++ b/backend/doc/schema/postgresql.sql Wed Jun 05 13:16:28 2013 +0200 @@ -259,7 +259,7 @@ JOIN ranges r ON wqr.range_id=r.id JOIN wst_column_values wcv - ON wcv.wst_column_id=wc.id AND wcv.position between r.a and r.b; + ON wcv.wst_column_id=wc.id AND wcv.position between r.a and r.b ORDER BY wcv.position ASC, wc.position DESC; @@ -315,7 +315,6 @@ col_pos int NOT NULL, x NUMERIC NOT NULL, y NUMERIC NOT NULL, - UNIQUE (cross_section_line_id, col_pos) ); -- Indices for faster access of the points diff -r dc166b225775 -r 1298c1c2dadf backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java --- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java Fri May 24 16:26:41 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java Wed Jun 05 13:16:28 2013 +0200 @@ -113,7 +113,7 @@ public void parse(File file) throws IOException { log.info("Parsing bed height single file '" + file + "'"); - ImportBedHeight obj = newImportBedHeight(file.getName()); + ImportBedHeight obj = newImportBedHeight(file.getName().replaceAll("\\.csv", "")); LineNumberReader in = null; try { diff -r dc166b225775 -r 1298c1c2dadf backend/src/main/java/org/dive4elements/river/model/FlowVelocityModelValue.java --- a/backend/src/main/java/org/dive4elements/river/model/FlowVelocityModelValue.java Fri May 24 16:26:41 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/model/FlowVelocityModelValue.java Wed Jun 05 13:16:28 2013 +0200 @@ -154,7 +154,8 @@ "from FlowVelocityModelValue where " + " flowVelocity=:model and" + " station >= :kmLo and " + - " station <= :kmHi"); + " station <= :kmHi" + + " order by station"); query.setParameter("model", model); query.setParameter("kmLo", new BigDecimal(kmLo)); diff -r dc166b225775 -r 1298c1c2dadf backend/src/main/java/org/dive4elements/river/model/River.java --- a/backend/src/main/java/org/dive4elements/river/model/River.java Fri May 24 16:26:41 2013 +0200 +++ b/backend/src/main/java/org/dive4elements/river/model/River.java Wed Jun 05 13:16:28 2013 +0200 @@ -290,19 +290,36 @@ /** * This method returns the first gauge that is intersected by a and - * b, + * b, but which possibly does not ends with a or starts with b. * * @param a A start point. * @param b An end point. * - * @return the first intersecting gauge. + * @return the first intersecting gauge that does not border with a or b, + * the first intersecting gauge if that is impossible. */ public Gauge determineGauge(double a, double b) { List gauges = determineGauges(a, b); int idx = a < b ? 0 : gauges.size() - 1; - return gauges.isEmpty() ? null : gauges.get(idx); + if (a > b) { + for (int i = gauges.size() - 1; i >= 0; i--) { + Gauge g = gauges.get(i); + if (g.getRange().getA().doubleValue() == b) + continue; + return g; + } + } + + for (Gauge g: gauges) { + if ( g.getRange().getB().doubleValue() == a ) { + continue; + } + return g; + } + + return null; } /** diff -r dc166b225775 -r 1298c1c2dadf contrib/make_flys_release/README --- a/contrib/make_flys_release/README Fri May 24 16:26:41 2013 +0200 +++ b/contrib/make_flys_release/README Wed Jun 05 13:16:28 2013 +0200 @@ -27,6 +27,8 @@ BACKENDUSER BACKENDPASS +FEATURES_XML (Wenn gesetzt pfad zu einer zu verwendenden features.xml) + Prozess: ======== Als erstes muss man eine halbwegs aktuelle version von artifacts-common diff -r dc166b225775 -r 1298c1c2dadf contrib/make_flys_release/make_release.sh --- a/contrib/make_flys_release/make_release.sh Fri May 24 16:26:41 2013 +0200 +++ b/contrib/make_flys_release/make_release.sh Wed Jun 05 13:16:28 2013 +0200 @@ -199,6 +199,10 @@ sed -i -e "s@/tmp/flys-client.log@${LOG_DIR}/client-${VERSION}.log@g" \ $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/log4j.properties +if [ -r "$FEATURES_XML" ]; then + cp "$FEATURES_XML" $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/features.xml +fi + # XXX: Are they really used at runtime? find $FLYS_SOURCE_DIR/river/ -name \*.properties -o -name \*.xsl | \ xargs sed -i "s@https://flys-intern.intevation.de@${WIKI_URL}@g"; diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java Wed Jun 05 13:16:28 2013 +0200 @@ -284,6 +284,7 @@ public void onSuccess(River[] newRivers) { GWT.log("Retrieved " + newRivers.length + " new rivers."); rivers = newRivers; + newProject(); } }); } diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java Wed Jun 05 13:16:28 2013 +0200 @@ -604,6 +604,8 @@ String bed_difference_height_year(); + String fix_waterlevel_export(); + // ERRORS String error_years_wrong(); diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties Wed Jun 05 13:16:28 2013 +0200 @@ -280,6 +280,7 @@ eventselect = Eventselection events = Events kmchart = W/Q-Preview +fix_waterlevel_export = Fixing analysis export chart_themepanel_header_themes = Theme chart_themepanel_header_actions = Actions diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties Wed Jun 05 13:16:28 2013 +0200 @@ -278,6 +278,7 @@ eventselect = Ereignisauswahl events = Ereignisse kmchart = W/Q-Vorschau +fix_waterlevel_export = Fixierungsanalysen Export exportATTooltip = Daten als AT Datei exportieren diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties Wed Jun 05 13:16:28 2013 +0200 @@ -278,6 +278,7 @@ eventselect = Eventselection events = Events kmchart = W/Q-Preview +fix_waterlevel_export = Fixing analysis export chart_themepanel_header_themes = Theme chart_themepanel_header_actions = Actions diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWidget.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWidget.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWidget.java Wed Jun 05 13:16:28 2013 +0200 @@ -381,6 +381,7 @@ String name = node.getAttribute("facet"); String ids = node.getAttribute("ids"); String displayname = node.getAttribute("name"); + String targetOut = node.getAttribute("target_out"); String debugAttributeValues = ""; for (String attr: node.getAttributes()) { debugAttributeValues += ("[" + attr +": " @@ -394,7 +395,8 @@ out, name, ids, - displayname); + displayname, + targetOut); } TreeNode [] children = tree.getChildren(node); if (children != null) { diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java Wed Jun 05 13:16:28 2013 +0200 @@ -46,12 +46,6 @@ @Override - public User getUser() { - return null; - } - - - @Override public String getOuts() { return OUT; } diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LinkSelection.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LinkSelection.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LinkSelection.java Wed Jun 05 13:16:28 2013 +0200 @@ -16,7 +16,10 @@ import com.smartgwt.client.types.VerticalAlignment; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.HTMLPane; +import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.Label; +import com.smartgwt.client.widgets.events.VisibilityChangedEvent; +import com.smartgwt.client.widgets.events.VisibilityChangedHandler; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.LinkItem; import com.smartgwt.client.widgets.form.fields.events.ClickEvent; @@ -42,6 +45,7 @@ */ public class LinkSelection extends MapSelection +implements VisibilityChangedHandler { private static final long serialVersionUID = -7138270638349711024L; @@ -51,7 +55,9 @@ /** The selected river*/ protected Data river; - private static Map rivers; + private static Map riverHighlight; + private static Map riverList; + private static String selected; private static HLayout columns; private static Trigger trigger; @@ -95,7 +101,8 @@ public Canvas create(DataList data) { trigger = new Trigger(this); createCallback(); - rivers = new HashMap(); + riverHighlight = new HashMap(); + riverList = new HashMap(); VLayout v = new VLayout(); v.setMembersMargin(10); @@ -182,22 +189,37 @@ int counter = 0; for (DataItem item: d.getItems()) { + HLayout row = new HLayout(); LinkItem link = new LinkItem("river"); + link.setHoverDelay(0); link.setLinkTitle(item.getLabel()); link.setTarget(item.getStringValue()); link.setShowTitle(false); + Img img = new Img(); + img.setShowTitle(false); + img.setSrc("symbol_selected.png"); + img.setWidth(18); + img.setHeight(18); + img.setVisible(false); + Canvas container = new Canvas(); + container.addChild(img); + container.setHeight(20); + container.setWidth(20); DynamicForm f = new DynamicForm(); - rivers.put(item.getStringValue(), link); - + riverList.put(item.getStringValue(), row); + riverHighlight.put(item.getStringValue(), img); f.setItems(link); + row.addMember(container); + row.addMember(f); + row.addVisibilityChangedHandler(this); + link.setColSpan(20); if (counter < d.getItems().length/2) { - formLayout1.addMember(f); + formLayout1.addMember(row); } else { - formLayout2.addMember(f); + formLayout2.addMember(row); } counter++; - link.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { @@ -218,27 +240,22 @@ @Override public void onItemHover(ItemHoverEvent event) { String river = ((LinkItem)event.getItem()).getLinkTitle(); - for (Map.Entry entry: rivers.entrySet()) { - String s = entry.getKey(); - LinkItem item = entry.getValue(); - if (item.getLinkTitle().equals(river)) { - item.setCellStyle("riverLinkHighlight"); - callHighlightRiver(river); + Img item = riverHighlight.get(river); + if (item != null) { + item.setVisible(true); + if (selected != null && !selected.equals(river)) { + riverHighlight.get(selected).setVisible(false); + callUnHighlightRiver(selected); } - else { - item.setCellStyle("formCell"); - callUnHighlightRiver(s); - } - } - if (columns != null) { - columns.redraw(); + callHighlightRiver(river); + selected = river; } } }); } if (module != null) { - getModuleSelection().setRivers(rivers); + getModuleSelection().setRivers(riverList); } label.setWidth(50); @@ -248,7 +265,6 @@ layout.addMember(columns); } - layout.addMember(getNextButton()); HTMLPane map = new HTMLPane(); map.setContentsURL("images/FLYS_Karte_interactive.html"); @@ -270,24 +286,31 @@ private native void createCallback() /*-{ $wnd.highlightRiver = @org.dive4elements.river.client.client.ui.LinkSelection::highlightCallback(Ljava/lang/String;); + $wnd.unHighlightRiver = @org.dive4elements.river.client.client.ui.LinkSelection::unHighlightCallback(Ljava/lang/String;); $wnd.selectRiver = @org.dive4elements.river.client.client.ui.LinkSelection::selectCallback(Ljava/lang/String;); $wnd.availableRiver = @org.dive4elements.river.client.client.ui.LinkSelection::availableRiver(Ljava/lang/String;); }-*/; private static void highlightCallback(String name) { - for (Map.Entry entry: rivers.entrySet()) { - String s = entry.getKey(); - LinkItem item = entry.getValue(); - item.setCellStyle(s.equals(name) ? "riverLinkHighlight" : "formCell"); + if (riverHighlight.containsKey(name)) { + riverHighlight.get(name).setVisible(true); + if(selected != null && !selected.equals(name)) { + riverHighlight.get(selected).setVisible(false); + } + selected = name; } - if (columns != null) { - columns.redraw(); + } + + private static void unHighlightCallback(String name) { + if (riverHighlight.containsKey(name)) { + riverHighlight.get(name).setVisible(false); + selected = null; } } private static boolean availableRiver(String river) { - LinkItem ri = rivers.get(river); - return ri != null && ri.isVisible(); + HLayout row = riverList.get(river); + return row != null && row.isVisible(); } private static void selectCallback(String name) { @@ -303,5 +326,15 @@ private native void callUnHighlightRiver(String name) /*-{ $wnd.unHighlight(name); }-*/; + + + @Override + public void onVisibilityChanged(VisibilityChangedEvent event) { + for (Map.Entry entry: riverHighlight.entrySet()) { + entry.getValue().setVisible(false); + callUnHighlightRiver(entry.getKey()); + } + selected = null; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java Wed Jun 05 13:16:28 2013 +0200 @@ -16,7 +16,6 @@ import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.form.DynamicForm; -import com.smartgwt.client.widgets.form.fields.LinkItem; import com.smartgwt.client.widgets.form.fields.RadioGroupItem; import com.smartgwt.client.widgets.form.fields.events.ChangeEvent; import com.smartgwt.client.widgets.form.fields.events.ChangeHandler; @@ -55,7 +54,7 @@ protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class); /** The module checkboxes.*/ - protected RadioGroupItem radio; + protected static RadioGroupItem radio; /** */ protected Module[] modules; @@ -65,7 +64,7 @@ private List fixRivers; private List minfoRivers; - protected Map rivers; + protected Map rivers; /** * The default constructor. @@ -110,6 +109,7 @@ @Override public Canvas create(DataList data) { GWT.log("ModuleSelection - create()"); + createCallback(); VLayout newLayout = new VLayout(); newLayout.setMembersMargin(10); newLayout.setAlign(VerticalAlignment.TOP); @@ -179,7 +179,7 @@ public void onChange(ChangeEvent event) { String selected = (String)event.getValue(); if (!rivers.isEmpty()) { - for (Map.Entry s: rivers.entrySet()) { + for (Map.Entry s: rivers.entrySet()) { if (selected.equals("minfo") && !minfoRivers.contains(s.getKey())) { s.getValue().hide(); } @@ -188,9 +188,7 @@ } else { s.getValue().show(); - s.getValue().setCellStyle("formCell"); } - callUnHighlightRiver(s.getKey()); } } } @@ -235,12 +233,17 @@ return new Data[] {data}; } - public void setRivers(Map rivers) { + public void setRivers(Map rivers) { this.rivers = rivers; } - private native void callUnHighlightRiver(String name) /*-{ - $wnd.unHighlight(name); + private native void createCallback() /*-{ + $wnd.getModule = @org.dive4elements.river.client.client.ui.ModuleSelection::getSelectedModule(); }-*/; + + private static String getSelectedModule() { + GWT.log("selected: " + radio.getValueAsString()); + return radio.getValueAsString(); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java Wed Jun 05 13:16:28 2013 +0200 @@ -44,7 +44,6 @@ import java.util.ArrayList; import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; @@ -242,13 +241,10 @@ List errors = new ArrayList(); NumberFormat nf = NumberFormat.getDecimalFormat(); - Iterator iter = wqranges.keySet().iterator(); + for (Map.Entry entry: wqranges.entrySet()) { - while (iter.hasNext()) { - List tmpErrors = new ArrayList(); - - String key = iter.next(); - DoubleArrayPanel dap = wqranges.get(key); + String key = entry.getKey(); + DoubleArrayPanel dap = entry.getValue(); if (!dap.validateForm()) { errors.add(MSG.error_invalid_double_value()); @@ -261,6 +257,7 @@ continue; } + List tmpErrors = new ArrayList(); double[] values = dap.getInputValues(); // might geht npe here if one field not filled double[] good = new double[values.length]; @@ -362,10 +359,9 @@ protected Data getWQValues() { String wqvalue = null; - Iterator iter = wqranges.keySet().iterator(); - while (iter.hasNext()) { - String key = iter.next(); - DoubleArrayPanel dap = wqranges.get(key); + for (Map.Entry entry: wqranges.entrySet()) { + String key = entry.getKey(); + DoubleArrayPanel dap = entry.getValue(); double[] values = dap.getInputValues(); if (wqvalue == null) { diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java Wed Jun 05 13:16:28 2013 +0200 @@ -16,7 +16,9 @@ import com.google.gwt.user.client.ui.HorizontalPanel; import com.google.gwt.user.client.ui.Label; import com.google.gwt.user.client.ui.Widget; +import com.google.gwt.user.client.ui.HTML; +import org.dive4elements.river.client.client.FLYS; import org.dive4elements.river.client.client.FLYSConstants; import org.dive4elements.river.client.shared.model.RiverInfo; @@ -27,6 +29,9 @@ */ public class RiverInfoPanel extends HorizontalPanel { + /** The flys instance */ + protected FLYS flys; + /** The message class that provides i18n strings.*/ protected FLYSConstants MSG = GWT.create(FLYSConstants.class); @@ -35,7 +40,9 @@ public final static int PADDING = 8; public final static int MARGIN = 10; - public RiverInfoPanel(RiverInfo riverinfo) { + public RiverInfoPanel(FLYS flys, RiverInfo riverinfo) { + this.flys = flys; + setStyleName("riverinfopanel"); setHeight("" + HEIGHT + "px"); setVerticalAlignment(ALIGN_MIDDLE); @@ -91,8 +98,8 @@ String url = number != null ? MSG.gauge_river_url() + number : MSG.gauge_river_url(); - Anchor anchor = new Anchor(MSG.gauge_river_info_link(), url, "_blank"); - add(anchor); + add(new HTML(WikiLinks.linkHTML(this.flys, url, + MSG.gauge_river_info_link()))); } public static int getStaticHeight() { diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java Wed Jun 05 13:16:28 2013 +0200 @@ -31,7 +31,6 @@ import org.dive4elements.river.client.shared.model.DefaultDataItem; import java.util.ArrayList; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; @@ -260,14 +259,13 @@ @Override protected Data[] getData() { Map values = form.getValues(); - Iterator keys = values.keySet().iterator(); Data[] list = new Data[values.size()]; int i = 0; - while (keys.hasNext()) { - String fieldname = ((String) keys.next()).replace('_', ' '); - String selection = (String) values.get(fieldname); + for (Map.Entry entry: values.entrySet()) { + String fieldname = ((String)entry.getKey()).replace('_', ' '); + String selection = (String)entry.getValue(); DataItem item = new DefaultDataItem(fieldname, null, selection); diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java Wed Jun 05 13:16:28 2013 +0200 @@ -49,7 +49,6 @@ import org.dive4elements.river.client.shared.model.Theme; import java.util.Arrays; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; import java.util.Set; @@ -196,9 +195,7 @@ LinkedHashMap valueMap = new LinkedHashMap(); valueMap.put("aktuell", "Aktuell"); - Iterator iter = keys.iterator(); - while (iter.hasNext()) { - String s = iter.next().toString(); + for (String s: keys) { Style tmp = styleGroups.get(s); tmp.setFacet(current.getFacet()); tmp.setIndex(current.getIndex()); diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java Wed Jun 05 13:16:28 2013 +0200 @@ -51,7 +51,6 @@ import java.util.ArrayList; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; @@ -220,7 +219,6 @@ return; } - int idx = e.getColNum(); Record r = e.getRecord(); double val = r.getAttributeAsDouble("value"); @@ -385,13 +383,10 @@ List errors = new ArrayList(); NumberFormat nf = NumberFormat.getDecimalFormat(); - Iterator iter = wqranges.keySet().iterator(); + for (Map.Entry entry: wqranges.entrySet()) { - while (iter.hasNext()) { - List tmpErrors = new ArrayList(); - - String key = iter.next(); - DoubleArrayPanel dap = wqranges.get(key); + String key = entry.getKey(); + DoubleArrayPanel dap = entry.getValue(); if (!dap.validateForm()) { errors.add(MSG.error_invalid_double_value()); @@ -409,6 +404,7 @@ int idx = 0; + List tmpErrors = new ArrayList(); for (double value: values) { if (value < mm[0] || value > mm[1]) { String tmp = MSG.error_validate_range(); @@ -697,10 +693,9 @@ protected Data getWQValues() { String wqvalue = null; - Iterator iter = wqranges.keySet().iterator(); - while (iter.hasNext()) { - String key = iter.next(); - DoubleArrayPanel dap = wqranges.get(key); + for (Map.Entry entry: wqranges.entrySet()) { + String key = entry.getKey(); + DoubleArrayPanel dap = entry.getValue(); String label = dap.getItemTitle(); double[] values = dap.getInputValues(); diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiLinks.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiLinks.java Wed Jun 05 13:16:28 2013 +0200 @@ -0,0 +1,44 @@ +/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde + * Software engineering by Intevation GmbH + * + * This file is Free Software under the GNU AGPL (>=v3) + * and comes with ABSOLUTELY NO WARRANTY! Check out the + * documentation coming with Dive4Elements River for details. + */ + +package org.dive4elements.river.client.client.ui; + +import com.smartgwt.client.widgets.grid.CellFormatter; +import com.smartgwt.client.widgets.grid.ListGridRecord; +import com.google.gwt.safehtml.shared.SafeHtmlUtils; + +import org.dive4elements.river.client.client.FLYS; + +public class WikiLinks +{ + public static String linkHTML(FLYS flys, String url, String text) { + String saml = flys.getCurrentUser().getSamlXMLBase64(); + String quotedUrl = SafeHtmlUtils.htmlEscape(url); + String quotedText = SafeHtmlUtils.htmlEscape(text); + if (saml != null) { + return "
" + + "" + + "" + + "
"; + } + else { + return "" + quotedText + ""; + } + } + + public static CellFormatter cellFormatter(final FLYS flys) { + return new CellFormatter() { + public String format(Object value, ListGridRecord record, + int rowNum, int colNum) { + return linkHTML(flys, (String)value, record.getLinkText()); + } + }; + } +} diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java Wed Jun 05 13:16:28 2013 +0200 @@ -79,7 +79,7 @@ /** Data item name for CrossSections selected km. */ protected static String CS_KM = "cross_section.km"; - /** Data item name for CrossSections selected km. */ + /** Data item name for CrossSections reference ('master') flag. */ protected static String CS_IS_MASTER = "cross_section.master?"; /** List of cross-section themes through which is moved through synchronously. */ @@ -178,6 +178,8 @@ } // There is none selected. Take the first one. if (firstCSUuid != null) { + // TODO better take the one closest to first km! + // issue1157, query next/prev kms, select the one which is closest. setCurrentCSMaster(firstCSUuid); feedTellMaster(firstCSUuid); } @@ -410,7 +412,11 @@ * \param to. */ @Override - public void spinnerValueEntered(KMSpinner spinner, final double enteredKm, final FacetRecord facetRecord, final boolean up) { + public void spinnerValueEntered(KMSpinner spinner, + final double enteredKm, + final FacetRecord facetRecord, + final boolean up + ) { disable(); Config config = Config.getInstance(); final String locale = config.getLocale(); @@ -502,6 +508,7 @@ String fieldName = this.getFieldName(colNum); + // Place KMSpinner in Grid with currently chosen km value. if (fieldName.equals(GRID_FIELD_ACTIONS)) { double currentValue = Double.valueOf(facetRecord.getTheme().getCollectionItem().getData().get(CS_KM)); @@ -520,6 +527,7 @@ list.setShowAllRecords(true); list.setShowHeaderContextMenu(false); list.setLeaveScrollbarGap(false); + return list; } diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java Wed Jun 05 13:16:28 2013 +0200 @@ -23,7 +23,6 @@ import org.dive4elements.river.client.shared.model.DefaultDataItem; import java.util.HashMap; -import java.util.Iterator; import java.util.LinkedHashMap; import java.util.Map; @@ -145,15 +144,14 @@ @Override public Data[] getData() { - Map values = form.getValues(); - Iterator keys = values.keySet().iterator(); + Map values = form.getValues(); Data[] list = new Data[values.size()]; int i = 0; - while (keys.hasNext()) { - String fieldname = (String) keys.next(); - String selection = (String) values.get(fieldname); + for (Map.Entryentry: values.entrySet()) { + String fieldname = (String)entry.getKey(); + String selection = (String)entry.getValue(); DataItem item = new DefaultDataItem(fieldname, null, selection); diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedMultiPeriodPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedMultiPeriodPanel.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedMultiPeriodPanel.java Wed Jun 05 13:16:28 2013 +0200 @@ -11,7 +11,7 @@ import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.events.ResizedEvent; import com.smartgwt.client.widgets.events.ResizedHandler; -import com.smartgwt.client.widgets.layout.VLayout; +import com.smartgwt.client.widgets.layout.HLayout; import org.dive4elements.river.client.client.ui.MultiPeriodPanel; @@ -28,7 +28,7 @@ protected Canvas createHelper() { chartContainer1 = new BedCampaignChart(artifact, this); chartContainer2 = new BedloadCampaignChart(artifact, this); - VLayout layout = new VLayout(); + HLayout layout = new HLayout(); layout.addMember(chartContainer1); layout.addMember(chartContainer2); return layout; diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java Wed Jun 05 13:16:28 2013 +0200 @@ -21,6 +21,7 @@ import com.smartgwt.client.widgets.grid.events.RecordClickHandler; import org.dive4elements.river.client.client.FLYS; +import org.dive4elements.river.client.client.ui.WikiLinks; import org.dive4elements.river.client.shared.model.Data; import org.dive4elements.river.client.shared.model.DataItem; import org.dive4elements.river.client.shared.model.DataList; @@ -44,6 +45,7 @@ ListGridField stfield = new ListGridField("station", "Station [km]"); ListGridField lfield = new ListGridField("link", "Info"); lfield.setType(ListGridFieldType.LINK); + lfield.setCellFormatter(WikiLinks.cellFormatter(flys)); ListGridField cfield = new ListGridField("curvelink", MSG.gauge_curve_link()); cfield.addRecordClickHandler(this); diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugePanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugePanel.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugePanel.java Wed Jun 05 13:16:28 2013 +0200 @@ -29,7 +29,7 @@ * @param flys The FLYS object */ public GaugePanel(FLYS flys) { - super(new GaugeListGrid(flys)); + super(flys, new GaugeListGrid(flys)); } diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java Wed Jun 05 13:16:28 2013 +0200 @@ -14,6 +14,7 @@ import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.layout.SectionStackSection; import com.smartgwt.client.widgets.layout.VLayout; +import org.dive4elements.river.client.client.FLYS; import org.dive4elements.river.client.client.FLYSConstants; import org.dive4elements.river.client.client.services.RiverInfoService; import org.dive4elements.river.client.client.services.RiverInfoServiceAsync; @@ -26,6 +27,9 @@ */ public abstract class InfoPanel extends VLayout { + /** The instance of FLYS */ + protected FLYS flys; + /** SectionStackSection where this InfoPanel belongs in*/ protected SectionStackSection section; @@ -44,7 +48,7 @@ public final static String SECTION_ID = "InfoPanelSection"; - public InfoPanel(InfoListGrid listgrid) { + public InfoPanel(FLYS flys, InfoListGrid listgrid) { SectionStackSection section = new SectionStackSection(); section.setExpanded(false); section.setTitle(getSectionTitle()); @@ -54,6 +58,8 @@ setOverflow(Overflow.HIDDEN); setStyleName("infopanel"); + this.flys = flys; + section.setHidden(true); section.setItems(this); this.section = section; @@ -80,7 +86,7 @@ protected void render(RiverInfo riverinfo) { if (this.riverinfopanel == null) { - this.riverinfopanel = new RiverInfoPanel(riverinfo); + this.riverinfopanel = new RiverInfoPanel(this.flys, riverinfo); this.addMember(this.riverinfopanel, 0); } diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java Wed Jun 05 13:16:28 2013 +0200 @@ -19,6 +19,7 @@ import com.smartgwt.client.widgets.grid.events.RecordClickHandler; import org.dive4elements.river.client.client.FLYS; +import org.dive4elements.river.client.client.ui.WikiLinks; import org.dive4elements.river.client.shared.model.MeasurementStation; import org.dive4elements.river.client.shared.model.RiverInfo; @@ -40,6 +41,7 @@ ListGridField stfield = new ListGridField("station", "Station [km]"); ListGridField lfield = new ListGridField("link", "Link"); lfield.setType(ListGridFieldType.LINK); + lfield.setCellFormatter(WikiLinks.cellFormatter(flys)); ListGridField cfield = new ListGridField("curvelink", "SQ"); cfield.addRecordClickHandler(this); this.setFields(nfield, sfield, efield, stfield, lfield, cfield); diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java Wed Jun 05 13:16:28 2013 +0200 @@ -27,7 +27,7 @@ * @param flys The FLYS object */ public MeasurementStationPanel(FLYS flys) { - super(new MeasurementStationListGrid(flys)); + super(flys, new MeasurementStationListGrid(flys)); } /** diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java Wed Jun 05 13:16:28 2013 +0200 @@ -575,12 +575,15 @@ Recommendation[] rec = new Recommendation[num]; for (int i = 0; i < num; i++) { - Element e = (Element) list.item(i); - String factory = e.getAttribute("factory"); - String index = e.getAttribute("ids"); + Element e = (Element) list.item(i); + String factory = e.getAttribute("factory"); + String index = e.getAttribute("ids"); + String targetOut = e.getAttribute("target_out"); if (factory != null && factory.length() > 0) { - rec[i] = new Recommendation(factory, index); + logger.debug("Adding Recommendation. Factory: " + factory + + " IDs: " + index + " target out " + targetOut); + rec[i] = new Recommendation(factory, index, null, null, targetOut); } } diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java Wed Jun 05 13:16:28 2013 +0200 @@ -71,20 +71,23 @@ String uuid; String ids; CreationFilter filter; + String targetOut; if (recommendation != null) { - uuid = recommendation.getMasterArtifact(); - ids = recommendation.getIDs(); - filter = convertFilter(recommendation.getFilter()); + uuid = recommendation.getMasterArtifact(); + ids = recommendation.getIDs(); + filter = convertFilter(recommendation.getFilter()); + targetOut = recommendation.getTargetOut(); } else { - uuid = null; - ids = null; - filter = null; + uuid = null; + ids = null; + filter = null; + targetOut = null; } Document create = ClientProtocolUtils.newCreateDocument( - factory, uuid, ids, filter); + factory, uuid, ids, filter, targetOut); return sendCreate(serverUrl, locale, create); diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java Wed Jun 05 13:16:28 2013 +0200 @@ -403,6 +403,10 @@ public static Collection parseCollection(Document description) { logger.debug("CollectionHelper.parseCollection"); + if (logger.isDebugEnabled()) { + logger.debug(XMLUtils.toString(description)); + } + if (description == null) { logger.warn("The DESCRIBE of the Collection is null!"); return null; diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java Wed Jun 05 13:16:28 2013 +0200 @@ -52,9 +52,10 @@ try { Document result = client.callService(url, "fileupload", request); + resp.setContentType("text/html"); + PrintWriter respWriter = resp.getWriter(); - respWriter.write(""); - respWriter.write("
"); + respWriter.write("
"); if (result == null) { logger.warn("FileUpload service returned no result."); @@ -81,7 +82,7 @@ protected Document createFileXML(HttpServletRequest req) { - ServletFileUpload upload = new ServletFileUpload(); + ServletFileUpload upload = new ServletFileUpload(); try{ FileItemIterator iter = upload.getItemIterator(req); @@ -92,14 +93,18 @@ // Process the input stream ByteArrayOutputStream out = new ByteArrayOutputStream(); - int len; + int len, cnt = 0; byte[] buffer = new byte[stream.available()]; while ((len = stream.read(buffer, 0, buffer.length)) != -1) { out.write(buffer, 0, len); + cnt += len; } - buffer = Base64.encodeBase64(buffer); + buffer = Base64.encodeBase64(out.toByteArray()); String b64File = new String(buffer); + logger.debug("FileUploadServiceImpl.createFileXML(): " + cnt + + "/" + b64File.length() + + " bytes (orig/base64) file to be uploaded"); Document fileDoc = XMLUtils.newDocument(); diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java Wed Jun 05 13:16:28 2013 +0200 @@ -37,7 +37,7 @@ throws ServletException, IOException { String encoding = req.getCharacterEncoding(); - String samlTicketXML = req.getParameter("samlTicket"); + String samlTicketXML = req.getParameter("saml"); logger.debug("Processing post request"); @@ -86,6 +86,7 @@ Features features = (Features)sc.getAttribute(Features.CONTEXT_ATTRIBUTE); return new org.dive4elements.river.client.server.auth.saml.User( - assertion, features.getFeatures(assertion.getRoles()), null); + assertion, samlTicketXML, + features.getFeatures(assertion.getRoles()), null); } } diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java Wed Jun 05 13:16:28 2013 +0200 @@ -60,7 +60,8 @@ String name = user.getAttributeNS( ArtifactNamespaceContext.NAMESPACE_URI, "name"); - return new DefaultUser(uuid, name); + return new DefaultUser(uuid, name, + loginuser.getSamlXMLBase64()); } } catch (ConnectionException ce) { diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java Wed Jun 05 13:16:28 2013 +0200 @@ -16,6 +16,7 @@ protected String name; protected String account; protected String password; + protected String samlXML; protected boolean expired; protected List roles; protected List features; @@ -26,12 +27,14 @@ public DefaultUser( String name, String password, + String samlXML, boolean expired, List roles, List features ) { this.name = name; this.password = password; + this.samlXML = samlXML; this.expired = expired; this.roles = roles; this.features = features; @@ -92,5 +95,14 @@ public void setAccount(String account) { this.account = account; } + + @Override + public String getSamlXMLBase64() { + return this.samlXML; + } + + public void setSamlXMLBase64(String samlXML) { + this.samlXML = samlXML; + } } // vim:set ts=4 sw=4 si et fenc=utf8 tw=80: diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/auth/User.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/User.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/User.java Wed Jun 05 13:16:28 2013 +0200 @@ -46,5 +46,12 @@ * Returns the users account name */ public String getAccount(); + + /** + * Returns the SAML ticket for single sign-on. + * @return The SAML ticket in base64 encoded XML. null if no ticket + * is available. + */ + public String getSamlXMLBase64(); } // vim:set ts=4 sw=4 si et fenc=utf8 tw=80: diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java Wed Jun 05 13:16:28 2013 +0200 @@ -63,7 +63,7 @@ @Override public User getUser() { return isSuccess() - ? new DefaultUser(user, password, false, roles, this.features.getFeatures(roles)) + ? new DefaultUser(user, password, null, false, roles, this.features.getFeatures(roles)) : null; } } // class Authentication diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/auth/saml/User.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/saml/User.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/saml/User.java Wed Jun 05 13:16:28 2013 +0200 @@ -18,11 +18,13 @@ private Assertion assertion; - public User(Assertion assertion, List features, String password) { + public User(Assertion assertion, String samlXML, List features, + String password) { this.setName(assertion.getNameID()); this.setAccount(assertion.getNameID()); this.setRoles(assertion.getRoles()); this.assertion = assertion; + this.setSamlXMLBase64(samlXML); this.setAllowedFeatures(features); this.setPassword(password); } diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java Wed Jun 05 13:16:28 2013 +0200 @@ -10,11 +10,13 @@ import java.io.IOException; import java.io.InputStream; +import java.io.StringBufferInputStream; import java.util.List; import org.apache.commons.codec.binary.Base64InputStream; import org.apache.http.HttpEntity; +import org.apache.http.util.EntityUtils; import org.apache.log4j.Logger; @@ -37,6 +39,7 @@ private static Logger logger = Logger.getLogger(Response.class); private Element root; + private String samlTicketXML; private Assertion assertion; private String username; private String password; @@ -53,8 +56,9 @@ } String contenttype = entity.getContentType().getValue(); + String samlTicketXML = EntityUtils.toString(entity); - InputStream in = entity.getContent(); + InputStream in = new StringBufferInputStream(samlTicketXML); if (!contenttype.equals("application/vnd.ogc.se_xml")) { // XXX: Assume base64 encoded content. @@ -70,6 +74,7 @@ "ServiceException")); } + this.samlTicketXML = samlTicketXML; this.root = root; this.username = username; this.password = password; @@ -113,7 +118,7 @@ this.assertion.getRoles()); logger.debug("User " + this.username + " with features " + features + " successfully authenticated."); - return new User(assertion, features, this.password); + return new User(assertion, this.samlTicketXML, features, this.password); } } // vim: set si et fileencoding=utf-8 ts=4 sw=4 tw=80: diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java Wed Jun 05 13:16:28 2013 +0200 @@ -22,6 +22,8 @@ /** The name of the user.*/ protected String name; + /** The saml ticket used for single sign-on.*/ + protected String samlXML; /** * The default constructor. @@ -36,9 +38,10 @@ * @param identifier The uuid of the user. * @param name The name of the user. */ - public DefaultUser(String identifier, String name) { + public DefaultUser(String identifier, String name, String samlXML) { this.identifier = identifier; this.name = name; + this.samlXML = samlXML; } @@ -63,6 +66,16 @@ /** + * Returns the SAML ticket for single sign-on. + * + * @return the SAML ticket as base64 encoded XML + */ + public String getSamlXMLBase64() { + return samlXML; + } + + + /** * Set the identifier of the user. * * @param identifier The new identifier. @@ -80,5 +93,14 @@ public void setName(String name) { this.name = name; } + + /** + * Set the SAML Ticket for single sign-on. + * + * @param samlXML the SAML ticket as base64 encoded XML. + */ + public void setSamlXMLBase64(String samlXML) { + this.samlXML = samlXML; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Recommendation.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Recommendation.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Recommendation.java Wed Jun 05 13:16:28 2013 +0200 @@ -117,6 +117,9 @@ protected String masterArtifact; /** Optional facet filter. */ protected Filter filter; + /** The out this Artifact should be added to **/ + protected String targetOut; + protected String displayName = null; public Recommendation() { @@ -126,16 +129,39 @@ this(factory, ids, null, null); } + public Recommendation(String factory, String ids, String targetOut) { + this(factory, ids, null, null, targetOut); + } + public Recommendation( String factory, String ids, String masterArtifact, Filter filter ) { + this(factory, ids, masterArtifact, filter, null); + } + + public Recommendation( + String factory, + String ids, + String masterArtifact, + Filter filter, + String targetOut + ) { this.factory = factory; this.ids = ids; this.masterArtifact = masterArtifact; this.filter = filter; + this.targetOut = targetOut; + } + + public String getTargetOut() { + return targetOut; + } + + public void setTargetOut(String value) { + targetOut = value; } public String getFactory() { @@ -190,6 +216,9 @@ hash += (getMasterArtifact() != null) ? getMasterArtifact().hashCode() : 0; + hash += (getTargetOut() != null) + ? getTargetOut().hashCode() + : 0; return hash; } @@ -221,7 +250,8 @@ return (same(this.getFactory(), rec.getFactory())) && (same(this.getIDs(), rec.getIDs())) && (same(this.getFilter(), rec.getFilter())) - && (same(this.getMasterArtifact(), rec.getMasterArtifact())); + && (same(this.getMasterArtifact(), rec.getMasterArtifact())) + && (same(this.getTargetOut(), rec.getTargetOut())); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java Wed Jun 05 13:16:28 2013 +0200 @@ -15,6 +15,8 @@ import java.io.Serializable; +import com.google.gwt.core.client.GWT; + public class ToLoad implements Serializable { @@ -49,6 +51,16 @@ } return key; } + public void add( + String artifactName, + String factory, + String out, + String name, + String ids, + String displayName + ) { + add(artifactName, factory, out, name, ids, displayName, null); + } public void add( String artifactName, @@ -56,8 +68,13 @@ String out, String name, String ids, - String displayName + String displayName, + String targetOut ) { + GWT.log("Adding artifact: " + artifactName + " Factory: " + factory + + " Out: " + out + " Name: " + name + " Ids: " + ids + + " Display Name: " + displayName + " Target Out: " + targetOut); + if (artifactName == null) { artifactName = uniqueKey(artifacts); } diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java --- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java Wed Jun 05 13:16:28 2013 +0200 @@ -17,8 +17,12 @@ String getName(); + String getSamlXMLBase64(); + void setName(String name); void setIdentifier(String identifier); + + void setSamlXMLBase64(String samlXml); } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/webapp/WEB-INF/config.yaml --- a/gwt-client/src/main/webapp/WEB-INF/config.yaml Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/webapp/WEB-INF/config.yaml Wed Jun 05 13:16:28 2013 +0200 @@ -196,12 +196,12 @@ backgroundColor: #FFFFFF # The legend - !columns - absoluteX: 612 - absoluteY: 390 - width: 200 + absoluteX: 562 + absoluteY: 385 + width: 250 items: - !legends - maxHeight: 310 + maxHeight: 350 maxWidth: 0 maxIconHeight: 0 inline: true @@ -213,7 +213,7 @@ fontEncoding: Identity-H classFont: FreeSans layerFont: FreeSans - defaultScale: 0.5 + defaultScale: 0.7 config: borderWidthLeft: 1 borderWidthRight: 1 @@ -238,21 +238,16 @@ condition: mapTitle items: - !text + fontSize: 18 text: '${mapTitle}' # The Stamp - !columns absoluteX: 562 - absoluteY: 555 + absoluteY: 550 width: 250 - # config: - # borderWidthLeft: 5 - # borderWidthRight: 5 - # borderWidthTop: 5 - # borderWidthBottom: 5 - #padding: 10 - #backgroundColor: #FFFFFF - #borderColor: #FFFFFF + config: + borderWidth: 1 items: - !attributes source: data @@ -266,7 +261,7 @@ cell: !columns config: cells: - - borderWidth: 1 + - borderWidth: 0.5 padding: 5 items: - !text @@ -284,7 +279,7 @@ cell: !columns config: cells: - - borderWidth: 1 + - borderWidth: 0.5 padding: 5 items: - !text diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html --- a/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html Fri May 24 16:26:41 2013 +0200 +++ b/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html Wed Jun 05 13:16:28 2013 +0200 @@ -2,25 +2,39 @@ @@ -41,30 +59,30 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/webapp/images/FLYS_transp.png Binary file gwt-client/src/main/webapp/images/FLYS_transp.png has changed diff -r dc166b225775 -r 1298c1c2dadf gwt-client/src/main/webapp/images/symbol_selected.png Binary file gwt-client/src/main/webapp/images/symbol_selected.png has changed