comparison gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/SelectProductArtifact.java @ 778:9a828e5a2390

Removed trailing whitespace gnv-artifacts/trunk@851 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 29 Mar 2010 07:58:51 +0000
parents 9681ac6b6527
children b1f5f2a8840f
comparison
equal deleted inserted replaced
777:8009961db1cb 778:9a828e5a2390
46 46
47 public static final String XPATH_HASH = "art:action/art:hash/@value"; 47 public static final String XPATH_HASH = "art:action/art:hash/@value";
48 48
49 public static final String XPATH_INPUT_DATA_VALUE = 49 public static final String XPATH_INPUT_DATA_VALUE =
50 "art:action/art:data/art:input[@name='product']/@value"; 50 "art:action/art:data/art:input[@name='product']/@value";
51 51
52 public static final String XPATH_SETUP_PARAMETER_NODES = 52 public static final String XPATH_SETUP_PARAMETER_NODES =
53 "/art:action/art:factory/art:parameter"; 53 "/art:action/art:factory/art:parameter";
54 54
55 public static final String XFORM_URL = "http://www.w3.org/2002/xforms"; 55 public static final String XFORM_URL = "http://www.w3.org/2002/xforms";
56 public static final String XFORM_PREFIX = "xform"; 56 public static final String XFORM_PREFIX = "xform";
57 57
59 59
60 private Map products; 60 private Map products;
61 private Product current; 61 private Product current;
62 private Artifact artifact; 62 private Artifact artifact;
63 private String name; 63 private String name;
64 64
65 private Map<String, InputData> preSettings = null; 65 private Map<String, InputData> preSettings = null;
66 66
67 public SelectProductArtifact() { 67 public SelectProductArtifact() {
68 super(); 68 super();
69 } 69 }
76 Object context, 76 Object context,
77 Document data) { 77 Document data) {
78 log.debug("SelectProductArtifact.setup()"); 78 log.debug("SelectProductArtifact.setup()");
79 super.setup(identifier, factory, context,data); 79 super.setup(identifier, factory, context,data);
80 this.name = factory.getName(); 80 this.name = factory.getName();
81 81
82 // Read the Parameters that should be used for the setup from the 82 // Read the Parameters that should be used for the setup from the
83 // Data-XML.Document. 83 // Data-XML.Document.
84 NodeList parameterNodes = (NodeList) XMLUtils.xpath(data, 84 NodeList parameterNodes = (NodeList) XMLUtils.xpath(data,
85 XPATH_SETUP_PARAMETER_NODES, 85 XPATH_SETUP_PARAMETER_NODES,
86 XPathConstants.NODESET, 86 XPathConstants.NODESET,
87 ArtifactNamespaceContext.INSTANCE); 87 ArtifactNamespaceContext.INSTANCE);
88 if (parameterNodes != null && parameterNodes.getLength() > 0){ 88 if (parameterNodes != null && parameterNodes.getLength() > 0){
89 this.preSettings = new HashMap<String, InputData>(); 89 this.preSettings = new HashMap<String, InputData>();
100 }else{ 100 }else{
101 inputData.concartValue(value); 101 inputData.concartValue(value);
102 } 102 }
103 } 103 }
104 } 104 }
105 105
106 } 106 }
107 107
108 108
109 public void setProducts(Map products) { 109 public void setProducts(Map products) {
110 this.products = products; 110 this.products = products;
204 .getInternalArtifactFactory(this.name); 204 .getInternalArtifactFactory(this.name);
205 factory = ((GNVProductArtifactFactory)factory) 205 factory = ((GNVProductArtifactFactory)factory)
206 .getArtifactFactoryByName(current.getName()); 206 .getArtifactFactoryByName(current.getName());
207 artifact = factory.createArtifact(uuid, context, null); 207 artifact = factory.createArtifact(uuid, context, null);
208 208
209 209
210 if (this.preSettings != null && artifact instanceof PreSettingArtifact){ 210 if (this.preSettings != null && artifact instanceof PreSettingArtifact){
211 ((PreSettingArtifact)artifact).setPreSettings(this.preSettings); 211 ((PreSettingArtifact)artifact).setPreSettings(this.preSettings);
212 } 212 }
213 213
214 artifact.feed(feedDocument(uuid, hash), context); 214 artifact.feed(feedDocument(uuid, hash), context);
215 215
216 result = ((GNVArtifactBase) artifact).initialize(context); 216 result = ((GNVArtifactBase) artifact).initialize(context);
217 if (artifact instanceof GNVArtifactBase) { 217 if (artifact instanceof GNVArtifactBase) {
218 ((GNVArtifactBase) artifact).setProduct(current); 218 ((GNVArtifactBase) artifact).setProduct(current);

http://dive4elements.wald.intevation.org