jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r774736 - in /jackrabbit/trunk/jackrabbit-core/src: main/java/org/apache/jackrabbit/core/nodetype/compact/ test/java/org/apache/jackrabbit/core/nodetype/compact/ test/resources/
Date Thu, 14 May 2009 12:00:14 GMT
Author: stefan
Date: Thu May 14 12:00:14 2009
New Revision: 774736

URL: http://svn.apache.org/viewvc?rev=774736&view=rev
Log:
JCR-1591: JSR 283: NodeType Management (WIP...)
JCR-2091: Searchability settings in PropertyDefinition (WIP...)

Modified:
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
    jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefWriter.java
    jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java
    jackrabbit/trunk/jackrabbit-core/src/test/resources/cnd-reader-test-input.cnd

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java?rev=774736&r1=774735&r2=774736&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefReader.java
Thu May 14 12:00:14 2009
@@ -536,34 +536,29 @@
             return;
         }
         nextToken();
-        if (!currentTokenEquals(Lexer.SINGLE_QUOTE)) {
-            lexer.fail("Missing \' delimiter for beginning of query operators list");
-        }
+
+        String[] ops = currentToken.split(",");
         List queryOps = new ArrayList();
-        do {
-            nextToken();
-            if (currentTokenEquals(Lexer.QUEROPS_EQUAL)) {
+        for (int i = 0; i < ops.length; i++) {
+            String s = ops[i].trim();
+            if (s.equals(Lexer.QUEROPS_EQUAL)) {
                 queryOps.add(QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO);
-            } else if (currentTokenEquals(Lexer.QUEROPS_NOTEQUAL)) {
+            } else if (s.equals(Lexer.QUEROPS_NOTEQUAL)) {
                 queryOps.add(QueryObjectModelConstants.JCR_OPERATOR_NOT_EQUAL_TO);
-            } else if (currentTokenEquals(Lexer.QUEROPS_LESSTHAN)) {
+            } else if (s.equals(Lexer.QUEROPS_LESSTHAN)) {
                 queryOps.add(QueryObjectModelConstants.JCR_OPERATOR_LESS_THAN);
-            } else if (currentTokenEquals(Lexer.QUEROPS_LESSTHANOREQUAL)) {
+            } else if (s.equals(Lexer.QUEROPS_LESSTHANOREQUAL)) {
                 queryOps.add(QueryObjectModelConstants.JCR_OPERATOR_LESS_THAN_OR_EQUAL_TO);
-            } else if (currentTokenEquals(Lexer.QUEROPS_GREATERTHAN)) {
+            } else if (s.equals(Lexer.QUEROPS_GREATERTHAN)) {
                 queryOps.add(QueryObjectModelConstants.JCR_OPERATOR_GREATER_THAN);
-            } else if (currentTokenEquals(Lexer.QUEROPS_GREATERTHANOREQUAL)) {
+            } else if (s.equals(Lexer.QUEROPS_GREATERTHANOREQUAL)) {
                 queryOps.add(QueryObjectModelConstants.JCR_OPERATOR_GREATER_THAN_OR_EQUAL_TO);
-            } else if (currentTokenEquals(Lexer.QUEROPS_LIKE)) {
+            } else if (s.equals(Lexer.QUEROPS_LIKE)) {
                 queryOps.add(QueryObjectModelConstants.JCR_OPERATOR_LIKE);
-            } else if (currentTokenEquals(Lexer.SINGLE_QUOTE)) {
-                nextToken();
-                break;
             } else {
-                lexer.fail("'" + currentToken + "' is not a valid query operator");
+                lexer.fail("'" + s + "' is not a valid query operator");
             }
-            nextToken();
-        } while (currentTokenEquals(Lexer.LIST_DELIMITER));
+        }
         pdi.setAvailableQueryOperators((String[]) queryOps.toArray(new String[queryOps.size()]));
     }
 

Modified: jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefWriter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefWriter.java?rev=774736&r1=774735&r2=774736&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefWriter.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/main/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefWriter.java
Thu May 14 12:00:14 2009
@@ -305,7 +305,7 @@
                         out.write(Lexer.QUEROPS_LIKE);
                     }
                     if (i < qops.length - 1) {
-                        out.write("' ");
+                        out.write(", ");
                     }
                 }
                 out.write("'");

Modified: jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java?rev=774736&r1=774735&r2=774736&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java
(original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/java/org/apache/jackrabbit/core/nodetype/compact/CompactNodeTypeDefTest.java
Thu May 14 12:00:14 2009
@@ -31,8 +31,10 @@
 import org.apache.jackrabbit.spi.NameFactory;
 import org.apache.jackrabbit.spi.commons.conversion.NamePathResolver;
 import org.apache.jackrabbit.spi.commons.conversion.DefaultNamePathResolver;
+import org.apache.jackrabbit.spi.commons.query.qom.Operator;
 
 import javax.jcr.PropertyType;
+import javax.jcr.query.qom.QueryObjectModelConstants;
 import javax.jcr.version.OnParentVersionAction;
 import java.io.InputStreamReader;
 import java.io.Reader;
@@ -82,6 +84,9 @@
         pd.setProtected(true);
         pd.setMultiple(true);
         pd.setOnParentVersion(OnParentVersionAction.VERSION);
+        pd.setFullTextSearchable(false);
+        pd.setQueryOrderable(false);
+        pd.setAvailableQueryOperators(new String[]{QueryObjectModelConstants.JCR_OPERATOR_EQUAL_TO,
QueryObjectModelConstants.JCR_OPERATOR_NOT_EQUAL_TO});
         pd.setDefaultValues(defaultValues);
         pd.setValueConstraints(valueConstraints);
         pd.setDeclaringNodeType(NODE_TYPE_NAME);
@@ -102,6 +107,8 @@
         modelNodeTypeDef.setSupertypes(SUPERTYPES);
         modelNodeTypeDef.setOrderableChildNodes(true);
         modelNodeTypeDef.setMixin(true);
+        modelNodeTypeDef.setAbstract(true);
+        modelNodeTypeDef.setQueryable(false);
         modelNodeTypeDef.setPrimaryItemName(PROPERTY_NAME);
         modelNodeTypeDef.setPropertyDefs(new PropDef[]{pd});
         modelNodeTypeDef.setChildNodeDefs(new NodeDef[]{nd});

Modified: jackrabbit/trunk/jackrabbit-core/src/test/resources/cnd-reader-test-input.cnd
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-core/src/test/resources/cnd-reader-test-input.cnd?rev=774736&r1=774735&r2=774736&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit-core/src/test/resources/cnd-reader-test-input.cnd (original)
+++ jackrabbit/trunk/jackrabbit-core/src/test/resources/cnd-reader-test-input.cnd Thu May
14 12:00:14 2009
@@ -18,8 +18,8 @@
 <nt = "http://www.jcp.org/jcr/nt/1.0">
 
 [ex:NodeType] > ex:ParentNodeType1, ex:ParentNodeType2
-  orderable mixin
-  - ex:property (long) = '1', '2' primary mandatory autocreated protected multiple version
< '[1,10]'
+  orderable mixin abstract noquery
+  - ex:property (long) = '1', '2' primary mandatory autocreated protected multiple queryops
'=, <>' nofulltext noqueryorder version < '[1,10]'
   + ex:node (ex:RequiredNodeType1, ex:RequiredNodeType2) = ex:RequiredNodeType1 mandatory
autocreated protected multiple version
 
 [ex:AnotherNodeType] > ex:NodeType



Mime
View raw message