comparison flys-artifacts/src/main/java/de/intevation/flys/artifacts/AnnotationArtifact.java @ 1771:c62ff9e72cea

Restore mapping of state id to facets (revert, rev 3083 and 3088). flys-artifacts/trunk@3092 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 27 Oct 2011 09:32:05 +0000
parents 5d8b3880a553
children a8aa343799a2
comparison
equal deleted inserted replaced
1770:e8a98eee816d 1771:c62ff9e72cea
61 DefaultState state = (DefaultState) getCurrentState(context); 61 DefaultState state = (DefaultState) getCurrentState(context);
62 state.computeInit(this, hash(), context, meta, fs); 62 state.computeInit(this, hash(), context, meta, fs);
63 63
64 if (!fs.isEmpty()) { 64 if (!fs.isEmpty()) {
65 logger.debug("Facets to add in AnnotationsArtifact.initialize ."); 65 logger.debug("Facets to add in AnnotationsArtifact.initialize .");
66 facets.addAll(fs); 66 facets.put(getCurrentStateId(), fs);
67 } 67 }
68 else { 68 else {
69 logger.debug("No facets to add in AnnotationsArtifact.initialize ."); 69 logger.debug("No facets to add in AnnotationsArtifact.initialize .");
70 } 70 }
71 } 71 }
171 if (list == null || list.size() == 0) { 171 if (list == null || list.size() == 0) {
172 logger.debug("-> No output modes for this state."); 172 logger.debug("-> No output modes for this state.");
173 continue; 173 continue;
174 } 174 }
175 175
176 if (facets == null || facets.size() == 0) { 176 List<Facet> fs = facets.get(stateId);
177 if (fs == null || fs.size() == 0) {
177 logger.debug("No facets found."); 178 logger.debug("No facets found.");
178 continue; 179 continue;
179 } 180 }
180 181
181 logger.debug("Found " + facets.size() + " facets in previous states."); 182 logger.debug("Found " + fs.size() + " facets in previous states.");
182 183
183 List<Output> generated = generateOutputs(list, facets); 184 List<Output> generated = generateOutputs(list, fs);
184 185
185 ProtocolUtils.appendOutputModes(doc, outs, generated); 186 ProtocolUtils.appendOutputModes(doc, outs, generated);
186 } 187 }
187 188
188 try { 189 try {
191 List<Output> list = cur.getOutputs(); 192 List<Output> list = cur.getOutputs();
192 if (list != null && list.size() > 0) { 193 if (list != null && list.size() > 0) {
193 logger.debug( 194 logger.debug(
194 "Append output modes for state: " + cur.getID()); 195 "Append output modes for state: " + cur.getID());
195 196
196 if (facets != null && facets.size() > 0) { 197 List<Facet> fs = facets.get(cur.getID());
197 List<Output> generated = generateOutputs(list, facets); 198 if (fs != null && fs.size() > 0) {
198 199 List<Output> generated = generateOutputs(list, fs);
199 logger.debug("Found " + facets.size() + " current facets."); 200
201 logger.debug("Found " + fs.size() + " current facets.");
200 if (!generated.isEmpty()) { 202 if (!generated.isEmpty()) {
201 ProtocolUtils.appendOutputModes( 203 ProtocolUtils.appendOutputModes(
202 doc, outs, generated); 204 doc, outs, generated);
203 } 205 }
204 else{ 206 else{

http://dive4elements.wald.intevation.org