comparison flys-client/src/main/java/de/intevation/flys/client/server/FLYSArtifactCreator.java @ 862:c9549074ecd1

Parse Artifact's 'background-processing' attribute and lock the UI if this attribute is true. flys-client/trunk@2669 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Wed, 07 Sep 2011 13:57:28 +0000
parents 7f7f6d2c4b2c
children d5fb88ba99d2
comparison
equal deleted inserted replaced
861:65204f30877b 862:c9549074ecd1
27 /** The XPath to the artifact's hash value.*/ 27 /** The XPath to the artifact's hash value.*/
28 public static final String XPATH_HASH = "/art:result/art:hash/@art:value"; 28 public static final String XPATH_HASH = "/art:result/art:hash/@art:value";
29 29
30 /** The XPath to the artifact's name value.*/ 30 /** The XPath to the artifact's name value.*/
31 public static final String XPATH_NAME = "/art:result/art:name/@art:value"; 31 public static final String XPATH_NAME = "/art:result/art:name/@art:value";
32
33 /** The XPath to the value that determines if the artifact is processing in
34 * background.*/
35 public static final String XPATH_BACKGROUND =
36 "/art:result/art:background-processing/@art:value";
32 37
33 38
34 /** 39 /**
35 * Creates a new instance of an {@link ArtifactCreator}. 40 * Creates a new instance of an {@link ArtifactCreator}.
36 */ 41 */
74 doc, XPATH_HASH, ArtifactNamespaceContext.INSTANCE); 79 doc, XPATH_HASH, ArtifactNamespaceContext.INSTANCE);
75 80
76 String name = XMLUtils.xpathString( 81 String name = XMLUtils.xpathString(
77 doc, XPATH_NAME, ArtifactNamespaceContext.INSTANCE); 82 doc, XPATH_NAME, ArtifactNamespaceContext.INSTANCE);
78 83
84 String backgroundStr = XMLUtils.xpathString(
85 doc, XPATH_BACKGROUND, ArtifactNamespaceContext.INSTANCE);
86
87 boolean background = false;
88 if (backgroundStr != null && backgroundStr.length() > 0) {
89 background = Boolean.valueOf(backgroundStr);
90 }
91
79 System.out.println("NEW Artifact UUID: " + uuid); 92 System.out.println("NEW Artifact UUID: " + uuid);
80 System.out.println("NEW Artifact HASH: " + hash); 93 System.out.println("NEW Artifact HASH: " + hash);
81 System.out.println("NEW Artifact NAME: " + name); 94 System.out.println("NEW Artifact NAME: " + name);
95 System.out.println("NEW Artifact IN BACKGROUND: " + background);
82 96
83 if (name == null) { 97 if (name == null) {
84 return new DefaultArtifact(uuid, hash); 98 return new DefaultArtifact(uuid, hash, background);
85 } 99 }
86 100
87 name = name.trim(); 101 name = name.trim();
88 102
89 if (name.length() > 0 && name.equals("winfo")) { 103 if (name.length() > 0 && name.equals("winfo")) {
90 System.out.println("+++++ NEW WINFO ARTIFACT."); 104 System.out.println("+++++ NEW WINFO ARTIFACT.");
91 return new WINFOArtifact(uuid, hash); 105 return new WINFOArtifact(uuid, hash, background);
92 } 106 }
93 107
94 return new DefaultArtifact(uuid, hash); 108 return new DefaultArtifact(uuid, hash, background);
95 } 109 }
96 } 110 }
97 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : 111 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org