DotCMIS interop fixes

git-svn-id: https://svn.apache.org/repos/asf/chemistry/dotcmis/trunk@1135254 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/DotCMIS/binding/atompub/atompub-linkcache.cs b/DotCMIS/binding/atompub/atompub-linkcache.cs
index e40688d..477d039 100644
--- a/DotCMIS/binding/atompub/atompub-linkcache.cs
+++ b/DotCMIS/binding/atompub/atompub-linkcache.cs
@@ -40,6 +40,7 @@
             KnownLinks.Add(AtomPubConstants.RelEditMedia);

             KnownLinks.Add(AtomPubConstants.RelPolicies);

             KnownLinks.Add(AtomPubConstants.RelVersionHistory);

+            KnownLinks.Add(AtomPubConstants.RelWorkingCopy);

             KnownLinks.Add(AtomPubConstants.LinkRelContent);

         }

 

diff --git a/DotCMIS/binding/atompub/atompub.cs b/DotCMIS/binding/atompub/atompub.cs
index bcf0a30..5bf1a00 100644
--- a/DotCMIS/binding/atompub/atompub.cs
+++ b/DotCMIS/binding/atompub/atompub.cs
@@ -2128,6 +2128,14 @@
                 ThrowLinkException(repositoryId, objectId, AtomPubConstants.RelSelf, AtomPubConstants.MediatypeEntry);

             }

 

+            // prefer working copy link if available

+            // (workaround for non-compliant repositories)

+            string wcLink = GetLink(repositoryId, objectId, AtomPubConstants.RelWorkingCopy, AtomPubConstants.MediatypeEntry);

+            if (wcLink != null)

+            {

+                link = wcLink;

+            }

+

             Delete(new UrlBuilder(link));

         }

 

@@ -2149,6 +2157,14 @@
                 ThrowLinkException(repositoryId, objectId, AtomPubConstants.RelSelf, AtomPubConstants.MediatypeEntry);

             }

 

+            // prefer working copy link if available

+            // (workaround for non-compliant repositories)

+            string wcLink = GetLink(repositoryId, objectId, AtomPubConstants.RelWorkingCopy, AtomPubConstants.MediatypeEntry);

+            if (wcLink != null)

+            {

+                link = wcLink;

+            }

+

             UrlBuilder url = new UrlBuilder(link);

             url.AddParameter(AtomPubConstants.ParamCheckinComment, checkinComment);

             url.AddParameter(AtomPubConstants.ParamMajor, major);

diff --git a/DotCMIS/data/data-impl.cs b/DotCMIS/data/data-impl.cs
index 68d9ef3..b0ff4a4 100644
--- a/DotCMIS/data/data-impl.cs
+++ b/DotCMIS/data/data-impl.cs
@@ -111,6 +111,7 @@
     {

         private List<IPropertyDefinition> propertyDefintionList = new List<IPropertyDefinition>();

         private Dictionary<string, IPropertyDefinition> propertyDefintionDict = new Dictionary<string, IPropertyDefinition>();

+        private string parentTypeId;

 

         public string Id { get; set; }

         public string LocalName { get; set; }

@@ -119,7 +120,11 @@
         public string QueryName { get; set; }

         public string Description { get; set; }

         public BaseTypeId BaseTypeId { get; set; }

-        public string ParentTypeId { get; set; }

+        public string ParentTypeId

+        {

+            get { return parentTypeId; }

+            set { parentTypeId = (value == null || value.Length == 0 ? null : value); }

+        }

         public bool? IsCreatable { get; set; }

         public bool? IsFileable { get; set; }

         public bool? IsQueryable { get; set; }