Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java @ 638:c580666a843f
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
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Tue, 02 Mar 2010 08:43:50 +0000 |
parents | 292fbcd5e9ac |
children | 9a828e5a2390 |
comparison
equal
deleted
inserted
replaced
637:154d158238d3 | 638:c580666a843f |
---|---|
33 /** | 33 /** |
34 * The UID of this Class | 34 * The UID of this Class |
35 */ | 35 */ |
36 private static final long serialVersionUID = -7989531326553305293L; | 36 private static final long serialVersionUID = -7989531326553305293L; |
37 | 37 |
38 protected CallMeta callMeta; | 38 protected String ipos; |
39 protected String jpos; | |
39 | 40 |
40 /** | 41 /** |
41 * Constructor | 42 * Constructor |
42 */ | 43 */ |
43 public NorthSouthEastWestState() { | 44 public NorthSouthEastWestState() { |
52 | 53 |
53 NamedCollection<KeyValueDescibeData> keyValueDescibeData = | 54 NamedCollection<KeyValueDescibeData> keyValueDescibeData = |
54 new NamedArrayList<KeyValueDescibeData>(dataName, 2); | 55 new NamedArrayList<KeyValueDescibeData>(dataName, 2); |
55 | 56 |
56 keyValueDescibeData.setMultiSelect(super.dataMultiSelect); | 57 keyValueDescibeData.setMultiSelect(super.dataMultiSelect); |
57 keyValueDescibeData.add(new DefaultKeyValueDescribeData("IPOSITION", | 58 keyValueDescibeData.add(new DefaultKeyValueDescribeData( |
58 RessourceFactory.getInstance().getRessource( | 59 "IPOSITION", ipos)); |
59 callMeta.getLanguages(), "iposition", "iposition"))); | 60 keyValueDescibeData.add(new DefaultKeyValueDescribeData( |
60 keyValueDescibeData.add(new DefaultKeyValueDescribeData("JPOSITION", | 61 "JPOSITION", jpos)); |
61 RessourceFactory.getInstance().getRessource( | |
62 callMeta.getLanguages(), "jposition", "jposition"))); | |
63 describeData.add(keyValueDescibeData); | 62 describeData.add(keyValueDescibeData); |
64 | 63 |
65 return describeData; | 64 return describeData; |
66 } | 65 } |
67 | 66 |
70 */ | 69 */ |
71 @Override | 70 @Override |
72 public void initialize(String uuid, CallContext context) | 71 public void initialize(String uuid, CallContext context) |
73 throws StateException | 72 throws StateException |
74 { | 73 { |
75 this.callMeta = context.getMeta(); | 74 CallMeta callMeta = context.getMeta(); |
75 RessourceFactory factory = RessourceFactory.getInstance(); | |
76 | |
77 // XXX Workarround - we need these strings in purifyResult, but have no | |
78 // CallMeta object there which is necessary to get resources from | |
79 // RessourceFactory. Storing the strings here is not nice, because the | |
80 // Locale object could change! | |
81 ipos = factory.getRessource( | |
82 callMeta.getLanguages(), "iposition", "iposition"); | |
83 jpos = factory.getRessource( | |
84 callMeta.getLanguages(), "jposition", "jposition"); | |
76 } | 85 } |
77 | 86 |
78 | 87 |
79 } | 88 } |