- refactored namespaces
- added query implementation

git-svn-id: https://svn.apache.org/repos/asf/incubator/chemistry/dotcmis/trunk@1067790 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/DotCMIS.suo b/DotCMIS.suo
index 81c2f10..daccb95 100644
--- a/DotCMIS.suo
+++ b/DotCMIS.suo
Binary files differ
diff --git a/DotCMIS/DotCMIS.csproj b/DotCMIS/DotCMIS.csproj
index 6a25571..539c138 100644
--- a/DotCMIS/DotCMIS.csproj
+++ b/DotCMIS/DotCMIS.csproj
@@ -21,6 +21,7 @@
     <DefineConstants>DEBUG;TRACE</DefineConstants>

     <ErrorReport>prompt</ErrorReport>

     <WarningLevel>4</WarningLevel>

+    <DocumentationFile>bin\Debug\DotCMIS.XML</DocumentationFile>

   </PropertyGroup>

   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">

     <DebugType>pdbonly</DebugType>

@@ -29,6 +30,7 @@
     <DefineConstants>TRACE</DefineConstants>

     <ErrorReport>prompt</ErrorReport>

     <WarningLevel>4</WarningLevel>

+    <DocumentationFile>bin\Release\DotCMIS.XML</DocumentationFile>

   </PropertyGroup>

   <ItemGroup>

     <Reference Include="System" />

diff --git a/DotCMIS/binding/atompub/atompub-linkcache.cs b/DotCMIS/binding/atompub/atompub-linkcache.cs
index 815cc78..6296b8c 100644
--- a/DotCMIS/binding/atompub/atompub-linkcache.cs
+++ b/DotCMIS/binding/atompub/atompub-linkcache.cs
@@ -31,11 +31,11 @@
         private const int CacheSizeTypes = 100;

         private const int CacheSizeLinks = 400;

 

-        private ICache linkCache;

-        private ICache typeLinkCache;

-        private ICache collectionLinkCache;

-        private ICache templateCache;

-        private ICache repositoryLinkCache;

+        private IBindingCache linkCache;

+        private IBindingCache typeLinkCache;

+        private IBindingCache collectionLinkCache;

+        private IBindingCache templateCache;

+        private IBindingCache repositoryLinkCache;

 

         public LinkCache(BindingSession session)

         {

diff --git a/DotCMIS/binding/atompub/atompub-writer.cs b/DotCMIS/binding/atompub/atompub-writer.cs
index 9774371..d881301 100644
--- a/DotCMIS/binding/atompub/atompub-writer.cs
+++ b/DotCMIS/binding/atompub/atompub-writer.cs
@@ -83,7 +83,10 @@
 

         public void Write(Stream outStream)

         {

-            using (XmlWriter writer = XmlWriter.Create(outStream))

+            XmlWriterSettings xmlWriterSettings = new XmlWriterSettings();

+            xmlWriterSettings.Encoding = new UTF8Encoding(false);

+

+            using (XmlWriter writer = XmlWriter.Create(outStream, xmlWriterSettings))

             {

                 // start doc

                 writer.WriteStartDocument();

@@ -213,16 +216,17 @@
 

         public void Write(Stream outStream)

         {

-            using (XmlWriter writer = XmlWriter.Create(outStream))

+            XmlWriterSettings xmlWriterSettings = new XmlWriterSettings();

+            xmlWriterSettings.Encoding = new UTF8Encoding(false);

+

+            using (XmlWriter writer = XmlWriter.Create(outStream, xmlWriterSettings))

             {

                 // start doc

                 writer.WriteStartDocument();

 

                 // start query

                 writer.WriteStartElement(AtomWriter.PrefixCMIS, AtomPubConstants.TagQuery, AtomPubConstants.NamespaceCMIS);

-                writer.WriteAttributeString("xmlns", AtomWriter.PrefixAtom, null, AtomPubConstants.NamespaceAtom);

                 writer.WriteAttributeString("xmlns", AtomWriter.PrefixCMIS, null, AtomPubConstants.NamespaceCMIS);

-                writer.WriteAttributeString("xmlns", AtomWriter.PrefixRestAtom, null, AtomPubConstants.NamespaceRestAtom);

 

                 // cmis:statement

                 writer.WriteStartElement(AtomWriter.PrefixCMIS, AtomPubConstants.TagStatement, AtomPubConstants.NamespaceCMIS);

diff --git a/DotCMIS/binding/atompub/atompub.cs b/DotCMIS/binding/atompub/atompub.cs
index 5d0c2b0..02e5132 100644
--- a/DotCMIS/binding/atompub/atompub.cs
+++ b/DotCMIS/binding/atompub/atompub.cs
@@ -25,8 +25,9 @@
 using DotCMIS.CMISWebServicesReference;

 using DotCMIS.Data;

 using DotCMIS.Data.Extensions;

-using DotCMIS.Exceptions;

+using DotCMIS.Data.Impl;

 using DotCMIS.Enums;

+using DotCMIS.Exceptions;

 

 namespace DotCMIS.Binding.AtomPub

 {

diff --git a/DotCMIS/binding/binding-caches.cs b/DotCMIS/binding/binding-caches.cs
index c115fc0..42ef619 100644
--- a/DotCMIS/binding/binding-caches.cs
+++ b/DotCMIS/binding/binding-caches.cs
@@ -29,7 +29,7 @@
 {

     // --- base cache implementation ---

 

-    internal interface ICache

+    internal interface IBindingCache

     {

         void Initialize(string[] cacheLevelConfig);

 

@@ -46,7 +46,7 @@
         void Unlock();

     }

 

-    internal interface ICacheLevel

+    internal interface IBindingCacheLevel

     {

         void Initialize(IDictionary<string, string> cacheLevelConfig);

 

@@ -55,11 +55,11 @@
         void Remove(string key);

     }

 

-    internal class Cache : ICache

+    internal class Cache : IBindingCache

     {

         private IList<Type> cacheLevels;

         private IList<IDictionary<string, string>> cacheLevelParameters;

-        private ICacheLevel root;

+        private IBindingCacheLevel root;

         private string name;

         private object cacheLock = new object();

  

@@ -125,7 +125,7 @@
             Lock();

             try

             {

-                ICacheLevel cacheLevel = root;

+                IBindingCacheLevel cacheLevel = root;

 

                 // follow the branch

                 for (int i = 0; i < keys.Length - 1; i++)

@@ -140,7 +140,7 @@
                     }

 

                     // next level

-                    cacheLevel = (ICacheLevel)level;

+                    cacheLevel = (IBindingCacheLevel)level;

                 }

 

                 cacheLevel[keys[keys.Length - 1]] = value;

@@ -167,7 +167,7 @@
             Lock();

             try

             {

-                ICacheLevel cacheLevel = root;

+                IBindingCacheLevel cacheLevel = root;

 

                 // follow the branch

                 for (int i = 0; i < keys.Length - 1; i++)

@@ -178,7 +178,7 @@
                     if (level == null) { return null; }

 

                     // next level

-                    cacheLevel = (ICacheLevel)level;

+                    cacheLevel = (IBindingCacheLevel)level;

                 }

 

                 // get the value

@@ -199,7 +199,7 @@
             Lock();

             try

             {

-                ICacheLevel cacheLevel = root;

+                IBindingCacheLevel cacheLevel = root;

 

                 // follow the branch

                 for (int i = 0; i < keys.Length - 1; i++)

@@ -210,7 +210,7 @@
                     if (level == null) { return; }

 

                     // next level

-                    cacheLevel = (ICacheLevel)level;

+                    cacheLevel = (IBindingCacheLevel)level;

                 }

 

                 cacheLevel.Remove(keys[keys.Length - 1]);

@@ -230,7 +230,7 @@
             Lock();

             try

             {

-                ICacheLevel cacheLevel = root;

+                IBindingCacheLevel cacheLevel = root;

 

                 // follow the branch

                 for (int i = 0; i < keys.Length - 1; i++)

@@ -241,7 +241,7 @@
                     if (level == null) { return i; }

 

                     // next level

-                    cacheLevel = (ICacheLevel)level;

+                    cacheLevel = (IBindingCacheLevel)level;

                 }

 

                 return keys.Length;

@@ -277,7 +277,7 @@
                 throw new ArgumentException("Class '" + typeName + "' not found!", e);

             }

 

-            if (!typeof(ICacheLevel).IsAssignableFrom(levelType))

+            if (!typeof(IBindingCacheLevel).IsAssignableFrom(levelType))

             {

                 throw new ArgumentException("Class '" + typeName + "' does not implement the ICacheLevel interface!");

             }

@@ -309,7 +309,7 @@
             }

         }

 

-        private ICacheLevel CreateCacheLevel(int level)

+        private IBindingCacheLevel CreateCacheLevel(int level)

         {

             if ((level < 0) || (level >= cacheLevels.Count))

             {

@@ -318,10 +318,10 @@
 

             // get the class and create an instance

             Type levelType = cacheLevels[level];

-            ICacheLevel cacheLevel = null;

+            IBindingCacheLevel cacheLevel = null;

             try

             {

-                cacheLevel = (ICacheLevel)Activator.CreateInstance(levelType);

+                cacheLevel = (IBindingCacheLevel)Activator.CreateInstance(levelType);

             }

             catch (Exception e)

             {

@@ -350,7 +350,7 @@
         }

     }

 

-    internal abstract class AbstractDictionaryCacheLevel : ICacheLevel

+    internal abstract class AbstractDictionaryCacheLevel : IBindingCacheLevel

     {

         protected static string NullKey = "";

 

@@ -567,7 +567,7 @@
     {

         private const int CacheSizeRepositories = 10;

 

-        private ICache cache;

+        private IBindingCache cache;

 

         public RepositoryInfoCache(BindingSession session)

         {

@@ -611,7 +611,7 @@
         private const int CacheSizeRepositories = 10;

         private const int CacheSizeTypes = 100;

 

-        private ICache cache;

+        private IBindingCache cache;

 

         public TypeDefinitionCache(BindingSession session)

         {

diff --git a/DotCMIS/binding/binding-impl.cs b/DotCMIS/binding/binding-impl.cs
index 8194088..907fa35 100644
--- a/DotCMIS/binding/binding-impl.cs
+++ b/DotCMIS/binding/binding-impl.cs
@@ -18,14 +18,11 @@
  */

 using System;

 using System.Collections.Generic;

-using System.Linq;

-using System.Text;

-using DotCMIS.Binding;

-using DotCMIS.Binding.Services;

 using System.Threading;

-using DotCMIS.Exceptions;

+using DotCMIS.Binding.Services;

 using DotCMIS.Data;

 using DotCMIS.Data.Extensions;

+using DotCMIS.Exceptions;

 

 namespace DotCMIS.Binding.Impl

 {

@@ -424,7 +421,7 @@
             if (!hasExtension && (result != null))

             {

                 RepositoryInfoCache cache = session.GetRepositoryInfoCache();

-                foreach (RepositoryInfo rid in result)

+                foreach (IRepositoryInfo rid in result)

                 {

                     cache.Put(rid);

                 }

diff --git a/DotCMIS/binding/converter.cs b/DotCMIS/binding/converter.cs
index e1b7dbe..a39ff6b 100644
--- a/DotCMIS/binding/converter.cs
+++ b/DotCMIS/binding/converter.cs
@@ -1,5 +1,4 @@
-using DotCMIS.CMISWebServicesReference;

-/*

+/*

  * 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

@@ -17,15 +16,17 @@
  * specific language governing permissions and limitations

  * under the License.

  */

+using System;

+using System.Collections.Generic;

+using System.IO;

+using System.Reflection;

+using System.Xml;

+using System.Xml.Serialization;

+using DotCMIS.CMISWebServicesReference;

 using DotCMIS.Data;

 using DotCMIS.Data.Extensions;

-using System.Collections.Generic;

-using System.Xml;

+using DotCMIS.Data.Impl;

 using DotCMIS.Enums;

-using System;

-using System.Reflection;

-using System.Xml.Serialization;

-using System.IO;

 

 namespace DotCMIS.Binding

 {

diff --git a/DotCMIS/binding/http.cs b/DotCMIS/binding/http.cs
index b787788..aabd311 100644
--- a/DotCMIS/binding/http.cs
+++ b/DotCMIS/binding/http.cs
@@ -20,13 +20,12 @@
 using System.Diagnostics;

 using System.IO;

 using System.Net;

-using DotCMIS.Binding.Impl;

+using System.Text;

+using System.Web;

 using DotCMIS.Enums;

 using DotCMIS.Exceptions;

-using System.Web;

-using System.Text;

 

-namespace DotCMIS.Binding

+namespace DotCMIS.Binding.Impl

 {

     internal static class HttpUtils

     {

diff --git a/DotCMIS/client/client-caches.cs b/DotCMIS/client/client-caches.cs
index 448881d..7c103ba 100644
--- a/DotCMIS/client/client-caches.cs
+++ b/DotCMIS/client/client-caches.cs
@@ -21,7 +21,7 @@
 using System.Linq;

 using System.Text;

 

-namespace DotCMIS.Client

+namespace DotCMIS.Client.Impl.Cache

 {

     /// <summary>

     /// Client cache interface.

@@ -42,7 +42,7 @@
     /// <summary>

     /// Cache implementation that doesn't cache.

     /// </summary>

-    internal class NoCache : ICache

+    public class NoCache : ICache

     {

         public void Initialize(ISession session, IDictionary<string, string> parameters) { }

         public bool ContainsId(string objectId, string cacheKey) { return false; }

diff --git a/DotCMIS/client/client-impl.cs b/DotCMIS/client/client-impl.cs
index 347b7fc..d4a980d 100644
--- a/DotCMIS/client/client-impl.cs
+++ b/DotCMIS/client/client-impl.cs
@@ -18,17 +18,16 @@
  */

 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;

-using DotCMIS.Data.Extensions;

+using DotCMIS.Binding;

 using DotCMIS.Binding.Services;

+using DotCMIS.Client.Impl.Cache;

+using DotCMIS.Data;

+using DotCMIS.Data.Impl;

+using DotCMIS.Enums;

+using DotCMIS.Exceptions;

 

-namespace DotCMIS.Client

+namespace DotCMIS.Client.Impl

 {

     /// <summary>

     /// Session factory implementation.

@@ -550,7 +549,36 @@
         }

 

         public IItemEnumerable<IQueryResult> Query(string statement, bool searchAllVersions, IOperationContext context)

-        { throw new CmisNotSupportedException("Client not implemented!"); }

+        {

+            IDiscoveryService service = Binding.GetDiscoveryService();

+            IOperationContext ctxt = new OperationContext(context);

+

+            PageFetcher<IQueryResult>.FetchPage fetchPageDelegate = delegate(long maxNumItems, long skipCount)

+            {

+                // fetch the data

+                IObjectList resultList = service.Query(RepositoryId, statement, searchAllVersions, ctxt.IncludeAllowableActions,

+                    ctxt.IncludeRelationships, ctxt.RenditionFilterString, maxNumItems, skipCount, null);

+

+                // convert query results

+                IList<IQueryResult> page = new List<IQueryResult>();

+                if (resultList.Objects != null)

+                {

+                    foreach (IObjectData objectData in resultList.Objects)

+                    {

+                        if (objectData == null)

+                        {

+                            continue;

+                        }

+

+                        page.Add(ObjectFactory.ConvertQueryResult(objectData));

+                    }

+                }

+

+                return new PageFetcher<IQueryResult>.Page<IQueryResult>(page, resultList.NumItems, resultList.HasMoreItems);

+            };

+

+            return new CollectionEnumerable<IQueryResult>(new PageFetcher<IQueryResult>(DefaultContext.MaxItemsPerPage, fetchPageDelegate));

+        }

 

         public IChangeEvents GetContentChanges(string changeLogToken, bool includeProperties, long maxNumItems)

         {

@@ -600,12 +628,12 @@
             IObjectType type = null;

             if (source is ICmisObject)

             {

-                type = ((ICmisObject)source).Type;

+                type = ((ICmisObject)source).ObjectType;

             }

             else

             {

                 ICmisObject sourceObj = GetObject(source);

-                type = sourceObj.Type;

+                type = sourceObj.ObjectType;

             }

 

             if (type.BaseTypeId != BaseTypeId.CmisDocument)

diff --git a/DotCMIS/client/client-intf.cs b/DotCMIS/client/client-intf.cs
index 61d2639..79f6ee9 100644
--- a/DotCMIS/client/client-intf.cs
+++ b/DotCMIS/client/client-intf.cs
@@ -37,6 +37,9 @@
         ISession CreateSession();

     }

 

+    /// <summary>

+    /// Session interface.

+    /// </summary>

     public interface ISession

     {

         void Clear();

@@ -252,7 +255,7 @@
         DateTime? LastModificationDate { get; }

         BaseTypeId BaseTypeId { get; }

         IObjectType BaseType { get; }

-        IObjectType Type { get; }

+        IObjectType ObjectType { get; }

         string ChangeToken { get; }

     }

 

@@ -408,13 +411,31 @@
 

     public interface IQueryResult

     {

+        IPropertyData this[string queryName] { get; }

+        IList<IPropertyData> Properties { get; }

+        IPropertyData GetPropertyById(string propertyId);

+        object GetPropertyValueByQueryName(string queryName);

+        object GetPropertyValueById(string propertyId);

+        IList<object> GetPropertyMultivalueByQueryName(string queryName);

+        IList<object> GetPropertyMultivalueById(string propertyId);

+        IAllowableActions AllowableActions { get; }

+        IList<IRelationship> Relationships { get; }

+        IList<IRendition> Renditions { get; }

     }

 

-    public interface IChangeEvent

+    public interface IChangeEvent : IChangeEventInfo

     {

+        string ObjectId { get; }

+        IDictionary<string, IList<object>> Properties { get; }

+        IList<string> PolicyIds { get; }

+        IAcl Acl { get; }

     }

 

     public interface IChangeEvents

     {

+        string LatestChangeLogToken { get; }

+        IList<IChangeEvent> ChangeEvents { get; }

+        bool HasMoreItems { get; }

+        long getTotalNumItems { get; }

     }

 }

diff --git a/DotCMIS/client/client-objectfactory.cs b/DotCMIS/client/client-objectfactory.cs
index 833130e..7bcb22e 100644
--- a/DotCMIS/client/client-objectfactory.cs
+++ b/DotCMIS/client/client-objectfactory.cs
@@ -17,16 +17,15 @@
  * under the License.

  */

 using System;

+using System.Collections;

 using System.Collections.Generic;

-using System.Linq;

-using System.Text;

-using DotCMIS.Data;

 using System.IO;

+using DotCMIS.Data;

+using DotCMIS.Data.Impl;

 using DotCMIS.Enums;

 using DotCMIS.Exceptions;

-using System.Collections;

 

-namespace DotCMIS.Client

+namespace DotCMIS.Client.Impl

 {

     public class ObjectFactory : IObjectFactory

     {

@@ -305,7 +304,7 @@
                 throw new ArgumentException("Properties must be set!");

             }

 

-            return new List<IPropertyData>(properties.PropertyList);

+            return properties.PropertyList;

         }

 

         // objects

@@ -333,7 +332,15 @@
             }

         }

 

-        public IQueryResult ConvertQueryResult(IObjectData objectData) { return null; }

+        public IQueryResult ConvertQueryResult(IObjectData objectData) {

+            if (objectData == null)

+            {

+                throw new ArgumentException("Object data is null!");

+            }

+

+            return new QueryResult(session, objectData);

+        }

+

         public IChangeEvent ConvertChangeEvent(IObjectData objectData) { return null; }

         public IChangeEvents ConvertChangeEvents(String changeLogToken, IObjectList objectList) { return null; }

     }

diff --git a/DotCMIS/client/client-objects.cs b/DotCMIS/client/client-objects.cs
index e5462f8..8ef2900 100644
--- a/DotCMIS/client/client-objects.cs
+++ b/DotCMIS/client/client-objects.cs
@@ -18,18 +18,17 @@
  */

 using System;

 using System.Collections.Generic;

-using System.Linq;

 using System.Text;

 using System.Threading;

 using DotCMIS.Binding;

-using DotCMIS.Client;

+using DotCMIS.Binding.Services;

 using DotCMIS.Data;

 using DotCMIS.Data.Extensions;

+using DotCMIS.Data.Impl;

 using DotCMIS.Enums;

 using DotCMIS.Exceptions;

-using DotCMIS.Binding.Services;

 

-namespace DotCMIS.Client

+namespace DotCMIS.Client.Impl

 {

     /// <summary>

     /// CMIS object base class.

@@ -41,7 +40,7 @@
         protected ICmisBinding Binding { get { return Session.Binding; } }

 

         private IObjectType objectType;

-        protected IObjectType ObjectType

+        public IObjectType ObjectType

         {

             get

             {

@@ -81,7 +80,6 @@
         private IList<IRelationship> relationships;

         private IDictionary<ExtensionLevel, IList<ICmisExtensionElement>> extensions;

 

-

         private object objectLock = new object();

 

         protected void Initialize(ISession session, IObjectType objectType, IObjectData objectData, IOperationContext context)

@@ -304,8 +302,6 @@
 

         public string ChangeToken { get { return GetPropertyValue(PropertyIds.ChangeToken) as string; } }

 

-        public IObjectType Type { get { return ObjectType; } }

-

         public IList<IProperty> Properties

         {

             get

@@ -1657,4 +1653,155 @@
             return session.Binding.GetObjectService().GetContentStream(session.RepositoryInfo.Id, objectId, StreamId, null, null, null);

         }

     }

+

+    public class QueryResult : IQueryResult

+    {

+        private IDictionary<string, IPropertyData> propertiesById;

+        private IDictionary<string, IPropertyData> propertiesByQueryName;

+

+        public QueryResult(ISession session, IObjectData objectData)

+        {

+            if (objectData != null)

+            {

+                IObjectFactory of = session.ObjectFactory;

+

+                // handle properties

+                if (objectData.Properties != null)

+                {

+                    Properties = new List<IPropertyData>();

+                    propertiesById = new Dictionary<string, IPropertyData>();

+                    propertiesByQueryName = new Dictionary<string, IPropertyData>();

+

+                    IList<IPropertyData> queryProperties = of.ConvertQueryProperties(objectData.Properties);

+

+                    foreach (IPropertyData property in queryProperties)

+                    {

+                        Properties.Add(property);

+                        if (property.Id != null)

+                        {

+                            propertiesById[property.Id] = property;

+                        }

+                        if (property.QueryName != null)

+                        {

+                            propertiesByQueryName[property.QueryName] = property;

+                        }

+                    }

+                }

+

+                // handle allowable actions

+                AllowableActions = objectData.AllowableActions;

+

+                // handle relationships

+                if (objectData.Relationships != null)

+                {

+                    Relationships = new List<IRelationship>();

+                    foreach (IObjectData rod in objectData.Relationships)

+                    {

+                        IRelationship relationship = of.ConvertObject(rod, session.DefaultContext) as IRelationship;

+                        if (relationship != null)

+                        {

+                            Relationships.Add(relationship);

+                        }

+                    }

+                }

+

+                // handle renditions

+                if (objectData.Renditions != null)

+                {

+                    Renditions = new List<IRendition>();

+                    foreach (IRenditionData rd in objectData.Renditions)

+                    {

+                        Renditions.Add(of.ConvertRendition(null, rd));

+                    }

+                }

+            }

+        }

+

+        public IPropertyData this[string queryName]

+        {

+            get

+            {

+                if (queryName == null)

+                {

+                    return null;

+                }

+

+                IPropertyData result;

+                if (propertiesByQueryName.TryGetValue(queryName, out result))

+                {

+                    return result;

+                }

+

+                return null;

+            }

+        }

+

+        public IList<IPropertyData> Properties { get; protected set; }

+

+        public IPropertyData GetPropertyById(string propertyId)

+        {

+            if (propertyId == null)

+            {

+                return null;

+            }

+

+            IPropertyData result;

+            if (propertiesById.TryGetValue(propertyId, out result))

+            {

+                return result;

+            }

+

+            return null;

+        }

+

+        public object GetPropertyValueByQueryName(string queryName)

+        {

+            IPropertyData property = this[queryName];

+            if (property == null)

+            {

+                return null;

+            }

+

+            return property.FirstValue;

+        }

+

+        public object GetPropertyValueById(string propertyId)

+        {

+            IPropertyData property = GetPropertyById(propertyId);

+            if (property == null)

+            {

+                return null;

+            }

+

+            return property.FirstValue;

+        }

+

+        public IList<object> GetPropertyMultivalueByQueryName(string queryName)

+        {

+            IPropertyData property = this[queryName];

+            if (property == null)

+            {

+                return null;

+            }

+

+            return property.Values;

+        }

+

+        public IList<object> GetPropertyMultivalueById(string propertyId)

+        {

+            IPropertyData property = GetPropertyById(propertyId);

+            if (property == null)

+            {

+                return null;

+            }

+

+            return property.Values;

+        }

+

+        public IAllowableActions AllowableActions { get; protected set; }

+

+        public IList<IRelationship> Relationships { get; protected set; }

+

+        public IList<IRendition> Renditions { get; protected set; }

+    }

 }
\ No newline at end of file
diff --git a/DotCMIS/client/client-types.cs b/DotCMIS/client/client-types.cs
index e6b333f..39cae18 100644
--- a/DotCMIS/client/client-types.cs
+++ b/DotCMIS/client/client-types.cs
@@ -22,8 +22,9 @@
 using System.Text;

 using DotCMIS.Enums;

 using DotCMIS.Data;

+using DotCMIS.Data.Impl;

 

-namespace DotCMIS.Client

+namespace DotCMIS.Client.Impl

 {

     /// <summary>

     /// Helper for all type implementations.

diff --git a/DotCMIS/client/client-utils.cs b/DotCMIS/client/client-utils.cs
index bff191e..ed14b20 100644
--- a/DotCMIS/client/client-utils.cs
+++ b/DotCMIS/client/client-utils.cs
@@ -23,7 +23,7 @@
 using DotCMIS.Enums;

 using System.Collections;

 

-namespace DotCMIS.Client

+namespace DotCMIS.Client.Impl

 {

     /// <summary>

     /// Operation context implementation.

diff --git a/DotCMIS/data/data-impl.cs b/DotCMIS/data/data-impl.cs
index 26945d3..69c5285 100644
--- a/DotCMIS/data/data-impl.cs
+++ b/DotCMIS/data/data-impl.cs
@@ -23,7 +23,7 @@
 using DotCMIS.Data.Extensions;

 using DotCMIS.Enums;

 

-namespace DotCMIS.Data

+namespace DotCMIS.Data.Impl

 {

     public class RepositoryInfo : ExtensionsData, IRepositoryInfo

     {

diff --git a/DotCMISUnitTest/EnumeratorTest.cs b/DotCMISUnitTest/EnumeratorTest.cs
index bd6a750..f30aacb 100644
--- a/DotCMISUnitTest/EnumeratorTest.cs
+++ b/DotCMISUnitTest/EnumeratorTest.cs
@@ -18,6 +18,7 @@
  */

 using System.Collections.Generic;

 using DotCMIS.Client;

+using DotCMIS.Client.Impl;

 using NUnit.Framework;

 

 namespace DotCMISUnitTest

diff --git a/DotCMISUnitTest/SmokeTest.cs b/DotCMISUnitTest/SmokeTest.cs
index fa7b19f..49822f4 100644
--- a/DotCMISUnitTest/SmokeTest.cs
+++ b/DotCMISUnitTest/SmokeTest.cs
@@ -16,14 +16,13 @@
  * specific language governing permissions and limitations

  * under the License.

  */

-using System;

 using System.Collections.Generic;

-using System.Linq;

-using System.Text;

-using NUnit.Framework;

-using DotCMIS.Client;

-using DotCMIS.Enums;

 using DotCMIS;

+using DotCMIS.Client;

+using DotCMIS.Client.Impl;

+using DotCMIS.Enums;

+using NUnit.Framework;

+using System;

 

 namespace DotCMISUnitTest

 {

@@ -128,7 +127,7 @@
         }

 

         [Test]

-        public void SmokeRootFolder()

+        public void SmokeTestRootFolder()

         {

             ICmisObject rootFolderObject = Session.GetRootFolder();

 

@@ -144,6 +143,30 @@
             Assert.NotNull(rootFolder.AllowableActions);

             Assert.True(rootFolder.AllowableActions.Actions.Contains(Actions.CanGetProperties));

             Assert.False(rootFolder.AllowableActions.Actions.Contains(Actions.CanGetFolderParent));

+

+            IItemEnumerable<ICmisObject> children = rootFolder.GetChildren();

+            Assert.NotNull(children);

+            foreach (ICmisObject child in children)

+            {

+                Assert.NotNull(child);

+                Assert.NotNull(child.Id);

+                Assert.NotNull(child.Name);

+                Console.WriteLine(child.Name + " (" + child.Id + ")");

+            }

+        }

+

+        [Test]

+        public void SmokeTestQuery()

+        {

+            IItemEnumerable<IQueryResult> qr = Session.Query("SELECT * FROM cmis:document", false);

+            Assert.NotNull(qr);

+

+            foreach (IQueryResult hit in qr)

+            {

+                Assert.NotNull(hit);

+                Assert.NotNull(hit["cmis:objectId"]);

+                Console.WriteLine(hit.GetPropertyValueById(PropertyIds.Name) + " (" + hit.GetPropertyValueById(PropertyIds.ObjectId) + ")");

+            }

         }

     }

 }

diff --git a/DotCMISUnitTest/TestFramework.cs b/DotCMISUnitTest/TestFramework.cs
index bf1289e..2095095 100644
--- a/DotCMISUnitTest/TestFramework.cs
+++ b/DotCMISUnitTest/TestFramework.cs
@@ -22,11 +22,13 @@
 using System.Text;

 using DotCMIS;

 using DotCMIS.Binding;

+using DotCMIS.Client;

+using DotCMIS.Client.Impl;

 using DotCMIS.Data;

+using DotCMIS.Data.Impl;

 using DotCMIS.Enums;

 using DotCMIS.Exceptions;

 using NUnit.Framework;

-using DotCMIS.Client;

 

 namespace DotCMISUnitTest

 {