# HG changeset patch # User Ingo Weinzierl # Date 1267519430 0 # Node ID c580666a843fd7a0493ce13975ef1816c7d50d81 # Parent 154d158238d31b986375b285d296e4ae24407940 Removed CallMeta object from state which should not be serialized. Implemented a little workarround instead to save localized strings for axes descriptions of horizontal profile charts (issue180). gnv-artifacts/trunk@721 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 154d158238d3 -r c580666a843f gnv-artifacts/ChangeLog --- a/gnv-artifacts/ChangeLog Mon Mar 01 16:00:39 2010 +0000 +++ b/gnv-artifacts/ChangeLog Tue Mar 02 08:43:50 2010 +0000 @@ -1,3 +1,11 @@ +2010-03-02 Ingo Weinzierl + + Issue180 + + * src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java: + Removed CallMeta object from state which should not be serialized. + Implemented a little workarround to save localized strings on this state. + 2010-03-01 Ingo Weinzierl Issue182 diff -r 154d158238d3 -r c580666a843f gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java Mon Mar 01 16:00:39 2010 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java Tue Mar 02 08:43:50 2010 +0000 @@ -35,7 +35,8 @@ */ private static final long serialVersionUID = -7989531326553305293L; - protected CallMeta callMeta; + protected String ipos; + protected String jpos; /** * Constructor @@ -54,12 +55,10 @@ new NamedArrayList(dataName, 2); keyValueDescibeData.setMultiSelect(super.dataMultiSelect); - keyValueDescibeData.add(new DefaultKeyValueDescribeData("IPOSITION", - RessourceFactory.getInstance().getRessource( - callMeta.getLanguages(), "iposition", "iposition"))); - keyValueDescibeData.add(new DefaultKeyValueDescribeData("JPOSITION", - RessourceFactory.getInstance().getRessource( - callMeta.getLanguages(), "jposition", "jposition"))); + keyValueDescibeData.add(new DefaultKeyValueDescribeData( + "IPOSITION", ipos)); + keyValueDescibeData.add(new DefaultKeyValueDescribeData( + "JPOSITION", jpos)); describeData.add(keyValueDescibeData); return describeData; @@ -72,7 +71,17 @@ public void initialize(String uuid, CallContext context) throws StateException { - this.callMeta = context.getMeta(); + CallMeta callMeta = context.getMeta(); + RessourceFactory factory = RessourceFactory.getInstance(); + + // XXX Workarround - we need these strings in purifyResult, but have no + // CallMeta object there which is necessary to get resources from + // RessourceFactory. Storing the strings here is not nice, because the + // Locale object could change! + ipos = factory.getRessource( + callMeta.getLanguages(), "iposition", "iposition"); + jpos = factory.getRessource( + callMeta.getLanguages(), "jposition", "jposition"); }