chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r1040303 - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-server: chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/ chemistry-opencmis-server-support/src/main/java/org/apache/chemistr...
Date Mon, 29 Nov 2010 21:20:29 GMT
Author: jens
Date: Mon Nov 29 21:20:29 2010
New Revision: 1040303

URL: http://svn.apache.org/viewvc?rev=1040303&view=rev
Log:
minor corrections and cleanups

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java

Modified: incubator/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/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java?rev=1040303&r1=1040302&r2=1040303&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-inmemory/src/main/java/org/apache/chemistry/opencmis/inmemory/server/InMemoryObjectServiceImpl.java
Mon Nov 29 21:20:29 2010
@@ -43,6 +43,7 @@ import org.apache.chemistry.opencmis.com
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinition;
 import org.apache.chemistry.opencmis.commons.definitions.TypeDefinitionContainer;
 import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
+import org.apache.chemistry.opencmis.commons.enums.Cardinality;
 import org.apache.chemistry.opencmis.commons.enums.IncludeRelationships;
 import org.apache.chemistry.opencmis.commons.enums.PropertyType;
 import org.apache.chemistry.opencmis.commons.enums.UnfileObject;
@@ -924,21 +925,45 @@ public class InMemoryObjectServiceImpl e
                     hasCopied = true;
                 }
                 if (propDef.getPropertyType() == PropertyType.BOOLEAN)
-                    pd = fStoreManager.getObjectFactory().createPropertyBooleanData(propId,
(List<Boolean>)defaultVal);
+                    if (propDef.getCardinality() == Cardinality.MULTI)
+                        pd = fStoreManager.getObjectFactory().createPropertyBooleanData(propId,
(List<Boolean>)defaultVal);
+                    else 
+                        pd = fStoreManager.getObjectFactory().createPropertyBooleanData(propId,
(Boolean)defaultVal.get(0));
                 else if (propDef.getPropertyType() == PropertyType.DATETIME)
-                    pd = fStoreManager.getObjectFactory().createPropertyDateTimeData(propId,
(List<GregorianCalendar>)defaultVal);
+                    if (propDef.getCardinality() == Cardinality.MULTI)
+                        pd = fStoreManager.getObjectFactory().createPropertyDateTimeData(propId,
(List<GregorianCalendar>)defaultVal);
+                    else 
+                        pd = fStoreManager.getObjectFactory().createPropertyDateTimeData(propId,
(GregorianCalendar)defaultVal.get(0));
                 else if (propDef.getPropertyType() == PropertyType.DECIMAL)
-                    pd = fStoreManager.getObjectFactory().createPropertyDecimalData(propId,
(List<BigDecimal>)defaultVal);
+                    if (propDef.getCardinality() == Cardinality.MULTI)
+                        pd = fStoreManager.getObjectFactory().createPropertyDecimalData(propId,
(List<BigDecimal>)defaultVal);
+                    else 
+                        pd = fStoreManager.getObjectFactory().createPropertyDecimalData(propId,
(BigDecimal)defaultVal.get(0));
                 else if (propDef.getPropertyType() == PropertyType.HTML)
-                    pd = fStoreManager.getObjectFactory().createPropertyHtmlData(propId,
(List<String>)defaultVal);
+                    if (propDef.getCardinality() == Cardinality.MULTI)
+                        pd = fStoreManager.getObjectFactory().createPropertyHtmlData(propId,
(List<String>)defaultVal);
+                    else 
+                        pd = fStoreManager.getObjectFactory().createPropertyHtmlData(propId,
(String)defaultVal.get(0));
                 else if (propDef.getPropertyType() == PropertyType.ID)
-                    pd = fStoreManager.getObjectFactory().createPropertyIdData(propId, (List<String>)defaultVal);
+                    if (propDef.getCardinality() == Cardinality.MULTI)
+                        pd = fStoreManager.getObjectFactory().createPropertyIdData(propId,
(List<String>)defaultVal);
+                    else 
+                        pd = fStoreManager.getObjectFactory().createPropertyIdData(propId,
(String)defaultVal.get(0));
                 else if (propDef.getPropertyType() == PropertyType.INTEGER)
-                    pd = fStoreManager.getObjectFactory().createPropertyIntegerData(propId,
(List<BigInteger>)defaultVal);
+                    if (propDef.getCardinality() == Cardinality.MULTI)
+                        pd = fStoreManager.getObjectFactory().createPropertyIntegerData(propId,
(List<BigInteger>)defaultVal);
+                    else 
+                        pd = fStoreManager.getObjectFactory().createPropertyIntegerData(propId,
(BigInteger)defaultVal.get(0));
                 else if (propDef.getPropertyType() == PropertyType.STRING)
-                    pd = fStoreManager.getObjectFactory().createPropertyStringData(propId,
(List<String>)defaultVal);
+                    if (propDef.getCardinality() == Cardinality.MULTI)
+                        pd = fStoreManager.getObjectFactory().createPropertyStringData(propId,
(List<String>)defaultVal);
+                    else 
+                        pd = fStoreManager.getObjectFactory().createPropertyStringData(propId,
(String)defaultVal.get(0));
                 else if (propDef.getPropertyType() == PropertyType.URI)
-                    pd = fStoreManager.getObjectFactory().createPropertyUriData(propId, (List<String>)defaultVal);
+                    if (propDef.getCardinality() == Cardinality.MULTI)
+                        pd = fStoreManager.getObjectFactory().createPropertyUriData(propId,
(List<String>)defaultVal);
+                    else 
+                        pd = fStoreManager.getObjectFactory().createPropertyUriData(propId,
(String)defaultVal.get(0));
                 // set property:
                 properties.put(propId, pd);
             }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java?rev=1040303&r1=1040302&r2=1040303&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
(original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-support/src/main/java/org/apache/chemistry/opencmis/server/support/TypeValidator.java
Mon Nov 29 21:20:29 2010
@@ -317,7 +317,7 @@ public class TypeValidator {
             return false;
 
         for (PropertyDefinition<?> propDef : propDefs.values()) {
-            if (propDef.getQueryName().equals(propertyQueryName))
+            if (propDef.getQueryName().toLowerCase().equals(propertyQueryName.toLowerCase()))
                 return true;
         }
         



Mime
View raw message