diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 2606:619f6dfec901

#460 Fixed duplicated Outputs in DESCRIBE documents. flys-artifacts/trunk@4186 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 30 Mar 2012 09:38:29 +0000
parents 3f1cc396d253
children 247f3e98a14b
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Thu Mar 29 11:09:26 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Fri Mar 30 09:38:29 2012 +0000
@@ -242,69 +242,10 @@
         CallContext context,
         String      uuid)
     {
-        List<String> stateIds = getPreviousStateIds();
-
-        XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator(
-            doc,
-            ArtifactNamespaceContext.NAMESPACE_URI,
-            ArtifactNamespaceContext.NAMESPACE_PREFIX);
-
-        FLYSContext flysContext = FLYSUtils.getFlysContext(context);
-        StateEngine engine      = (StateEngine) flysContext.get(
-            FLYSContext.STATE_ENGINE_KEY);
-
-        for (String stateId: stateIds) {
-            logger.debug("Append output modes for state: " + stateId);
-            DefaultState state = (DefaultState) engine.getState(stateId);
-
-            List<Output> list = state.getOutputs();
-            if (list == null || list.size() == 0) {
-                logger.debug("-> No output modes for this state.");
-                continue;
-            }
-
-            List<Facet> fs = facets.get(stateId);
-
-            if (fs == null || fs.size() == 0) {
-                logger.debug("No facets for previous state found.");
-                continue;
-            }
-
-            logger.debug("Found " + fs.size() + " facets in previous states.");
+        List<Output> generated = getOutputs(context);
+        logger.debug("This Artifact has " + generated.size() + " Outputs.");
 
-            List<Output> generated = generateOutputs(list, fs);
-
-            ProtocolUtils.appendOutputModes(doc, outs, generated);
-        }
-
-        try {
-            DefaultState cur = (DefaultState) getCurrentState(context);
-            if (cur.validate(this)) {
-                List<Output> list = cur.getOutputs();
-                if (list != null && list.size() > 0) {
-                    logger.debug(
-                        "Append output modes for current state: " + cur.getID());
-
-                    List<Facet> fs = facets.get(cur.getID());
-
-                    if (fs != null && fs.size() > 0) {
-                        List<Output> generated = generateOutputs(list, fs);
-
-                        logger.debug("Found " + fs.size() + " current facets.");
-                        if (!generated.isEmpty()) {
-                            ProtocolUtils.appendOutputModes(
-                                doc, outs, generated);
-                        }
-                    }
-                    else {
-                        logger.debug("No facets found for the current state.");
-                    }
-                }
-            }
-        }
-        catch (IllegalArgumentException iae) {
-            // state is not valid, so we do not append its outputs.
-        }
+        ProtocolUtils.appendOutputModes(doc, outs, generated);
     }
 
 

http://dive4elements.wald.intevation.org