chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fguilla...@apache.org
Subject svn commit: r800074 - in /incubator/chemistry/trunk/chemistry: chemistry-api/src/main/java/org/apache/chemistry/ chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/ chemistry-commons/src/main/java/org/apache/chemistry/impl/simpl...
Date Sun, 02 Aug 2009 13:43:46 GMT
Author: fguillaume
Date: Sun Aug  2 13:43:46 2009
New Revision: 800074

URL: http://svn.apache.org/viewvc?rev=800074&view=rev
Log:
CMIS-44: added cmis:ContentStreamId property

Modified:
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/CMISObject.java
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Rendition.java
    incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
    incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObject.java
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRendition.java
    incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrDocument.java
    incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java

Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/CMISObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/CMISObject.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/CMISObject.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/CMISObject.java
Sun Aug  2 13:43:46 2009
@@ -247,13 +247,13 @@
     /**
      * Gets a content stream for this document.
      *
-     * @param renditionId the rendition ID, or {@code null} for the primary
-     *            stream
+     * @param contentStreamId the content stream ID, or {@code null} for the
+     *            primary content stream
      * @return the content stream
      *
      * @throws IOException
      */
-    ContentStream getContentStream(String renditionId) throws IOException;
+    ContentStream getContentStream(String contentStreamId) throws IOException;
 
     /**
      * Saves the modifications done to the object through {@link #setValue},

Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Property.java
Sun Aug  2 13:43:46 2009
@@ -75,6 +75,8 @@
 
     String CONTENT_STREAM_FILENAME = "cmis:ContentStreamFilename";
 
+    String CONTENT_STREAM_ID = "cmis:ContentStreamId";
+
     /*
      * ----- Folder -----
      */

Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Rendition.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Rendition.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Rendition.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/Rendition.java
Sun Aug  2 13:43:46 2009
@@ -35,23 +35,21 @@
     String KIND_THUMBNAIL = "cmis:thumbnail";
 
     /**
-     * The rendition ID.
-     * <p>
-     * This ID has meaning only in the context of the rendition's base document
-     * or folder.
-     * <p>
-     * This ID may be passed to {@link SPI#getContentStream} to retrieve the
-     * rendition stream.
-     */
-    String getId();
-
-    /**
      * The object ID of the base document or folder that this rendition is
      * about.
      */
     ObjectId getObjectId();
 
     /**
+     * The rendition content stream ID.
+     * <p>
+     * The content stream ID has meaning only in the context of the rendition's
+     * base document or folder. It may be passed to {@link SPI#getContentStream}
+     * to retrieve the rendition stream.
+     */
+    String getContentStreamId();
+
+    /**
      * The rendition document object ID (optional).
      * <p>
      * This is only available if this rendition is represented as a document by
@@ -70,7 +68,7 @@
     long getLength();
 
     /**
-     * The rendition title, or {@code null}
+     * The rendition title, or {@code null}.
      */
     String getTitle();
 

Modified: incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-api/src/main/java/org/apache/chemistry/SPI.java
Sun Aug  2 13:43:46 2009
@@ -367,16 +367,16 @@
     /**
      * Gets a content stream for a document or folder.
      * <p>
-     * If a rendition ID is provided, the content stream returned will be for
-     * the given rendition.
+     * A content stream ID can be provided, to access alternate content streams
+     * (renditions for instance).
      *
      * @param object the document or folder
-     * @param renditionId the rendition ID, or {@code null}
+     * @param contentStreamId the content stream ID, or {@code null}
      * @return the content stream
      *
      * @throws IOException
      */
-    ContentStream getContentStream(ObjectId object, String renditionId)
+    ContentStream getContentStream(ObjectId object, String contentStreamId)
             throws IOException;
 
     /**

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPConnection.java
Sun Aug  2 13:43:46 2009
@@ -433,8 +433,8 @@
         throw new UnsupportedOperationException();
     }
 
-    public ContentStream getContentStream(ObjectId object, String renditionId)
-            throws IOException {
+    public ContentStream getContentStream(ObjectId object,
+            String contentStreamId) throws IOException {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }

Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-atompub-client/src/main/java/org/apache/chemistry/atompub/client/APPObject.java
Sun Aug  2 13:43:46 2009
@@ -92,7 +92,7 @@
         throw new UnsupportedOperationException();
     }
 
-    public ContentStream getContentStream(String renditionId) {
+    public ContentStream getContentStream(String contentStreamId) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleConnection.java
Sun Aug  2 13:43:46 2009
@@ -486,8 +486,9 @@
         return bytes != null;
     }
 
-    public ContentStream getContentStream(ObjectId object, String renditionId) {
-        // TODO renditionId
+    public ContentStream getContentStream(ObjectId object,
+            String contentStreamId) {
+        // TODO contentStreamId
         SimpleData data = repository.datas.get(object.getId());
         byte[] bytes = (byte[]) data.get(SimpleProperty.CONTENT_BYTES_KEY);
         if (bytes == null) {

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObject.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObject.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObject.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleObject.java
Sun Aug  2 13:43:46 2009
@@ -146,7 +146,7 @@
         return new SimpleProperty(entry, id, propertyDefinition);
     }
 
-    public ContentStream getContentStream(String renditionId) {
+    public ContentStream getContentStream(String contentStreamId) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRendition.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRendition.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRendition.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleRendition.java
Sun Aug  2 13:43:46 2009
@@ -7,10 +7,10 @@
 
 public class SimpleRendition implements Rendition {
 
-    private final String id;
-
     private final ObjectId objectId;
 
+    private final String contentStreamId;
+
     private final ObjectId renditionDocumentId;
 
     private final String mimeType;
@@ -27,15 +27,12 @@
 
     private final Map<String, String> metadata;
 
-    public SimpleRendition(String id, ObjectId objectId,
+    public SimpleRendition(ObjectId objectId, String contentStreamId,
             ObjectId renditionDocumentId, String mimeType, long length,
             String title, String kind, long height, long width,
             Map<String, String> metadata) {
-        if (id == null) {
-            throw new IllegalArgumentException("Rendition id cannot be null");
-        }
-        this.id = id;
         this.objectId = objectId;
+        this.contentStreamId = contentStreamId;
         this.renditionDocumentId = renditionDocumentId;
         this.mimeType = mimeType;
         this.length = length;
@@ -46,14 +43,14 @@
         this.metadata = metadata;
     }
 
-    public String getId() {
-        return id;
-    }
-
     public ObjectId getObjectId() {
         return objectId;
     }
 
+    public String getContentStreamId() {
+        return contentStreamId;
+    }
+
     public ObjectId getRenditionDocumentId() {
         return renditionDocumentId;
     }

Modified: incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-commons/src/main/java/org/apache/chemistry/impl/simple/SimpleType.java
Sun Aug  2 13:43:46 2009
@@ -165,6 +165,12 @@
             "", false, PropertyType.STRING, false, null, false, false, null,
             Updatability.READ_WRITE, true, true, 0, null, null, -1, null);
 
+    public static final SimplePropertyDefinition PROP_CONTENT_STREAM_ID = new SimplePropertyDefinition(
+            Property.CONTENT_STREAM_ID, "def:contentstreamid", null,
+            Property.CONTENT_STREAM_ID, "Content Stream ID", "", false,
+            PropertyType.STRING, false, null, false, false, null,
+            Updatability.READ_ONLY, true, true, 0, null, null, -1, null);
+
     public static final SimplePropertyDefinition PROP_PARENT_ID = new SimplePropertyDefinition(
             Property.PARENT_ID, "def:parentid", null, Property.PARENT_ID,
             "Parent Id", "", false, PropertyType.ID, false, null, false, true,
@@ -231,7 +237,8 @@
             PROP_CHECKIN_COMMENT, //
             PROP_CONTENT_STREAM_LENGTH, //
             PROP_CONTENT_STREAM_MIME_TYPE, //
-            PROP_CONTENT_STREAM_FILENAME);
+            PROP_CONTENT_STREAM_FILENAME, //
+            PROP_CONTENT_STREAM_ID);
 
     public static final List<PropertyDefinition> PROPS_FOLDER_BASE = commonPlus(
             PROP_NAME, //

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrConnection.java
Sun Aug  2 13:43:46 2009
@@ -315,8 +315,8 @@
     }
 
     public ContentStream getContentStream(ObjectId documentId,
-            String renditionId) throws IOException {
-        // TODO renditionId
+            String contentStreamId) throws IOException {
+        // TODO contentStreamId
         try {
             String relPath = JcrObjectEntry.getPath(documentId.getId()).substring(
                     1);

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrDocument.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrDocument.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrDocument.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrDocument.java
Sun Aug  2 13:43:46 2009
@@ -56,7 +56,7 @@
         return null;
     }
 
-    public ContentStream getContentStream(String renditionId) {
+    public ContentStream getContentStream(String contentStreamId) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }

Modified: incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java?rev=800074&r1=800073&r2=800074&view=diff
==============================================================================
--- incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java
(original)
+++ incubator/chemistry/trunk/chemistry/chemistry-jcr/src/main/java/org/apache/chemistry/jcr/JcrFolder.java
Sun Aug  2 13:43:46 2009
@@ -140,7 +140,7 @@
         return BaseType.FOLDER;
     }
 
-    public ContentStream getContentStream(String renditionId) {
+    public ContentStream getContentStream(String contentStreamId) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }



Mime
View raw message