comparison artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java @ 6323:f49749526af4

Fix dc:fromValue and dc:toValue for locations The mode is named location and not locations
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 13 Jun 2013 09:43:50 +0200
parents 95257f28bb3f
children 00aa1bc72a65
comparison
equal deleted inserted replaced
6322:8c976bb0362f 6323:f49749526af4
232 public Object fromValue(List args) throws XPathFunctionException { 232 public Object fromValue(List args) throws XPathFunctionException {
233 Object mode = args.get(0); 233 Object mode = args.get(0);
234 Object locations = args.get(1); 234 Object locations = args.get(1);
235 Object from = args.get(2); 235 Object from = args.get(2);
236 236
237 if (mode instanceof String && mode.equals("locations")) { 237 if (mode instanceof String && mode.equals("location")) {
238 if (!(locations instanceof String)) { 238 if (!(locations instanceof String)) {
239 return -FAR_AWAY; 239 return -FAR_AWAY;
240 } 240 }
241 String loc = ((String)locations).replace(" ", ""); 241 String loc = ((String)locations).replace(" ", "");
242 String[] split = loc.split(","); 242 String[] split = loc.split(",");
277 public Object toValue(List args) throws XPathFunctionException { 277 public Object toValue(List args) throws XPathFunctionException {
278 Object mode = args.get(0); 278 Object mode = args.get(0);
279 Object locations = args.get(1); 279 Object locations = args.get(1);
280 Object to = args.get(2); 280 Object to = args.get(2);
281 281
282 if (mode instanceof String && mode.equals("locations")) { 282 if (mode instanceof String && mode.equals("location")) {
283 if (!(locations instanceof String)) { 283 if (!(locations instanceof String)) {
284 return FAR_AWAY; 284 return FAR_AWAY;
285 } 285 }
286 try { 286 try {
287 String loc = ((String)locations).replace(" ", ""); 287 String loc = ((String)locations).replace(" ", "");

http://dive4elements.wald.intevation.org