From 54f3ed06b35c7f352909cf159432e961ca38c264 Mon Sep 17 00:00:00 2001 From: Mike Taylor Date: Tue, 27 Jul 2010 17:16:38 +0100 Subject: [PATCH] Patch from Ralph LeVan to recognise "qualifier.dc.creator"-like properties as well as "index.dc.creator" -- backwards compatible with version prior to 1.0 as well as those subsequent. --- src/main/java/org/z3950/zing/cql/CQLTermNode.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/z3950/zing/cql/CQLTermNode.java b/src/main/java/org/z3950/zing/cql/CQLTermNode.java index f9b17ac..924b6ba 100644 --- a/src/main/java/org/z3950/zing/cql/CQLTermNode.java +++ b/src/main/java/org/z3950/zing/cql/CQLTermNode.java @@ -43,6 +43,7 @@ public class CQLTermNode extends CQLNode { qual.equals("cql.resultSetName")); } + @Override public String getResultSetName() { if (isResultSetIndex(index)) return term; @@ -96,6 +97,8 @@ public class CQLTermNode extends CQLNode { attr = config.getProperty("index." + index); if (attr == null) + attr = config.getProperty("qualifier." + index); + if (attr == null) throw new UnknownIndexException(index); attrs.add(attr); @@ -227,7 +230,7 @@ public class CQLTermNode extends CQLNode { if (len > 0 && text.substring(len-1, len).equals("^")) text = text.substring(0, len-1); - String attr, attrList, term = text; + String attr, attrList; byte[] operand = new byte[text.length()+100]; int i, j, offset, type, value; offset = putTag(CONTEXT, 0, CONSTRUCTED, operand, 0); // op @@ -264,7 +267,7 @@ public class CQLTermNode extends CQLNode { operand[offset++] = 0x00; offset = putTag(CONTEXT, 45, PRIMITIVE, operand, offset); // general Term - byte[] t = term.getBytes(); + byte[] t = text.getBytes(); offset = putLen(t.length, operand, offset); System.arraycopy(t, 0, operand, offset, t.length); offset += t.length; -- 1.7.10.4