Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/ArtifactDescriptionFactory.java @ 1592:f34bbb5fb6d2
Added TODO and handle dynamic data of unknown type.
flys-client/trunk@3892 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Fri, 03 Feb 2012 11:15:09 +0000 |
parents | 1227878665b5 |
children | ff9d71469b7c |
comparison
equal
deleted
inserted
replaced
1591:8ab010967f78 | 1592:f34bbb5fb6d2 |
---|---|
133 String type = XMLUtils.xpathString( | 133 String type = XMLUtils.xpathString( |
134 d, "@art:type", ArtifactNamespaceContext.INSTANCE); | 134 d, "@art:type", ArtifactNamespaceContext.INSTANCE); |
135 | 135 |
136 logger.debug("Create new IntegerRangeData object for: " + name); | 136 logger.debug("Create new IntegerRangeData object for: " + name); |
137 logger.debug("New Data is from type: " + type); | 137 logger.debug("New Data is from type: " + type); |
138 | |
139 // TODO replace with DataFactory. | |
138 | 140 |
139 if (type == null || type.length() == 0) { | 141 if (type == null || type.length() == 0) { |
140 NodeList choices = ClientProtocolUtils.getItemNodes(d); | 142 NodeList choices = ClientProtocolUtils.getItemNodes(d); |
141 DataItem[] dataItems = extractCurrentDataItems(choices); | 143 DataItem[] dataItems = extractCurrentDataItems(choices); |
142 DataItem def = extractDefaultDataItem(d); | 144 DataItem def = extractDefaultDataItem(d); |
177 NodeList choices = ClientProtocolUtils.getItemNodes(d); | 179 NodeList choices = ClientProtocolUtils.getItemNodes(d); |
178 DataItem[] opts = extractCurrentDataItems(choices); | 180 DataItem[] opts = extractCurrentDataItems(choices); |
179 | 181 |
180 list.add(new IntegerOptionsData(name, label, opts)); | 182 list.add(new IntegerOptionsData(name, label, opts)); |
181 } | 183 } |
184 else { | |
185 logger.warn("Unrecognized Dynamic data type."); | |
186 NodeList choices = ClientProtocolUtils.getItemNodes(d); | |
187 DataItem[] dataItems = extractCurrentDataItems(choices); | |
188 DataItem def = extractDefaultDataItem(d); | |
189 | |
190 list.add(new DefaultData(name, label, null, dataItems, def)); | |
191 } | |
192 | |
182 } | 193 } |
183 | 194 |
184 return list; | 195 return list; |
185 } | 196 } |
186 | 197 |