From: Niels Erik G. Nielsen Date: Fri, 18 Apr 2014 19:53:05 +0000 (-0400) Subject: Adds pazpar2 limit parameter delimiters to escape X-Git-Tag: v0.0.7~11 X-Git-Url: http://jsfdemo.indexdata.com/cgi-bin?a=commitdiff_plain;h=1e8b64ac581cdc14d250c299347a628a5b57813b;p=mkjsf-moved-to-github.git Adds pazpar2 limit parameter delimiters to escape --- diff --git a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/LimitParameter.java b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/LimitParameter.java index 93a26fc..9a11143 100644 --- a/src/main/java/com/indexdata/mkjsf/pazpar2/commands/LimitParameter.java +++ b/src/main/java/com/indexdata/mkjsf/pazpar2/commands/LimitParameter.java @@ -31,17 +31,14 @@ public class LimitParameter extends CommandParameter { completeValue.append(","); else first=false; - completeValue.append(expr.toString()); + completeValue.append(expr.getField() + expr.getOperator() + expr.getValue()); logger.trace("valueWithExpressions so far: [" + completeValue + "]"); } return completeValue.toString(); } - - private String pz2escape (String expressionString) { - String escaped = expressionString.replaceAll("\\\\","\\\\\\\\"); - escaped = escaped.replaceAll(",","\\\\,"); - escaped = escaped.replaceAll("\\|", "\\\\|"); - return escaped; + + private String pz2escape (String str) { + return str.replaceAll("[~|,=\\\\]","\\\\$0"); }