You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fm...@apache.org on 2010/07/05 14:32:05 UTC

svn commit: r960582 - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-client: chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/ chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/cli...

Author: fmui
Date: Mon Jul  5 12:32:04 2010
New Revision: 960582

URL: http://svn.apache.org/viewvc?rev=960582&view=rev
Log:
- added a method to retrieve content with a given stream id
- corrected an internal method name

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/PersistentObjectFactoryImpl.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java?rev=960582&r1=960581&r2=960582&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-api/src/main/java/org/apache/chemistry/opencmis/client/api/Document.java Mon Jul  5 12:32:04 2010
@@ -35,6 +35,8 @@ public interface Document extends Fileab
     void deleteAllVersions();
 
     ContentStream getContentStream();
+    
+    ContentStream getContentStream(String streamId);
 
     ObjectId setContentStream(ContentStream contentStream, boolean overwrite);
 

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java?rev=960582&r1=960581&r2=960582&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/PersistentDocumentImpl.java Mon Jul  5 12:32:04 2010
@@ -301,14 +301,25 @@ public class PersistentDocumentImpl exte
     /*
      * (non-Javadoc)
      * 
-     * @see org.apache.opencmis.client.api.Document#getContentStream()
+     * @see org.apache.chemistry.opencmis.client.api.Document#getContentStream()
      */
     public ContentStream getContentStream() {
+        return getContentStream(null);
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * org.apache.chemistry.opencmis.client.api.Document#getContentStream(java
+     * .lang.String)
+     */
+    public ContentStream getContentStream(String streamId) {
         String objectId = getObjectId();
 
         // get the stream
         ContentStream contentStream = getBinding().getObjectService().getContentStream(getRepositoryId(), objectId,
-                null, null, null, null);
+                streamId, null, null, null);
 
         // TODO: what should happen if the length is not set?
         long length = (contentStream.getBigLength() == null ? -1 : contentStream.getBigLength().longValue());

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/PersistentObjectFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/PersistentObjectFactoryImpl.java?rev=960582&r1=960581&r2=960582&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/PersistentObjectFactoryImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-impl/src/main/java/org/apache/chemistry/opencmis/client/runtime/repository/PersistentObjectFactoryImpl.java Mon Jul  5 12:32:04 2010
@@ -109,7 +109,7 @@ public class PersistentObjectFactoryImpl
     /**
      * Returns the bindings object factory.
      */
-    protected BindingsObjectFactory getProviderObjectFactory() {
+    protected BindingsObjectFactory getBindingsObjectFactory() {
         return session.getBinding().getObjectFactory();
     }
 
@@ -127,28 +127,28 @@ public class PersistentObjectFactoryImpl
             return null;
         }
 
-        BindingsObjectFactory pof = getProviderObjectFactory();
+        BindingsObjectFactory bof = getBindingsObjectFactory();
 
         List<Ace> providerAces = new ArrayList<Ace>();
         for (Ace ace : aces) {
-            providerAces.add(pof.createAccessControlEntry(ace.getPrincipalId(), ace.getPermissions()));
+            providerAces.add(bof.createAccessControlEntry(ace.getPrincipalId(), ace.getPermissions()));
         }
 
-        return pof.createAccessControlList(providerAces);
+        return bof.createAccessControlList(providerAces);
     }
 
     public Ace createAce(String principal, List<String> permissions) {
-        BindingsObjectFactory pof = getProviderObjectFactory();
+        BindingsObjectFactory bof = getBindingsObjectFactory();
 
-        Ace ace = pof.createAccessControlEntry(principal, permissions);
+        Ace ace = bof.createAccessControlEntry(principal, permissions);
 
         return ace;
     }
 
     public Acl createAcl(List<Ace> aces) {
-        BindingsObjectFactory pof = getProviderObjectFactory();
+        BindingsObjectFactory bof = getBindingsObjectFactory();
 
-        Acl acl = pof.createAccessControlList(aces);
+        Acl acl = bof.createAccessControlList(aces);
 
         return acl;
     }
@@ -228,7 +228,7 @@ public class PersistentObjectFactoryImpl
 
         BigInteger length = (contentStream.getLength() < 0 ? null : BigInteger.valueOf(contentStream.getLength()));
 
-        return getProviderObjectFactory().createContentStream(contentStream.getFileName(), length,
+        return getBindingsObjectFactory().createContentStream(contentStream.getFileName(), length,
                 contentStream.getMimeType(), contentStream.getStream());
     }
 
@@ -393,7 +393,7 @@ public class PersistentObjectFactoryImpl
         }
 
         // some preparation
-        BindingsObjectFactory pof = getProviderObjectFactory();
+        BindingsObjectFactory bof = getBindingsObjectFactory();
         List<PropertyData<?>> propertyList = new ArrayList<PropertyData<?>>();
 
         // the big loop
@@ -464,41 +464,41 @@ public class PersistentObjectFactoryImpl
 
             if (definition instanceof PropertyStringDefinition) {
                 if (firstValue == null) {
-                    propertyData = pof.createPropertyStringData(id, (List<String>) null);
+                    propertyData = bof.createPropertyStringData(id, (List<String>) null);
                 } else if (firstValue instanceof String) {
-                    propertyData = pof.createPropertyStringData(id, (List<String>) values);
+                    propertyData = bof.createPropertyStringData(id, (List<String>) values);
                 } else {
                     throw new IllegalArgumentException("Property '" + id + "' is a String property!");
                 }
             } else if (definition instanceof PropertyIdDefinition) {
                 if (firstValue == null) {
-                    propertyData = pof.createPropertyIdData(id, (List<String>) null);
+                    propertyData = bof.createPropertyIdData(id, (List<String>) null);
                 } else if (firstValue instanceof String) {
-                    propertyData = pof.createPropertyIdData(id, (List<String>) values);
+                    propertyData = bof.createPropertyIdData(id, (List<String>) values);
                 } else {
                     throw new IllegalArgumentException("Property '" + id + "' is an Id property!");
                 }
             } else if (definition instanceof PropertyHtmlDefinition) {
                 if (firstValue == null) {
-                    propertyData = pof.createPropertyHtmlData(id, (List<String>) values);
+                    propertyData = bof.createPropertyHtmlData(id, (List<String>) values);
                 } else if (firstValue instanceof String) {
-                    propertyData = pof.createPropertyHtmlData(id, (List<String>) values);
+                    propertyData = bof.createPropertyHtmlData(id, (List<String>) values);
                 } else {
                     throw new IllegalArgumentException("Property '" + id + "' is a HTML property!");
                 }
             } else if (definition instanceof PropertyUriDefinition) {
                 if (firstValue == null) {
-                    propertyData = pof.createPropertyUriData(id, (List<String>) null);
+                    propertyData = bof.createPropertyUriData(id, (List<String>) null);
                 } else if (firstValue instanceof String) {
-                    propertyData = pof.createPropertyUriData(id, (List<String>) values);
+                    propertyData = bof.createPropertyUriData(id, (List<String>) values);
                 } else {
                     throw new IllegalArgumentException("Property '" + id + "' is an URI property!");
                 }
             } else if (definition instanceof PropertyIntegerDefinition) {
                 if (firstValue == null) {
-                    propertyData = pof.createPropertyIntegerData(id, (List<BigInteger>) null);
+                    propertyData = bof.createPropertyIntegerData(id, (List<BigInteger>) null);
                 } else if (firstValue instanceof BigInteger) {
-                    propertyData = pof.createPropertyIntegerData(id, (List<BigInteger>) values);
+                    propertyData = bof.createPropertyIntegerData(id, (List<BigInteger>) values);
                 } else if ((firstValue instanceof Byte) || (firstValue instanceof Short)
                         || (firstValue instanceof Integer) || (firstValue instanceof Long)) {
                     // we accept all kinds of integers
@@ -507,31 +507,31 @@ public class PersistentObjectFactoryImpl
                         list.add(BigInteger.valueOf(((Number) v).longValue()));
                     }
 
-                    propertyData = pof.createPropertyIntegerData(id, list);
+                    propertyData = bof.createPropertyIntegerData(id, list);
                 } else {
                     throw new IllegalArgumentException("Property '" + id + "' is an Integer property!");
                 }
             } else if (definition instanceof PropertyBooleanDefinition) {
                 if (firstValue == null) {
-                    propertyData = pof.createPropertyBooleanData(id, (List<Boolean>) null);
+                    propertyData = bof.createPropertyBooleanData(id, (List<Boolean>) null);
                 } else if (firstValue instanceof Boolean) {
-                    propertyData = pof.createPropertyBooleanData(id, (List<Boolean>) values);
+                    propertyData = bof.createPropertyBooleanData(id, (List<Boolean>) values);
                 } else {
                     throw new IllegalArgumentException("Property '" + id + "' is a Boolean property!");
                 }
             } else if (definition instanceof PropertyDecimalDefinition) {
                 if (firstValue == null) {
-                    propertyData = pof.createPropertyDecimalData(id, (List<BigDecimal>) null);
+                    propertyData = bof.createPropertyDecimalData(id, (List<BigDecimal>) null);
                 } else if (firstValue instanceof BigDecimal) {
-                    propertyData = pof.createPropertyDecimalData(id, (List<BigDecimal>) values);
+                    propertyData = bof.createPropertyDecimalData(id, (List<BigDecimal>) values);
                 } else {
                     throw new IllegalArgumentException("Property '" + id + "' is a Decimal property!");
                 }
             } else if (definition instanceof PropertyDateTimeDefinition) {
                 if (firstValue == null) {
-                    propertyData = pof.createPropertyDateTimeData(id, (List<GregorianCalendar>) null);
+                    propertyData = bof.createPropertyDateTimeData(id, (List<GregorianCalendar>) null);
                 } else if (firstValue instanceof GregorianCalendar) {
-                    propertyData = pof.createPropertyDateTimeData(id, (List<GregorianCalendar>) values);
+                    propertyData = bof.createPropertyDateTimeData(id, (List<GregorianCalendar>) values);
                 } else {
                     throw new IllegalArgumentException("Property '" + id + "' is a Decimal property!");
                 }
@@ -545,7 +545,7 @@ public class PersistentObjectFactoryImpl
             propertyList.add(propertyData);
         }
 
-        return pof.createPropertiesData(propertyList);
+        return bof.createPropertiesData(propertyList);
     }
 
     /*