chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r927360 - in /incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl: DocumentImpl.java DocumentVersionImpl.java
Date Thu, 25 Mar 2010 12:03:40 GMT
Author: jens
Date: Thu Mar 25 12:03:40 2010
New Revision: 927360

URL: http://svn.apache.org/viewvc?rev=927360&view=rev
Log:
CMIS-182 add missing properties, avoid null properties

Modified:
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl/DocumentImpl.java
    incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl/DocumentImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl/DocumentImpl.java?rev=927360&r1=927359&r2=927360&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl/DocumentImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl/DocumentImpl.java
Thu Mar 25 12:03:40 2010
@@ -92,41 +92,27 @@ public class DocumentImpl extends Abstra
     // fill the version related properties (versions should override this but the spec requires
some
     // properties always to be set
     
-    if (FilterParser.isContainedInFilter(PropertyIds.CMIS_IS_LATEST_VERSION, requestedIds))
{
-      properties.put(PropertyIds.CMIS_IS_LATEST_VERSION, objFactory.createPropertyBooleanData(PropertyIds.CMIS_IS_LATEST_VERSION,
true));
-    }
     if (FilterParser.isContainedInFilter(PropertyIds.CMIS_IS_IMMUTABLE, requestedIds)) {
       properties.put(PropertyIds.CMIS_IS_IMMUTABLE, objFactory.createPropertyBooleanData(PropertyIds.CMIS_IS_IMMUTABLE,
false));
     }
-    if (FilterParser.isContainedInFilter(PropertyIds.CMIS_IS_MAJOR_VERSION, requestedIds))
{
-      properties.put(PropertyIds.CMIS_IS_MAJOR_VERSION, objFactory.createPropertyBooleanData(PropertyIds.CMIS_IS_MAJOR_VERSION,
true));
-    }
-    if (FilterParser.isContainedInFilter(PropertyIds.CMIS_IS_LATEST_MAJOR_VERSION, requestedIds))
{
-      properties.put(PropertyIds.CMIS_IS_LATEST_MAJOR_VERSION, objFactory.createPropertyBooleanData(PropertyIds.CMIS_IS_LATEST_MAJOR_VERSION,
true));
-    }
-    if (FilterParser.isContainedInFilter(PropertyIds.CMIS_VERSION_SERIES_ID, requestedIds))
{
-      // return id of document itself
-      properties.put(PropertyIds.CMIS_VERSION_SERIES_ID, objFactory.createPropertyIdData(PropertyIds.CMIS_VERSION_SERIES_ID,
getId()));
-    }
-    if (FilterParser.isContainedInFilter(PropertyIds.CMIS_IS_VERSION_SERIES_CHECKED_OUT,
requestedIds)) {
-      properties.put(PropertyIds.CMIS_IS_VERSION_SERIES_CHECKED_OUT, objFactory.createPropertyBooleanData(PropertyIds.CMIS_IS_VERSION_SERIES_CHECKED_OUT,
false));
-    }
-    if (FilterParser.isContainedInFilter(PropertyIds.CMIS_VERSION_SERIES_CHECKED_OUT_BY,
requestedIds)) {
-      properties.put(PropertyIds.CMIS_VERSION_SERIES_CHECKED_OUT_BY, objFactory.createPropertyStringData(PropertyIds.CMIS_VERSION_SERIES_CHECKED_OUT_BY,
(String)null));
+        
+    // Set the content related properties
+    if (null != fContent) {
+      if (FilterParser.isContainedInFilter(PropertyIds.CMIS_CONTENT_STREAM_FILE_NAME, requestedIds))
{
+        properties.put(PropertyIds.CMIS_CONTENT_STREAM_FILE_NAME, objFactory
+            .createPropertyStringData(PropertyIds.CMIS_CONTENT_STREAM_FILE_NAME, fContent
+                .getFileName()));
+      }
+      // omit: PropertyIds.CMIS_CONTENT_STREAM_ID
+      if (FilterParser.isContainedInFilter(PropertyIds.CMIS_CONTENT_STREAM_LENGTH, requestedIds))
{
+        properties.put(PropertyIds.CMIS_CONTENT_STREAM_LENGTH, objFactory
+            .createPropertyIntegerData(PropertyIds.CMIS_CONTENT_STREAM_LENGTH, fContent.getLength()));
+      }
+      if (FilterParser.isContainedInFilter(PropertyIds.CMIS_CONTENT_STREAM_MIME_TYPE, requestedIds))
{
+        properties.put(PropertyIds.CMIS_CONTENT_STREAM_MIME_TYPE, objFactory
+            .createPropertyStringData(PropertyIds.CMIS_CONTENT_STREAM_MIME_TYPE, fContent.getMimeType()));
+      }      
     }
-    if (FilterParser.isContainedInFilter(PropertyIds.CMIS_VERSION_SERIES_CHECKED_OUT_ID,
requestedIds)) {
-      properties.put(PropertyIds.CMIS_VERSION_SERIES_CHECKED_OUT_ID, objFactory.createPropertyIdData(PropertyIds.CMIS_VERSION_SERIES_CHECKED_OUT_ID,
(String)null));
-    }
-    if (FilterParser.isContainedInFilter(PropertyIds.CMIS_CHECKIN_COMMENT, requestedIds))
{
-      properties.put(PropertyIds.CMIS_CHECKIN_COMMENT, objFactory.createPropertyStringData(PropertyIds.CMIS_CHECKIN_COMMENT,
(String)null));
-    }
-    
-    // optional:
-//    if (FilterParser.isContainedInFilter(PropertyIds.CMIS_VERSION_LABEL, requestedIds))
{
-//      properties.add(objFactory.createPropertyStringData(PropertyIds.CMIS_VERSION_LABEL,
""));
-//    }
-    
-    
   }
 
 }

Modified: incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java?rev=927360&r1=927359&r2=927360&view=diff
==============================================================================
--- incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
(original)
+++ incubator/chemistry/trunk/opencmis/opencmis-server/opencmis-server-inmemory/src/main/java/org/apache/opencmis/inmemory/storedobj/impl/DocumentVersionImpl.java
Thu Mar 25 12:03:40 2010
@@ -194,6 +194,26 @@ public class DocumentVersionImpl extends
     if (FilterParser.isContainedInFilter(PropertyIds.CMIS_VERSION_LABEL, requestedIds)) {
       properties.put(PropertyIds.CMIS_VERSION_LABEL, objFactory.createPropertyStringData(PropertyIds.CMIS_VERSION_LABEL,
getVersionLabel()));
     }
+
+    // Set the content related properties
+    if (null != fContent) {
+      if (FilterParser.isContainedInFilter(PropertyIds.CMIS_CONTENT_STREAM_FILE_NAME, requestedIds))
{
+        properties.put(PropertyIds.CMIS_CONTENT_STREAM_FILE_NAME, objFactory
+            .createPropertyStringData(PropertyIds.CMIS_CONTENT_STREAM_FILE_NAME, fContent
+                .getFileName()));
+      }
+      
+      // omit: PropertyIds.CMIS_CONTENT_STREAM_ID
+
+      if (FilterParser.isContainedInFilter(PropertyIds.CMIS_CONTENT_STREAM_LENGTH, requestedIds))
{
+        properties.put(PropertyIds.CMIS_CONTENT_STREAM_LENGTH, objFactory
+            .createPropertyIntegerData(PropertyIds.CMIS_CONTENT_STREAM_LENGTH, fContent.getLength()));
+      }
+      if (FilterParser.isContainedInFilter(PropertyIds.CMIS_CONTENT_STREAM_MIME_TYPE, requestedIds))
{
+        properties.put(PropertyIds.CMIS_CONTENT_STREAM_MIME_TYPE, objFactory
+            .createPropertyStringData(PropertyIds.CMIS_CONTENT_STREAM_MIME_TYPE, fContent.getMimeType()));
+      }      
+    }
   }
 
   public List<Folder> getParents() {



Mime
View raw message