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/26 17:34:02 UTC

svn commit: r1039448 - in /incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub: AtomEntryParser.java VersioningService.java

Author: fguillaume
Date: Fri Nov 26 16:34:02 2010
New Revision: 1039448

URL: http://svn.apache.org/viewvc?rev=1039448&view=rev
Log:
CMIS-287: Allow checkout in AtomPub with an entry containing an atom:content src

Modified:
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java
    incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.java

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.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/AtomEntryParser.java?rev=1039448&r1=1039447&r2=1039448&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/AtomEntryParser.java Fri Nov 26 16:34:02 2010
@@ -69,6 +69,8 @@ public class AtomEntryParser {
     private final static String ATTR_SRC = "src";
     private final static String ATTR_TYPE = "type";
 
+    protected boolean ignoreAtomContentSrc;
+
     private ObjectData fObject;
     private ContentStreamImpl fAtomContentStream;
     private ContentStreamImpl fCmisContentStream;
@@ -87,6 +89,14 @@ public class AtomEntryParser {
     }
 
     /**
+     * Sets the flag controlling whether atom content src (external content) is
+     * ignored. This flag is false by default (not ignored).
+     */
+    public void setIgnoreAtomContentSrc(boolean ignoreAtomContentSrc) {
+        this.ignoreAtomContentSrc = ignoreAtomContentSrc;
+    }
+
+    /**
      * Returns the object.
      */
     public ObjectData getObject() {
@@ -260,6 +270,11 @@ public class AtomEntryParser {
                     type = parser.getAttributeValue(i).trim().toLowerCase();
                 }
             } else if (ATTR_SRC.equals(attrName.getLocalPart())) {
+                if (ignoreAtomContentSrc) {
+                    fAtomContentStream = null;
+                    skip(parser);
+                    return;
+                }
                 throw new CmisNotSupportedException("External content not supported!");
             }
         }

Modified: incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.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/VersioningService.java?rev=1039448&r1=1039447&r2=1039448&view=diff
==============================================================================
--- incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.java (original)
+++ incubator/chemistry/opencmis/trunk/chemistry-opencmis-server/chemistry-opencmis-server-bindings/src/main/java/org/apache/chemistry/opencmis/server/impl/atompub/VersioningService.java Fri Nov 26 16:34:02 2010
@@ -51,7 +51,9 @@ public class VersioningService {
     public static void checkOut(CallContext context, CmisService service, String repositoryId,
             HttpServletRequest request, HttpServletResponse response) throws Exception {
         // get parameters
-        AtomEntryParser parser = new AtomEntryParser(request.getInputStream());
+        AtomEntryParser parser = new AtomEntryParser();
+        parser.setIgnoreAtomContentSrc(true); // needed for some clients
+        parser.parse(request.getInputStream());
 
         // execute
         Holder<String> checkOutId = new Holder<String>(parser.getId());