comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java @ 89:cde042a0a395

Successreporting added gnv-artifacts/trunk@126 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Thu, 24 Sep 2009 11:03:31 +0000
parents 1b12021905b9
children 158e89c2263b
comparison
equal deleted inserted replaced
88:1b12021905b9 89:cde042a0a395
187 /** 187 /**
188 * @see de.intevation.artifactdatabase.DefaultArtifact#feed(org.w3c.dom.Document, java.lang.Object) 188 * @see de.intevation.artifactdatabase.DefaultArtifact#feed(org.w3c.dom.Document, java.lang.Object)
189 */ 189 */
190 @Override 190 @Override
191 public Document feed(Document target, CallContext context) { 191 public Document feed(Document target, CallContext context) {
192 log.debug("FISArtifact.feed");
193 Document result = null;
192 if (this.productArtifact == null){ 194 if (this.productArtifact == null){
193 String productName = Config.getStringXPath(target, "action/data/input[@name='product']/@value"); 195 String productName = Config.getStringXPath(target, "action/data/input[@name='product']/@value");
196 log.debug("Looking for ProductArtifact "+productName);
194 if (this.products.containsKey(productName)) { 197 if (this.products.containsKey(productName)) {
195 this.current = this.products.get(productName); 198 this.current = this.products.get(productName);
196 // TODO : success-Dokument erzeugen 199 result = new ArtifactXMLUtilities().createSuccessReport("Feed success New ProductArtifact created", XMLUtils.newDocument());
197 return null;
198 }else{ 200 }else{
199 String msg = "Product does not exists for "+productName; 201 String msg = "Product does not exists for "+productName;
200 log.error(msg); 202 log.error(msg);
201 return new ArtifactXMLUtilities().createExceptionReport(msg, XMLUtils.newDocument()); 203 result = new ArtifactXMLUtilities().createExceptionReport(msg, XMLUtils.newDocument());
202 } 204 }
203 }else{ 205 }else{
204 return this.productArtifact.feed(target, context); 206 log.debug("Feed a Productartifact");
205 } 207 result = this.productArtifact.feed(target, context);
208 }
209 return result;
206 } 210 }
207 211
208 /** 212 /**
209 * @see de.intevation.artifactdatabase.DefaultArtifact#out(org.w3c.dom.Document, java.lang.Object) 213 * @see de.intevation.artifactdatabase.DefaultArtifact#out(org.w3c.dom.Document, java.lang.Object)
210 */ 214 */
255 Node artifactFactoryNode = Config.getNodeXPath(productNode, "artifact-factory"); 259 Node artifactFactoryNode = Config.getNodeXPath(productNode, "artifact-factory");
256 ArtifactFactory artifactFactory =new ArtifactFactoryUtilities().createArtitfactFactor(doc, artifactFactoryNode); 260 ArtifactFactory artifactFactory =new ArtifactFactoryUtilities().createArtitfactFactor(doc, artifactFactoryNode);
257 this.products.put(productName, new DefaultProduct(productName, parameter,artifactFactory)); 261 this.products.put(productName, new DefaultProduct(productName, parameter,artifactFactory));
258 } 262 }
259 } 263 }
260
261
262 } 264 }
263 } 265 }
264 266
265 protected Node getConfigurationFragment(Document document){ 267 protected Node getConfigurationFragment(Document document){
266 log.debug("GNVArtifactBase.getConfigurationFragment"); 268 log.debug("GNVArtifactBase.getConfigurationFragment");

http://dive4elements.wald.intevation.org