jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r1653275 - /jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/user/AuthorizableQueryManager.java
Date Tue, 20 Jan 2015 15:47:55 GMT
Author: angela
Date: Tue Jan 20 15:47:55 2015
New Revision: 1653275

URL: http://svn.apache.org/r1653275
Log:
JCR-3845 : Have AuthorizableQueryManager Support Specifying Sort Ignore Case Mode (patch provided
by dominique jaeggi)

Modified:
    jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/user/AuthorizableQueryManager.java

Modified: jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/user/AuthorizableQueryManager.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/user/AuthorizableQueryManager.java?rev=1653275&r1=1653274&r2=1653275&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/user/AuthorizableQueryManager.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-commons/src/main/java/org/apache/jackrabbit/commons/jackrabbit/user/AuthorizableQueryManager.java
Tue Jan 20 15:47:55 2015
@@ -60,6 +60,7 @@ import java.util.Stack;
     {
       property: /* relative path (String) * /
       ( direction: "asc" | "desc" )                       // Defaults to "asc"
+      ( ignoreCase: true | false )                        // Defaults to "true", see QueryBuilder#setSortOrder()
     }
   ) ?                                                     // Defaults to document order
 
@@ -636,15 +637,16 @@ public class AuthorizableQueryManager {
             private String currentKey;
             private String property;
             private QueryBuilder.Direction direction;
+            private boolean ignoreCase = true;
 
             @Override
             public void endObject() throws IOException {
                 if (property == null) {
                     throw new IOException("Missing property");
                 } else {
-                    queryBuilder.setSortOrder(property, direction == null
-                            ? QueryBuilder.Direction.ASCENDING
-                            : direction, true);
+                    queryBuilder.setSortOrder(property,
+                            direction == null ? QueryBuilder.Direction.ASCENDING : direction,
+                            ignoreCase);
                 }
                 handlers.pop();
             }
@@ -660,6 +662,8 @@ public class AuthorizableQueryManager {
                     property = s;
                 } else if ("direction".equals(currentKey)) {
                     direction = directionFor(s);
+                } else if ("ignoreCase".equals(currentKey)) {
+                    ignoreCase = Boolean.valueOf(s);
                 } else {
                     throw new IOException("Unexpected: '" + currentKey + ':' + s + '\'');
                 }



Mime
View raw message