chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1299988 - in /chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src: main/java/org/apache/chemistry/opencmis/inmemory/ main/java/org/apache/chemistry/opencmis/inmemory/server/ test/java/org/apache/chemis...
Date Tue, 13 Mar 2012 07:18:31 GMT
Author: jens
Date: Tue Mar 13 07:18:31 2012
New Revision: 1299988

URL: http://svn.apache.org/viewvc?rev=1299988&view=rev
Log:
InMemory: Allow more characters in the name of a CMIS object

Modified:
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/NameValidator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
    chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceMutabilityTest.java

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/NameValidator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/NameValidator.java?rev=1299988&r1=1299987&r2=1299988&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/NameValidator.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/NameValidator.java
Tue Mar 13 07:18:31 2012
@@ -66,12 +66,14 @@ public class NameValidator {
      *            string to verify
      */
     public static boolean isValidName(String s) {
+        if (null == s || s.length() == 0) {
+            return false;
+        }
         for (int i = 0; i < s.length(); i++) {
             char c = s.charAt(i);
-            if (!((c >= 'A' && c <= 'Z') || (c >= 'a' && c <=
'z') || (c >= '0' && c <= '9') || c == '.' || c == '-'
-                    || c == '_' || c == ' ')) {
+            if (c == '\\' || c == '/' || c == '\'' || c == '\"' || c == ':' || c == '*' ||

+                    c == '?' ||c == '<' || c == '>' && c == '|')
                 return false;
-            }
         }
         return true;
     }

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java?rev=1299988&r1=1299987&r2=1299988&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/TypeValidator.java
Tue Mar 13 07:18:31 2012
@@ -61,13 +61,13 @@ public class TypeValidator {
             // check query name syntax
             if (null == pd2.getQueryName())
                 throw new CmisInvalidArgumentException("property query name cannot be null.");
-            if (!NameValidator.isValidName(pd2.getQueryName()))
+            if (!NameValidator.isValidQueryName(pd2.getQueryName()))
                 throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
     
             // check local name syntax
             if (null == pd2.getLocalName())
                 throw new CmisInvalidArgumentException("property local name cannot be null.");
-            if (!NameValidator.isValidName(pd2.getLocalName()))
+            if (!NameValidator.isValidLocalName(pd2.getLocalName()))
                 throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
             
             for (TypeDefinitionContainer tdc : tdl) {

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java?rev=1299988&r1=1299987&r2=1299988&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
Tue Mar 13 07:18:31 2012
@@ -740,7 +740,7 @@ public class InMemoryObjectServiceImpl e
         }
 
         // check name syntax
-        if (!NameValidator.isValidId(name)) {
+        if (!NameValidator.isValidName(name)) {
             throw new CmisInvalidArgumentException(NameValidator.ERROR_ILLEGAL_NAME);
         }
 

Modified: chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceMutabilityTest.java
URL: http://svn.apache.org/viewvc/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceMutabilityTest.java?rev=1299988&r1=1299987&r2=1299988&view=diff
==============================================================================
--- chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceMutabilityTest.java
(original)
+++ chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/test/java/org/apache/chemistry/opencmis/inmemory/RepositoryServiceMutabilityTest.java
Tue Mar 13 07:18:31 2012
@@ -215,7 +215,7 @@ public class RepositoryServiceMutability
         // test illegal property id
         typeDef = createTypeForAddingAtRuntime();
         pd = getPropertyDefinitionImpl(typeDef);
-        pd.setQueryName(pd.getQueryName() + "!!!");
+        pd.setQueryName(pd.getQueryName() + "!*!");
         checkAddingType(repositoryId, typeDef, CmisInvalidArgumentException.class);
 
         // test null property query name



Mime
View raw message