jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r1436914 [3/3] - in /jackrabbit/trunk: jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/
Date Tue, 22 Jan 2013 13:37:42 GMT
Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java?rev=1436914&r1=1436913&r2=1436914&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SearchIndex.java
Tue Jan 22 13:37:41 2013
@@ -1166,6 +1166,8 @@ public class SearchIndex extends Abstrac
                     sortFields.add(new SortField(orderProps[i].getString(), new UpperCaseSortComparator(scs),
!orderSpecs[i]));
                 } else if ("lower-case".equals(orderFuncs[i])) {
                     sortFields.add(new SortField(orderProps[i].getString(), new LowerCaseSortComparator(scs),
!orderSpecs[i]));
+                } else if ("normalize".equals(orderFuncs[i])) {
+                    sortFields.add(new SortField(orderProps[i].getString(), new NormalizeSortComparator(scs),
!orderSpecs[i]));
                 } else {
                     sortFields.add(new SortField(orderProps[i].getString(), scs, !orderSpecs[i]));
                 }

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java?rev=1436914&r1=1436913&r2=1436914&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/xpath/XPathQueryBuilder.java
Tue Jan 22 13:37:41 2013
@@ -85,6 +85,11 @@ public class XPathQueryBuilder implement
     static final Name FN_UPPER_CASE = NAME_FACTORY.create(NS_FN_URI, "upper-case");
 
     /**
+     * Name for 'rep:normalize'
+     */
+    static final Name REP_NORMALIZE = NAME_FACTORY.create(Name.NS_REP_URI, "normalize");
+
+    /**
      * Name for 'not' as defined in XPath 1.0 (no prefix)
      */
     static final Name FN_NOT_10 = NAME_FACTORY.create("", "not");
@@ -1009,7 +1014,18 @@ public class XPathQueryBuilder implement
                         exceptions.add(new InvalidQueryException("Unsupported location for
fn:upper-case()"));
                     }
                 } else {
-                    exceptions.add(new InvalidQueryException("Unsupported location for fn:upper-case()"));
+                    exceptions.add(new InvalidQueryException("Wrong number of argument for
fn:upper-case()"));
+                }
+            } else if (REP_NORMALIZE.equals(funName)) {
+                if (node.jjtGetNumChildren() == 2) {
+                    if (queryNode.getType() == QueryNode.TYPE_ORDER) {
+                        ((OrderQueryNode) queryNode).setFunction(REP_NORMALIZE.getLocalName());
+                        node.childrenAccept(this, queryNode);
+                    } else {
+                        exceptions.add(new InvalidQueryException("Unsupported location for
rep:normalize()"));
+                    }
+                } else {
+                    exceptions.add(new InvalidQueryException("Wrong number of argument for
rep:normalize()"));
                 }
             } else if (REP_SIMILAR.equals(funName)) {
                 if (node.jjtGetNumChildren() == 3) {



Mime
View raw message