Author: fmui
Date: Thu Feb 10 17:25:04 2011
New Revision: 1069481
URL: http://svn.apache.org/viewvc?rev=1069481&view=rev
Log:
added ChangeEvent implementation
Modified:
incubator/chemistry/dotcmis/trunk/DotCMIS.suo
incubator/chemistry/dotcmis/trunk/DotCMIS/DotCMIS.csproj
incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-impl.cs
incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-intf.cs
incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-objectfactory.cs
incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-objects.cs
incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-impl.cs
incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-intf.cs
Modified: incubator/chemistry/dotcmis/trunk/DotCMIS.suo
URL:
http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS.suo?rev=1069481&r1=1069480&r2=1069481&view=diff
==============================================================================
Binary files - no diff available.
Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/DotCMIS.csproj
URL:
http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/DotCMIS.csproj?rev=1069481&r1=1069480&r2=1069481&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/DotCMIS.csproj (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/DotCMIS.csproj Thu Feb 10
17:25:04 2011
@@ -22,6 +22,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Debug\DotCMIS.XML</DocumentationFile>
+ <NoWarn>1591</NoWarn>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@@ -31,6 +32,7 @@
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DocumentationFile>bin\Release\DotCMIS.XML</DocumentationFile>
+ <NoWarn>1591</NoWarn>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-impl.cs
URL:
http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-impl.cs?rev=1069481&r1=1069480&r2=1069481&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-impl.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-impl.cs Thu Feb 10
17:25:04 2011
@@ -596,7 +596,20 @@ namespace DotCMIS.Client.Impl
public IChangeEvents GetContentChanges(string changeLogToken, bool
includeProperties, long maxNumItems,
IOperationContext context)
- { throw new CmisNotSupportedException("Client not implemented!"); }
+ {
+ Lock();
+ try
+ {
+ IObjectList objectList =
Binding.GetDiscoveryService().GetContentChanges(RepositoryId, ref
changeLogToken, includeProperties,
+ context.FilterString, context.IncludePolicies,
context.IncludeAcls, maxNumItems, null);
+
+ return ObjectFactory.ConvertChangeEvents(changeLogToken,
objectList);
+ }
+ finally
+ {
+ Unlock();
+ }
+ }
// create
Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-intf.cs
URL:
http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-intf.cs?rev=1069481&r1=1069480&r2=1069481&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-intf.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-intf.cs Thu Feb 10
17:25:04 2011
@@ -233,7 +233,7 @@ namespace DotCMIS.Client
ICmisObject ConvertObject(IObjectData objectData, IOperationContext
context);
IQueryResult ConvertQueryResult(IObjectData objectData);
IChangeEvent ConvertChangeEvent(IObjectData objectData);
- IChangeEvents ConvertChangeEvents(String changeLogToken, IObjectList
objectList);
+ IChangeEvents ConvertChangeEvents(string changeLogToken, IObjectList
objectList);
}
/// <summary>
@@ -627,8 +627,8 @@ namespace DotCMIS.Client
public interface IChangeEvents
{
string LatestChangeLogToken { get; }
- IList<IChangeEvent> ChangeEvents { get; }
- bool HasMoreItems { get; }
- long getTotalNumItems { get; }
+ IList<IChangeEvent> ChangeEventList { get; }
+ bool? HasMoreItems { get; }
+ long? TotalNumItems { get; }
}
}
Modified:
incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-objectfactory.cs
URL:
http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-objectfactory.cs?rev=1069481&r1=1069480&r2=1069481&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-objectfactory.cs
(original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-objectfactory.cs
Thu Feb 10 17:25:04 2011
@@ -332,7 +332,8 @@ namespace DotCMIS.Client.Impl
}
}
- public IQueryResult ConvertQueryResult(IObjectData objectData) {
+ public IQueryResult ConvertQueryResult(IObjectData objectData)
+ {
if (objectData == null)
{
throw new ArgumentException("Object data is null!");
@@ -341,7 +342,79 @@ namespace DotCMIS.Client.Impl
return new QueryResult(session, objectData);
}
- public IChangeEvent ConvertChangeEvent(IObjectData objectData) {
return null; }
- public IChangeEvents ConvertChangeEvents(String changeLogToken,
IObjectList objectList) { return null; }
+ public IChangeEvent ConvertChangeEvent(IObjectData objectData)
+ {
+ ChangeEvent result = new ChangeEvent();
+
+ if (objectData.ChangeEventInfo != null)
+ {
+ result.ChangeType = objectData.ChangeEventInfo.ChangeType;
+ result.ChangeTime = objectData.ChangeEventInfo.ChangeTime;
+ }
+
+ if (objectData.Properties != null &&
objectData.Properties.PropertyList != null)
+ {
+ result.Properties = new Dictionary<string, IList<object>>();
+
+ foreach (IPropertyData property in
objectData.Properties.PropertyList)
+ {
+ if (property.Id != null)
+ {
+ result.Properties[property.Id] = property.Values;
+ }
+ }
+
+ IList<object> objectIdList;
+ if (result.Properties.TryGetValue(PropertyIds.ObjectId, out
objectIdList))
+ {
+ if (objectIdList != null && objectIdList.Count > 0)
+ {
+ result.ObjectId = objectIdList[0] as string;
+ }
+ }
+
+ if (objectData.PolicyIds != null &&
objectData.PolicyIds.PolicyIds != null)
+ {
+ result.PolicyIds = objectData.PolicyIds.PolicyIds;
+ }
+
+ if (objectData.Acl != null)
+ {
+ result.Acl = objectData.Acl;
+ }
+ }
+
+ return result;
+ }
+
+ public IChangeEvents ConvertChangeEvents(string changeLogToken,
IObjectList objectList)
+ {
+ if (objectList == null)
+ {
+ return null;
+ }
+
+ ChangeEvents result = new ChangeEvents();
+ result.LatestChangeLogToken = changeLogToken;
+
+ result.ChangeEventList = new List<IChangeEvent>();
+ if (objectList.Objects != null)
+ {
+ foreach (IObjectData objectData in objectList.Objects)
+ {
+ if (objectData == null)
+ {
+ continue;
+ }
+
+ result.ChangeEventList.Add(ConvertChangeEvent(objectData));
+ }
+ }
+
+ result.HasMoreItems = objectList.HasMoreItems;
+ result.TotalNumItems = objectList.NumItems;
+
+ return result;
+ }
}
}
Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-objects.cs
URL:
http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-objects.cs?rev=1069481&r1=1069480&r2=1069481&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-objects.cs
(original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-objects.cs Thu Feb
10 17:25:04 2011
@@ -1804,4 +1804,26 @@ namespace DotCMIS.Client.Impl
public IList<IRendition> Renditions { get; protected set; }
}
+
+ public class ChangeEvent : ChangeEventInfo, IChangeEvent
+ {
+ public string ObjectId { get; set; }
+
+ public IDictionary<string, IList<object>> Properties { get; set; }
+
+ public IList<string> PolicyIds { get; set; }
+
+ public IAcl Acl { get; set; }
+ }
+
+ public class ChangeEvents : IChangeEvents
+ {
+ public string LatestChangeLogToken { get; set; }
+
+ public IList<IChangeEvent> ChangeEventList { get; set; }
+
+ public bool? HasMoreItems { get; set; }
+
+ public long? TotalNumItems { get; set; }
+ }
}
\ No newline at end of file
Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-impl.cs
URL:
http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-impl.cs?rev=1069481&r1=1069480&r2=1069481&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-impl.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-impl.cs Thu Feb 10
17:25:04 2011
@@ -588,8 +588,8 @@ namespace DotCMIS.Data.Impl
public class ChangeEventInfo : ExtensionsData, IChangeEventInfo
{
- public ChangeType ChangeType { get; set; }
- public DateTime ChangeTime { get; set; }
+ public ChangeType? ChangeType { get; set; }
+ public DateTime? ChangeTime { get; set; }
}
public class PolicyIdList : ExtensionsData, IPolicyIdList
Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-intf.cs
URL:
http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-intf.cs?rev=1069481&r1=1069480&r2=1069481&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-intf.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-intf.cs Thu Feb 10
17:25:04 2011
@@ -326,8 +326,8 @@ namespace DotCMIS.Data
public interface IChangeEventInfo : IExtensionsData
{
- ChangeType ChangeType { get; }
- DateTime ChangeTime { get; }
+ ChangeType? ChangeType { get; }
+ DateTime? ChangeTime { get; }
}
public interface IPolicyIdList : IExtensionsData