jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r792508 - in /jackrabbit/trunk: ./ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/ jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/ jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/quer...
Date Thu, 09 Jul 2009 11:39:06 GMT
Author: jukka
Date: Thu Jul  9 11:39:05 2009
New Revision: 792508

URL: http://svn.apache.org/viewvc?rev=792508&view=rev
Log:
JCR-1104: JSR 283 support

Upgraded to the latest pre-release version of the JCR 2.0 API jar. Adjusted sources accordingly
(see JCR-2200 and JCR-2201 for the missing pieces).

Modified:
    jackrabbit/trunk/README.txt
    jackrabbit/trunk/RELEASE-NOTES.txt
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingleColumnQueryResult.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/FullTextSearchScoreTest.java
    jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/QueryObjectModelFactoryTest.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryObjectModelImpl.java
    jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
    jackrabbit/trunk/jackrabbit-parent/pom.xml
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/QueryObjectModelFactoryImpl.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java
    jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/sql2/ParserTest.java

Modified: jackrabbit/trunk/README.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/README.txt?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/README.txt (original)
+++ jackrabbit/trunk/README.txt Thu Jul  9 11:39:05 2009
@@ -10,10 +10,10 @@
 repositories include content management, document management,
 and records management systems.
 
-Jackrabbit is currently based on the Proposed Final Draft (PFD) version
-of the JCR 2.0 API defined by the Java Specification Request 283
-(JSR 283, http://jcp.org/en/jsr/detail?id=283). Version 1.0 of the
-JCR API was specified by JSR 170.
+Jackrabbit is currently based on a pre-release version of the JCR 2.0 API
+defined by the Java Specification Request 283 (JSR 283,
+http://jcp.org/en/jsr/detail?id=283). Version 1.0 of the JCR API was
+specified by JSR 170.
 
 Apache Jackrabbit is a project of the Apache Software Foundation.
 
@@ -25,7 +25,7 @@
 and install them to your local Maven repository:
 
     mvn install:install-file \
-        -Dfile=jcr-2.0-b18.jar -DpomFile=jcr-2.0-b18.xml
+        -Dfile=jcr-2.0-b19.jar -DpomFile=jcr-2.0-b19.xml
 
 Once you've installed the jar, you can build Jackrabbit like this:
 
@@ -89,4 +89,3 @@
 
 See http://jackrabbit.apache.org/jackrabbit-team.html for the list of 
 Jackrabbit committers and main contributors.
-

Modified: jackrabbit/trunk/RELEASE-NOTES.txt
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/RELEASE-NOTES.txt?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/RELEASE-NOTES.txt (original)
+++ jackrabbit/trunk/RELEASE-NOTES.txt Thu Jul  9 11:39:05 2009
@@ -45,12 +45,12 @@
 JCR 2.0 feature completeness
 ----------------------------
 
-The following 39 top level JCR 2.0 implementation issues are being tracked in
+The following 41 top level JCR 2.0 implementation issues are being tracked in
 the Jackrabbit issue tracker. Most of them have already been partially
 implemented, but the issue will only be marked as resolved once no more
 related work is needed.
 
-Open (14 issues)
+Open (16 issues)
   [JCR-1565] JSR 283 lifecycle management
   [JCR-1588] JSR 283: Access Control
   [JCR-1590] JSR 283: Locking
@@ -65,6 +65,8 @@
   [JCR-2137] Use type StaticOperand for fullTextSearchExpression
   [JCR-2140] JSR 283: Baselines
   [JCR-2198] Text.escapeIllegalJCRChars should be adjusted to match the ...
+  [JCR-2200] Implement Query.getBindVariableNames()
+  [JCR-2201] Implement QueryResult.getSelectorNames()
 
 Resolved (25 issues)
   [JCR-1564] JSR 283 namespace handling

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryImpl.java
Thu Jul  9 11:39:05 2009
@@ -195,6 +195,12 @@
         }
     }
 
+    // TODO: JCR-2200: Implement Query.getBindVariableNames()
+    public String[] getBindVariableNames() throws RepositoryException {
+        throw new UnsupportedRepositoryOperationException(
+                "JCR-2200: Implement Query.getBindVariableNames()");
+    }
+
     /**
      * Binds the given <code>value</code> to the variable named
      * <code>varName</code>.
@@ -267,5 +273,5 @@
             throw new IllegalStateException("not initialized");
         }
     }
-}
 
+}

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
Thu Jul  9 11:39:05 2009
@@ -80,8 +80,7 @@
         this.session = session;
         this.itemMgr = itemMgr;
         this.searchMgr = searchMgr;
-        this.qomFactory = new QueryObjectModelFactoryImpl(
-                session, session.getValueFactory()) {
+        this.qomFactory = new QueryObjectModelFactoryImpl(session) {
             protected QueryObjectModel createQuery(QueryObjectModelTree qomTree)
                     throws InvalidQueryException, RepositoryException {
                 return searchMgr.createQueryObjectModel(
@@ -194,8 +193,7 @@
 
         public QueryFactoryImpl(final Node node, final String language) {
             super(Arrays.asList(
-                new QOMQueryFactory(new QueryObjectModelFactoryImpl(
-                        session, session.getValueFactory()) {
+                new QOMQueryFactory(new QueryObjectModelFactoryImpl(session) {
                     protected QueryObjectModel createQuery(QueryObjectModelTree qomTree)
                             throws InvalidQueryException, RepositoryException {
                         return searchMgr.createQueryObjectModel(

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/QueryResultImpl.java
Thu Jul  9 11:39:05 2009
@@ -27,6 +27,7 @@
 import javax.jcr.ItemNotFoundException;
 import javax.jcr.NodeIterator;
 import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.query.QueryResult;
 import javax.jcr.query.RowIterator;
 import java.io.IOException;
@@ -181,6 +182,12 @@
         }
     }
 
+    // TODO: JCR-2201: Implement QueryResult.getSelectorNames()
+    public String[] getSelectorNames() throws RepositoryException {
+        throw new UnsupportedRepositoryOperationException(
+                "JCR-2201: Implement QueryResult.getSelectorNames()");
+    }
+
     /**
      * {@inheritDoc}
      */

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingleColumnQueryResult.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingleColumnQueryResult.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingleColumnQueryResult.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/query/lucene/SingleColumnQueryResult.java
Thu Jul  9 11:39:05 2009
@@ -85,4 +85,5 @@
     protected ExcerptProvider createExcerptProvider() throws IOException {
         return index.createExcerptProvider(query);
     }
+
 }

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/AbstractQueryTest.java
Thu Jul  9 11:39:05 2009
@@ -30,6 +30,8 @@
 import javax.jcr.Node;
 import javax.jcr.NodeIterator;
 import javax.jcr.Session;
+import javax.jcr.ValueFactory;
+
 import java.util.Set;
 import java.util.HashSet;
 import java.util.Iterator;
@@ -81,6 +83,11 @@
     protected QueryObjectModelFactory qf;
 
     /**
+     * The value factory for creating literals for the query object model.
+     */
+    protected ValueFactory vf;
+
+    /**
      * The query manager for {@link #superuser}
      */
     protected QueryManager qm;
@@ -100,11 +107,13 @@
         xpathRoot = "/" + jcrRoot + ISO9075.encodePath(testRoot);
         qm = superuser.getWorkspace().getQueryManager();
         qf = qm.getQOMFactory();
+        vf = superuser.getValueFactory();
     }
 
     protected void tearDown() throws Exception {
         qm = null;
         qf = null;
+        vf = null;
         super.tearDown();
     }
 

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/FullTextSearchScoreTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/FullTextSearchScoreTest.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/FullTextSearchScoreTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/FullTextSearchScoreTest.java
Thu Jul  9 11:39:05 2009
@@ -45,7 +45,7 @@
         QueryObjectModel qom = qf.createQuery(
                 qf.selector(testNodeType, "s"),
                 qf.and(
-                        qf.fullTextSearch("s", null, "fox"),
+                        qf.fullTextSearch("s", null, qf.literal(vf.createValue("fox"))),
                         qf.descendantNode("s", testRootNode.getPath())
                 ),
                 new Ordering[]{qf.ascending(qf.fullTextSearchScore("s"))},
@@ -72,7 +72,7 @@
                 qf.selector(testNodeType, "s"),
                 qf.and(
                         qf.and(
-                                qf.fullTextSearch("s", null, "fox"),
+                                qf.fullTextSearch("s", null, qf.literal(vf.createValue("fox"))),
                                 qf.comparison(
                                         qf.fullTextSearchScore("s"),
                                         QueryObjectModelFactory.JCR_OPERATOR_GREATER_THAN,

Modified: jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/QueryObjectModelFactoryTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/QueryObjectModelFactoryTest.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/QueryObjectModelFactoryTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-tests/src/main/java/org/apache/jackrabbit/test/api/query/qom/QueryObjectModelFactoryTest.java
Thu Jul  9 11:39:05 2009
@@ -373,7 +373,9 @@
      * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, String)}
      */
     public void testFullTextSearch() throws RepositoryException {
-        FullTextSearch ftSearch = qf.fullTextSearch(SELECTOR_NAME1, propertyName1, FULLTEXT_SEARCH_EXPR);
+        FullTextSearch ftSearch = qf.fullTextSearch(
+                SELECTOR_NAME1, propertyName1,
+                qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
         assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
         assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());
         // TODO is there some way to check the contents of a StaticOperand?
@@ -387,7 +389,9 @@
      * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, String)}
      */
     public void testFullTextSearchAllProperties() throws RepositoryException {
-        FullTextSearch ftSearch = qf.fullTextSearch(SELECTOR_NAME1, null, FULLTEXT_SEARCH_EXPR);
+        FullTextSearch ftSearch = qf.fullTextSearch(
+                SELECTOR_NAME1, null,
+                qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
         assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
         assertNull("Property name must be null", ftSearch.getPropertyName());
         // TODO is there some way to check the contents of a StaticOperand?

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryImpl.java
Thu Jul  9 11:39:05 2009
@@ -220,6 +220,12 @@
         }
     }
 
+    // TODO: JCR-2200: Implement Query.getBindVariableNames()
+    public String[] getBindVariableNames() throws RepositoryException {
+        throw new UnsupportedRepositoryOperationException(
+                "JCR-2200: Implement Query.getBindVariableNames()");
+    }
+
     /**
      * @see Query#bindValue(String, Value)
      */

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryManagerImpl.java
Thu Jul  9 11:39:05 2009
@@ -116,8 +116,7 @@
         String language = node.getProperty(resolver.getJCRName(NameConstants.JCR_LANGUAGE)).getString();
 
         if (Query.JCR_JQOM.equals(language)) {
-            QueryObjectModelFactory qomFactory = new QOMFactory(
-                    node, resolver, valueFactory);
+            QueryObjectModelFactory qomFactory = new QOMFactory(node, resolver);
             QueryObjectModelBuilder builder = QueryObjectModelBuilderRegistry.getQueryObjectModelBuilder(language);
             return builder.createQueryObjectModel(statement, qomFactory, valueFactory);
         } else {
@@ -137,7 +136,7 @@
      * @see QueryManager#getQOMFactory()
      */
     public QueryObjectModelFactory getQOMFactory() {
-        return new QOMFactory(null, mgrProvider.getNamePathResolver(), valueFactory);
+        return new QOMFactory(null, mgrProvider.getNamePathResolver());
     }
 
     //------------------------------------------------------------< private >---
@@ -158,10 +157,8 @@
 
         private final Node node;
 
-        public QOMFactory(Node node,
-                          NamePathResolver resolver,
-                          ValueFactory factory) {
-            super(resolver, factory);
+        public QOMFactory(Node node, NamePathResolver resolver) {
+            super(resolver);
             this.node = node;
         }
 

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryObjectModelImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryObjectModelImpl.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryObjectModelImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryObjectModelImpl.java
Thu Jul  9 11:39:05 2009
@@ -180,5 +180,10 @@
                 throws IllegalArgumentException, RepositoryException {
             throw new UnsupportedOperationException();
         }
+
+        public String[] getBindVariableNames() throws RepositoryException {
+            throw new UnsupportedOperationException();
+        }
+
     }
 }

Modified: jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/query/QueryResultImpl.java
Thu Jul  9 11:39:05 2009
@@ -63,6 +63,13 @@
     /**
      * {@inheritDoc}
      */
+    public String[] getSelectorNames() throws RepositoryException {
+        return queryInfo.getColumnNames();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public String[] getColumnNames() throws RepositoryException {
         return queryInfo.getColumnNames();
     }

Modified: jackrabbit/trunk/jackrabbit-parent/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-parent/pom.xml?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-parent/pom.xml (original)
+++ jackrabbit/trunk/jackrabbit-parent/pom.xml Thu Jul  9 11:39:05 2009
@@ -147,7 +147,7 @@
       <dependency>
         <groupId>javax.jcr</groupId>
         <artifactId>jcr</artifactId>
-        <version>2.0-b18</version>
+        <version>2.0-b19</version>
         <scope>provided</scope>
       </dependency>
       <dependency>

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/QueryObjectModelFactoryImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/QueryObjectModelFactoryImpl.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/QueryObjectModelFactoryImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/qom/QueryObjectModelFactoryImpl.java
Thu Jul  9 11:39:05 2009
@@ -58,7 +58,6 @@
 import javax.jcr.query.qom.UpperCase;
 import javax.jcr.RepositoryException;
 import javax.jcr.Value;
-import javax.jcr.ValueFactory;
 
 /**
  * <code>QueryObjectModelFactoryImpl</code> implements the query object model
@@ -71,15 +70,8 @@
      */
     private final NamePathResolver resolver;
 
-    /**
-     * Value factory of the current session.
-     */
-    private final ValueFactory factory;
-
-    public QueryObjectModelFactoryImpl(
-            NamePathResolver resolver, ValueFactory factory) {
+    public QueryObjectModelFactoryImpl(NamePathResolver resolver) {
         this.resolver = resolver;
-        this.factory = factory;
     }
 
     /**
@@ -529,7 +521,7 @@
      */
     public FullTextSearch fullTextSearch(String selectorName,
                                          String propertyName,
-                                         String fullTextSearchExpression)
+                                         StaticOperand fullTextSearchExpression)
             throws InvalidQueryException, RepositoryException {
         if (fullTextSearchExpression == null) {
             throw new IllegalArgumentException(
@@ -539,11 +531,9 @@
         if (propertyName != null) {
             propName = checkPropertyName(propertyName);
         }
-        Literal literal =
-            literal(factory.createValue(fullTextSearchExpression));
         return new FullTextSearchImpl(resolver,
                 checkSelectorName(selectorName), propName,
-                checkFullTextSearchExpression(literal));
+                checkFullTextSearchExpression(fullTextSearchExpression));
     }
 
     /**

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/main/java/org/apache/jackrabbit/spi/commons/query/sql2/Parser.java
Thu Jul  9 11:39:05 2009
@@ -139,9 +139,9 @@
     private String readName() throws RepositoryException {
         if (readIf("[")) {
             if (currentTokenType == VALUE) {
-                String s = readString();
+                Value value = readString();
                 read("]");
-                return s;
+                return value.getString();
             } else {
                 int level = 1;
                 StringBuilder buff = new StringBuilder();
@@ -330,16 +330,20 @@
             if (readIf(".")) {
                 if (readIf("*")) {
                     read(",");
-                    c = factory.fullTextSearch(name, null, readString());
+                    c = factory.fullTextSearch(
+                            name, null, factory.literal(readString()));
                 } else {
                     String selector = name;
                     name = readName();
                     read(",");
-                    c = factory.fullTextSearch(selector, name, readString());
+                    c = factory.fullTextSearch(
+                            selector, name, factory.literal(readString()));
                 }
             } else {
                 read(",");
-                c = factory.fullTextSearch(getOnlySelectorName(), name, readString());
+                c = factory.fullTextSearch(
+                        getOnlySelectorName(), name,
+                        factory.literal(readString()));
             }
         } else if ("ISSAMENODE".equalsIgnoreCase(functionName)) {
             String name = readName();
@@ -635,13 +639,13 @@
         return s;
     }
 
-    private String readString() throws RepositoryException {
+    private Value readString() throws RepositoryException {
         if (currentTokenType != VALUE) {
             throw getSyntaxError("string value");
         }
-        String s = currentValue.getString();
+        Value value = currentValue;
         read();
-        return s;
+        return value;
     }
 
     private void addExpected(String token) {

Modified: jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/sql2/ParserTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/sql2/ParserTest.java?rev=792508&r1=792507&r2=792508&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/sql2/ParserTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-spi-commons/src/test/java/org/apache/jackrabbit/spi/commons/query/sql2/ParserTest.java
Thu Jul  9 11:39:05 2009
@@ -46,8 +46,8 @@
 
     static class QOMF extends QueryObjectModelFactoryImpl  {
 
-        public QOMF(NamePathResolver resolver, ValueFactory factory) {
-            super(resolver, factory);
+        public QOMF(NamePathResolver resolver) {
+            super(resolver);
         }
 
         protected QueryObjectModel createQuery(QueryObjectModelTree qomTree) throws InvalidQueryException,
@@ -60,8 +60,8 @@
     protected void setUp() throws Exception {
         super.setUp();
         NamePathResolver resolver = new DefaultNamePathResolver(new DummyNamespaceResolver());
+        QueryObjectModelFactoryImpl factory = new QOMF(resolver);
         ValueFactory vf = new ValueFactoryQImpl(QValueFactoryImpl.getInstance(), resolver);
-        QueryObjectModelFactoryImpl factory = new QOMF(resolver, vf);
         parser = new Parser(factory, vf);
     }
 



Mime
View raw message