chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dcaru...@apache.org
Subject svn commit: r918980 - /incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/
Date Thu, 04 Mar 2010 13:20:07 GMT
Author: dcaruana
Date: Thu Mar  4 13:20:07 2010
New Revision: 918980

URL: http://svn.apache.org/viewvc?rev=918980&view=rev
Log:
Some minor fixes to opencmis client implementation
- property value not set needs further investigation in PersistentPropertyImpl.java

Modified:
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/AbstractPersistentCmisObject.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentPropertyImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/AbstractPersistentCmisObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/AbstractPersistentCmisObject.java?rev=918980&r1=918979&r2=918980&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/AbstractPersistentCmisObject.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/AbstractPersistentCmisObject.java
Thu Mar  4 13:20:07 2010
@@ -76,7 +76,7 @@
       throw new IllegalArgumentException("Object type must be set!");
     }
 
-    if (objectType.getPropertyDefintions().size() >= 9) {
+    if (objectType.getPropertyDefintions().size() < 9) {
       // there must be at least the 9 standard properties that all objects have
       throw new IllegalArgumentException("Object type must have property defintions!");
     }
@@ -216,7 +216,7 @@
    * @see org.apache.opencmis.client.api.CmisObject#getBaseTypeId()
    */
   public BaseObjectTypeIds getBaseTypeId() {
-    return getPropertyValue(PropertyIds.CMIS_BASE_TYPE_ID);
+    return BaseObjectTypeIds.fromValue((String)getPropertyValue(PropertyIds.CMIS_BASE_TYPE_ID));
   }
 
   /*

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentPropertyImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentPropertyImpl.java?rev=918980&r1=918979&r2=918980&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentPropertyImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentPropertyImpl.java
Thu Mar  4 13:20:07 2010
@@ -67,9 +67,9 @@
       throw new IllegalArgumentException("Values must be set!");
     }
 
-    if (values.isEmpty()) {
-      throw new IllegalArgumentException("Values must not be empyt!");
-    }
+//    if (values.isEmpty()) {
+//      throw new IllegalArgumentException("Values must not be empyt!");
+//    }
 
     this.type = type;
     this.values = values;
@@ -100,10 +100,16 @@
   }
 
   public T getValue() {
+    if (this.values.size() == 0) {
+        return null;
+    }
     return this.values.get(0);
   }
 
   public String getValueAsString() {
+    if (this.values.size() == 0) {
+        return null;
+    }
     switch (this.type.getPropertyType()) {
     default:
       return this.values.get(0).toString();
@@ -111,6 +117,9 @@
   }
 
   public List<T> getValues() {
+    if (this.values.size() == 0) {
+        return null;
+    }
     return this.values;
   }
 

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java?rev=918980&r1=918979&r2=918980&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/PersistentSessionImpl.java
Thu Mar  4 13:20:07 2010
@@ -564,9 +564,9 @@
       rootFolder = this.getRootFolder();
     }
 
-    PropertyIdDefinitionImpl objectIdPropertyType = new PropertyIdDefinitionImpl();
-    objectIdPropertyType.setId(CmisProperties.OBJECT_ID.value());
-    objectIdPropertyType.setCardinality(Cardinality.SINGLE);
+    PropertyIdDefinitionImpl objectTypeIdPropertyType = new PropertyIdDefinitionImpl();
+    objectTypeIdPropertyType.setId(CmisProperties.OBJECT_TYPE_ID.value());
+    objectTypeIdPropertyType.setCardinality(Cardinality.SINGLE);
 
     PropertyStringDefinitionImpl namePropertyType = new PropertyStringDefinitionImpl();
     namePropertyType.setId(CmisProperties.NAME.value());
@@ -577,7 +577,7 @@
     Property<String> nameProperty = this.getPropertyFactory().createProperty(namePropertyType,
         UUID.randomUUID().toString());
     properties.add(nameProperty);
-    Property<String> typeProperty = this.getPropertyFactory().createProperty(objectIdPropertyType,
+    Property<String> typeProperty = this.getPropertyFactory().createProperty(objectTypeIdPropertyType,
         folderTypeId);
     properties.add(typeProperty);
 

Modified: incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java?rev=918980&r1=918979&r2=918980&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-client/opencmis-client-impl/src/main/java/org/apache/opencmis/client/runtime/RepositoryInfoImpl.java
Thu Mar  4 13:20:07 2010
@@ -125,7 +125,7 @@
 	}
 
 	public String getProductVersion() {
-		return this.getProductVersion();
+		return this.riData.getProductVersion();
 	}
 
 	public String getRootFolderId() {



Mime
View raw message