jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mreut...@apache.org
Subject svn commit: r892268 - in /jackrabbit/branches/2.0: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/
Date Fri, 18 Dec 2009 15:03:41 GMT
Author: mreutegg
Date: Fri Dec 18 15:03:35 2009
New Revision: 892268

URL: http://svn.apache.org/viewvc?rev=892268&view=rev
Log:
JCR-2444: Exception executing SQL2/JQOM with non-admin session

Modified:
    jackrabbit/branches/2.0/   (props changed)
    jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/NodeLocalNameOperand.java
    jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/NodeNameOperand.java
    jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/PropertyValueOperand.java

Propchange: jackrabbit/branches/2.0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Dec 18 15:03:35 2009
@@ -2,4 +2,4 @@
 /jackrabbit/sandbox/JCR-1456:774917-886178
 /jackrabbit/sandbox/JCR-2170:812417-816332
 /jackrabbit/sandbox/tripod-JCR-2209:795441-795863
-/jackrabbit/trunk:891629,892253
+/jackrabbit/trunk:891629,892253,892263

Modified: jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/NodeLocalNameOperand.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/NodeLocalNameOperand.java?rev=892268&r1=892267&r2=892268&view=diff
==============================================================================
--- jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/NodeLocalNameOperand.java
(original)
+++ jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/NodeLocalNameOperand.java
Fri Dec 18 15:03:35 2009
@@ -16,11 +16,12 @@
  */
 package org.apache.jackrabbit.core.query.lucene.constraint;
 
+import javax.jcr.ItemNotFoundException;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
 
-import org.apache.jackrabbit.core.query.lucene.ScoreNode;
 import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.query.lucene.ScoreNode;
 import org.apache.jackrabbit.util.Text;
 
 /**
@@ -41,8 +42,13 @@
     public Value[] getValues(ScoreNode sn, EvaluationContext context)
             throws RepositoryException {
         SessionImpl session = context.getSession();
-        String name = session.getNodeById(sn.getNodeId()).getName();
-        return new Value[]{session.getValueFactory().createValue(
-                Text.getLocalName(name))};
+        try {
+            String name = session.getNodeById(sn.getNodeId()).getName();
+            return new Value[]{session.getValueFactory().createValue(
+                    Text.getLocalName(name))};
+        } catch (ItemNotFoundException e) {
+            // access denied to score node
+            return new Value[0];
+        }
     }
 }

Modified: jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/NodeNameOperand.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/NodeNameOperand.java?rev=892268&r1=892267&r2=892268&view=diff
==============================================================================
--- jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/NodeNameOperand.java
(original)
+++ jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/NodeNameOperand.java
Fri Dec 18 15:03:35 2009
@@ -16,12 +16,13 @@
  */
 package org.apache.jackrabbit.core.query.lucene.constraint;
 
+import javax.jcr.ItemNotFoundException;
+import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
-import javax.jcr.PropertyType;
 
-import org.apache.jackrabbit.core.query.lucene.ScoreNode;
 import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.query.lucene.ScoreNode;
 
 /**
  * <code>NodeNameOperand</code> implements a node name operand.
@@ -40,7 +41,12 @@
     public Value[] getValues(ScoreNode sn, EvaluationContext context)
             throws RepositoryException {
         SessionImpl session = context.getSession();
-        String name = session.getNodeById(sn.getNodeId()).getName();
-        return new Value[]{session.getValueFactory().createValue(name, PropertyType.NAME)};
+        try {
+            String name = session.getNodeById(sn.getNodeId()).getName();
+            return new Value[]{session.getValueFactory().createValue(name, PropertyType.NAME)};
+        } catch (ItemNotFoundException e) {
+            // access denied to score node
+            return new Value[0];
+        }
     }
 }

Modified: jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/PropertyValueOperand.java
URL: http://svn.apache.org/viewvc/jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/PropertyValueOperand.java?rev=892268&r1=892267&r2=892268&view=diff
==============================================================================
--- jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/PropertyValueOperand.java
(original)
+++ jackrabbit/branches/2.0/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/constraint/PropertyValueOperand.java
Fri Dec 18 15:03:35 2009
@@ -16,20 +16,21 @@
  */
 package org.apache.jackrabbit.core.query.lucene.constraint;
 
-import javax.jcr.Value;
-import javax.jcr.Property;
+import javax.jcr.ItemNotFoundException;
 import javax.jcr.Node;
 import javax.jcr.PathNotFoundException;
+import javax.jcr.Property;
 import javax.jcr.RepositoryException;
+import javax.jcr.Value;
 
-import org.apache.jackrabbit.spi.commons.query.qom.PropertyValueImpl;
+import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.id.PropertyId;
 import org.apache.jackrabbit.core.query.lucene.ScoreNode;
-import org.apache.jackrabbit.core.state.ItemStateManager;
-import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.state.ItemStateException;
+import org.apache.jackrabbit.core.state.ItemStateManager;
 import org.apache.jackrabbit.core.state.NoSuchItemStateException;
-import org.apache.jackrabbit.core.id.PropertyId;
-import org.apache.jackrabbit.core.SessionImpl;
+import org.apache.jackrabbit.core.state.PropertyState;
+import org.apache.jackrabbit.spi.commons.query.qom.PropertyValueImpl;
 
 /**
  * <code>PropertyValueOperand</code> implements a property value operand.
@@ -90,7 +91,11 @@
         try {
             Node n = session.getNodeById(sn.getNodeId());
             return n.getProperty(operand.getPropertyName());
+        } catch (ItemNotFoundException e) {
+            // access denied to score node
+            return null;
         } catch (PathNotFoundException e) {
+            // property not found
             return null;
         }
     }



Mime
View raw message