Return-Path: Delivered-To: apmail-incubator-chemistry-commits-archive@minotaur.apache.org Received: (qmail 31895 invoked from network); 26 Nov 2010 16:35:39 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 26 Nov 2010 16:35:39 -0000 Received: (qmail 91923 invoked by uid 500); 26 Nov 2010 16:35:39 -0000 Delivered-To: apmail-incubator-chemistry-commits-archive@incubator.apache.org Received: (qmail 91869 invoked by uid 500); 26 Nov 2010 16:35:38 -0000 Mailing-List: contact chemistry-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: chemistry-dev@incubator.apache.org Delivered-To: mailing list chemistry-commits@incubator.apache.org Received: (qmail 91861 invoked by uid 99); 26 Nov 2010 16:35:37 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Nov 2010 16:35:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Nov 2010 16:35:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C4E17238890D; Fri, 26 Nov 2010 16:34:02 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: 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 Date: Fri, 26 Nov 2010 16:34:02 -0000 To: chemistry-commits@incubator.apache.org From: fguillaume@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20101126163402.C4E17238890D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 checkOutId = new Holder(parser.getId());