Author: fmui
Date: Tue Jul 12 08:57:28 2016
New Revision: 1752248
URL: http://svn.apache.org/viewvc?rev=1752248&view=rev
Log:
CMIS-983: AtomPub: added support for OpenCMIS latestChangeLogToken
Modified:
chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub-parser.cs
chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs
Modified: chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub-parser.cs
URL:
http://svn.apache.org/viewvc/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub-parser.cs?rev=1752248&r1=1752247&r2=1752248&view=diff
==============================================================================
--- chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub-parser.cs (original)
+++ chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub-parser.cs Tue Jul
12 08:57:28 2016
@@ -82,7 +82,8 @@ namespace DotCMIS.Binding.AtomPub
settings.ProhibitDtd = false;
settings.MaxCharactersFromEntities = 1024;
- try {
+ try
+ {
using (XmlReader reader = XmlReader.Create(stream, settings))
{
while (true)
@@ -393,6 +394,10 @@ namespace DotCMIS.Binding.AtomPub
Skip(reader);
}
}
+ else if (AtomPubConstants.NamespaceApacheChemistry ==
reader.NamespaceURI)
+ {
+ feed.AddElement(ParseText(reader));
+ }
else
{
Skip(reader);
Modified: chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs
URL:
http://svn.apache.org/viewvc/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs?rev=1752248&r1=1752247&r2=1752248&view=diff
==============================================================================
--- chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs (original)
+++ chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs Tue Jul 12
08:57:28 2016
@@ -2697,6 +2697,7 @@ namespace DotCMIS.Binding.AtomPub
// read and parse
HttpUtils.Response resp = Read(url);
AtomFeed feed = Parse<AtomFeed>(resp.Stream);
+ string lastChangeLogToken = null;
// handle top level
foreach (AtomElement element in feed.GetElements())
@@ -2712,6 +2713,10 @@ namespace DotCMIS.Binding.AtomPub
{
result.NumItems = (long)element.Object;
}
+ else if (IsStr("changeLogToken", element))
+ {
+ lastChangeLogToken = (string)element.Object;
+ }
}
// get the changes
@@ -2738,6 +2743,13 @@ namespace DotCMIS.Binding.AtomPub
}
}
+ if (changeLogToken != null)
+ {
+ // the AtomPub binding cannot return a new change log token,
+ // but an OpenCMIS server uses a proprietary tag
+ changeLogToken = lastChangeLogToken;
+ }
+
return result;
}
}