chemistry-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From f...@apache.org
Subject svn commit: r1062859 - in /incubator/chemistry/dotcmis/trunk: ./ DotCMIS/ DotCMIS/binding/ DotCMIS/binding/atompub/ DotCMIS/binding/webservices/ DotCMIS/client/ DotCMIS/data/ DotCMISUnitTest/
Date Mon, 24 Jan 2011 16:23:27 GMT
Author: fmui
Date: Mon Jan 24 16:23:26 2011
New Revision: 1062859

URL: http://svn.apache.org/viewvc?rev=1062859&view=rev
Log:
first steps toward the client API

Added:
    incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-caches.cs
Modified:
    incubator/chemistry/dotcmis/trunk/DotCMIS.suo
    incubator/chemistry/dotcmis/trunk/DotCMIS/DotCMIS.csproj
    incubator/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub-writer.cs
    incubator/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs
    incubator/chemistry/dotcmis/trunk/DotCMIS/binding/services.cs
    incubator/chemistry/dotcmis/trunk/DotCMIS/binding/webservices/webservices.cs
    incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-impl.cs
    incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-intf.cs
    incubator/chemistry/dotcmis/trunk/DotCMIS/const.cs
    incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-impl.cs
    incubator/chemistry/dotcmis/trunk/DotCMIS/enums.cs
    incubator/chemistry/dotcmis/trunk/DotCMISUnitTest/CRUDTest.cs
    incubator/chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs

Modified: incubator/chemistry/dotcmis/trunk/DotCMIS.suo
URL: http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS.suo?rev=1062859&r1=1062858&r2=1062859&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=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/DotCMIS.csproj (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/DotCMIS.csproj Mon Jan 24 16:23:26 2011
@@ -53,6 +53,7 @@
     <Compile Include="binding\services.cs" />
     <Compile Include="binding\converter.cs" />
     <Compile Include="binding\webservices\webservices.cs" />
+    <Compile Include="client\client-caches.cs" />
     <Compile Include="client\client-intf.cs" />
     <Compile Include="client\client-impl.cs" />
     <Compile Include="const.cs" />

Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub-writer.cs
URL: http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub-writer.cs?rev=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub-writer.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub-writer.cs Mon Jan 24 16:23:26 2011
@@ -193,13 +193,13 @@ namespace DotCMIS.Binding.AtomPub
         private string statement;
         private bool? searchAllVersions;
         private bool? includeAllowableActions;
-        private IncludeRelationships? includeRelationships;
+        private IncludeRelationshipsFlag? includeRelationships;
         private string renditionFilter;
         private long? maxItems;
         private long? skipCount;
 
         public AtomQueryWriter(string statement, bool? searchAllVersions,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             long? maxItems, long? skipCount)
         {
             this.statement = statement;

Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs
URL: http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs?rev=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/binding/atompub/atompub.cs Mon Jan 24 16:23:26 2011
@@ -696,7 +696,7 @@ namespace DotCMIS.Binding.AtomPub
         }
 
         protected IObjectData GetObjectInternal(string repositoryId, IdentifierType idOrPath, string objectIdOrPath,
-            ReturnVersion? returnVersion, string filter, bool? includeAllowableActions, IncludeRelationships? includeRelationships,
+            ReturnVersion? returnVersion, string filter, bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships,
             string renditionFilter, bool? includePolicyIds, bool? includeAcl, IExtensionsData extension)
         {
             IObjectData result = null;
@@ -1012,7 +1012,7 @@ namespace DotCMIS.Binding.AtomPub
         }
 
         public IObjectInFolderList GetChildren(string repositoryId, string folderId, string filter, string orderBy,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includePathSegment, long? maxItems, long? skipCount, IExtensionsData extension)
         {
             ObjectInFolderList result = new ObjectInFolderList();
@@ -1103,7 +1103,7 @@ namespace DotCMIS.Binding.AtomPub
         }
 
         public IList<IObjectInFolderContainer> GetDescendants(string repositoryId, string folderId, long? depth, string filter,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includePathSegment, IExtensionsData extension)
         {
             IList<IObjectInFolderContainer> result = new List<IObjectInFolderContainer>();
@@ -1135,7 +1135,7 @@ namespace DotCMIS.Binding.AtomPub
         }
 
         public IList<IObjectInFolderContainer> GetFolderTree(string repositoryId, string folderId, long? depth, string filter,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includePathSegment, IExtensionsData extension)
         {
             IList<IObjectInFolderContainer> result = new List<IObjectInFolderContainer>();
@@ -1167,7 +1167,7 @@ namespace DotCMIS.Binding.AtomPub
         }
 
         public IList<IObjectParentData> GetObjectParents(string repositoryId, string objectId, string filter,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includeRelativePathSegment, IExtensionsData extension)
         {
             IList<IObjectParentData> result = new List<IObjectParentData>();
@@ -1333,7 +1333,7 @@ namespace DotCMIS.Binding.AtomPub
         }
 
         public IObjectList GetCheckedOutDocs(string repositoryId, string folderId, string filter, string orderBy,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             long? maxItems, long? skipCount, IExtensionsData extension)
         {
             ObjectList result = new ObjectList();
@@ -1674,7 +1674,7 @@ namespace DotCMIS.Binding.AtomPub
         public IProperties GetProperties(string repositoryId, string objectId, string filter, IExtensionsData extension)
         {
             IObjectData obj = GetObjectInternal(repositoryId, IdentifierType.Id, objectId, ReturnVersion.This, filter,
-                    false, IncludeRelationships.None, "cmis:none", false, false, extension);
+                    false, IncludeRelationshipsFlag.None, "cmis:none", false, false, extension);
 
             return obj.Properties;
         }
@@ -1683,7 +1683,7 @@ namespace DotCMIS.Binding.AtomPub
             long? maxItems, long? skipCount, IExtensionsData extension)
         {
             IObjectData obj = GetObjectInternal(repositoryId, IdentifierType.Id, objectId, ReturnVersion.This,
-                PropertyIds.ObjectId, false, IncludeRelationships.None, renditionFilter, false, false, extension);
+                PropertyIds.ObjectId, false, IncludeRelationshipsFlag.None, renditionFilter, false, false, extension);
 
             IList<IRenditionData> result = obj.Renditions;
             if (result == null)
@@ -1695,7 +1695,7 @@ namespace DotCMIS.Binding.AtomPub
         }
 
         public IObjectData GetObject(string repositoryId, string objectId, string filter, bool? includeAllowableActions,
-            IncludeRelationships? includeRelationships, string renditionFilter, bool? includePolicyIds,
+            IncludeRelationshipsFlag? includeRelationships, string renditionFilter, bool? includePolicyIds,
             bool? includeAcl, IExtensionsData extension)
         {
             return GetObjectInternal(repositoryId, IdentifierType.Id, objectId, ReturnVersion.This, filter, includeAllowableActions,
@@ -1703,7 +1703,7 @@ namespace DotCMIS.Binding.AtomPub
         }
 
         public IObjectData GetObjectByPath(string repositoryId, string path, string filter, bool? includeAllowableActions,
-            IncludeRelationships? includeRelationships, string renditionFilter, bool? includePolicyIds, bool? includeAcl,
+            IncludeRelationshipsFlag? includeRelationships, string renditionFilter, bool? includePolicyIds, bool? includeAcl,
             IExtensionsData extension)
         {
             return GetObjectInternal(repositoryId, IdentifierType.Path, path, ReturnVersion.This, filter, includeAllowableActions,
@@ -2217,7 +2217,7 @@ namespace DotCMIS.Binding.AtomPub
         }
 
         public IObjectData GetObjectOfLatestVersion(string repositoryId, string objectId, string versionSeriesId, bool major,
-            string filter, bool? includeAllowableActions, IncludeRelationships? includeRelationships,
+            string filter, bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships,
             string renditionFilter, bool? includePolicyIds, bool? includeAcl, IExtensionsData extension)
         {
             ReturnVersion returnVersion = ReturnVersion.Latest;
@@ -2240,7 +2240,7 @@ namespace DotCMIS.Binding.AtomPub
             }
 
             IObjectData objectData = GetObjectInternal(repositoryId, IdentifierType.Id, objectId, returnVersion, filter,
-                    false, IncludeRelationships.None, "cmis:none", false, false, extension);
+                    false, IncludeRelationshipsFlag.None, "cmis:none", false, false, extension);
 
             return objectData.Properties;
         }
@@ -2410,7 +2410,7 @@ namespace DotCMIS.Binding.AtomPub
         }
 
         public IObjectList Query(string repositoryId, string statement, bool? searchAllVersions,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             long? maxItems, long? skipCount, IExtensionsData extension)
         {
             ObjectList result = new ObjectList();

Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/binding/services.cs
URL: http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/binding/services.cs?rev=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/binding/services.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/binding/services.cs Mon Jan 24 16:23:26 2011
@@ -42,25 +42,25 @@ namespace DotCMIS.Binding.Services
     public interface INavigationService
     {
         IObjectInFolderList GetChildren(string repositoryId, string folderId, string filter, string orderBy,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includePathSegment, long? maxItems, long? skipCount, IExtensionsData extension);
 
         IList<IObjectInFolderContainer> GetDescendants(string repositoryId, string folderId, long? depth, string filter,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includePathSegment, IExtensionsData extension);
 
         IList<IObjectInFolderContainer> GetFolderTree(string repositoryId, string folderId, long? depth, string filter,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includePathSegment, IExtensionsData extension);
 
         IList<IObjectParentData> GetObjectParents(string repositoryId, string objectId, string filter,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includeRelativePathSegment, IExtensionsData extension);
 
         IObjectData GetFolderParent(string repositoryId, string folderId, string filter, ExtensionsData extension);
 
         IObjectList GetCheckedOutDocs(string repositoryId, string folderId, string filter, string orderBy,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             long? maxItems, long? skipCount, IExtensionsData extension);
     }
 
@@ -89,11 +89,11 @@ namespace DotCMIS.Binding.Services
             long? maxItems, long? skipCount, IExtensionsData extension);
 
         IObjectData GetObject(string repositoryId, string objectId, string filter, bool? includeAllowableActions,
-            IncludeRelationships? includeRelationships, string renditionFilter, bool? includePolicyIds,
+            IncludeRelationshipsFlag? includeRelationships, string renditionFilter, bool? includePolicyIds,
             bool? includeAcl, IExtensionsData extension);
 
         IObjectData GetObjectByPath(string repositoryId, string path, string filter, bool? includeAllowableActions,
-            IncludeRelationships? includeRelationships, string renditionFilter, bool? includePolicyIds, bool? includeAcl,
+            IncludeRelationshipsFlag? includeRelationships, string renditionFilter, bool? includePolicyIds, bool? includeAcl,
             IExtensionsData extension);
 
         IContentStream GetContentStream(string repositoryId, string objectId, string streamId, long? offset, long? length,
@@ -127,7 +127,7 @@ namespace DotCMIS.Binding.Services
             IExtensionsData extension);
 
         IObjectData GetObjectOfLatestVersion(string repositoryId, string objectId, string versionSeriesId, bool major,
-            string filter, bool? includeAllowableActions, IncludeRelationships? includeRelationships,
+            string filter, bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships,
             string renditionFilter, bool? includePolicyIds, bool? includeAcl, IExtensionsData extension);
 
         IProperties GetPropertiesOfLatestVersion(string repositoryId, string objectId, string versionSeriesId, bool major,
@@ -147,7 +147,7 @@ namespace DotCMIS.Binding.Services
     public interface IDiscoveryService
     {
         IObjectList Query(string repositoryId, string statement, bool? searchAllVersions,
-           bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+           bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
            long? maxItems, long? skipCount, IExtensionsData extension);
 
         IObjectList GetContentChanges(string repositoryId, ref string changeLogToken, bool? includeProperties,

Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/binding/webservices/webservices.cs
URL: http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/binding/webservices/webservices.cs?rev=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/binding/webservices/webservices.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/binding/webservices/webservices.cs Mon Jan 24 16:23:26 2011
@@ -480,7 +480,7 @@ namespace DotCMIS.Binding.WebServices
         }
 
         public IObjectInFolderList GetChildren(string repositoryId, string folderId, string filter, string orderBy,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includePathSegment, long? maxItems, long? skipCount, IExtensionsData extension)
         {
             NavigationServicePortClient port = Provider.GetNavigationService();
@@ -502,7 +502,7 @@ namespace DotCMIS.Binding.WebServices
         }
 
         public IList<IObjectInFolderContainer> GetDescendants(string repositoryId, string folderId, long? depth, string filter,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includePathSegment, IExtensionsData extension)
         {
             NavigationServicePortClient port = Provider.GetNavigationService();
@@ -537,7 +537,7 @@ namespace DotCMIS.Binding.WebServices
         }
 
         public IList<IObjectInFolderContainer> GetFolderTree(string repositoryId, string folderId, long? depth, string filter,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includePathSegment, IExtensionsData extension)
         {
             NavigationServicePortClient port = Provider.GetNavigationService();
@@ -572,7 +572,7 @@ namespace DotCMIS.Binding.WebServices
         }
 
         public IList<IObjectParentData> GetObjectParents(string repositoryId, string objectId, string filter,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             bool? includeRelativePathSegment, IExtensionsData extension)
         {
             NavigationServicePortClient port = Provider.GetNavigationService();
@@ -625,7 +625,7 @@ namespace DotCMIS.Binding.WebServices
         }
 
         public IObjectList GetCheckedOutDocs(string repositoryId, string folderId, string filter, string orderBy,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             long? maxItems, long? skipCount, IExtensionsData extension)
         {
             NavigationServicePortClient port = Provider.GetNavigationService();
@@ -858,7 +858,7 @@ namespace DotCMIS.Binding.WebServices
         }
 
         public IObjectData GetObject(string repositoryId, string objectId, string filter, bool? includeAllowableActions,
-            IncludeRelationships? includeRelationships, string renditionFilter, bool? includePolicyIds,
+            IncludeRelationshipsFlag? includeRelationships, string renditionFilter, bool? includePolicyIds,
             bool? includeAcl, IExtensionsData extension)
         {
             ObjectServicePortClient port = Provider.GetObjectService();
@@ -880,7 +880,7 @@ namespace DotCMIS.Binding.WebServices
         }
 
         public IObjectData GetObjectByPath(string repositoryId, string path, string filter, bool? includeAllowableActions,
-            IncludeRelationships? includeRelationships, string renditionFilter, bool? includePolicyIds, bool? includeAcl,
+            IncludeRelationshipsFlag? includeRelationships, string renditionFilter, bool? includePolicyIds, bool? includeAcl,
             IExtensionsData extension)
         {
             ObjectServicePortClient port = Provider.GetObjectService();
@@ -1136,7 +1136,7 @@ namespace DotCMIS.Binding.WebServices
         }
 
         public IObjectData GetObjectOfLatestVersion(string repositoryId, string objectId, string versionSeriesId, bool major,
-            string filter, bool? includeAllowableActions, IncludeRelationships? includeRelationships,
+            string filter, bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships,
             string renditionFilter, bool? includePolicyIds, bool? includeAcl, IExtensionsData extension)
         {
             VersioningServicePortClient port = Provider.GetVersioningService();
@@ -1252,7 +1252,7 @@ namespace DotCMIS.Binding.WebServices
         }
 
         public IObjectList Query(string repositoryId, string statement, bool? searchAllVersions,
-            bool? includeAllowableActions, IncludeRelationships? includeRelationships, string renditionFilter,
+            bool? includeAllowableActions, IncludeRelationshipsFlag? includeRelationships, string renditionFilter,
             long? maxItems, long? skipCount, IExtensionsData extension)
         {
             DiscoveryServicePortClient port = Provider.GetDiscoveryService();

Added: incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-caches.cs
URL: http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-caches.cs?rev=1062859&view=auto
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-caches.cs (added)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-caches.cs Mon Jan 24 16:23:26 2011
@@ -0,0 +1,57 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace DotCMIS.Client
+{
+    /// <summary>
+    /// Client cache interface.
+    /// </summary>
+    public interface ICache
+    {
+        void Initialize(ISession session, IDictionary<string, string> parameters);
+        bool ContainsId(string objectId, string cacheKey);
+        bool ContainsPath(string path, string cacheKey);
+        void Put(ICmisObject cmisObject, string cacheKey);
+        void PutPath(string path, ICmisObject cmisObject, string cacheKey);
+        ICmisObject GetById(string objectId, string cacheKey);
+        ICmisObject GetByPath(string path, string cacheKey);
+        void Clear();
+        int CacheSize { get; }
+    }
+
+    /// <summary>
+    /// Cache implementation that doesn't cache.
+    /// </summary>
+    internal class NoCache : ICache
+    {
+        public void Initialize(ISession session, IDictionary<string, string> parameters) { }
+        public bool ContainsId(string objectId, string cacheKey) { return false; }
+        public bool ContainsPath(string path, string cacheKey) { return false; }
+        public void Put(ICmisObject cmisObject, string cacheKey) { }
+        public void PutPath(string path, ICmisObject cmisObject, string cacheKey) { }
+        public ICmisObject GetById(string objectId, string cacheKey) { return null; }
+        public ICmisObject GetByPath(string path, string cacheKey) { return null; }
+        public void Clear() { }
+        public int CacheSize { get { return 0; } }
+    }
+}

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=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-impl.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-impl.cs Mon Jan 24 16:23:26 2011
@@ -1,9 +1,744 @@
-using System;
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
+using DotCMIS.Binding;
+using DotCMIS.Data;
+using DotCMIS.Exceptions;
+using System.Threading;
+using DotCMIS.Enums;
 
 namespace DotCMIS.Client
 {
- 
+    /// <summary>
+    /// Session factory implementation.
+    /// </summary>
+    public class SessionFactory : ISessionFactory
+    {
+        private SessionFactory()
+        {
+        }
+
+        public static SessionFactory NewInstance()
+        {
+            return new SessionFactory();
+        }
+
+        public ISession CreateSession(IDictionary<string, string> parameters)
+        {
+            Session session = new Session(parameters);
+            session.Connect();
+
+            return session;
+        }
+
+        public IList<IRepository> GetRepositories(IDictionary<string, string> parameters)
+        {
+            ICmisBinding binding = CmisBindingHelper.CreateProvider(parameters);
+
+            IList<IRepositoryInfo> repositoryInfos = binding.GetRepositoryService().GetRepositoryInfos(null);
+
+            IList<IRepository> result = new List<IRepository>();
+            foreach (IRepositoryInfo data in repositoryInfos)
+            {
+                result.Add(new Repository(data, parameters, this));
+            }
+
+            return result;
+        }
+    }
+
+    /// <summary>
+    /// Binding helper class.
+    /// </summary>
+    internal class CmisBindingHelper
+    {
+        public static ICmisBinding CreateProvider(IDictionary<string, string> parameters)
+        {
+            if (parameters == null)
+            {
+                throw new ArgumentNullException("parameters");
+            }
+
+            if (!parameters.ContainsKey(SessionParameter.BindingType))
+            {
+                parameters[SessionParameter.BindingType] = BindingType.Custom;
+            }
+
+            string bt = parameters[SessionParameter.BindingType];
+            switch (bt)
+            {
+                case BindingType.AtomPub:
+                    return CreateAtomPubBinding(parameters);
+                case BindingType.WebServices:
+                    return CreateWebServiceBinding(parameters);
+                case BindingType.Custom:
+                    return CreateCustomBinding(parameters);
+                default:
+                    throw new CmisRuntimeException("Ambiguous session parameter: " + parameters);
+            }
+        }
+
+        private static ICmisBinding CreateCustomBinding(IDictionary<string, string> parameters)
+        {
+            CmisBindingFactory factory = CmisBindingFactory.NewInstance();
+            ICmisBinding binding = factory.CreateCmisBinding(parameters);
+
+            return binding;
+        }
+
+        private static ICmisBinding CreateWebServiceBinding(IDictionary<string, string> parameters)
+        {
+            CmisBindingFactory factory = CmisBindingFactory.NewInstance();
+            ICmisBinding binding = factory.CreateCmisWebServicesBinding(parameters);
+
+            return binding;
+        }
+
+        private static ICmisBinding CreateAtomPubBinding(IDictionary<string, string> parameters)
+        {
+            CmisBindingFactory factory = CmisBindingFactory.NewInstance();
+            ICmisBinding binding = factory.CreateCmisAtomPubBinding(parameters);
+
+            return binding;
+        }
+    }
+
+    /// <summary>
+    /// Repository implementation.
+    /// </summary>
+    public class Repository : RepositoryInfo, IRepository
+    {
+        private IDictionary<string, string> parameters;
+        private ISessionFactory sessionFactory;
+
+        public Repository(IRepositoryInfo info, IDictionary<string, string> parameters, ISessionFactory sessionFactory)
+            : base(info)
+        {
+            this.parameters = new Dictionary<string, string>(parameters);
+            this.parameters[SessionParameter.RepositoryId] = Id;
+
+            this.sessionFactory = sessionFactory;
+        }
+
+        public ISession CreateSession()
+        {
+            return sessionFactory.CreateSession(parameters);
+        }
+    }
+
+    /// <summary>
+    /// Session implementation.
+    /// </summary>
+    public class Session : ISession
+    {
+        protected static IOperationContext FallbackContext = new OperationContext(null, false, true, false, IncludeRelationshipsFlag.None, null, true, null, true, 100);
+        protected IOperationContext context = FallbackContext;
+
+        protected IDictionary<string, string> parameters;
+        protected ICache cache;
+
+        private object sessionLock = new object();
+
+        public ICmisBinding Binding { get; protected set; }
+        public IRepositoryInfo RepositoryInfo { get; protected set; }
+        public IOperationContext DefaultContext
+        {
+            get
+            {
+                Lock();
+                try
+                {
+                    return context;
+                }
+                finally
+                {
+                    Unlock();
+                }
+            }
+            set
+            {
+                Lock();
+                try
+                {
+                    context = (value == null ? FallbackContext : value);
+                }
+                finally
+                {
+                    Unlock();
+                }
+            }
+        }
+
+        public Session(IDictionary<string, string> parameters)
+        {
+            if (parameters == null)
+            {
+                throw new ArgumentNullException("parameters");
+            }
+
+            this.parameters = parameters;
+
+            cache = CreateCache();
+        }
+
+        public void Connect()
+        {
+            Lock();
+            try
+            {
+                Binding = CmisBindingHelper.CreateProvider(parameters);
+
+                string repositoryId;
+                if (!parameters.TryGetValue(SessionParameter.RepositoryId, out repositoryId))
+                {
+                    throw new ArgumentException("Repository Id is not set!");
+                }
+
+                RepositoryInfo = Binding.GetRepositoryService().GetRepositoryInfo(repositoryId, null);
+            }
+            finally
+            {
+                Unlock();
+            }
+        }
+
+        protected ICache CreateCache()
+        {
+            try
+            {
+                string typeName;
+                Type cacheType;
+
+                if (parameters.TryGetValue(SessionParameter.CacheClass, out typeName))
+                {
+                    cacheType = Type.GetType(typeName);
+                }
+                else
+                {
+                    cacheType = typeof(NoCache);
+                }
+
+                object cacheObject = Activator.CreateInstance(cacheType);
+                if (!(cacheObject is ICache))
+                {
+                    throw new Exception("Class does not implement ICache!");
+                }
+
+                ((ICache)cacheObject).Initialize(this, parameters);
+
+                return (ICache)cacheObject;
+            }
+            catch (Exception e)
+            {
+                throw new ArgumentException("Unable to create cache: " + e, e);
+            }
+        }
+
+        public void Clear()
+        {
+            Lock();
+            try
+            {
+                cache = CreateCache();
+                Binding.ClearAllCaches();
+            }
+            finally
+            {
+                Unlock();
+            }
+        }
+
+        // session context
+
+        public IOperationContext CreateOperationContext()
+        {
+            return new OperationContext();
+        }
+
+        public IOperationContext CreateOperationContext(HashSet<string> filter, bool includeAcls, bool includeAllowableActions, bool includePolicies,
+            IncludeRelationshipsFlag includeRelationships, HashSet<string> renditionFilter, bool includePathSegments, string orderBy,
+            bool cacheEnabled, int maxItemsPerPage)
+        {
+            return new OperationContext(filter, includeAcls, includeAllowableActions, includePolicies, includeRelationships, renditionFilter,
+                includePathSegments, orderBy, cacheEnabled, maxItemsPerPage);
+        }
+
+        public IObjectId CreateObjectId(string id)
+        {
+            return new ObjectId(id);
+        }
+
+        // services
+
+        public IObjectFactory ObjectFactory { get; protected set; }
+
+        // types
+
+        public IObjectType GetTypeDefinition(string typeId)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IItemIterable<IObjectType> GetTypeChildren(string typeId, bool includePropertyDefinitions)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IList<ITree<IObjectType>> GetTypeDescendants(string typeId, int depth, bool includePropertyDefinitions)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        // navigation
+
+        public IFolder GetRootFolder()
+        {
+            return GetRootFolder(DefaultContext);
+        }
+
+        public IFolder GetRootFolder(IOperationContext context)
+        {
+            string rootFolderId = RepositoryInfo.RootFolderId;
+
+            ICmisObject rootFolder = GetObject(CreateObjectId(rootFolderId), context);
+            if (!(rootFolder is IFolder))
+            {
+                throw new CmisRuntimeException("Root folder object is not a folder!");
+            }
+
+            return (IFolder)rootFolder;
+        }
+
+        public IItemIterable<IDocument> GetCheckedOutDocs()
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IItemIterable<IDocument> GetCheckedOutDocs(IOperationContext context)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public ICmisObject GetObject(IObjectId objectId)
+        {
+            return GetObject(objectId, DefaultContext);
+        }
+
+        public ICmisObject GetObject(IObjectId objectId, IOperationContext context)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public ICmisObject GetObjectByPath(string path)
+        {
+            return GetObjectByPath(path, DefaultContext);
+        }
+
+        public ICmisObject GetObjectByPath(string path, IOperationContext context)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        // discovery
+
+        public IItemIterable<IQueryResult> Query(string statement, bool searchAllVersions)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IItemIterable<IQueryResult> query(string statement, bool searchAllVersions, IOperationContext context)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IChangeEvents getContentChanges(string changeLogToken, bool includeProperties, long maxNumItems)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IChangeEvents getContentChanges(string changeLogToken, bool includeProperties, long maxNumItems,
+                IOperationContext context)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        // create
+
+        public IObjectId CreateDocument(IDictionary<string, string> properties, IObjectId folderId, IContentStream contentStream,
+                VersioningState? versioningState, IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IObjectId CreateDocument(IDictionary<string, string> properties, IObjectId folderId, IContentStream contentStream,
+                VersioningState? versioningState)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IObjectId CreateDocumentFromSource(IObjectId source, IDictionary<string, string> properties, IObjectId folderId,
+                VersioningState? versioningState, IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IObjectId CreateDocumentFromSource(IObjectId source, IDictionary<string, string> properties, IObjectId folderId,
+                VersioningState? versioningState)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IObjectId CreateFolder(IDictionary<string, string> properties, IObjectId folderId, IList<IPolicy> policies, IList<IAce> addAces,
+                IList<IAce> removeAces)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IObjectId CreateFolder(IDictionary<string, string> properties, IObjectId folderId)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IObjectId CreatePolicy(IDictionary<string, string> properties, IObjectId folderId, IList<IPolicy> policies, IList<IAce> addAces,
+                IList<IAce> removeAces)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IObjectId CreatePolicy(IDictionary<string, string> properties, IObjectId folderId)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IObjectId CreateRelationship(IDictionary<string, string> properties, IList<IPolicy> policies, IList<IAce> addAces,
+                IList<IAce> removeAces)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IObjectId CreateRelationship(IDictionary<string, string> properties)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IItemIterable<IRelationship> GetRelationships(IObjectId objectId, bool includeSubRelationshipTypes,
+                RelationshipDirection? relationshipDirection, IObjectType type, IOperationContext context)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        // permissions
+
+        public IAcl GetAcl(IObjectId objectId, bool onlyBasicPermissions)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public IAcl ApplyAcl(IObjectId objectId, IList<IAce> addAces, IList<IAce> removeAces, AclPropagation? aclPropagation)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public void ApplyPolicy(IObjectId objectId, IObjectId policyIds)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        public void RemovePolicy(IObjectId objectId, IObjectId policyIds)
+        { throw new CmisNotSupportedException("Client not implemented!"); }
+
+        protected void Lock()
+        {
+            Monitor.Enter(sessionLock);
+        }
+
+        protected void Unlock()
+        {
+            Monitor.Exit(sessionLock);
+        }
+    }
+
+    /// <summary>
+    /// Operation context implementation.
+    /// </summary>
+    public class OperationContext : IOperationContext
+    {
+        public const string PropertiesStar = "*";
+        public const string RenditionNone = "cmis:none";
+
+        private HashSet<string> filter;
+        private bool includeAllowableActions;
+        private bool includeAcls;
+        private IncludeRelationshipsFlag? includeRelationships;
+        private bool includePolicies;
+        private HashSet<string> renditionFilter;
+        private bool includePathSegments;
+        private string orderBy;
+        private bool cacheEnabled;
+        private string cacheKey;
+        private int maxItemsPerPage;
+
+        public OperationContext()
+        {
+            filter = null;
+            includeAcls = false;
+            includeAllowableActions = true;
+            includePolicies = false;
+            includeRelationships = IncludeRelationshipsFlag.None;
+            renditionFilter = null;
+            includePathSegments = true;
+            orderBy = null;
+            cacheEnabled = false;
+            maxItemsPerPage = 100;
+
+            GenerateCacheKey();
+        }
+
+        public OperationContext(HashSet<string> filter, bool includeAcls, bool includeAllowableActions,
+            bool includePolicies, IncludeRelationshipsFlag includeRelationships, HashSet<string> renditionFilter,
+            bool includePathSegments, String orderBy, bool cacheEnabled, int maxItemsPerPage)
+        {
+            this.filter = filter;
+            this.includeAcls = includeAcls;
+            this.includeAllowableActions = includeAllowableActions;
+            this.includePolicies = includePolicies;
+            this.includeRelationships = includeRelationships;
+            this.renditionFilter = renditionFilter;
+            this.includePathSegments = includePathSegments;
+            this.orderBy = orderBy;
+            this.cacheEnabled = cacheEnabled;
+            this.maxItemsPerPage = maxItemsPerPage;
+
+            GenerateCacheKey();
+        }
+
+        public HashSet<string> Filter
+        {
+            get { return new HashSet<string>(filter); }
+            set
+            {
+                if (value != null)
+                {
+                    HashSet<string> tempSet = new HashSet<string>();
+                    foreach (string oid in value)
+                    {
+                        if (oid == null) { continue; }
+
+                        string toid = oid.Trim();
+                        if (toid.Length == 0) { continue; }
+                        if (toid == PropertiesStar)
+                        {
+                            tempSet = new HashSet<string>();
+                            tempSet.Add(PropertiesStar);
+                            break;
+                        }
+                        if (toid.IndexOf(',') > -1)
+                        {
+                            throw new ArgumentException("Query id must not contain a comma!");
+                        }
+
+                        tempSet.Add(toid);
+                    }
+
+                    if (tempSet.Count == 0) { filter = null; }
+                    else { filter = tempSet; }
+                }
+                else
+                {
+                    filter = null;
+                }
+
+                GenerateCacheKey();
+            }
+        }
+
+        public string FilterString
+        {
+            get
+            {
+                if (filter == null) { return null; }
+
+                if (filter.Contains(PropertiesStar))
+                {
+                    return PropertiesStar;
+                }
+
+                this.filter.Add(PropertyIds.ObjectId);
+                this.filter.Add(PropertyIds.BaseTypeId);
+                this.filter.Add(PropertyIds.ObjectTypeId);
+
+                StringBuilder sb = new StringBuilder();
+
+                foreach (String oid in filter)
+                {
+                    if (sb.Length > 0) { sb.Append(','); }
+                    sb.Append(oid);
+                }
+
+                return sb.ToString();
+            }
+
+            set
+            {
+                if (value == null || value.Trim().Length == 0)
+                {
+                    Filter = null;
+                    return;
+                }
+
+                string[] ids = value.Split(',');
+                HashSet<string> tempSet = new HashSet<string>();
+                foreach (string qid in ids)
+                {
+                    tempSet.Add(qid);
+                }
+
+                Filter = tempSet;
+            }
+        }
+
+        public bool IncludeAllowableActions
+        {
+            get { return includeAllowableActions; }
+            set { includeAllowableActions = value; GenerateCacheKey(); }
+        }
+
+        public bool IncludeAcls
+        {
+            get { return includeAcls; }
+            set { includeAcls = value; GenerateCacheKey(); }
+        }
+
+        public IncludeRelationshipsFlag? IncludeRelationships
+        {
+            get { return includeRelationships; }
+            set { includeRelationships = value; GenerateCacheKey(); }
+        }
+
+        public bool IncludePolicies
+        {
+            get { return includePolicies; }
+            set { includePolicies = value; GenerateCacheKey(); }
+        }
+
+        public HashSet<string> RenditionFilter
+        {
+            get { return new HashSet<string>(renditionFilter); }
+            set
+            {
+                HashSet<string> tempSet = new HashSet<string>();
+                if (value != null)
+                {
+                    foreach (String rf in value)
+                    {
+                        if (rf == null) { continue; }
+
+                        String trf = rf.Trim();
+                        if (trf.Length == 0) { continue; }
+                        if (trf.IndexOf(',') > -1)
+                        {
+                            throw new ArgumentException("Rendition must not contain a comma!");
+                        }
+
+                        tempSet.Add(trf);
+                    }
+
+                    if (tempSet.Count == 0)
+                    {
+                        tempSet.Add(RenditionNone);
+                    }
+                }
+                else
+                {
+                    tempSet.Add(RenditionNone);
+                }
+
+                renditionFilter = tempSet;
+
+                GenerateCacheKey();
+            }
+        }
+
+        public string RenditionFilterString
+        {
+            get
+            {
+                if (renditionFilter == null) { return null; }
+
+                StringBuilder sb = new StringBuilder();
+                foreach (string rf in renditionFilter)
+                {
+                    if (sb.Length > 0) { sb.Append(','); }
+                    sb.Append(rf);
+                }
+
+                return sb.ToString();
+            }
+
+            set
+            {
+                if (value == null || value.Trim().Length == 0)
+                {
+                    RenditionFilter = null;
+                    return;
+                }
+
+                string[] renditions = value.Split(',');
+                HashSet<string> tempSet = new HashSet<string>();
+                foreach (string rend in renditions)
+                {
+                    tempSet.Add(rend);
+                }
+
+                RenditionFilter = tempSet;
+            }
+        }
+
+        public bool IncludePathSegments
+        {
+            get { return includePathSegments; }
+            set { includePathSegments = value; GenerateCacheKey(); }
+        }
+
+        public string OrderBy
+        {
+            get { return orderBy; }
+            set { orderBy = value; GenerateCacheKey(); }
+        }
+
+        public bool CacheEnabled
+        {
+            get { return cacheEnabled; }
+            set { cacheEnabled = value; GenerateCacheKey(); }
+        }
+
+        public string CacheKey
+        {
+            get { return cacheKey; }
+        }
+
+        public int MaxItemsPerPage
+        {
+            get { return maxItemsPerPage; }
+            set { maxItemsPerPage = value; }
+        }
+
+        protected void GenerateCacheKey()
+        {
+            if (!cacheEnabled)
+            {
+                cacheKey = null;
+            }
+
+            StringBuilder sb = new StringBuilder();
+
+            sb.Append(includeAcls ? "1" : "0");
+            sb.Append(includeAllowableActions ? "1" : "0");
+            sb.Append(includePolicies ? "1" : "0");
+            sb.Append("|");
+            sb.Append(filter == null ? "" : FilterString);
+            sb.Append("|");
+            sb.Append(includeRelationships == null ? "" : includeRelationships.GetCmisValue());
+
+            sb.Append("|");
+            sb.Append(renditionFilter == null ? "" : RenditionFilterString);
+
+            cacheKey = sb.ToString();
+        }
+    }
+
+    /// <summary>
+    /// Object id implementation.
+    /// </summary>
+    public class ObjectId : IObjectId
+    {
+        private string id;
+        public string Id
+        {
+            get { return id; }
+            set
+            {
+                if (value == null || value.Length == 0)
+                {
+                    throw new ArgumentException("Id must be set!");
+                }
+
+                id = value;
+            }
+        }
+
+        public ObjectId(string id)
+        {
+            Id = id;
+        }
+    }
 }

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=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-intf.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/client/client-intf.cs Mon Jan 24 16:23:26 2011
@@ -23,10 +23,115 @@ using System.Text;
 using DotCMIS.Data;
 using DotCMIS.Enums;
 using DotCMIS.Data.Extensions;
+using DotCMIS.Binding;
 
 namespace DotCMIS.Client
 {
-    public interface IOperationContext { }
+    public interface ISessionFactory
+    {
+        ISession CreateSession(IDictionary<string, string> parameters);
+        IList<IRepository> GetRepositories(IDictionary<string, string> parameters);
+    }
+
+    public interface IRepository : IRepositoryInfo
+    {
+        ISession CreateSession();
+    }
+
+    public interface ISession
+    {
+        void Clear();
+
+        // session context
+
+        ICmisBinding Binding { get; }
+
+        IOperationContext DefaultContext { get; set; }
+        IOperationContext CreateOperationContext();
+        IOperationContext CreateOperationContext(HashSet<string> filter, bool includeAcls, bool includeAllowableActions, bool includePolicies,
+            IncludeRelationshipsFlag includeRelationships, HashSet<string> renditionFilter, bool includePathSegments, string orderBy, 
+            bool cacheEnabled, int maxItemsPerPage);
+        IObjectId CreateObjectId(string id);
+
+        // services
+
+        IRepositoryInfo RepositoryInfo { get; }
+        IObjectFactory ObjectFactory { get; }
+
+        // types
+
+        IObjectType GetTypeDefinition(string typeId);
+        IItemIterable<IObjectType> GetTypeChildren(string typeId, bool includePropertyDefinitions);
+        IList<ITree<IObjectType>> GetTypeDescendants(string typeId, int depth, bool includePropertyDefinitions);
+
+        // navigation
+
+        IFolder GetRootFolder();
+        IFolder GetRootFolder(IOperationContext context);
+        IItemIterable<IDocument> GetCheckedOutDocs();
+        IItemIterable<IDocument> GetCheckedOutDocs(IOperationContext context);
+        ICmisObject GetObject(IObjectId objectId);
+        ICmisObject GetObject(IObjectId objectId, IOperationContext context);
+        ICmisObject GetObjectByPath(string path);
+        ICmisObject GetObjectByPath(string path, IOperationContext context);
+
+        // discovery
+
+        IItemIterable<IQueryResult> Query(string statement, bool searchAllVersions);
+        IItemIterable<IQueryResult> query(string statement, bool searchAllVersions, IOperationContext context);
+        IChangeEvents getContentChanges(string changeLogToken, bool includeProperties, long maxNumItems);
+        IChangeEvents getContentChanges(string changeLogToken, bool includeProperties, long maxNumItems,
+                IOperationContext context);
+
+        // create
+
+        IObjectId CreateDocument(IDictionary<string, string> properties, IObjectId folderId, IContentStream contentStream,
+                VersioningState? versioningState, IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces);
+        IObjectId CreateDocument(IDictionary<string, string> properties, IObjectId folderId, IContentStream contentStream,
+                VersioningState? versioningState);
+        IObjectId CreateDocumentFromSource(IObjectId source, IDictionary<string, string> properties, IObjectId folderId,
+                VersioningState? versioningState, IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces);
+        IObjectId CreateDocumentFromSource(IObjectId source, IDictionary<string, string> properties, IObjectId folderId,
+                VersioningState? versioningState);
+        IObjectId CreateFolder(IDictionary<string, string> properties, IObjectId folderId, IList<IPolicy> policies, IList<IAce> addAces,
+                IList<IAce> removeAces);
+        IObjectId CreateFolder(IDictionary<string, string> properties, IObjectId folderId);
+        IObjectId CreatePolicy(IDictionary<string, string> properties, IObjectId folderId, IList<IPolicy> policies, IList<IAce> addAces,
+                IList<IAce> removeAces);
+        IObjectId CreatePolicy(IDictionary<string, string> properties, IObjectId folderId);
+        IObjectId CreateRelationship(IDictionary<string, string> properties, IList<IPolicy> policies, IList<IAce> addAces,
+                IList<IAce> removeAces);
+        IObjectId CreateRelationship(IDictionary<string, string> properties);
+
+        IItemIterable<IRelationship> GetRelationships(IObjectId objectId, bool includeSubRelationshipTypes,
+                RelationshipDirection? relationshipDirection, IObjectType type, IOperationContext context);
+
+        // permissions
+
+        IAcl GetAcl(IObjectId objectId, bool onlyBasicPermissions);
+        IAcl ApplyAcl(IObjectId objectId, IList<IAce> addAces, IList<IAce> removeAces, AclPropagation? aclPropagation);
+        void ApplyPolicy(IObjectId objectId, IObjectId policyIds);
+        void RemovePolicy(IObjectId objectId, IObjectId policyIds);
+    }
+
+    public interface IObjectFactory { }
+
+    public interface IOperationContext
+    {
+        HashSet<string> Filter { get; set; }
+        string FilterString { get; set; }
+        bool IncludeAllowableActions { get; set; }
+        bool IncludeAcls { get; set; }
+        IncludeRelationshipsFlag? IncludeRelationships { get; set; }
+        bool IncludePolicies { get; set; }
+        HashSet<string> RenditionFilter { get; set; }
+        string RenditionFilterString { get; set; }
+        bool IncludePathSegments { get; set; }
+        string OrderBy { get; set; }
+        bool CacheEnabled { get; set; }
+        string CacheKey { get; }
+        int MaxItemsPerPage { get; set; }
+    }
 
     public interface ITree<T>
     {
@@ -70,16 +175,16 @@ namespace DotCMIS.Client
         bool IsMultiValued { get; }
         PropertyType PropertyType { get; }
         PropertyDefinition PropertyDefinition { get; }
-        V getValue<V>();
+        V GetValue<V>();
         string GetValueAsString();
-        string getValuesAsString();
+        string GetValuesAsString();
     }
 
     public interface ICmisObjectProperties
     {
         IList<IProperty> Properties { get; }
         IProperty GetProperty(string id);
-        T getPropertyValue<T>(string id);
+        T GetPropertyValue<T>(string id);
 
         // convenience accessors
         string Name { get; }
@@ -102,48 +207,48 @@ namespace DotCMIS.Client
     public interface ICmisObject : IObjectId, ICmisObjectProperties
     {
         // object
-        IAllowableActions getAllowableActions();
-        IList<IRelationship> getRelationships();
-        IAcl getAcl();
+        IAllowableActions GetAllowableActions();
+        IList<IRelationship> GetRelationships();
+        IAcl GetAcl();
 
         // object service
-        void delete(bool allVersions);
-        ICmisObject updateProperties(IDictionary<string, object> properties);
-        IObjectId updateProperties(IDictionary<string, object> properties, bool refresh);
+        void Delete(bool allVersions);
+        ICmisObject UpdateProperties(IDictionary<string, object> properties);
+        IObjectId UpdateProperties(IDictionary<string, object> properties, bool refresh);
 
         // renditions
-        IList<IRendition> getRenditions();
+        IList<IRendition> GetRenditions();
 
         // policy service
-        void applyPolicy(IObjectId policyId);
-        void removePolicy(IObjectId policyIds);
-        IList<IPolicy> getPolicies();
+        void ApplyPolicy(IObjectId policyId);
+        void RemovePolicy(IObjectId policyIds);
+        IList<IPolicy> GetPolicies();
 
         // ACL service
-        IAcl applyAcl(IList<Ace> addAces, IList<Ace> removeAces, AclPropagation? aclPropagation);
-        IAcl addAcl(IList<Ace> addAces, AclPropagation? aclPropagation);
-        IAcl removeAcl(IList<Ace> removeAces, AclPropagation? aclPropagation);
+        IAcl applyAcl(IList<IAce> AddAces, IList<IAce> removeAces, AclPropagation? aclPropagation);
+        IAcl addAcl(IList<IAce> AddAces, AclPropagation? aclPropagation);
+        IAcl removeAcl(IList<IAce> RemoveAces, AclPropagation? aclPropagation);
 
         // extensions
-        IList<ICmisExtensionElement> getExtensions(ExtensionLevel level);
+        IList<ICmisExtensionElement> GetExtensions(ExtensionLevel level);
 
-        long getRefreshTimestamp();
-        void refresh();
-        void refreshIfOld(long durationInMillis);
+        long GetRefreshTimestamp();
+        void Refresh();
+        void RefreshIfOld(long durationInMillis);
     }
 
     public interface IFileableCmisObject : ICmisObject
     {
         // object service
-        IFileableCmisObject move(IObjectId sourceFolderId, IObjectId targetFolderId);
+        IFileableCmisObject Move(IObjectId sourceFolderId, IObjectId targetFolderId);
 
         // navigation service
         IList<IFolder> GetParents();
         IList<string> GetPaths();
 
         // multifiling service
-        void addToFolder(IObjectId folderId, bool allVersions);
-        void removeFromFolder(IObjectId folderId);
+        void AddToFolder(IObjectId folderId, bool allVersions);
+        void RemoveFromFolder(IObjectId folderId);
     }
 
     public interface IDocumentProperties
@@ -194,19 +299,19 @@ namespace DotCMIS.Client
 
     public interface IFolder : IFileableCmisObject, IFolderProperties
     {
-        IDocument createDocument(IDictionary<string, object> properties, IContentStream contentStream, VersioningState? versioningState,
+        IDocument CreateDocument(IDictionary<string, object> properties, IContentStream contentStream, VersioningState? versioningState,
                 IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces, IOperationContext context);
-        IDocument createDocument(IDictionary<string, object> properties, IContentStream contentStream, VersioningState? versioningState);
-        IDocument createDocumentFromSource(IObjectId source, IDictionary<string, object> properties, VersioningState? versioningState,
+        IDocument CreateDocument(IDictionary<string, object> properties, IContentStream contentStream, VersioningState? versioningState);
+        IDocument CreateDocumentFromSource(IObjectId source, IDictionary<string, object> properties, VersioningState? versioningState,
                 IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces, IOperationContext context);
-        IDocument createDocumentFromSource(IObjectId source, IDictionary<string, object> properties, VersioningState? versioningState);
-        IFolder createFolder(IDictionary<string, object> properties, IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces,
+        IDocument CreateDocumentFromSource(IObjectId source, IDictionary<string, object> properties, VersioningState? versioningState);
+        IFolder CreateFolder(IDictionary<string, object> properties, IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces,
                 IOperationContext context);
-        IFolder createFolder(IDictionary<string, object> properties);
-        IPolicy createPolicy(IDictionary<string, object> properties, List<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces,
+        IFolder CreateFolder(IDictionary<string, object> properties);
+        IPolicy CreatePolicy(IDictionary<string, object> properties, List<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces,
                 IOperationContext context);
-        IPolicy createPolicy(IDictionary<string, object> properties);
-        IList<string> deleteTree(bool allversions, UnfileObject? unfile, bool continueOnFailure);
+        IPolicy CreatePolicy(IDictionary<string, object> properties);
+        IList<string> DeleteTree(bool allversions, UnfileObject? unfile, bool continueOnFailure);
         IList<ITree<IFileableCmisObject>> GetFolderTree(int depth);
         IList<ITree<IFileableCmisObject>> GetFolderTree(int depth, IOperationContext context);
         IList<ITree<IFileableCmisObject>> GetDescendants(int depth);
@@ -242,4 +347,12 @@ namespace DotCMIS.Client
         ICmisObject GetTarget();
         ICmisObject GetTarget(IOperationContext context);
     }
+
+    public interface IQueryResult
+    {
+    }
+
+    public interface IChangeEvents
+    {
+    }
 }

Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/const.cs
URL: http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/const.cs?rev=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/const.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/const.cs Mon Jan 24 16:23:26 2011
@@ -60,12 +60,17 @@ namespace DotCMIS
 
         // message size
         public const string MessageSize = "org.apache.chemistry.dotcmis.binding.message.size";
+
+        // session parameter
+        public const string CacheClass = "org.apache.chemistry.dotcmis.cache.classname";
+        public const string RepositoryId = "org.apache.chemistry.dotcmis.session.repository.id";
     }
 
     public static class BindingType
     {
         public const string AtomPub = "atompub";
         public const string WebServices = "webservices";
+        public const string Custom = "custom";
     }
 
     public static class PropertyIds

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=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-impl.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/data/data-impl.cs Mon Jan 24 16:23:26 2011
@@ -27,6 +27,30 @@ namespace DotCMIS.Data
 {
     public class RepositoryInfo : ExtensionsData, IRepositoryInfo
     {
+        public RepositoryInfo()
+        {
+        }
+
+        public RepositoryInfo(IRepositoryInfo source)
+        {
+            Id = source.Id;
+            Name = source.Name;
+            Description = source.Description;
+            VendorName = source.VendorName;
+            ProductName = source.ProductName;
+            ProductVersion = source.ProductVersion;
+            RootFolderId = source.RootFolderId;
+            Capabilities = source.Capabilities;
+            AclCapabilities = source.AclCapabilities;
+            LatestChangeLogToken = source.LatestChangeLogToken;
+            CmisVersionSupported = source.CmisVersionSupported;
+            ThinClientUri = source.ThinClientUri;
+            ChangesIncomplete = source.ChangesIncomplete;
+            ChangesOnType = source.ChangesOnType;
+            PrincipalIdAnonymous = source.PrincipalIdAnonymous;
+            PrincipalIdAnyone = source.PrincipalIdAnyone;
+        }
+
         public string Id { get; set; }
         public string Name { get; set; }
         public string Description { get; set; }

Modified: incubator/chemistry/dotcmis/trunk/DotCMIS/enums.cs
URL: http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMIS/enums.cs?rev=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMIS/enums.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMIS/enums.cs Mon Jan 24 16:23:26 2011
@@ -227,7 +227,7 @@ namespace DotCMIS.Enums
         Bits64
     }
 
-    public enum IncludeRelationships
+    public enum IncludeRelationshipsFlag
     {
         [CmisValue("none")]
         None,
@@ -346,7 +346,7 @@ namespace DotCMIS.Enums
             MapEnums(typeof(Updatability), typeof(enumUpdatability));
             MapEnums(typeof(DateTimeResolution), typeof(enumDateTimeResolution));
             MapEnums(typeof(DecimalPrecision), typeof(enumDecimalPrecision));
-            MapEnums(typeof(IncludeRelationships), typeof(enumIncludeRelationships));
+            MapEnums(typeof(IncludeRelationshipsFlag), typeof(enumIncludeRelationships));
             MapEnums(typeof(ChangeType), typeof(enumTypeOfChanges));
         }
 

Modified: incubator/chemistry/dotcmis/trunk/DotCMISUnitTest/CRUDTest.cs
URL: http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMISUnitTest/CRUDTest.cs?rev=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMISUnitTest/CRUDTest.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMISUnitTest/CRUDTest.cs Mon Jan 24 16:23:26 2011
@@ -39,7 +39,7 @@ namespace DotCMISUnitTest
             IObjectData rootFolder = GetFullObject(RepositoryInfo.RootFolderId);
             Assert.AreEqual(BaseTypeId.CmisFolder, rootFolder.BaseTypeId);
 
-            IObjectData rootFolder2 = Binding.GetObjectService().GetObjectByPath(RepositoryInfo.Id, "/", null, true, IncludeRelationships.Both, null, true, true, null);
+            IObjectData rootFolder2 = Binding.GetObjectService().GetObjectByPath(RepositoryInfo.Id, "/", null, true, IncludeRelationshipsFlag.Both, null, true, true, null);
             Assert.AreEqual(BaseTypeId.CmisFolder, rootFolder2.BaseTypeId);
 
             Assert.AreEqual(rootFolder.Id, rootFolder2.Id);
@@ -48,7 +48,7 @@ namespace DotCMISUnitTest
         [Test]
         public void TestCreateDocument()
         {
-               string content1 = "my content";
+            string content1 = "my content";
 
             IObjectData doc = CreateDocument(RepositoryInfo.RootFolderId, "dottest", content1);
 

Modified: incubator/chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs
URL: http://svn.apache.org/viewvc/incubator/chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs?rev=1062859&r1=1062858&r2=1062859&view=diff
==============================================================================
--- incubator/chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs (original)
+++ incubator/chemistry/dotcmis/trunk/DotCMISUnitTest/TestFramework.cs Mon Jan 24 16:23:26 2011
@@ -17,15 +17,15 @@
  * under the License.
  */
 using System.Collections.Generic;
+using System.IO;
 using System.Net;
+using System.Text;
 using DotCMIS;
 using DotCMIS.Binding;
-using NUnit.Framework;
 using DotCMIS.Data;
 using DotCMIS.Enums;
 using DotCMIS.Exceptions;
-using System.Text;
-using System.IO;
+using NUnit.Framework;
 
 namespace DotCMISUnitTest
 {
@@ -108,7 +108,7 @@ namespace DotCMISUnitTest
 
         public IObjectData GetFullObject(string objectId)
         {
-            IObjectData result = Binding.GetObjectService().GetObject(RepositoryInfo.Id, objectId, "*", true, IncludeRelationships.Both, "*", true, true, null);
+            IObjectData result = Binding.GetObjectService().GetObject(RepositoryInfo.Id, objectId, "*", true, IncludeRelationshipsFlag.Both, "*", true, true, null);
 
             Assert.NotNull(result);
             Assert.NotNull(result.Id);



Mime
View raw message