Author: fmui
Date: Tue Apr 26 13:31:44 2016
New Revision: 1741020
URL: http://svn.apache.org/viewvc?rev=1741020&view=rev
Log:
PortCMIS: added more documentation
Modified:
chemistry/portcmis/trunk/PortCMIS/binding/BindingIntf.cs
chemistry/portcmis/trunk/PortCMIS/binding/Http.cs
chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs
chemistry/portcmis/trunk/PortCMIS/binding/browser/BrowserBinding.cs
chemistry/portcmis/trunk/PortCMIS/binding/browser/json/Json.cs
chemistry/portcmis/trunk/PortCMIS/client/ClientCaches.cs
chemistry/portcmis/trunk/PortCMIS/client/ClientImpl.cs
chemistry/portcmis/trunk/PortCMIS/client/ClientIntf.cs
chemistry/portcmis/trunk/PortCMIS/client/ClientUtils.cs
chemistry/portcmis/trunk/PortCMIS/client/SessionParameter.cs
chemistry/portcmis/trunk/PortCMIS/const/ExtensionFeatures.cs
chemistry/portcmis/trunk/PortCMIS/data/DataImpl.cs
chemistry/portcmis/trunk/PortCMIS/data/DataIntf.cs
chemistry/portcmis/trunk/PortCMIS/enum/Enums.cs
chemistry/portcmis/trunk/PortCMIS/exceptions/Exceptions.cs
chemistry/portcmis/trunk/PortCMISWin/binding/WindowsHttp.cs
Modified: chemistry/portcmis/trunk/PortCMIS/binding/BindingIntf.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/binding/BindingIntf.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/binding/BindingIntf.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/binding/BindingIntf.cs Tue Apr 26
13:31:44 2016
@@ -32,34 +32,150 @@ using System.Threading.Tasks;
namespace PortCMIS.Binding
{
+ /// <summary>
+ /// Low-level CMIS binding interface.
+ /// </summary>
public interface ICmisBinding : IDisposable
{
+ /// <value>
+ /// Binding type.
+ /// </value>
string BindingType { get; }
+
+ /// <summary>
+ /// Returns the repository service instance.
+ /// </summary>
+ /// <returns>the repository service instance</returns>
IRepositoryService GetRepositoryService();
+
+ /// <summary>
+ /// Returns the navigation service instance.
+ /// </summary>
+ /// <returns>the navigation service instance</returns>
INavigationService GetNavigationService();
+
+ /// <summary>
+ /// Returns the object service instance.
+ /// </summary>
+ /// <returns>the object service instance</returns>
IObjectService GetObjectService();
+
+ /// <summary>
+ /// Returns the versioning service instance.
+ /// </summary>
+ /// <returns>the versioning service instance</returns>
IVersioningService GetVersioningService();
+
+ /// <summary>
+ /// Returns the relationship service instance.
+ /// </summary>
+ /// <returns>the relationship service instance</returns>
IRelationshipService GetRelationshipService();
+
+ /// <summary>
+ /// Returns the discovery service instance.
+ /// </summary>
+ /// <returns>the discovery service instance</returns>
IDiscoveryService GetDiscoveryService();
+
+ /// <summary>
+ /// Returns the multi-filing service instance.
+ /// </summary>
+ /// <returns>the multi-filing service instance</returns>
IMultiFilingService GetMultiFilingService();
+
+ /// <summary>
+ /// Returns the ACL service instance.
+ /// </summary>
+ /// <returns>the ACL service instance</returns>
IAclService GetAclService();
+
+ /// <summary>
+ /// Returns the policy service instance.
+ /// </summary>
+ /// <returns>the policy service instance</returns>
IPolicyService GetPolicyService();
+
+ /// <summary>
+ /// Returns the authentication provider instance.
+ /// </summary>
+ /// <returns>the authentication provider instance</returns>
IAuthenticationProvider GetAuthenticationProvider();
+
+ /// <summary>
+ /// Clears all low-level caches.
+ /// </summary>
void ClearAllCaches();
+
+ /// <summary>
+ /// Clears all low-level caches for the given repository.
+ /// </summary>
+ /// <param name="repositoryId">the repository ID</param>
void ClearRepositoryCache(string repositoryId);
}
+ /// <summary>
+ /// Binding Session interface.
+ /// </summary>
public interface IBindingSession
{
+ /// <summary>
+ /// Gets a value from the session.
+ /// </summary>
+ /// <param name="key">the key</param>
+ /// <returns>the value or <c>null</c> if the key is unknown</returns>
object GetValue(string key);
+
+ /// <summary>
+ /// Gets a value from the session.
+ /// </summary>
+ /// <param name="key">the key</param>
+ /// <param name="defValue">the default value</param>
+ /// <returns>the value or the default value if the key is
unknown</returns>
object GetValue(string key, object defValue);
+
+ /// <summary>
+ /// Gets a value as an integer from the session.
+ /// </summary>
+ /// <param name="key">the key</param>
+ /// <param name="defValue">the default value</param>
+ /// <returns>the value or the default value if the key is unknown or
the value cannot be returned as an integer</returns>
int GetValue(string key, int defValue);
+
+ /// <summary>
+ /// Gets a value as a boolean from the session.
+ /// </summary>
+ /// <param name="key">the key</param>
+ /// <param name="defValue">the default value</param>
+ /// <returns>the value or the default value if the key is unknown or
the value cannot be returned as a boolean</returns>
bool GetValue(string key, bool defValue);
+ /// <summary>
+ /// Adds a key-value pair to the session.
+ /// </summary>
+ /// <param name="key">the key</param>
+ /// <param name="value">the value</param>
void PutValue(string key, object value);
+
+ /// <summary>
+ /// Removes a key-value pair.
+ /// </summary>
+ /// <param name="key">the key</param>
void RemoveValue(string key);
+ /// <summary>
+ /// Gets the authentication provider from the session.
+ /// </summary>
+ /// <returns>the authentication provider or <c>null</c> if no
authentication provider has been set</returns>
IAuthenticationProvider GetAuthenticationProvider();
+
+ /// <summary>
+ /// Gets the HTTP invoker from the session.
+ /// </summary>
+ /// <remarks>
+ /// If no HTTP invoker has been set, a HTTP invoker is created, added
to the session and returned.
+ /// </remarks>
+ /// <returns>the HTTP invoker</returns>
IHttpInvoker GetHttpInvoker();
}
@@ -68,44 +184,126 @@ namespace PortCMIS.Binding
/// </summary>
public interface ICmisSpi : IDisposable
{
+ /// <summary>
+ /// Initializes the SPI with a binding session.
+ /// </summary>
+ /// <param name="session">the binding session</param>
void Initialize(IBindingSession session);
+
+ /// <summary>
+ /// Returns the repository service instance.
+ /// </summary>
IRepositoryService GetRepositoryService();
+
+ /// <summary>
+ /// Returns the navigation service instance.
+ /// </summary>
INavigationService GetNavigationService();
+
+ /// <summary>
+ /// Returns the object service instance.
+ /// </summary>
IObjectService GetObjectService();
+
+ /// <summary>
+ /// Returns the versioning service instance.
+ /// </summary>
IVersioningService GetVersioningService();
+
+ /// <summary>
+ /// Returns the relationship service instance.
+ /// </summary>
IRelationshipService GetRelationshipService();
+
+ /// <summary>
+ /// Returns the discovery service instance.
+ /// </summary>
IDiscoveryService GetDiscoveryService();
+
+ /// <summary>
+ /// Returns the multi-filing service instance.
+ /// </summary>
IMultiFilingService GetMultiFilingService();
+
+ /// <summary>
+ /// Returns the ACL service instance.
+ /// </summary>
IAclService GetAclService();
+
+ /// <summary>
+ /// Returns the repository service instance.
+ /// </summary>
IPolicyService GetPolicyService();
+
+ /// <summary>
+ /// Clears all caches.
+ /// </summary>
void ClearAllCaches();
+
+ /// <summary>
+ /// Clears all caches of a repository.
+ /// </summary>
+ /// <param name="repositoryId">the repository ID</param>
void ClearRepositoryCache(string repositoryId);
}
/// <summary>
- /// Basic authentication provider
+ /// Authentication provider interface.
/// </summary>
public interface IAuthenticationProvider
{
+ /// <value>Binding session instance</value>
IBindingSession Session { get; set; }
}
+ /// <summary>
+ /// Authentication provider interface for the portable HTTP client.
+ /// </summary>
public interface IPortableAuthenticationProvider : IAuthenticationProvider
{
+ /// <summary>
+ /// Prepares the HTTP client handler before it is used.
+ /// </summary>
+ /// <param name="httpClientHandler">the HTTP client handler</param>
void PrepareHttpClientHandler(HttpClientHandler httpClientHandler);
+
+ /// <summary>
+ /// Prepares the HTTP request message before it is used.
+ /// </summary>
+ /// <param name="httpRequestMessage">the HTTP request message</param>
void PrepareHttpRequestMessage(HttpRequestMessage httpRequestMessage);
+
+ /// <summary>
+ /// Handles the HTTP response if necessary.
+ /// </summary>
+ /// <param name="httpResponseMessage">the HTTP response message</param>
void HandleResponse(HttpResponseMessage httpResponseMessage);
}
+ /// <summary>
+ /// Base implementation of an authentication provider.
+ /// </summary>
public abstract class AbstractAuthenticationProvider :
IPortableAuthenticationProvider
{
+ /// <value>Binding session instance</value>
public IBindingSession Session { get; set; }
+
+ /// <value>HTTP cookie container</value>
public CookieContainer CookieContainer { get; private set; }
+
+ /// <value>User</value>
public string User { get { return
Session.GetValue(SessionParameter.User) as string; } }
+
+ /// <value>Password</value>
public string Password { get { return
Session.GetValue(SessionParameter.Password) as string; } }
+
+ /// <value>Proxy user</value>
public string ProxyUser { get { return
Session.GetValue(SessionParameter.ProxyUser) as string; } }
+
+ /// <value>Proxy password</value>
public string ProxyPassword { get { return
Session.GetValue(SessionParameter.ProxyPassword) as string; } }
+ /// <inheritdoc/>
public virtual void PrepareHttpClientHandler(HttpClientHandler
httpClientHandler)
{
httpClientHandler.PreAuthenticate = true;
@@ -115,32 +313,48 @@ namespace PortCMIS.Binding
httpClientHandler.CookieContainer = CookieContainer;
}
+ /// <inheritdoc/>
public virtual void PrepareHttpRequestMessage(HttpRequestMessage
httpRequestMessage)
{
}
+ /// <inheritdoc/>
public virtual void HandleResponse(HttpResponseMessage
httpResponseMessage)
{
}
}
+ /// <summary>
+ /// Standard Authentication Provider.
+ /// </summary>
public class StandardAuthenticationProvider :
AbstractAuthenticationProvider
{
+ /// <value>OAuth bearer token</value>
public string BearerToken { get { return
Session.GetValue(SessionParameter.OAuthBearerToken) as string; } }
+
+ /// <value>CSRF header</value>
public string CsrfHeader { get { return
Session.GetValue(SessionParameter.CsrfHeader) as string; } }
+ /// <value>Authentication header</value>
protected AuthenticationHeaderValue AuthenticationHeader { get; set; }
+
+ /// <value>proxy authentication header</value>
protected AuthenticationHeaderValue ProxyAuthenticationHeader { get;
set; }
private object tokenLock = new object();
private string token = "fetch";
+
+ /// <value>CSRF header name</value>
protected string CsrfHeaderName { get; set; }
+
+ /// <value>CSRF header token</value>
protected string CsrfToken
{
get { lock (tokenLock) { return token; } }
set { lock (tokenLock) { token = value; } }
}
+ /// <inheritdoc/>
public override void PrepareHttpClientHandler(HttpClientHandler
httpClientHandler)
{
base.PrepareHttpClientHandler(httpClientHandler);
@@ -175,6 +389,7 @@ namespace PortCMIS.Binding
}
}
+ /// <inheritdoc/>
public override void PrepareHttpRequestMessage(HttpRequestMessage
httpRequestMessage)
{
base.PrepareHttpRequestMessage(httpRequestMessage);
@@ -195,6 +410,7 @@ namespace PortCMIS.Binding
}
}
+ /// <inheritdoc/>
public override void HandleResponse(HttpResponseMessage
httpResponseMessage)
{
base.HandleResponse(httpResponseMessage);
Modified: chemistry/portcmis/trunk/PortCMIS/binding/Http.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/binding/Http.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/binding/Http.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/binding/Http.cs Tue Apr 26 13:31:44 2016
@@ -31,24 +31,84 @@ using System.Threading.Tasks;
namespace PortCMIS.Binding.Http
{
+ /// <summary>
+ /// Implementations of this interface are responsible to handle HTTP
requests.
+ /// </summary>
public interface IHttpInvoker
{
+ /// <summary>
+ /// Invokes HTTP GET.
+ /// </summary>
+ /// <param name="url">the URL</param>
+ /// <param name="session">the binding session</param>
+ /// <returns>the HTTP response</returns>
IResponse InvokeGET(UrlBuilder url, IBindingSession session);
+
+ /// <summary>
+ /// Invokes HTTP GET to get document content.
+ /// </summary>
+ /// <param name="url">the URL</param>
+ /// <param name="session">the binding session</param>
+ /// <param name="offset">content offset (<c>null</c> = start from the
beginning)</param>
+ /// <param name="length">max content length (<c>null</c> = read to the
end)</param>
+ /// <returns>the HTTP response</returns>
IResponse InvokeGET(UrlBuilder url, IBindingSession session, long?
offset, long? length);
+
+ /// <summary>
+ /// Invokes HTTP POST.
+ /// </summary>
+ /// <param name="url">the URL</param>
+ /// <param name="content">the content to send</param>
+ /// <param name="session">the binding session</param>
+ /// <returns>the HTTP response</returns>
IResponse InvokePOST(UrlBuilder url, HttpContent content,
IBindingSession session);
+
+ /// <summary>
+ /// Invokes HTTP PUT.
+ /// </summary>
+ /// <param name="url">the URL</param>
+ /// <param name="headers">additional headers, may be
<c>null</c></param>
+ /// <param name="content">the content to send</param>
+ /// <param name="session">the binding session</param>
+ /// <returns>the HTTP response</returns>
IResponse InvokePUT(UrlBuilder url, IDictionary<string, string>
headers, HttpContent content, IBindingSession session);
+
+ /// <summary>
+ /// Invokes HTTP DELETE.
+ /// </summary>
+ /// <param name="url">the URL</param>
+ /// <param name="session">the binding session</param>
+ /// <returns>the HTTP response</returns>
IResponse InvokeDELETE(UrlBuilder url, IBindingSession session);
}
+ /// <summary>
+ /// Response of a HTTP request.
+ /// </summary>
public interface IResponse
{
+ /// <value>HTTP status code</value>
int StatusCode { get; }
+
+ /// <value>HTTP status message</value>
string Message { get; }
+
+ /// <value>response stream</value>
Stream Stream { get; }
+
+ /// <value>the content in case of an error</value>
string ErrorContent { get; }
+
+ /// <value>the content type</value>
string ContentType { get; }
+
+ /// <value>the content charset</value>
string Charset { get; }
+
+ /// <value>the content length, if known</value>
long? ContentLength { get; }
+
+ /// <value>the content filename, if known</value>
string Filename { get; }
}
}
Modified: chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/binding/HttpPortable.cs Tue Apr 26
13:31:44 2016
@@ -36,26 +36,31 @@ namespace PortCMIS.Binding.Http
private const string InvokerHttpClient =
"org.apache.chemistry.portcmis.invoker.httpclient";
private object invokerLock = new object();
+ /// <inheritdoc/>
public IResponse InvokeGET(UrlBuilder url, IBindingSession session)
{
return Invoke(url, HttpMethod.Get, null, session, null, null,
null);
}
+ /// <inheritdoc/>
public IResponse InvokeGET(UrlBuilder url, IBindingSession session,
long? offset, long? length)
{
return Invoke(url, HttpMethod.Get, null, session, offset, length,
null);
}
+ /// <inheritdoc/>
public IResponse InvokePOST(UrlBuilder url, HttpContent content,
IBindingSession session)
{
return Invoke(url, HttpMethod.Post, content, session, null, null,
null);
}
+ /// <inheritdoc/>
public IResponse InvokePUT(UrlBuilder url, IDictionary<string, string>
headers, HttpContent content, IBindingSession session)
{
return Invoke(url, HttpMethod.Put, content, session, null, null,
headers);
}
+ /// <inheritdoc/>
public IResponse InvokeDELETE(UrlBuilder url, IBindingSession session)
{
return Invoke(url, HttpMethod.Delete, null, session, null, null,
null);
Modified: chemistry/portcmis/trunk/PortCMIS/binding/browser/BrowserBinding.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/binding/browser/BrowserBinding.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/binding/browser/BrowserBinding.cs
(original)
+++ chemistry/portcmis/trunk/PortCMIS/binding/browser/BrowserBinding.cs Tue Apr
26 13:31:44 2016
@@ -68,6 +68,7 @@ namespace PortCMIS.Binding.Browser
private PolicyService policyService;
private AclService aclService;
+ /// <inheritdoc/>
public void Initialize(IBindingSession session)
{
this.session = session as BindingSession;
@@ -87,56 +88,67 @@ namespace PortCMIS.Binding.Browser
aclService = new AclService(this.session);
}
+ /// <inheritdoc/>
public IRepositoryService GetRepositoryService()
{
return repositoryService;
}
+ /// <inheritdoc/>
public INavigationService GetNavigationService()
{
return navigationService;
}
+ /// <inheritdoc/>
public IObjectService GetObjectService()
{
return objectService;
}
+ /// <inheritdoc/>
public IVersioningService GetVersioningService()
{
return versioningService;
}
+ /// <inheritdoc/>
public IRelationshipService GetRelationshipService()
{
return relationshipService;
}
+ /// <inheritdoc/>
public IDiscoveryService GetDiscoveryService()
{
return discoveryService;
}
+ /// <inheritdoc/>
public IMultiFilingService GetMultiFilingService()
{
return multiFilingService;
}
+ /// <inheritdoc/>
public IAclService GetAclService()
{
return aclService;
}
+ /// <inheritdoc/>
public IPolicyService GetPolicyService()
{
return policyService;
}
+ /// <inheritdoc/>
public void ClearAllCaches()
{
session.RemoveValue(RepositoryUrlCache);
}
+ /// <inheritdoc/>
public void ClearRepositoryCache(string repositoryId)
{
RepositoryUrlCache repUrlCache =
session.GetValue(RepositoryUrlCache) as RepositoryUrlCache;
@@ -146,6 +158,7 @@ namespace PortCMIS.Binding.Browser
}
}
+ /// <inheritdoc/>
public void Dispose()
{
// nothing to do
Modified: chemistry/portcmis/trunk/PortCMIS/binding/browser/json/Json.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/binding/browser/json/Json.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/binding/browser/json/Json.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/binding/browser/json/Json.cs Tue Apr 26
13:31:44 2016
@@ -17,6 +17,11 @@
* under the License.
*/
+/*
+ * This JSON parser implementation is based on
+ * JSON.simple <http://code.google.com/p/json-simple/>.
+ */
+
using System;
using System.Collections;
using System.Collections.Generic;
@@ -27,10 +32,7 @@ using System.Numerics;
using System.Text;
using System.Threading.Tasks;
-/// <summary>
-/// This JSON parser implementation is based on
-/// JSON.simple <http://code.google.com/p/json-simple/>.
-/// </summary>
+
namespace PortCMIS.Binding.Browser.Json
{
/// <summary>
Modified: chemistry/portcmis/trunk/PortCMIS/client/ClientCaches.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/client/ClientCaches.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/client/ClientCaches.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/client/ClientCaches.cs Tue Apr 26
13:31:44 2016
@@ -24,36 +24,114 @@ using System.Collections.Generic;
namespace PortCMIS.Client
{
/// <summary>
- /// Client cache interface.
+ /// Client object cache interface.
/// </summary>
public interface ICache
{
+ /// <summary>
+ /// Initializes the cache.
+ /// </summary>
+ /// <param name="session">the session</param>
+ /// <param name="parameters">cache parameters</param>
void Initialize(ISession session, IDictionary<string, string>
parameters);
+
+ /// <summary>
+ /// Returns whether the cache contains an object with given object ID
and cache key.
+ /// </summary>
+ /// <param name="objectId">the object ID</param>
+ /// <param name="cacheKey">the cache key</param>
+ /// <returns><c>true</c> if the object is in the cache, <c>false</c>
otherwise</returns>
bool ContainsId(string objectId, string cacheKey);
+
+ /// <summary>
+ /// Returns whether the cache contains an object with given path and
cache key.
+ /// </summary>
+ /// <param name="path">the path</param>
+ /// <param name="cacheKey">the cache key</param>
+ /// <returns><c>true</c> if the object is in the cache, <c>false</c>
otherwise</returns>
bool ContainsPath(string path, string cacheKey);
+
+ /// <summary>
+ /// Puts an object into the cache.
+ /// </summary>
+ /// <param name="cmisObject">the object</param>
+ /// <param name="cacheKey">the cache key</param>
void Put(ICmisObject cmisObject, string cacheKey);
+
+ /// <summary>
+ /// Puts an object with a path into the cache.
+ /// </summary>
+ /// <param name="path">the path</param>
+ /// <param name="cmisObject">the object</param>
+ /// <param name="cacheKey">the cache key</param>
void PutPath(string path, ICmisObject cmisObject, string cacheKey);
+
+ /// <summary>
+ /// Gets an object by ID.
+ /// </summary>
+ /// <param name="objectId">the object ID</param>
+ /// <param name="cacheKey">the cache key</param>
+ /// <returns>the object or <c>null</c> if the object is not in the
cache</returns>
ICmisObject GetById(string objectId, string cacheKey);
+
+ /// <summary>
+ /// Gets an object by path.
+ /// </summary>
+ /// <param name="path">the path</param>
+ /// <param name="cacheKey">the cache key</param>
+ /// <returns>the object or <c>null</c> if the object is not in the
cache</returns>
ICmisObject GetByPath(string path, string cacheKey);
+
+ /// <summary>
+ /// Removes an object from the cache.
+ /// </summary>
+ /// <param name="objectId">the object ID</param>
void Remove(string objectId);
+
+ /// <summary>
+ /// Clears the cache.
+ /// </summary>
void Clear();
+
+ /// <value>
+ /// The number of objects in the cache.
+ /// </value>
int CacheSize { get; }
}
/// <summary>
- /// Cache implementation that doesn't cache.
+ /// Cache implementation that doesn't cache anything.
/// </summary>
public class NoCache : ICache
{
+ /// <inheritdoc/>
public void Initialize(ISession session, IDictionary<string, string>
parameters) { }
+
+ /// <inheritdoc/>
public bool ContainsId(string objectId, string cacheKey) { return
false; }
+
+ /// <inheritdoc/>
public bool ContainsPath(string path, string cacheKey) { return false;
}
+
+ /// <inheritdoc/>
public void Put(ICmisObject cmisObject, string cacheKey) { }
+
+ /// <inheritdoc/>
public void PutPath(string path, ICmisObject cmisObject, string
cacheKey) { }
+
+ /// <inheritdoc/>
public ICmisObject GetById(string objectId, string cacheKey) { return
null; }
+
+ /// <inheritdoc/>
public ICmisObject GetByPath(string path, string cacheKey) { return
null; }
+
+ /// <inheritdoc/>
public void Remove(string objectId) { }
+
+ /// <inheritdoc/>
public void Clear() { }
+
+ /// <inheritdoc/>
public int CacheSize { get { return 0; } }
}
@@ -71,6 +149,7 @@ namespace PortCMIS.Client
public CmisObjectCache() { }
+ /// <inheritdoc/>
public void Initialize(ISession session, IDictionary<string, string>
parameters)
{
lock (cacheLock)
@@ -152,11 +231,13 @@ namespace PortCMIS.Client
}
}
+ /// <inheritdoc/>
public void Clear()
{
InitializeInternals();
}
+ /// <inheritdoc/>
public bool ContainsId(string objectId, string cacheKey)
{
lock (cacheLock)
@@ -165,6 +246,7 @@ namespace PortCMIS.Client
}
}
+ /// <inheritdoc/>
public bool ContainsPath(string path, string cacheKey)
{
lock (cacheLock)
@@ -173,6 +255,7 @@ namespace PortCMIS.Client
}
}
+ /// <inheritdoc/>
public ICmisObject GetById(string objectId, string cacheKey)
{
lock (cacheLock)
@@ -193,6 +276,7 @@ namespace PortCMIS.Client
}
}
+ /// <inheritdoc/>
public ICmisObject GetByPath(string path, string cacheKey)
{
lock (cacheLock)
@@ -207,6 +291,7 @@ namespace PortCMIS.Client
}
}
+ /// <inheritdoc/>
public void Put(ICmisObject cmisObject, string cacheKey)
{
// no object, no id, no cache key - no cache
@@ -235,6 +320,7 @@ namespace PortCMIS.Client
}
}
+ /// <inheritdoc/>
public void PutPath(string path, ICmisObject cmisObject, string
cacheKey)
{
// no path, no object, no id, no cache key - no cache
@@ -250,6 +336,7 @@ namespace PortCMIS.Client
}
}
+ /// <inheritdoc/>
public void Remove(string objectId)
{
if (objectId == null)
@@ -263,6 +350,7 @@ namespace PortCMIS.Client
}
}
+ /// <inheritdoc/>
public int CacheSize
{
get { return cacheSize; }
Modified: chemistry/portcmis/trunk/PortCMIS/client/ClientImpl.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/client/ClientImpl.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/client/ClientImpl.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/client/ClientImpl.cs Tue Apr 26 13:31:44
2016
@@ -51,11 +51,13 @@ namespace PortCMIS.Client.Impl
return new SessionFactory();
}
+ /// <inheritdoc/>
public ISession CreateSession(IDictionary<string, string> parameters)
{
return CreateSession(parameters, null, null, null);
}
+ /// <inheritdoc/>
public ISession CreateSession(IDictionary<string, string> parameters,
IObjectFactory objectFactory, IAuthenticationProvider authenticationProvider,
ICache cache)
{
Session session = new Session(parameters, objectFactory,
authenticationProvider, cache);
@@ -64,11 +66,21 @@ namespace PortCMIS.Client.Impl
return session;
}
+ /// <inheritdoc/>
public IList<IRepository> GetRepositories(IDictionary<string, string>
parameters)
{
return GetRepositories(parameters, null, null, null);
}
+ /// <summary>
+ /// Gets all repository available at the specified endpoint.
+ /// </summary>
+ /// <param name="parameters">the session parameters</param>
+ /// <param name="objectFactory">Object factory.</param>
+ /// <param name="authenticationProvider">Authentication
provider.</param>
+ /// <param name="cache">Client object cache.</param>
+ /// <returns>a list of all available repositories</returns>
+ /// <seealso cref="PortCMIS.SessionParameter"/>
public IList<IRepository> GetRepositories(IDictionary<string, string>
parameters, IObjectFactory objectFactory, IAuthenticationProvider
authenticationProvider, ICache cache)
{
ICmisBinding binding = CmisBindingHelper.CreateBinding(parameters);
@@ -350,11 +362,13 @@ namespace PortCMIS.Client.Impl
// session context
+ /// <inheritdoc/>
public IOperationContext CreateOperationContext()
{
return new OperationContext();
}
+ /// <inheritdoc/>
public IOperationContext CreateOperationContext(HashSet<string>
filter, bool includeAcls, bool includeAllowableActions, bool includePolicies,
IncludeRelationships includeRelationships, HashSet<string>
renditionFilter, bool includePathSegments, string orderBy,
bool cacheEnabled, int maxItemsPerPage)
@@ -363,6 +377,7 @@ namespace PortCMIS.Client.Impl
includePathSegments, orderBy, cacheEnabled, maxItemsPerPage);
}
+ /// <inheritdoc/>
public IObjectId CreateObjectId(string id)
{
return new ObjectId(id);
@@ -759,6 +774,7 @@ namespace PortCMIS.Client.Impl
return result as IDocument;
}
+ /// <inheritdoc/>
public void RemoveObjectFromCache(IObjectId objectId)
{
if (objectId == null || objectId.Id == null)
@@ -769,6 +785,7 @@ namespace PortCMIS.Client.Impl
RemoveObjectFromCache(objectId.Id);
}
+ /// <inheritdoc/>
public void RemoveObjectFromCache(string objectId)
{
Cache.Remove(objectId);
@@ -888,21 +905,25 @@ namespace PortCMIS.Client.Impl
return new CollectionEnumerable<ICmisObject>(new
PageFetcher<ICmisObject>(DefaultContext.MaxItemsPerPage, fetchPageDelegate));
}
+ /// <inheritdoc/>
public IQueryStatement CreateQueryStatement(string statement)
{
return new QueryStatement(this, statement);
}
+ /// <inheritdoc/>
public string GetLatestChangeLogToken()
{
return
Binding.GetRepositoryService().GetRepositoryInfo(RepositoryId,
null).LatestChangeLogToken;
}
+ /// <inheritdoc/>
public IChangeEvents GetContentChanges(string changeLogToken, bool
includeProperties, long maxNumItems)
{
return GetContentChanges(changeLogToken, includeProperties,
maxNumItems, DefaultContext);
}
+ /// <inheritdoc/>
public IChangeEvents GetContentChanges(string changeLogToken, bool
includeProperties, long maxNumItems,
IOperationContext context)
{
@@ -933,12 +954,14 @@ namespace PortCMIS.Client.Impl
return newId == null ? null : CreateObjectId(newId);
}
+ /// <inheritdoc/>
public IObjectId CreateDocument(IDictionary<string, object>
properties, IObjectId folderId, IContentStream contentStream,
VersioningState? versioningState)
{
return CreateDocument(properties, folderId, contentStream,
versioningState, null, null, null);
}
+ /// <inheritdoc/>
public IObjectId CreateDocumentFromSource(IObjectId source,
IDictionary<string, object> properties, IObjectId folderId,
VersioningState? versioningState, IList<IPolicy> policies,
IList<IAce> addAces, IList<IAce> removeAces)
{
@@ -977,12 +1000,14 @@ namespace PortCMIS.Client.Impl
return newId == null ? null : CreateObjectId(newId);
}
+ /// <inheritdoc/>
public IObjectId CreateDocumentFromSource(IObjectId source,
IDictionary<string, object> properties, IObjectId folderId,
VersioningState? versioningState)
{
return CreateDocumentFromSource(source, properties, folderId,
versioningState, null, null, null);
}
+ /// <inheritdoc/>
public IObjectId CreateFolder(IDictionary<string, object> properties,
IObjectId folderId, IList<IPolicy> policies,
IList<IAce> addAces, IList<IAce> removeAces)
{
@@ -1002,11 +1027,13 @@ namespace PortCMIS.Client.Impl
return newId == null ? null : CreateObjectId(newId);
}
+ /// <inheritdoc/>
public IObjectId CreateFolder(IDictionary<string, object> properties,
IObjectId folderId)
{
return CreateFolder(properties, folderId, null, null, null);
}
+ /// <inheritdoc/>
public IObjectId CreatePolicy(IDictionary<string, object> properties,
IObjectId folderId, IList<IPolicy> policies,
IList<IAce> addAces, IList<IAce> removeAces)
{
@@ -1022,11 +1049,13 @@ namespace PortCMIS.Client.Impl
return newId == null ? null : CreateObjectId(newId);
}
+ /// <inheritdoc/>
public IObjectId CreatePolicy(IDictionary<string, object> properties,
IObjectId folderId)
{
return CreatePolicy(properties, folderId, null, null, null);
}
+ /// <inheritdoc/>
public IObjectId CreateItem(IDictionary<string, object> properties,
IObjectId folderId, IList<IPolicy> policies, IList<IAce> addAces,
IList<IAce> removeAces)
{
@@ -1042,11 +1071,13 @@ namespace PortCMIS.Client.Impl
return newId == null ? null : CreateObjectId(newId);
}
+ /// <inheritdoc/>
public IObjectId CreateItem(IDictionary<string, object> properties,
IObjectId folderId)
{
return CreateItem(properties, folderId, null, null, null);
}
+ /// <inheritdoc/>
public IObjectId CreateRelationship(IDictionary<string, object>
properties, IList<IPolicy> policies, IList<IAce> addAces,
IList<IAce> removeAces)
{
@@ -1061,11 +1092,13 @@ namespace PortCMIS.Client.Impl
return newId == null ? null : CreateObjectId(newId);
}
+ /// <inheritdoc/>
public IObjectId CreateRelationship(IDictionary<string, object>
properties)
{
return CreateRelationship(properties, null, null, null);
}
+ /// <inheritdoc/>
public IItemEnumerable<IRelationship> GetRelationships(IObjectId
objectId, bool includeSubRelationshipTypes,
RelationshipDirection? relationshipDirection, IObjectType
type, IOperationContext context)
{
@@ -1178,6 +1211,7 @@ namespace PortCMIS.Client.Impl
// permissions
+ /// <inheritdoc/>
public IAcl GetAcl(IObjectId objectId, bool onlyBasicPermissions)
{
if (objectId == null || objectId.Id == null)
@@ -1188,6 +1222,7 @@ namespace PortCMIS.Client.Impl
return Binding.GetAclService().GetAcl(RepositoryId, objectId.Id,
onlyBasicPermissions, null);
}
+ /// <inheritdoc/>
public IAcl ApplyAcl(IObjectId objectId, IList<IAce> addAces,
IList<IAce> removeAces, AclPropagation? aclPropagation)
{
if (objectId == null || objectId.Id == null)
@@ -1199,6 +1234,7 @@ namespace PortCMIS.Client.Impl
ObjectFactory.ConvertAces(removeAces), aclPropagation, null);
}
+ /// <inheritdoc/>
public void ApplyPolicy(IObjectId objectId, params IObjectId[]
policyIds)
{
if (objectId == null || objectId.Id == null)
@@ -1227,6 +1263,7 @@ namespace PortCMIS.Client.Impl
}
}
+ /// <inheritdoc/>
public void RemovePolicy(IObjectId objectId, params IObjectId[]
policyIds)
{
if (objectId == null || objectId.Id == null)
@@ -1278,11 +1315,13 @@ namespace PortCMIS.Client.Impl
this.statement = statement.Trim();
}
+ /// <inheritdoc/>
public void SetType(int parameterIndex, string typeId)
{
SetType(parameterIndex, session.GetTypeDefinition(typeId));
}
+ /// <inheritdoc/>
public void SetType(int parameterIndex, IObjectType type)
{
if (type == null)
@@ -1298,6 +1337,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = type.QueryName;
}
+ /// <inheritdoc/>
public void SetProperty(int parameterIndex, string typeId, string
propertyId)
{
IObjectType type = session.GetTypeDefinition(typeId);
@@ -1311,6 +1351,7 @@ namespace PortCMIS.Client.Impl
SetProperty(parameterIndex, propertyDefinition);
}
+ /// <inheritdoc/>
public void SetProperty(int parameterIndex, IPropertyDefinition
propertyDefinition)
{
if (propertyDefinition == null)
@@ -1327,6 +1368,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = queryName;
}
+ /// <inheritdoc/>
public void SetInteger(int parameterIndex, params BigInteger[] num)
{
if (num == null || num.Length == 0)
@@ -1348,6 +1390,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = slb.ToString();
}
+ /// <inheritdoc/>
public void SetDecimal(int parameterIndex, params decimal[] num)
{
if (num == null || num.Length == 0)
@@ -1364,6 +1407,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = slb.ToString();
}
+ /// <inheritdoc/>
public void SetString(int parameterIndex, params string[] str)
{
if (str == null || str.Length == 0)
@@ -1385,6 +1429,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = slb.ToString();
}
+ /// <inheritdoc/>
public void SetStringLike(int parameterIndex, string str)
{
if (str == null)
@@ -1395,6 +1440,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = EscapeLike(str);
}
+ /// <inheritdoc/>
public void SetStringContains(int parameterIndex, string str)
{
if (str == null)
@@ -1405,6 +1451,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = EscapeContains(str);
}
+ /// <inheritdoc/>
public void SetId(int parameterIndex, params IObjectId[] id)
{
if (id == null || id.Length == 0)
@@ -1426,6 +1473,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = slb.ToString();
}
+ /// <inheritdoc/>
public void SetUri(int parameterIndex, params Uri[] uri)
{
if (uri == null || uri.Length == 0)
@@ -1447,6 +1495,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = slb.ToString();
}
+ /// <inheritdoc/>
public void SetBoolean(int parameterIndex, params bool[] boolean)
{
if (boolean == null || boolean.Length == 0)
@@ -1463,26 +1512,31 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = slb.ToString();
}
+ /// <inheritdoc/>
public void SetDateTime(int parameterIndex, params DateTime[] dt)
{
SetDateTime(parameterIndex, false, dt);
}
+ /// <inheritdoc/>
public void SetDateTime(int parameterIndex, params long[] ms)
{
SetDateTime(parameterIndex, false, ms);
}
+ /// <inheritdoc/>
public void SetDateTimeTimestamp(int parameterIndex, params DateTime[]
dt)
{
SetDateTime(parameterIndex, true, dt);
}
+ /// <inheritdoc/>
public void SetDateTimeTimestamp(int parameterIndex, params long[] ms)
{
SetDateTime(parameterIndex, true, ms);
}
+ /// <inheritdoc/>
protected void SetDateTime(int parameterIndex, bool prefix, params
DateTime[] cal)
{
if (cal == null || cal.Length == 0)
@@ -1517,6 +1571,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = sb.ToString();
}
+ /// <inheritdoc/>
protected void SetDateTime(int parameterIndex, bool prefix, params
long[] ms)
{
if (ms == null || ms.Length == 0)
@@ -1546,6 +1601,7 @@ namespace PortCMIS.Client.Impl
parametersDict[parameterIndex] = sb.ToString();
}
+ /// <inheritdoc/>
public string ToQueryString()
{
bool inStr = false;
@@ -1590,11 +1646,13 @@ namespace PortCMIS.Client.Impl
return sb.ToString();
}
+ /// <inheritdoc/>
public IItemEnumerable<IQueryResult> Query(bool searchAllVersions)
{
return session.Query(ToQueryString(), searchAllVersions);
}
+ /// <inheritdoc/>
public IItemEnumerable<IQueryResult> Query(bool searchAllVersions,
IOperationContext context)
{
return session.Query(ToQueryString(), searchAllVersions, context);
Modified: chemistry/portcmis/trunk/PortCMIS/client/ClientIntf.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/client/ClientIntf.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/client/ClientIntf.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/client/ClientIntf.cs Tue Apr 26 13:31:44
2016
@@ -69,7 +69,7 @@ namespace PortCMIS.Client
/// ISession session = factory.CreateSession(parameters);
/// </code>
/// </example>
- /// <seealso cref="PortCMIS.SessionParameter"/>
+ /// <seealso cref="PortCMIS.Client.SessionParameter"/>
ISession CreateSession(IDictionary<string, string> parameters);
/// <summary>
@@ -80,6 +80,7 @@ namespace PortCMIS.Client
/// <param name="objectFactory">Object factory.</param>
/// <param name="authenticationProvider">Authentication
provider.</param>
/// <param name="cache">Client object cache.</param>
+ /// <seealso cref="PortCMIS.Client.SessionParameter"/>
ISession CreateSession(IDictionary<string, string> parameters,
IObjectFactory objectFactory, IAuthenticationProvider authenticationProvider,
ICache cache);
/// <summary>
@@ -87,7 +88,7 @@ namespace PortCMIS.Client
/// </summary>
/// <param name="parameters">the session parameters</param>
/// <returns>a list of all available repositories</returns>
- /// <seealso cref="PortCMIS.SessionParameter"/>
+ /// <seealso cref="PortCMIS.Client.SessionParameter"/>
IList<IRepository> GetRepositories(IDictionary<string, string>
parameters);
}
@@ -289,7 +290,7 @@ namespace PortCMIS.Client
/// <summary>
/// Gets a CMIS object from the session cache. If the object is not in
the cache or the cache is
- /// turned off per default <see
cref="PortCMIS.Client.IOperationContext"/>, it will load the object
+ /// turned off per default operation context, it will load the object
/// from the repository and puts it into the cache.
/// <para>
/// This method might return a stale object if the object has been
found in the cache and has
@@ -301,8 +302,54 @@ namespace PortCMIS.Client
/// <param name="path">the path to the object</param>
/// <cmis>1.0</cmis>
ICmisObject GetObjectByPath(string path);
+
+ /// <summary>
+ /// Gets a CMIS object from the session cache. If the object is not in
the cache or the cache is
+ /// turned off or the given operation context has caching turned off,
it will load the object
+ /// from the repository and puts it into the cache.
+ /// <para>
+ /// This method might return a stale object if the object has been
found in the cache and has
+ /// been changed in or removed from the repository.
+ /// Use <see cref="PortCMIS.Client.ICmisObject.Refresh()"/> and <see
cref="PortCMIS.Client.ICmisObject.RefreshIfOld(long)"/>
+ /// to update the object if necessary.
+ /// </para>
+ /// </summary>
+ /// <param name="path">the path to the object</param>
+ /// <param name="context">the operation context</param>
+ /// <cmis>1.0</cmis>
ICmisObject GetObjectByPath(string path, IOperationContext context);
+
+ /// <summary>
+ /// Gets a CMIS object from the session cache. If the object is not in
the cache or the cache is
+ /// turned off per default operation context, it will load the object
+ /// from the repository and puts it into the cache.
+ /// <para>
+ /// This method might return a stale object if the object has been
found in the cache and has
+ /// been changed in or removed from the repository.
+ /// Use <see cref="PortCMIS.Client.ICmisObject.Refresh()"/> and <see
cref="PortCMIS.Client.ICmisObject.RefreshIfOld(long)"/>
+ /// to update the object if necessary.
+ /// </para>
+ /// </summary>
+ /// <param name="parentPath">the path of the parent folder</param>
+ /// <param name="name">name of the object</param>
+ /// <cmis>1.0</cmis>
ICmisObject GetObjectByPath(string parentPath, string name);
+
+ /// <summary>
+ /// Gets a CMIS object from the session cache. If the object is not in
the cache or the cache is
+ /// turned off or the given operation context has caching turned off,
it will load the object
+ /// from the repository and puts it into the cache.
+ /// <para>
+ /// This method might return a stale object if the object has been
found in the cache and has
+ /// been changed in or removed from the repository.
+ /// Use <see cref="PortCMIS.Client.ICmisObject.Refresh()"/> and <see
cref="PortCMIS.Client.ICmisObject.RefreshIfOld(long)"/>
+ /// to update the object if necessary.
+ /// </para>
+ /// </summary>
+ /// <param name="parentPath">the path of the parent folder</param>
+ /// <param name="name">name of the object</param>
+ /// <param name="context">the operation context</param>
+ /// <cmis>1.0</cmis>
ICmisObject GetObjectByPath(string parentPath, string name,
IOperationContext context);
/// <summary>
@@ -311,9 +358,37 @@ namespace PortCMIS.Client
/// <param name="objectId">the document ID of an arbitrary version in
the version series</param>
/// <cmis>1.0</cmis>
IDocument GetLatestDocumentVersion(string objectId);
+
+ /// <summary>
+ /// Gets the latest version in a version series with the given
operation context.
+ /// </summary>
+ /// <param name="objectId">the document ID of an arbitrary version in
the version series</param>
+ /// <param name="context">the operation context</param>
+ /// <cmis>1.0</cmis>
IDocument GetLatestDocumentVersion(string objectId, IOperationContext
context);
+
+ /// <summary>
+ /// Gets the latest version in a version series.
+ /// </summary>
+ /// <param name="objectId">the document ID of an arbitrary version in
the version series</param>
+ /// <cmis>1.0</cmis>
IDocument GetLatestDocumentVersion(IObjectId objectId);
+
+ /// <summary>
+ /// Gets the latest version in a version series with the given
operation context.
+ /// </summary>
+ /// <param name="objectId">the document ID of an arbitrary version in
the version series</param>
+ /// <param name="context">the operation context</param>
+ /// <cmis>1.0</cmis>
IDocument GetLatestDocumentVersion(IObjectId objectId,
IOperationContext context);
+
+ /// <summary>
+ /// Gets the latest version in a version series with the given
operation context.
+ /// </summary>
+ /// <param name="objectId">the document ID of an arbitrary version in
the version series</param>
+ /// <param name="major">defines if the latest major or the latest
minor version should be returned</param>
+ /// <param name="context">the operation context</param>
+ /// <cmis>1.0</cmis>
IDocument GetLatestDocumentVersion(IObjectId objectId, bool major,
IOperationContext context);
/// <summary>
@@ -339,6 +414,14 @@ namespace PortCMIS.Client
/// <cmis>1.0</cmis>
IItemEnumerable<IQueryResult> Query(string statement, bool
searchAllVersions);
IItemEnumerable<ICmisObject> QueryObjects(string typeId, string where,
bool searchAllVersions, IOperationContext context);
+
+ /// <summary>
+ /// Creates a query statement.
+ /// </summary>
+ /// <param name="statement">the CMIS QL statement</param>
+ /// <returns>the query statement object</returns>
+ /// <seealso cref="PortCMIS.Client.IQueryStatement"/>
+ /// <cmis>1.0</cmis>
IQueryStatement CreateQueryStatement(string statement);
/// <summary>
@@ -351,6 +434,10 @@ namespace PortCMIS.Client
/// <cmis>1.0</cmis>
IItemEnumerable<IQueryResult> Query(string statement, bool
searchAllVersions, IOperationContext context);
+ /// <summary>
+ /// Gets the latest change log token from the repository.
+ /// </summary>
+ /// <returns>the latest change log token</returns>
string GetLatestChangeLogToken();
IChangeEvents GetContentChanges(string changeLogToken, bool
includeProperties, long maxNumItems);
IChangeEvents GetContentChanges(string changeLogToken, bool
includeProperties, long maxNumItems, IOperationContext context);
@@ -429,9 +516,41 @@ namespace PortCMIS.Client
IContentStream GetContentStream(IObjectId docId, string streamId,
long? offset, long? length);
// permissions
+
+ /// <summary>
+ /// Gets the ACL of an object.
+ /// </summary>
+ /// <param name="objectId">the object ID</param>
+ /// <param name="onlyBasicPermissions">a flag indicating whether only
basic permissions are requested</param>
+ /// <returns>the ACL</returns>
+ /// <cmis>1.0</cmis>
IAcl GetAcl(IObjectId objectId, bool onlyBasicPermissions);
+
+ /// <summary>
+ /// Applies an ACL.
+ /// </summary>
+ /// <param name="objectId">the object ID</param>
+ /// <param name="addAces">the ACEs to be added</param>
+ /// <param name="removeAces">the ACSs to be removed</param>
+ /// <param name="aclPropagation">the ACL propagation flag</param>
+ /// <returns>the new ACL of the object</returns>
+ /// <cmis>1.0</cmis>
IAcl ApplyAcl(IObjectId objectId, IList<IAce> addAces, IList<IAce>
removeAces, AclPropagation? aclPropagation);
+
+ /// <summary>
+ /// Applies policies.
+ /// </summary>
+ /// <param name="objectId">the object ID</param>
+ /// <param name="policyIds">the policy IDs</param>
+ /// <cmis>1.0</cmis>
void ApplyPolicy(IObjectId objectId, params IObjectId[] policyIds);
+
+ /// <summary>
+ /// Removes policies.
+ /// </summary>
+ /// <param name="objectId">the object ID</param>
+ /// <param name="policyIds">the policy IDs</param>
+ /// <cmis>1.0</cmis>
void RemovePolicy(IObjectId objectId, params IObjectId[] policyIds);
}
@@ -1034,13 +1153,34 @@ namespace PortCMIS.Client
IList<ISecondaryType> SecondaryTypes { get; }
}
+ /// <summary>
+ /// Extension level.
+ /// </summary>
public enum ExtensionLevel
{
+ /// <summary>
+ /// Object extensions.
+ /// </summary>
Object,
+ /// <summary>
+ /// Properties extensions.
+ /// </summary>
Properties,
+ /// <summary>
+ /// Allowable Actions extensions.
+ /// </summary>
AllowableActions,
+ /// <summary>
+ /// ACL extensions.
+ /// </summary>
Acl,
+ /// <summary>
+ /// Policies extensions.
+ /// </summary>
Policies,
+ /// <summary>
+ /// Change Event extensions.
+ /// </summary>
ChangeEvent
}
@@ -1279,7 +1419,7 @@ namespace PortCMIS.Client
/// <value>
/// The content stream hashes or <c>null</c> if the document has no
content or the repository hasn't provided content hashes (CMIS property
<c>cmis:contentStreamHash</c>).
- /// </summary>
+ /// </value>
IList<IContentStreamHash> ContentStreamHashes { get; }
}
Modified: chemistry/portcmis/trunk/PortCMIS/client/ClientUtils.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/client/ClientUtils.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/client/ClientUtils.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/client/ClientUtils.cs Tue Apr 26 13:31:44
2016
@@ -96,6 +96,7 @@ namespace PortCMIS.Client.Impl
GenerateCacheKey();
}
+ /// <inheritdoc/>
public HashSet<string> Filter
{
get { return filter == null ? null : new HashSet<string>(filter); }
@@ -136,6 +137,7 @@ namespace PortCMIS.Client.Impl
}
}
+ /// <inheritdoc/>
public string FilterString
{
get
@@ -181,30 +183,35 @@ namespace PortCMIS.Client.Impl
}
}
+ /// <inheritdoc/>
public bool IncludeAllowableActions
{
get { return includeAllowableActions; }
set { includeAllowableActions = value; GenerateCacheKey(); }
}
+ /// <inheritdoc/>
public bool IncludeAcls
{
get { return includeAcls; }
set { includeAcls = value; GenerateCacheKey(); }
}
+ /// <inheritdoc/>
public IncludeRelationships? IncludeRelationships
{
get { return includeRelationships; }
set { includeRelationships = value; GenerateCacheKey(); }
}
+ /// <inheritdoc/>
public bool IncludePolicies
{
get { return includePolicies; }
set { includePolicies = value; GenerateCacheKey(); }
}
+ /// <inheritdoc/>
public HashSet<string> RenditionFilter
{
get { return renditionFilter == null ? null : new
HashSet<string>(renditionFilter); }
@@ -243,6 +250,7 @@ namespace PortCMIS.Client.Impl
}
}
+ /// <inheritdoc/>
public string RenditionFilterString
{
get
@@ -278,29 +286,34 @@ namespace PortCMIS.Client.Impl
}
}
+ /// <inheritdoc/>
public bool IncludePathSegments
{
get { return includePathSegments; }
set { includePathSegments = value; GenerateCacheKey(); }
}
+ /// <inheritdoc/>
public string OrderBy
{
get { return orderBy; }
set { orderBy = value; GenerateCacheKey(); }
}
+ /// <inheritdoc/>
public bool CacheEnabled
{
get { return cacheEnabled; }
set { cacheEnabled = value; GenerateCacheKey(); }
}
+ /// <inheritdoc/>
public string CacheKey
{
get { return cacheKey; }
}
+ /// <inheritdoc/>
public int MaxItemsPerPage
{
get { return maxItemsPerPage; }
Modified: chemistry/portcmis/trunk/PortCMIS/client/SessionParameter.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/client/SessionParameter.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/client/SessionParameter.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/client/SessionParameter.cs Tue Apr 26
13:31:44 2016
@@ -19,59 +19,120 @@
namespace PortCMIS.Client
{
+ /// <summary>
+ /// Session parameter constants.
+ /// </summary>
public static class SessionParameter
{
// ---- general parameter ----
+
+ /// <summary>Repository ID</summary>
+ public const string RepositoryId =
"org.apache.chemistry.portcmis.session.repository.id";
+
+ /// <summary>User</summary>
public const string User = "org.apache.chemistry.portcmis.user";
+
+ /// <summary>Password</summary>
public const string Password =
"org.apache.chemistry.portcmis.password";
+
// ---- provider parameter ----
- // Predefined binding types
+
+ /// <summary>Binding Type ("atompub" or "browser")</summary>
+ /// <seealso cref="PortCMIS.BindingType"/>
public const string BindingType =
"org.apache.chemistry.portcmis.binding.spi.type";
+
+ /// <summary>Force CMIS version ("1.0" or "1.1")</summary>
public const string ForceCmisVersion =
"org.apache.chemistry.portcmis.cmisversion";
- // Class name of the binding class.
+
+ /// <summary>Class name of the binding class</summary>
public const string BindingSpiClass =
"org.apache.chemistry.portcmis.binding.spi.classname";
- // URL of the AtomPub service document.
+
+ /// <summary>URL of the AtomPub service document</summary>
public const string AtomPubUrl =
"org.apache.chemistry.portcmis.binding.atompub.url";
- // URL of the Browser service
+
+ /// <summary>URL of the Browser service</summary>
public const string BrowserUrl =
"org.apache.chemistry.portcmis.binding.browser.url";
- // succinct flag
+
+ /// <summary>Succinct flag (browser binding only)</summary>
public const string BrowserSuccinct =
"org.apache.chemistry.portcmis.binding.browser.succinct";
- // date time format
+
+ /// <summary>DateTime format ("simple" or "extended") (browser binding
only)</summary>
+ /// <seealso cref="PortCMIS.Enums.DateTimeFormat"/>
public const string BrowserDateTimeFormat =
"org.apache.chemistry.portcmis.binding.browser.datetimeformat";
- // authentication provider
+
+ /// <summary>Class name of the authentication provider class</summary>
public const string AuthenticationProviderClass =
"org.apache.chemistry.portcmis.binding.auth.classname";
- // HTTP invoker
+
+ /// <summary>Class name of the HTTP invoker class</summary>
public const string HttpInvokerClass =
"org.apache.chemistry.portcmis.binding.httpinvoker.classname";
- // compression flag
+
+ /// <summary>Compression flag ("true" or "false")</summary>
public const string Compression =
"org.apache.chemistry.portcmis.binding.compression";
- // timeouts
+
+ /// <summary>Connect timeout in milliseconds</summary>
public const string ConnectTimeout =
"org.apache.chemistry.portcmis.binding.connecttimeout";
+
+ /// <summary>Read timeout in milliseconds</summary>
public const string ReadTimeout =
"org.apache.chemistry.portcmis.binding.readtimeout";
- // binding caches
+
+ /// <summary>OAuth 2 bearer token</summary>
+ public const string OAuthBearerToken =
"org.apache.chemistry.portcmis.binding.auth.http.oauth.bearer";
+
+ /// <summary>Proxy user</summary>
+ public const string ProxyUser =
"org.apache.chemistry.portcmis.binding.proxyuser";
+
+ /// <summary>Proxy password</summary>
+ public const string ProxyPassword =
"org.apache.chemistry.portcmis.binding.proxypassword";
+
+ /// <summary>CSRF HTTP header</summary>
+ public const string CsrfHeader =
"org.apache.chemistry.portcmis.binding.csrfheader";
+
+ // ---- binding caches ----
+
+ /// <summary>Size of the repositories cache</summary>
public const string CacheSizeRepositories =
"org.apache.chemistry.portcmis.binding.cache.repositories.size";
+
+ /// <summary>Size of the types cache</summary>
public const string CacheSizeTypes =
"org.apache.chemistry.portcmis.binding.cache.types.size";
+
+ /// <summary>Size of the link cache</summary>
public const string CacheSizeLinks =
"org.apache.chemistry.portcmis.binding.cache.links.size";
- // session parameter
+
+ // ---- session parameter ----
+
+ /// <summary>Class name of the object factory class</summary>
public const string ObjectFactoryClass =
"org.apache.chemistry.portcmis.objectfactory.classname";
+
+ /// <summary>Class name of the object cache class</summary>
public const string CacheClass =
"org.apache.chemistry.portcmis.cache.classname";
- public const string RepositoryId =
"org.apache.chemistry.portcmis.session.repository.id";
+
+ /// <summary>Size of the object cache</summary>
public const string CacheSizeObjects =
"org.apache.chemistry.portcmis.cache.objects.size";
+
+ /// <summary>Time-to-live of objects in the object cache</summary>
public const string CacheTTLObjects =
"org.apache.chemistry.portcmis.cache.objects.ttl";
+
+ /// <summary>Size of the path cache</summary>
public const string CacheSizePathToId =
"org.apache.chemistry.portcmis.cache.pathtoid.size";
+
+ /// <summary>Time-to-live of objects in the path cache</summary>
public const string CacheTTLPathToId =
"org.apache.chemistry.portcmis.cache.pathtoid.ttl";
+
+ /// <summary>Path cache ("true" or "false")</summary>
public const string CachePathOmit =
"org.apache.chemistry.portcmis.cache.path.omit";
- // OAuth 2
- public const string OAuthBearerToken =
"org.apache.chemistry.portcmis.binding.auth.http.oauth.bearer";
- // proxy
- public const string ProxyUser =
"org.apache.chemistry.portcmis.binding.proxyuser";
- public const string ProxyPassword =
"org.apache.chemistry.portcmis.binding.proxypassword";
- // CSRF
- public const string CsrfHeader =
"org.apache.chemistry.portcmis.binding.csrfheader";
+ // ---- workarounds ----
- // workarounds
+ /// <summary>Defines if the object ID should be added to the move URL
("true" or "false")
+ /// (Workaround for SharePoint 2010)</summary>
public const string IncludeObjectIdUrlParamOnCheckout =
"org.apache.chemistry.portcmis.workaround.includeObjectIdOnCheckout";
+
+ /// <summary>Defines if the change token should be omitted for
updating calls ("true" or "false")
+ /// (Workaround for SharePoint 2010 and SharePoint 2013)</summary>
public const string IncludeObjectIdUrlParamOnMove =
"org.apache.chemistry.portcmis.workaround.includeObjectIdOnMove";
+
+ /// <summary>Defines if the document name should be added to the
properties on check in if no properties are updated ("true" or "false")
+ /// (Workaround for SharePoint 2010 and SharePoint 2013)</summary>
public const string OmitChangeTokens =
"org.apache.chemistry.opencmis.portcmis.omitChangeTokens";
}
-}
+}
\ No newline at end of file
Modified: chemistry/portcmis/trunk/PortCMIS/const/ExtensionFeatures.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/const/ExtensionFeatures.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/const/ExtensionFeatures.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/const/ExtensionFeatures.cs Tue Apr 26
13:31:44 2016
@@ -26,8 +26,14 @@ using PortCMIS.Data;
namespace PortCMIS.Const
{
+ /// <summary>
+ /// CMIS extensions defined by the CMIS TC.
+ /// </summary>
public class ExtensionFeatures
{
+ /// <summary>
+ /// DateTime format extension for the Browers Bindings.
+ /// </summary>
public readonly static IExtensionFeature ExtendedDatetimeFormat = new
ExtensionFeature()
{
Id = "http://docs.oasis-open.org/ns/cmis/extension/datetimeformat",
@@ -37,6 +43,9 @@ namespace PortCMIS.Const
Description = "Adds an additional DateTime format for the Browser
Binding."
};
+ /// <summary>
+ /// Content Stream Hash property extension.
+ /// </summary>
public readonly static IExtensionFeature ContentStreamHash = new
ExtensionFeature()
{
Id =
"http://docs.oasis-open.org/ns/cmis/extension/contentstreamhash",
Modified: chemistry/portcmis/trunk/PortCMIS/data/DataImpl.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/data/DataImpl.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/data/DataImpl.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/data/DataImpl.cs Tue Apr 26 13:31:44 2016
@@ -291,30 +291,65 @@ namespace PortCMIS.Data
public IDictionary<string, string> FeatureData { get; set; }
}
+ /// <summary>
+ /// Base type definition implementation.
+ /// </summary>
public abstract class AbstractTypeDefinition : ExtensionsData,
ITypeDefinition
{
private List<IPropertyDefinition> propertyDefintionList = new
List<IPropertyDefinition>();
private Dictionary<string, IPropertyDefinition> propertyDefintionDict
= new Dictionary<string, IPropertyDefinition>();
private string parentTypeId;
+
+ /// <inheritdoc/>
public string Id { get; set; }
+
+ /// <inheritdoc/>
public string LocalName { get; set; }
+
+ /// <inheritdoc/>
public string LocalNamespace { get; set; }
+
+ /// <inheritdoc/>
public string DisplayName { get; set; }
+
+ /// <inheritdoc/>
public string QueryName { get; set; }
+
+ /// <inheritdoc/>
public string Description { get; set; }
+
+ /// <inheritdoc/>
public BaseTypeId BaseTypeId { get; set; }
+
+ /// <inheritdoc/>
public string ParentTypeId
{
get { return parentTypeId; }
set { parentTypeId = (value == null || value.Length == 0 ? null :
value); }
}
+
+ /// <inheritdoc/>
public bool? IsCreatable { get; set; }
+
+ /// <inheritdoc/>
public bool? IsFileable { get; set; }
+
+ /// <inheritdoc/>
public bool? IsQueryable { get; set; }
+
+ /// <inheritdoc/>
public bool? IsFulltextIndexed { get; set; }
+
+ /// <inheritdoc/>
public bool? IsIncludedInSupertypeQuery { get; set; }
+
+ /// <inheritdoc/>
public bool? IsControllablePolicy { get; set; }
+
+ /// <inheritdoc/>
public bool? IsControllableAcl { get; set; }
+
+ /// <inheritdoc/>
public IPropertyDefinition this[string propertyId]
{
get
@@ -324,6 +359,8 @@ namespace PortCMIS.Data
return propertyDefinition;
}
}
+
+ /// <inheritdoc/>
public IList<IPropertyDefinition> PropertyDefinitions
{
get
@@ -331,6 +368,8 @@ namespace PortCMIS.Data
return propertyDefintionList;
}
}
+
+ /// <inheritdoc/>
public ITypeMutability TypeMutability { get; set; }
public void Initialize(ITypeDefinition typeDefinition)
@@ -374,54 +413,97 @@ namespace PortCMIS.Data
}
}
+ /// <summary>
+ /// Type mutability implementation.
+ /// </summary>
public class TypeMutability : ExtensionsData, ITypeMutability
{
+ /// <inheritdoc/>
public bool? CanCreate { get; set; }
+
+ /// <inheritdoc/>
public bool? CanUpdate { get; set; }
+
+ /// <inheritdoc/>
public bool? CanDelete { get; set; }
}
+ /// <summary>
+ /// Document type definition implementation.
+ /// </summary>
public class DocumentTypeDefinition : AbstractTypeDefinition,
IDocumentTypeDefinition
{
+ /// <inheritdoc/>
public bool? IsVersionable { get; set; }
+
+ /// <inheritdoc/>
public ContentStreamAllowed? ContentStreamAllowed { get; set; }
}
+ /// <summary>
+ /// Folder type definition implementation.
+ /// </summary>
public class FolderTypeDefinition : AbstractTypeDefinition,
IFolderTypeDefinition
{
}
+ /// <summary>
+ /// Policy type definition implementation.
+ /// </summary>
public class PolicyTypeDefinition : AbstractTypeDefinition,
IPolicyTypeDefinition
{
}
+ /// <summary>
+ /// Item type definition implementation.
+ /// </summary>
public class ItemTypeDefinition : AbstractTypeDefinition,
IItemTypeDefinition
{
}
+ /// <summary>
+ /// Secondary type definition implementation.
+ /// </summary>
public class SecondaryTypeDefinition : AbstractTypeDefinition,
ISecondaryTypeDefinition
{
}
+ /// <summary>
+ /// Relationship type definition implementation.
+ /// </summary>
public class RelationshipTypeDefinition : AbstractTypeDefinition,
IRelationshipTypeDefinition
{
+ /// <inheritdoc/>
public IList<string> AllowedSourceTypeIds { get; set; }
+
+ /// <inheritdoc/>
public IList<string> AllowedTargetTypeIds { get; set; }
}
public class TypeDefinitionList : ExtensionsData, ITypeDefinitionList
{
+ /// <inheritdoc/>
public IList<ITypeDefinition> List { get; set; }
+
+ /// <inheritdoc/>
public bool? HasMoreItems { get; set; }
+
+ /// <inheritdoc/>
public BigInteger? NumItems { get; set; }
}
public class TypeDefinitionContainer : ExtensionsData,
ITypeDefinitionContainer
{
+ /// <inheritdoc/>
public ITypeDefinition TypeDefinition { get; set; }
+
+ /// <inheritdoc/>
public IList<ITypeDefinitionContainer> Children { get; set; }
}
+ /// <summary>
+ /// Property definition implementation.
+ /// </summary>
public abstract class PropertyDefinition : ExtensionsData,
IPropertyDefinition
{
/// <inheritdoc/>
Modified: chemistry/portcmis/trunk/PortCMIS/data/DataIntf.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/trunk/PortCMIS/data/DataIntf.cs?rev=1741020&r1=1741019&r2=1741020&view=diff
==============================================================================
--- chemistry/portcmis/trunk/PortCMIS/data/DataIntf.cs (original)
+++ chemistry/portcmis/trunk/PortCMIS/data/DataIntf.cs Tue Apr 26 13:31:44 2016
@@ -26,6 +26,9 @@ using System.Numerics;
namespace PortCMIS.Data
{
+ /// <summary>
+ /// Represents a repository info.
+ /// </summary>
public interface IRepositoryInfo : IExtensionsData
{
/// <value>
@@ -192,6 +195,9 @@ namespace PortCMIS.Data
IDictionary<string, string> FeatureData { get; }
}
+ /// <summary>
+ /// Type definition.
+ /// </summary>
public interface ITypeDefinition : IExtensionsData
{
string Id { get; }
@@ -214,35 +220,74 @@ namespace PortCMIS.Data
ITypeMutability TypeMutability { get; }
}
+ /// <summary>
+ /// TypeMutability flags.
+ /// </summary>
public interface ITypeMutability : IExtensionsData
{
+ /// <value>
+ /// Defines whether subtypes can be created.
+ /// </value>
bool? CanCreate { get; }
+
+ /// <value>
+ /// Defines whether the type can be updated.
+ /// </value>
bool? CanUpdate { get; }
+
+ /// <value>
+ /// Defines whether the type can be deleted.
+ /// </value>
bool? CanDelete { get; }
}
+ /// <summary>
+ /// Document type definition.
+ /// </summary>
public interface IDocumentTypeDefinition : ITypeDefinition
{
+ /// <value>
+ /// Defines whether the type is versionabel or not.
+ /// </summary>
bool? IsVersionable { get; }
+
+ /// <value>
+ /// Defines if content streams are supported for this type.
+ /// </value>
ContentStreamAllowed? ContentStreamAllowed { get; }
}
+ /// <summary>
+ /// Folder type definition.
+ /// </summary>
public interface IFolderTypeDefinition : ITypeDefinition
{
}
+ /// <summary>
+ /// Secondary type definition.
+ /// </summary>
public interface ISecondaryTypeDefinition : ITypeDefinition
{
}
+ /// <summary>
+ /// Policy type definition.
+ /// </summary>
public interface IPolicyTypeDefinition : ITypeDefinition
{
}
+ /// <summary>
+ /// Item type definition.
+ /// </summary>
public interface IItemTypeDefinition : ITypeDefinition
{
}
+ /// <summary>
+ /// Relationship type definition.
+ /// </summary>
public interface IRelationshipTypeDefinition : ITypeDefinition
{
IList<string> AllowedSourceTypeIds { get; }
@@ -262,6 +307,9 @@ namespace PortCMIS.Data
IList<ITypeDefinitionContainer> Children { get; }
}
+ /// <summary>
+ /// Property definition.
+ /// </summary>
public interface IPropertyDefinition : IExtensionsData
{
string Id { get; }
@@ -405,33 +453,66 @@ namespace PortCMIS.Data
object FirstValue { get; }
}
+ /// <summary>
+ /// Represents a principal.
+ /// </summary>
public interface IPrincipal : IExtensionsData
{
+ /// <value>The principal ID</value>
string Id { get; }
}
+ /// <summary>
+ /// Represents an ACE.
+ /// </summary>
public interface IAce : IExtensionsData
{
+ /// <value>The principal</value>
IPrincipal Principal { get; }
+
+ /// <value>The principal ID</value>
string PrincipalId { get; }
+
+ /// <value>The list of permissions</value>
IList<string> Permissions { get; }
+
+ /// <value>Indicates whether the ACE is a direct ACE or not</value>
bool IsDirect { get; }
}
+ /// <summary>
+ /// Represents an ACL.
+ /// </summary>
public interface IAcl : IExtensionsData
{
+ /// <value>The list of ACEs</value>
IList<IAce> Aces { get; }
+
+ /// <value>Indicates whether the ACL is exact or not</value>
bool? IsExact { get; }
}
+ /// <summary>
+ /// Represents a content stream.
+ /// </summary>
public interface IContentStream : IExtensionsData
{
+ /// <value>The stream length, if known</value>
BigInteger? Length { get; }
+
+ /// <value>The MIME type, if known</value>
string MimeType { get; }
+
+ /// <value>The file name, if known</value>
string FileName { get; }
+
+ /// <value>The stream</value>
Stream Stream { get; }
}
+ /// <summary>
+ /// Represents a partial content stream.
+ /// </summary>
public interface IPartialContentStream : IContentStream
{
}