Mercurial > dive4elements > gnv-client
annotate 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 |
rev | line source |
---|---|
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
1 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
2 * |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
3 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
4 package de.intevation.gnv.state.profile.horizontal; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
5 |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
6 import de.intevation.artifacts.CallContext; |
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
7 import de.intevation.artifacts.CallMeta; |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
8 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
9 import de.intevation.gnv.artifacts.ressource.RessourceFactory; |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
10 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
11 import de.intevation.gnv.geobackend.base.Result; |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
12 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
13 import de.intevation.gnv.state.StateBase; |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
14 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
15 import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
16 import de.intevation.gnv.state.describedata.KeyValueDescibeData; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
17 import de.intevation.gnv.state.describedata.NamedArrayList; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
18 import de.intevation.gnv.state.describedata.NamedCollection; |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
19 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
20 import de.intevation.gnv.state.exception.StateException; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
21 |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
22 import java.util.ArrayList; |
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
23 import java.util.Collection; |
607
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
24 import java.util.List; |
493
cef17cc90fd0
Changed some method signatures of the State interface. Use CallContext objects instead of CallMeta objects which are a subset of CallContext.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
335
diff
changeset
|
25 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
26 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
27 * @author Tim Englich <tim.englich@intevation.de> |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
28 * |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
29 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
30 public class NorthSouthEastWestState extends StateBase { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
31 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
32 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
33 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
34 * The UID of this Class |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
35 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
36 private static final long serialVersionUID = -7989531326553305293L; |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
37 |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
38 protected String ipos; |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
39 protected String jpos; |
607
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
40 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
41 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
42 * Constructor |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
43 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
44 public NorthSouthEastWestState() { |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
45 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
46 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
47 /** |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
48 * @see de.intevation.gnv.state.StateBase#purifyResult(java.util.Collection, java.lang.String) |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
49 */ |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
50 @Override |
607
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
51 protected List<Object> purifyResult(Collection<Result> result, String uuid) { |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
52 List<Object> describeData = new ArrayList<Object>(); |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
53 |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
54 NamedCollection<KeyValueDescibeData> keyValueDescibeData = |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
55 new NamedArrayList<KeyValueDescibeData>(dataName, 2); |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
56 |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
57 keyValueDescibeData.setMultiSelect(super.dataMultiSelect); |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
58 keyValueDescibeData.add(new DefaultKeyValueDescribeData( |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
59 "IPOSITION", ipos)); |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
60 keyValueDescibeData.add(new DefaultKeyValueDescribeData( |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
61 "JPOSITION", jpos)); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
62 describeData.add(keyValueDescibeData); |
607
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
63 |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
64 return describeData; |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
65 } |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
66 |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
67 /** |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
68 * @see de.intevation.gnv.state.StateBase#initialize(java.lang.String, de.intevation.artifacts.CallMeta) |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
69 */ |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
70 @Override |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
71 public void initialize(String uuid, CallContext context) |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
72 throws StateException |
292fbcd5e9ac
Parted the cache blob into pieces and changed the way how user input is stored on each state.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
493
diff
changeset
|
73 { |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
74 CallMeta callMeta = context.getMeta(); |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
75 RessourceFactory factory = RessourceFactory.getInstance(); |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
76 |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
77 // XXX Workarround - we need these strings in purifyResult, but have no |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
78 // CallMeta object there which is necessary to get resources from |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
79 // RessourceFactory. Storing the strings here is not nice, because the |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
80 // Locale object could change! |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
81 ipos = factory.getRessource( |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
82 callMeta.getLanguages(), "iposition", "iposition"); |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
83 jpos = factory.getRessource( |
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).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
607
diff
changeset
|
84 callMeta.getLanguages(), "jposition", "jposition"); |
335
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
85 } |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
86 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
87 |
e964a3d8f7bc
Some Refactoring work done.
Tim Englich <tim.englich@intevation.de>
parents:
diff
changeset
|
88 } |