chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1398230 - /chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs
Date Mon, 15 Oct 2012 09:51:21 GMT
Author: fmui
Date: Mon Oct 15 09:51:20 2012
New Revision: 1398230

URL: http://svn.apache.org/viewvc?rev=1398230&view=rev
Log:
CMIS-577: allow creation of unfiled objects (AtomPub)

Modified:
    chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs

Modified: chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs
URL: http://svn.apache.org/viewvc/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs?rev=1398230&r1=1398229&r2=1398230&view=diff
==============================================================================
--- chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs (original)
+++ chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs Mon Oct 15 09:51:20 2012
@@ -1502,11 +1502,25 @@ namespace DotCMIS.Binding.AtomPub
             CheckCreateProperties(properties);
 
             // find the link
-            string link = LoadLink(repositoryId, folderId, AtomPubConstants.RelDown, AtomPubConstants.MediatypeChildren);
+            string link = null;
 
-            if (link == null)
+            if (folderId == null)
             {
-                ThrowLinkException(repositoryId, folderId, AtomPubConstants.RelDown, AtomPubConstants.MediatypeChildren);
+                link = LoadCollection(repositoryId, AtomPubConstants.CollectionUnfiled);
+
+                if (link == null)
+                {
+                    throw new CmisObjectNotFoundException("Unknown respository or unfiling
not supported!");
+                }
+            }
+            else
+            {
+                link = LoadLink(repositoryId, folderId, AtomPubConstants.RelDown, AtomPubConstants.MediatypeChildren);
+
+                if (link == null)
+                {
+                    ThrowLinkException(repositoryId, folderId, AtomPubConstants.RelDown,
AtomPubConstants.MediatypeChildren);
+                }
             }
 
             UrlBuilder url = new UrlBuilder(link);
@@ -1636,11 +1650,25 @@ namespace DotCMIS.Binding.AtomPub
             CheckCreateProperties(properties);
 
             // find the link
-            string link = LoadLink(repositoryId, folderId, AtomPubConstants.RelDown, AtomPubConstants.MediatypeChildren);
+            string link = null;
 
-            if (link == null)
+            if (folderId == null)
             {
-                ThrowLinkException(repositoryId, folderId, AtomPubConstants.RelDown, AtomPubConstants.MediatypeChildren);
+                link = LoadCollection(repositoryId, AtomPubConstants.CollectionUnfiled);
+
+                if (link == null)
+                {
+                    throw new CmisObjectNotFoundException("Unknown respository or unfiling
not supported!");
+                }
+            }
+            else
+            {
+                link = LoadLink(repositoryId, folderId, AtomPubConstants.RelDown, AtomPubConstants.MediatypeChildren);
+
+                if (link == null)
+                {
+                    ThrowLinkException(repositoryId, folderId, AtomPubConstants.RelDown,
AtomPubConstants.MediatypeChildren);
+                }
             }
 
             UrlBuilder url = new UrlBuilder(link);



Mime
View raw message