Mercurial > dive4elements > gnv-client
comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java @ 99:bb45c5097cb6
ehcache Integration for storing the chartresultvalues
gnv-artifacts/trunk@146 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Tim Englich <tim.englich@intevation.de> |
---|---|
date | Mon, 28 Sep 2009 14:17:15 +0000 |
parents | bd284d8306db |
children | 158e89c2263b |
comparison
equal
deleted
inserted
replaced
98:156db25ad4b4 | 99:bb45c5097cb6 |
---|---|
90 * @see de.intevation.artifactdatabase.DefaultArtifact#advance(org.w3c.dom.Document, de.intevation.artifacts.CallContext) | 90 * @see de.intevation.artifactdatabase.DefaultArtifact#advance(org.w3c.dom.Document, de.intevation.artifacts.CallContext) |
91 */ | 91 */ |
92 @Override | 92 @Override |
93 public Document advance(Document target, CallContext context) { | 93 public Document advance(Document target, CallContext context) { |
94 log.debug("GNVArtifactBase.advance"); | 94 log.debug("GNVArtifactBase.advance"); |
95 String uuid = Config.getStringXPath(target, "action/uuid/@value"); | |
95 Document result = XMLUtils.newDocument(); | 96 Document result = XMLUtils.newDocument(); |
96 try { | 97 try { |
97 if (this.current != null){ | 98 if (this.current != null){ |
98 String transitionName = this.readTransitionName(target); | 99 String transitionName = this.readTransitionName(target); |
99 if (this.current.isTransitionReachable(transitionName)){ | 100 if (this.current.isTransitionReachable(transitionName)){ |
101 if (this.current.validate()){ | 102 if (this.current.validate()){ |
102 | 103 |
103 try { | 104 try { |
104 Transition nextStep = this.transitions.get(transitionName); | 105 Transition nextStep = this.transitions.get(transitionName); |
105 // 2.Ergebnisse Berechnen | 106 // 2.Ergebnisse Berechnen |
106 this.current.advance(); | 107 this.current.advance(uuid); |
107 // 3. Ergebnisse übergeben | 108 // 3. Ergebnisse übergeben |
108 nextStep.setDescibeData(this.current.getDescibeData()); | 109 nextStep.setDescibeData(this.current.getDescibeData()); |
109 nextStep.putInputData(this.current.getInputData()); | 110 nextStep.putInputData(this.current.getInputData(),uuid); |
110 // 4. Umschalten auf neue Transistion | 111 // 4. Umschalten auf neue Transistion |
111 this.current = nextStep; | 112 this.current = nextStep; |
112 result = new ArtifactXMLUtilities().createSuccessReport("Advance success", XMLUtils.newDocument()); | 113 result = new ArtifactXMLUtilities().createSuccessReport("Advance success", XMLUtils.newDocument()); |
113 } catch (TransitionException e) { | 114 } catch (TransitionException e) { |
114 log.error(e,e); | 115 log.error(e,e); |
158 public Document feed(Document target, CallContext context) { | 159 public Document feed(Document target, CallContext context) { |
159 log.debug("GNVArtifactBase.feed"); | 160 log.debug("GNVArtifactBase.feed"); |
160 Document result = XMLUtils.newDocument(); | 161 Document result = XMLUtils.newDocument(); |
161 try { | 162 try { |
162 if (this.current != null){ | 163 if (this.current != null){ |
163 this.current.putInputData(this.parseInputData(target, "/action/data/input")); | 164 String uuid = Config.getStringXPath(target, "action/uuid/@value"); |
165 this.current.putInputData(this.parseInputData(target, "/action/data/input"),uuid); | |
164 result = new ArtifactXMLUtilities().createSuccessReport("Feed success", XMLUtils.newDocument()); | 166 result = new ArtifactXMLUtilities().createSuccessReport("Feed success", XMLUtils.newDocument()); |
165 }else{ | 167 }else{ |
166 String msg = "No Transition instantiated"; | 168 String msg = "No Transition instantiated"; |
167 log.warn(msg); | 169 log.warn(msg); |
168 result = new ArtifactXMLUtilities().createExceptionReport(msg, XMLUtils.newDocument()); | 170 result = new ArtifactXMLUtilities().createExceptionReport(msg, XMLUtils.newDocument()); |
358 } | 360 } |
359 } | 361 } |
360 } | 362 } |
361 return returnValue.values(); | 363 return returnValue.values(); |
362 } | 364 } |
363 /** | 365 |
364 * @see de.intevation.artifactdatabase.DefaultArtifact#out(org.w3c.dom.Document, java.lang.Object) | |
365 */ | |
366 | |
367 | 366 |
368 /** | 367 /** |
369 * @see de.intevation.artifactdatabase.DefaultArtifact#out(org.w3c.dom.Document, java.io.OutputStream, de.intevation.artifacts.CallContext) | 368 * @see de.intevation.artifactdatabase.DefaultArtifact#out(org.w3c.dom.Document, java.io.OutputStream, de.intevation.artifacts.CallContext) |
370 */ | 369 */ |
371 @Override | 370 @Override |
373 throws IOException { | 372 throws IOException { |
374 log.debug("TGNVArtifactBase.out"); | 373 log.debug("TGNVArtifactBase.out"); |
375 try { | 374 try { |
376 | 375 |
377 if (current != null && current instanceof OutputTransition){ | 376 if (current != null && current instanceof OutputTransition){ |
378 ((OutputTransition)current).out(this.readOutputType(format),this.parseInputData(format, "/action/out/params/input"), outputStream); | 377 String uuid = Config.getStringXPath(format, "action/uuid/@value"); |
379 context.afterCall(CallContext.STORE); // TODO: FIXME Schmutzige Lösung: Besser einen weiteren Transitionsschritt zwischenschalten. | 378 ((OutputTransition)current).out(this.readOutputType(format),this.parseInputData(format, "/action/out/params/input"), outputStream,uuid); |
379 //context.afterCall(CallContext.STORE); // TODO: FIXME Schmutzige Lösung: Besser einen weiteren Transitionsschritt zwischenschalten. | |
380 } | 380 } |
381 } catch (TransitionException e) { | 381 } catch (TransitionException e) { |
382 log.error(e,e); | 382 log.error(e,e); |
383 throw new IOException(e.getMessage()); | 383 throw new IOException(e.getMessage()); |
384 } | 384 } |