You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@chemistry.apache.org by fg...@apache.org on 2010/11/16 15:45:23 UTC

svn commit: r1035646 - in /incubator/chemistry/opencmis/trunk: chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ chemistry-opencmis-server/chemistry-opencmis-server-bin...

Author: fguillaume
Date: Tue Nov 16 14:45:23 2010
New Revision: 1035646

URL: http://svn.apache.org/viewvc?rev=1035646&view=rev
Log:
CMIS-269: fix AtomPub rendition URLs

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java?rev=1035646&r1=1035645&r2=1035646&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-client/chemistry-opencmis-client-bindings/src/main/java/org/apache/chemistry/opencmis/client/bindings/spi/atompub/ObjectServiceImpl.java Tue Nov 16 14:45:23 2010
@@ -400,6 +400,9 @@ public class ObjectServiceImpl extends A
             throw new CmisConstraintException("No content stream");
         }
 
+        // TODO FIXME using the content link for non-default streams is
+        // incorrect, rel=alternate links should be used (if somehow the
+        // stream id is known for them, which isn't the case in CMIS 1.0).
         UrlBuilder url = new UrlBuilder(link);
         url.addParameter(Constants.PARAM_STREAM_ID, streamId);
 

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java
URL: http://svn.apache.org/viewvc/incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java?rev=1035646&r1=1035645&r2=1035646&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomPubUtils.java Tue Nov 16 14:45:23 2010
@@ -202,7 +202,10 @@ public final class AtomPubUtils {
 
         if (info.getRenditionInfos() != null) {
             for (RenditionInfo ri : info.getRenditionInfos()) {
-                entry.writeAlternateLink(compileUrl(baseUrl, RESOURCE_CONTENT, ri.getId()), ri.getContenType(),
+                UrlBuilder rurl = compileUrlBuilder(baseUrl, RESOURCE_CONTENT,
+                        info.getId());
+                rurl.addParameter(Constants.PARAM_STREAM_ID, ri.getId());
+                entry.writeAlternateLink(rurl.toString(), ri.getContenType(),
                         ri.getKind(), ri.getTitle(), ri.getLength());
             }
         }
@@ -242,7 +245,7 @@ public final class AtomPubUtils {
 
     /**
      * Writes the a object entry in a content changes list.
-     * 
+     *
      * Content changes objects need special treatment because some of them could
      * have been deleted and an object info cannot be generated.
      */