comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/StaticWQKmsArtifact.java @ 1900:64ffc371afe7

Adjusted implementation to match implementation in StaticWKmsArtifact. flys-artifacts/trunk@3260 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Wed, 16 Nov 2011 09:15:25 +0000
parents 02cd002205a3
children a202a9e048a5
comparison
equal deleted inserted replaced
1899:d002198c64a2 1900:64ffc371afe7
85 //ex.: flood_protection-wstv-114-12 85 //ex.: flood_protection-wstv-114-12
86 if (code != null) { 86 if (code != null) {
87 String [] parts = code.split("-"); 87 String [] parts = code.split("-");
88 88
89 if (parts.length >= 4) { 89 if (parts.length >= 4) {
90 try { 90 int col = Integer.valueOf(parts[2]);
91 int col = Integer.valueOf(parts[2]); 91 int wst = Integer.valueOf(parts[3]);
92 int wst = Integer.valueOf(parts[3]); 92
93 93 addStringData("col_pos", parts[2]);
94 addStringData("col_pos", parts[2]); 94 addStringData("wst_id", parts[3]);
95 addStringData("wst_id", parts[3]); 95
96 96 String wkmsName = WKmsFactory.getWKmsName(col, wst);
97 String wkmsName = WKmsFactory.getWKmsName(col, wst); 97
98 98 String name;
99 String name; 99 if (parts[0].equals(HEIGHTMARKS_POINTS)) {
100 if (parts[0].equals(HEIGHTMARKS_POINTS)) { 100 name = HEIGHTMARKS_POINTS;
101 name = HEIGHTMARKS_POINTS;
102 }
103 else {
104 name = STATIC_WQKMS;
105 }
106
107 Facet facet = new WQKmsFacet(
108 name,
109 Resources.getMsg(
110 callMeta,
111 wkmsName,
112 wkmsName));
113 fs.add(facet);
114 facets.put(state.getID(), fs);
115 } 101 }
116 catch (Exception e) {} 102 else {
103 name = STATIC_WQKMS;
104 }
105
106 Facet facet = new WQKmsFacet(
107 name,
108 Resources.getMsg(
109 callMeta,
110 wkmsName,
111 wkmsName));
112 fs.add(facet);
113 facets.put(state.getID(), fs);
117 } 114 }
118 } 115 }
119 116
120 spawnState(); 117 spawnState();
121 super.setup(identifier, factory, context, callMeta, data); 118 super.setup(identifier, factory, context, callMeta, data);
123 120
124 121
125 /** 122 /**
126 * Initialize the static state with output. 123 * Initialize the static state with output.
127 * @return static state 124 * @return static state
125 * @TODO merge with StaticWKmsArtifact implementation.
128 */ 126 */
129 protected State spawnState() { 127 protected State spawnState() {
130 state = new StaticState(STATIC_STATE_NAME); 128 state = new StaticState(STATIC_STATE_NAME);
131 List<Facet> fs = facets.get(STATIC_STATE_NAME); 129 List<Facet> fs = facets.get(STATIC_STATE_NAME);
132 DefaultOutput output1 = new DefaultOutput( 130 DefaultOutput output = new DefaultOutput(
133 "w_differences", 131 "general",
134 "w_differences.longitudinal_section", "image/png", 132 "general",
133 "image/png",
135 fs, 134 fs,
136 "chart"); 135 "chart");
137 DefaultOutput output2 = new DefaultOutput( 136
138 "longitudinal_section", 137 state.getOutputs().add(output);
139 "longitudinal_section.longitudinal_section", "image/png",
140 fs,
141 "chart");
142
143 state.getOutputs().add(output1);
144 state.getOutputs().add(output2);
145 return state; 138 return state;
146 } 139 }
147 140
148 141
149 /** 142 /**

http://dive4elements.wald.intevation.org