changeset 194:00c1a931b9c3

Catch Exception that the Calling Program could not put no InputData into the feed Request.issue56 gnv-artifacts/trunk@244 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Mon, 19 Oct 2009 12:18:08 +0000
parents 34f233123a6f
children 63f65fb9f210
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java
diffstat 2 files changed, 18 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Mon Oct 19 12:06:48 2009 +0000
+++ b/gnv-artifacts/ChangeLog	Mon Oct 19 12:18:08 2009 +0000
@@ -1,5 +1,11 @@
 2009-10-19  Tim Englich  <tim.englich@intevation.de>
 
+	* src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (feed):
+	  Catch Exception that the Calling Program could not put no InputData 
+	  into the feed Request.issue56 
+
+2009-10-19  Tim Englich  <tim.englich@intevation.de>
+	
 	* src/main/java/de/intevation/gnv/chart/ChartFactory.java (createDataset),
 	  src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java (createDataset):
 	  Adding empty Series into Chart to prevent NPE issue 19
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java	Mon Oct 19 12:06:48 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java	Mon Oct 19 12:18:08 2009 +0000
@@ -181,10 +181,18 @@
             if (this.current != null) {
                 String uuid = Config.getStringXPath(target,
                         "action/uuid/@value");
-                this.current.putInputData(this.parseInputData(target,
-                        "/action/data/input"), uuid);
-                result = new ArtifactXMLUtilities().createSuccessReport(
-                        "Feed success", XMLUtils.newDocument());
+                Collection<InputData> inputData = this.parseInputData(target,
+                                                                      "/action/data/input");
+                if (!inputData.isEmpty()){
+                    this.current.putInputData(inputData, uuid);
+                    result = new ArtifactXMLUtilities().createSuccessReport(
+                            "Feed success", XMLUtils.newDocument());
+                }else{
+                    String msg = "No Inputdata given. Please select at least one Entry.";
+                    log.warn(msg);
+                    result = new ArtifactXMLUtilities().createExceptionReport(msg,
+                            XMLUtils.newDocument());
+                }
             } else {
                 String msg = "No Transition instantiated";
                 log.warn(msg);

http://dive4elements.wald.intevation.org