- moved unit test configuration from code to config file
- added SHFB build file
- added more code documentation
git-svn-id: https://svn.apache.org/repos/asf/incubator/chemistry/dotcmis/trunk@1070095 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/DotCMIS/DotCMIS.shfbproj b/DotCMIS/DotCMIS.shfbproj
new file mode 100644
index 0000000..6e6b6fd
--- /dev/null
+++ b/DotCMIS/DotCMIS.shfbproj
@@ -0,0 +1,70 @@
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="3.5">
+ <PropertyGroup>
+ <!-- The configuration and platform will be used to determine which
+ assemblies to include from solution and project documentation
+ sources -->
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{9cf9e0ef-9201-4fd3-a89f-bd03e481c4e5}</ProjectGuid>
+ <SHFBSchemaVersion>1.9.0.0</SHFBSchemaVersion>
+ <!-- AssemblyName, Name, and RootNamespace are not used by SHFB but Visual
+ Studio adds them anyway -->
+ <AssemblyName>Documentation</AssemblyName>
+ <RootNamespace>Documentation</RootNamespace>
+ <Name>Documentation</Name>
+ <!-- SHFB properties -->
+ <OutputPath>.\doc\</OutputPath>
+ <HtmlHelpName>DotCMISDoc</HtmlHelpName>
+ <Language>en-US</Language>
+ <DocumentationSources>
+ <DocumentationSource sourceFile="DotCMIS.csproj" xmlns="" />
+ </DocumentationSources>
+ <HelpTitle>Apache Chemistry DotCMIS</HelpTitle>
+ <HelpFileFormat>HtmlHelp1, Website</HelpFileFormat>
+ <NamingMethod>MemberName</NamingMethod>
+ <PresentationStyle>vs2005</PresentationStyle>
+ <MissingTags>Summary, Parameter, Returns, TypeParameter</MissingTags>
+ <ApiFilter>
+ <Filter entryType="Namespace" fullName="DotCMIS.Client.Impl" isExposed="False" />
+ <Filter entryType="Namespace" fullName="DotCMIS.Client.Impl.Cache" isExposed="False" />
+ <Filter entryType="Namespace" fullName="DotCMIS.CMISWebServicesReference" isExposed="False" />
+ <Filter entryType="Namespace" fullName="DotCMIS.Data.Extensions" isExposed="True">
+ <Filter entryType="Class" fullName="DotCMIS.Data.Extensions.CmisExtensionElement" filterName="CmisExtensionElement" isExposed="False" />
+ <Filter entryType="Class" fullName="DotCMIS.Data.Extensions.ExtensionsData" filterName="ExtensionsData" isExposed="False" />
+ </Filter>
+ <Filter entryType="Namespace" fullName="DotCMIS.Data.Impl" isExposed="False" />
+ <Filter entryType="Namespace" fullName="DotCMIS.Enums" isExposed="True">
+ <Filter entryType="Class" fullName="DotCMIS.Enums.CmisValue" filterName="CmisValue" isExposed="False" />
+ <Filter entryType="Class" fullName="DotCMIS.Enums.CmisValueAttribute" filterName="CmisValueAttribute" isExposed="False" />
+ </Filter>
+ </ApiFilter>
+ <SelfBranded>True</SelfBranded>
+ <FeedbackEMailLinkText>Apache Chemistry developer mailing list</FeedbackEMailLinkText>
+ <FeedbackEMailAddress>chemistry-dev%40incubator.apache.org</FeedbackEMailAddress>
+ <CopyrightText>Apache Software Foundation</CopyrightText>
+ <CopyrightHref>http://www.apache.org</CopyrightHref>
+ <BinaryTOC>False</BinaryTOC>
+ </PropertyGroup>
+ <!-- There are no properties for these groups. AnyCPU needs to appear in
+ order for Visual Studio to perform the build. The others are optional
+ common platform types that may appear. -->
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x64' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x64' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|Win32' ">
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|Win32' ">
+ </PropertyGroup>
+ <!-- Import the SHFB build targets -->
+ <Import Project="$(SHFBROOT)\SandcastleHelpFileBuilder.targets" />
+</Project>
\ No newline at end of file
diff --git a/DotCMIS/build.bat b/DotCMIS/build.bat
new file mode 100644
index 0000000..28bd63c
--- /dev/null
+++ b/DotCMIS/build.bat
@@ -0,0 +1,3 @@
+msbuild DotCMIS.csproj /p:Configuration=Debug
+msbuild DotCMIS.csproj /p:Configuration=Release
+msbuild DotCMIS.shfbproj /p:Configuration=Release
\ No newline at end of file
diff --git a/DotCMIS/client/client-intf.cs b/DotCMIS/client/client-intf.cs
index 930fb96..eb61697 100644
--- a/DotCMIS/client/client-intf.cs
+++ b/DotCMIS/client/client-intf.cs
@@ -100,6 +100,8 @@
/// <summary>
/// A session is a connection to a CMIS repository with a specific user.
+ /// </summary>
+ /// <remarks>
/// <para>
/// Not all operations might be supported by the connected repository. Either DotCMIS or the repository will
/// throw an exception if an unsupported operation is called.
@@ -114,7 +116,7 @@
/// for details about the domain model, terms, concepts, base types, properties, ids and query names,
/// query language, etc.)
/// </para>
- /// </summary>
+ /// </remarks>
public interface ISession
{
/// <summary>
@@ -178,8 +180,23 @@
// discovery
+ /// <summary>
+ /// Performs a query.
+ /// </summary>
+ /// <param name="statement">the CMIS QL statement</param>
+ /// <param name="searchAllVersions">indicates if all versions or only latest version should be searched</param>
+ /// <returns>query results</returns>
IItemEnumerable<IQueryResult> Query(string statement, bool searchAllVersions);
+
+ /// <summary>
+ /// Performs a query using the given <see cref="DotCMIS.Client.IOperationContext"/>.
+ /// </summary>
+ /// <param name="statement">the CMIS QL statement</param>
+ /// <param name="searchAllVersions">indicates if all versions or only latest version should be searched</param>
+ /// <param name="context">the <see cref="DotCMIS.Client.IOperationContext"/></param>
+ /// <returns>query results</returns>
IItemEnumerable<IQueryResult> Query(string statement, bool searchAllVersions, IOperationContext context);
+
IChangeEvents GetContentChanges(string changeLogToken, bool includeProperties, long maxNumItems);
IChangeEvents GetContentChanges(string changeLogToken, bool includeProperties, long maxNumItems,
IOperationContext context);
@@ -255,18 +272,85 @@
/// </summary>
public interface IOperationContext
{
+ /// <summary>
+ /// Gets and sets the property filter.
+ /// </summary>
+ /// <remarks>
+ /// This is a set of query names.
+ /// </remarks>
HashSet<string> Filter { get; set; }
+
+ /// <summary>
+ /// Gets and sets the property filter.
+ /// </summary>
+ /// <remarks>
+ /// This is a comma-separated list of query names.
+ /// </remarks>
string FilterString { get; set; }
+
+ /// <summary>
+ /// Gets and sets if allowable actions should be retrieved.
+ /// </summary>
bool IncludeAllowableActions { get; set; }
+
+ /// <summary>
+ /// Gets and sets if ACLs should be retrieved.
+ /// </summary>
bool IncludeAcls { get; set; }
+
+ /// <summary>
+ /// Gets and sets if relationships should be retrieved.
+ /// </summary>
IncludeRelationshipsFlag? IncludeRelationships { get; set; }
+
+ /// <summary>
+ /// Gets and sets if policies should be retrieved.
+ /// </summary>
bool IncludePolicies { get; set; }
+
+ /// <summary>
+ /// Gets and sets the rendition filter.
+ /// </summary>
+ /// <remarks>
+ /// This is a set of rendition kinds or MIME types.
+ /// </remarks>
HashSet<string> RenditionFilter { get; set; }
+
+ /// <summary>
+ /// Gets and sets the rendition filter.
+ /// </summary>
+ /// <remarks>
+ /// This is a comma-separated list of rendition kinds or MIME types.
+ /// </remarks>
string RenditionFilterString { get; set; }
+
+ /// <summary>
+ /// Gets and sets if path segements should be retrieved.
+ /// </summary>
bool IncludePathSegments { get; set; }
+
+ /// <summary>
+ /// Gets and sets order by list.
+ /// </summary>
+ /// <remarks>
+ /// This is a comma-separated list of query names.
+ /// </remarks>
string OrderBy { get; set; }
+
+ /// <summary>
+ /// Gets and sets if object fetched with this <see cref="DotCMIS.Client.IOperationContext"/>
+ /// should be cached or not.
+ /// </summary>
bool CacheEnabled { get; set; }
+
+ /// <summary>
+ /// Gets the cache key. (For internal use.)
+ /// </summary>
string CacheKey { get; }
+
+ /// <summary>
+ /// Gets and sets how many items should be fetched per page.
+ /// </summary>
int MaxItemsPerPage { get; set; }
}
@@ -539,17 +623,42 @@
/// </summary>
IList<IRendition> Renditions { get; }
- // policy service
+ /// <summary>
+ /// Applies the given policies to the object.
+ /// </summary>
void ApplyPolicy(params IObjectId[] policyId);
+
+ /// <summary>
+ /// Removes the given policies from the object.
+ /// </summary>
void RemovePolicy(params IObjectId[] policyId);
+
+ /// <summary>
+ /// Gets a list of policies applied to this object.
+ /// </summary>
IList<IPolicy> Policies { get; }
- // ACL service
- IAcl ApplyAcl(IList<IAce> AddAces, IList<IAce> removeAces, AclPropagation? aclPropagation);
- IAcl AddAcl(IList<IAce> AddAces, AclPropagation? aclPropagation);
- IAcl RemoveAcl(IList<IAce> RemoveAces, AclPropagation? aclPropagation);
+ /// <summary>
+ /// Adds and removes ACEs to this object.
+ /// </summary>
+ /// <returns>the new ACL of this object</returns>
+ IAcl ApplyAcl(IList<IAce> addAces, IList<IAce> removeAces, AclPropagation? aclPropagation);
- // extensions
+ /// <summary>
+ /// Adds ACEs to this object.
+ /// </summary>
+ /// <returns>the new ACL of this object</returns>
+ IAcl AddAcl(IList<IAce> addAces, AclPropagation? aclPropagation);
+
+ /// <summary>
+ /// Removes ACEs from this object.
+ /// </summary>
+ /// <returns>the new ACL of this object</returns>
+ IAcl RemoveAcl(IList<IAce> removeAces, AclPropagation? aclPropagation);
+
+ /// <summary>
+ /// Gets the extensions of the given level.
+ /// </summary>
IList<ICmisExtensionElement> GetExtensions(ExtensionLevel level);
/// <summary>
@@ -573,15 +682,41 @@
/// </summary>
public interface IFileableCmisObject : ICmisObject
{
- // object service
+ /// <summary>
+ /// Moves this object from a source folder to a target folder.
+ /// </summary>
+ /// <param name="sourceFolderId">the source folder id</param>
+ /// <param name="targetFolderId">the target folder id</param>
+ /// <returns>the object in the new location</returns>
IFileableCmisObject Move(IObjectId sourceFolderId, IObjectId targetFolderId);
- // navigation service
+ /// <summary>
+ /// Gets a list of all parent folders.
+ /// </summary>
+ /// <remarks>
+ /// Returns an empty list if it is an unfiled object or the root folder.
+ /// </remarks>
IList<IFolder> Parents { get; }
+
+ /// <summary>
+ /// Gets all paths for this object
+ /// </summary>
+ /// <remarks>
+ /// Returns an empty list for unfiled objects.
+ /// </remarks>
IList<string> Paths { get; }
- // multifiling service
+ /// <summary>
+ /// Adds this object to the given folder.
+ /// </summary>
+ /// <param name="folderId">the id of the target folder</param>
+ /// <param name="allVersions">indicates if only this object or all versions of the object should be added</param>
void AddToFolder(IObjectId folderId, bool allVersions);
+
+ /// <summary>
+ /// Removes this object from the given folder.
+ /// </summary>
+ /// <param name="folderId">the id of the folder</param>
void RemoveFromFolder(IObjectId folderId);
}
@@ -590,19 +725,74 @@
/// </summary>
public interface IDocumentProperties
{
+ /// <summary>
+ /// Gets if this CMIS object is immutable (CMIS property <c>cmis:isImmutable</c>).
+ /// </summary>
bool? IsImmutable { get; }
+
+ /// <summary>
+ /// Gets if this CMIS object is the latest version (CMIS property <c>cmis:isLatestVersion</c>)
+ /// </summary>
bool? IsLatestVersion { get; }
+
+ /// <summary>
+ /// Gets if this CMIS object is the latest version (CMIS property <c>cmis:isMajorVersion</c>).
+ /// </summary>
bool? IsMajorVersion { get; }
+
+ /// <summary>
+ /// Gets if this CMIS object is the latest major version (CMIS property <c>cmis:isLatestMajorVersion</c>).
+ /// </summary>
bool? IsLatestMajorVersion { get; }
+
+ /// <summary>
+ /// Gets the version label (CMIS property <c>cmis:versionLabel</c>).
+ /// </summary>
string VersionLabel { get; }
+
+ /// <summary>
+ /// Gets the version series id (CMIS property <c>cmis:versionSeriesId</c>).
+ /// </summary>
string VersionSeriesId { get; }
+
+ /// <summary>
+ /// Gets if this version series is checked out (CMIS property <c>cmis:isVersionSeriesCheckedOut</c>).
+ /// </summary>
bool? IsVersionSeriesCheckedOut { get; }
+
+ /// <summary>
+ /// Gets the user who checked out this version series (CMIS property <c>cmis:versionSeriesCheckedOutBy</c>).
+ /// </summary>
string VersionSeriesCheckedOutBy { get; }
+
+ /// <summary>
+ /// Gets the PWC id of this version series (CMIS property <c>cmis:versionSeriesCheckedOutId</c>).
+ /// </summary>
string VersionSeriesCheckedOutId { get; }
+
+ /// <summary>
+ /// Gets the checkin comment (CMIS property <c>cmis:checkinComment</c>).
+ /// </summary>
string CheckinComment { get; }
+
+ /// <summary>
+ /// Gets the content stream length or <c>null</c> if the document has no content (CMIS property <c>cmis:contentStreamLength</c>).
+ /// </summary>
long? ContentStreamLength { get; }
+
+ /// <summary>
+ /// Gets the content stream MIME type or <c>null</c> if the document has no content (CMIS property <c>cmis:contentStreamMimeType</c>).
+ /// </summary>
string ContentStreamMimeType { get; }
+
+ /// <summary>
+ /// Gets the content stream filename or <c>null</c> if the document has no content (CMIS property <c>cmis:contentStreamFileName</c>).
+ /// </summary>
string ContentStreamFileName { get; }
+
+ /// <summary>
+ /// Gets the content stream id or <c>null</c> if the document has no content (CMIS property <c>cmis:contentStreamId</c>).
+ /// </summary>
string ContentStreamId { get; }
}
@@ -611,22 +801,102 @@
/// </summary>
public interface IDocument : IFileableCmisObject, IDocumentProperties
{
+ /// <summary>
+ /// Deletes all versions of this document.
+ /// </summary>
void DeleteAllVersions();
+
+ /// <summary>
+ /// Gets the content stream of this document.
+ /// </summary>
+ /// <returns>the content stream or <c>null</c> if the document has no content</returns>
IContentStream GetContentStream();
+
+ /// <summary>
+ /// Gets the content stream identified by the given stream id.
+ /// </summary>
+ /// <returns>the content stream or <c>null</c> if the stream id is not associated with content</returns>
IContentStream GetContentStream(string streamId);
+
+ /// <summary>
+ /// Sets a new content stream for this document.
+ /// </summary>
+ /// <param name="contentStream">the content stream</param>
+ /// <param name="overwrite">indicates if the current stream should be overwritten</param>
+ /// <returns>the new document object</returns>
+ /// <remarks>
+ /// Repositories might create a new version if the content is updated.
+ /// </remarks>
IDocument SetContentStream(IContentStream contentStream, bool overwrite);
+
+ /// <summary>
+ /// Sets a new content stream for this document.
+ /// </summary>
+ /// <param name="contentStream">the content stream</param>
+ /// <param name="overwrite">indicates if the current stream should be overwritten</param>
+ /// <param name="refresh">indicates if this object should be refreshed after the new content is set</param>
+ /// <returns>the new document object id</returns>
+ /// <remarks>
+ /// Repositories might create a new version if the content is updated.
+ /// </remarks>
IObjectId SetContentStream(IContentStream contentStream, bool overwrite, bool refresh);
+
+ /// <summary>
+ /// Deletes the current content stream for this document.
+ /// </summary>
+ /// <returns>the new document object</returns>
+ /// <remarks>
+ /// Repositories might create a new version if the content is deleted.
+ /// </remarks>
IDocument DeleteContentStream();
+
+ /// <summary>
+ /// Deletes the current content stream for this document.
+ /// </summary>
+ /// <param name="refresh">indicates if this object should be refreshed after the content is deleted</param>
+ /// <returns>the new document object id</returns>
+ /// <remarks>
+ /// Repositories might create a new version if the content is deleted.
+ /// </remarks>
IObjectId DeleteContentStream(bool refresh);
+
+ /// <summary>
+ /// Checks out this document.
+ /// </summary>
+ /// <returns>the object id of the newly created private working copy (PWC).</returns>
IObjectId CheckOut();
+
+ /// <summary>
+ /// Cancels the check out.
+ /// </summary>
void CancelCheckOut();
+
+ /// <summary>
+ /// Checks in this private working copy (PWC).
+ /// </summary>
+ /// <returns>the object id of the new created document</returns>
IObjectId CheckIn(bool major, IDictionary<string, object> properties, IContentStream contentStream, string checkinComment,
IList<IPolicy> policies, IList<IAce> addAces, IList<IAce> removeAces);
+
+ /// <summary>
+ /// Checks in this private working copy (PWC).
+ /// </summary>
+ /// <returns>the object id of the new created document</returns>
IObjectId CheckIn(bool major, IDictionary<string, object> properties, IContentStream contentStream, string checkinComment);
+
IDocument GetObjectOfLatestVersion(bool major);
IDocument GetObjectOfLatestVersion(bool major, IOperationContext context);
+
+ /// <summary>
+ /// Gets a list of all versions in this version series.
+ /// </summary>
IList<IDocument> GetAllVersions();
+
+ /// <summary>
+ /// Gets a list of all versions in this version series using the given <see cref="DotCMIS.Client.IOperationContext"/>.
+ /// </summary>
IList<IDocument> GetAllVersions(IOperationContext context);
+
IDocument Copy(IObjectId targetFolderId);
IDocument Copy(IObjectId targetFolderId, IDictionary<string, object> properties, VersioningState? versioningState,
IList<IPolicy> policies, IList<IAce> addACEs, IList<IAce> removeACEs, IOperationContext context);
@@ -658,15 +928,82 @@
IOperationContext context);
IPolicy CreatePolicy(IDictionary<string, object> properties);
IList<string> DeleteTree(bool allversions, UnfileObject? unfile, bool continueOnFailure);
+
+ /// <summary>
+ /// Gets the folder tress of this folder (only folder).
+ /// </summary>
+ /// <param name="depth">the depth</param>
+ /// <returns>a list of folder trees</returns>
+ /// <remarks>
+ /// If depth == 1 only objects that are children of this folder are returned.
+ /// If depth > 1 only objects that are children of this folder and descendants up to "depth" levels deep are returned.
+ /// If depth == -1 all descendant objects at all depth levels in the CMIS hierarchy are returned.
+ /// </remarks>
IList<ITree<IFileableCmisObject>> GetFolderTree(int depth);
+
+ /// <summary>
+ /// Gets the folder tress of this folder (only folder) using the given <see cref="DotCMIS.Client.IOperationContext"/>.
+ /// </summary>
+ /// <param name="depth">the depth</param>
+ /// <param name="context">the <see cref="DotCMIS.Client.IOperationContext"/></param>
+ /// <returns>a list of folder trees</returns>
+ /// <remarks>
+ /// If depth == 1 only objects that are children of this folder are returned.
+ /// If depth > 1 only objects that are children of this folder and descendants up to "depth" levels deep are returned.
+ /// If depth == -1 all descendant objects at all depth levels in the CMIS hierarchy are returned.
+ /// </remarks>
IList<ITree<IFileableCmisObject>> GetFolderTree(int depth, IOperationContext context);
+
+ /// <summary>
+ /// Gets the descendants of this folder (all filable objects).
+ /// </summary>
+ /// <param name="depth">the depth</param>
+ /// <returns>a list of descendant trees</returns>
+ /// <remarks>
+ /// If depth == 1 only objects that are children of this folder are returned.
+ /// If depth > 1 only objects that are children of this folder and descendants up to "depth" levels deep are returned.
+ /// If depth == -1 all descendant objects at all depth levels in the CMIS hierarchy are returned.
+ /// </remarks>
IList<ITree<IFileableCmisObject>> GetDescendants(int depth);
+
+ /// <summary>
+ /// Gets the descendants of this folder (all filable objects) using the given <see cref="DotCMIS.Client.IOperationContext"/>.
+ /// </summary>
+ /// <param name="depth">the depth</param>
+ /// <param name="context">the <see cref="DotCMIS.Client.IOperationContext"/></param>
+ /// <returns>a list of descendant trees</returns>
+ /// <remarks>
+ /// If depth == 1 only objects that are children of this folder are returned.
+ /// If depth > 1 only objects that are children of this folder and descendants up to "depth" levels deep are returned.
+ /// If depth == -1 all descendant objects at all depth levels in the CMIS hierarchy are returned.
+ /// </remarks>
IList<ITree<IFileableCmisObject>> GetDescendants(int depth, IOperationContext context);
+
+ /// <summary>
+ /// Gets the children of this folder.
+ /// </summary>
IItemEnumerable<ICmisObject> GetChildren();
+
+ /// <summary>
+ /// Gets the children of this folder ussing the given <see cref="DotCMIS.Client.IOperationContext"/>.
+ /// </summary>
IItemEnumerable<ICmisObject> GetChildren(IOperationContext context);
+
+ /// <summary>
+ /// Gets if this folder is the root folder.
+ /// </summary>
bool IsRootFolder { get; }
+
+ /// <summary>
+ /// Gets the parent of this folder or <c>null</c> if this folder is the root folder.
+ /// </summary>
IFolder FolderParent { get; }
+
+ /// <summary>
+ /// Gets the path of this folder.
+ /// </summary>
string Path { get; }
+
IItemEnumerable<IDocument> GetCheckedOutDocs();
IItemEnumerable<IDocument> GetCheckedOutDocs(IOperationContext context);
}
@@ -676,6 +1013,9 @@
/// </summary>
public interface IPolicyProperties
{
+ /// <summary>
+ /// Gets the policy text of this CMIS policy (CMIS property <c>cmis:policyText</c>).
+ /// </summary>
string PolicyText { get; }
}
@@ -691,7 +1031,14 @@
/// </summary>
public interface IRelationshipProperties
{
+ /// <summary>
+ /// Gets the id of the relationship source object.
+ /// </summary>
IObjectId SourceId { get; }
+
+ /// <summary>
+ /// Gets the id of the relationships target object.
+ /// </summary>
IObjectId TargetId { get; }
}
@@ -700,9 +1047,36 @@
/// </summary>
public interface IRelationship : ICmisObject, IRelationshipProperties
{
+ /// <summary>
+ /// Gets the relationship source object.
+ /// </summary>
+ /// <remarks>
+ /// If the source object id is invalid, <c>null</c> will be returned.
+ /// </remarks>
ICmisObject GetSource();
+
+ /// <summary>
+ /// Gets the relationship source object using the given <see cref="DotCMIS.Client.IOperationContext"/>.
+ /// </summary>
+ /// <remarks>
+ /// If the source object id is invalid, <c>null</c> will be returned.
+ /// </remarks>
ICmisObject GetSource(IOperationContext context);
+
+ /// <summary>
+ /// Gets the relationship target object.
+ /// </summary>
+ /// <remarks>
+ /// If the target object id is invalid, <c>null</c> will be returned.
+ /// </remarks>
ICmisObject GetTarget();
+
+ /// <summary>
+ /// Gets the relationship target object using the given <see cref="DotCMIS.Client.IOperationContext"/>.
+ /// </summary>
+ /// <remarks>
+ /// If the target object id is invalid, <c>null</c> will be returned.
+ /// </remarks>
ICmisObject GetTarget(IOperationContext context);
}
@@ -711,15 +1085,61 @@
/// </summary>
public interface IQueryResult
{
+ /// <summary>
+ /// Gets the property.
+ /// </summary>
+ /// <param name="queryName">the propertys query name or alias</param>
IPropertyData this[string queryName] { get; }
+
+ /// <summary>
+ /// Gets a list of all properties in this query result.
+ /// </summary>
IList<IPropertyData> Properties { get; }
+
+ /// <summary>
+ /// Returns a property by id.
+ /// </summary>
+ /// <param name="propertyId">the property id</param>
+ /// <remarks>
+ /// Since repositories are not obligated to add property ids to their
+ /// query result properties, this method might not always work as expected with
+ /// some repositories. Use <see cref="this[string]"/> instead.
+ /// </remarks>
IPropertyData GetPropertyById(string propertyId);
+
+ /// <summary>
+ /// Gets the property (single) value by query name or alias.
+ /// </summary>
object GetPropertyValueByQueryName(string queryName);
+
+ /// <summary>
+ /// Gets the property (single) value by property id.
+ /// </summary>
object GetPropertyValueById(string propertyId);
+
+ /// <summary>
+ /// Gets the property value by query name or alias.
+ /// </summary>
IList<object> GetPropertyMultivalueByQueryName(string queryName);
+
+ /// <summary>
+ /// Gets the property value by property id.
+ /// </summary>
IList<object> GetPropertyMultivalueById(string propertyId);
+
+ /// <summary>
+ /// Gets the allowable actions if they were requested.
+ /// </summary>
IAllowableActions AllowableActions { get; }
+
+ /// <summary>
+ /// Gets the relationships if they were requested.
+ /// </summary>
IList<IRelationship> Relationships { get; }
+
+ /// <summary>
+ /// Gets the renditions if they were requested.
+ /// </summary>
IList<IRendition> Renditions { get; }
}
diff --git a/DotCMISUnitTest/DotCMISUnitTest.csproj b/DotCMISUnitTest/DotCMISUnitTest.csproj
index e7d976c..5b4e2df 100644
--- a/DotCMISUnitTest/DotCMISUnitTest.csproj
+++ b/DotCMISUnitTest/DotCMISUnitTest.csproj
@@ -36,6 +36,7 @@
<HintPath>..\..\..\..\Program Files (x86)\NUnit 2.5.9\bin\net-2.0\framework\nunit.framework.dll</HintPath>
</Reference>
<Reference Include="System" />
+ <Reference Include="System.configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
@@ -57,6 +58,11 @@
<Name>DotCMIS</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup>
+ <None Include="app.config">
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
diff --git a/DotCMISUnitTest/SmokeTest.cs b/DotCMISUnitTest/SmokeTest.cs
index ebc4624..fb9758c 100644
--- a/DotCMISUnitTest/SmokeTest.cs
+++ b/DotCMISUnitTest/SmokeTest.cs
@@ -196,7 +196,9 @@
// check doc
Assert.NotNull(doc);
Assert.NotNull(doc.Id);
-
+ Assert.AreEqual(properties[PropertyIds.Name], doc.Name);
+ Assert.AreEqual(BaseTypeId.CmisDocument, doc.BaseTypeId);
+
// check versions
IList<IDocument> versions = doc.GetAllVersions();
Assert.NotNull(versions);
@@ -232,6 +234,8 @@
// check folder
Assert.NotNull(folder);
Assert.NotNull(folder.Id);
+ Assert.AreEqual(properties[PropertyIds.Name], folder.Name);
+ Assert.AreEqual(BaseTypeId.CmisFolder, folder.BaseTypeId);
// check children
foreach (ICmisObject cmisObject in folder.GetChildren())
diff --git a/DotCMISUnitTest/TestFramework.cs b/DotCMISUnitTest/TestFramework.cs
index 2095095..50995c9 100644
--- a/DotCMISUnitTest/TestFramework.cs
+++ b/DotCMISUnitTest/TestFramework.cs
@@ -17,6 +17,7 @@
* under the License.
*/
using System.Collections.Generic;
+using System.Configuration;
using System.IO;
using System.Net;
using System.Text;
@@ -63,14 +64,43 @@
DefaultDocumentType = "cmis:document";
DefaultFolderType = "cmis:folder";
- Session = ConnectAtomPub();
+ Session = ConnectFromConfig();
+ }
+
+ public ISession ConnectFromConfig()
+ {
+ Dictionary<string, string> parameters = new Dictionary<string, string>();
+
+ foreach (string key in ConfigurationManager.AppSettings.AllKeys)
+ {
+ parameters[key] = ConfigurationManager.AppSettings.Get(key);
+ }
+
+ SessionFactory factory = SessionFactory.NewInstance();
+
+ ISession session = null;
+ if (parameters.ContainsKey(SessionParameter.RepositoryId))
+ {
+ session = factory.CreateSession(parameters);
+ }
+ else
+ {
+ session = factory.GetRepositories(parameters)[0].CreateSession();
+ }
+
+ Assert.NotNull(session);
+ Assert.NotNull(session.Binding);
+ Assert.NotNull(session.RepositoryInfo);
+ Assert.NotNull(session.RepositoryInfo.Id);
+
+ return session;
}
public ISession ConnectAtomPub()
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
- string baseUrlAtom = "http://localhost:8080/alfresco/service/cmis";
+ string baseUrlAtom = "http://localhost:8080/alfresco/cmisatom";
parameters[SessionParameter.BindingType] = BindingType.AtomPub;
parameters[SessionParameter.AtomPubUrl] = baseUrlAtom;
@@ -92,7 +122,7 @@
{
Dictionary<string, string> parameters = new Dictionary<string, string>();
- string baseUrlWS = "http://localhost:8080/alfresco/cmis";
+ string baseUrlWS = "https://localhost:8443/alfresco/cmisws";
parameters[SessionParameter.BindingType] = BindingType.WebServices;
parameters[SessionParameter.WebServicesRepositoryService] = baseUrlWS + "/RepositoryService?wsdl";
@@ -132,7 +162,7 @@
public IObjectData CreateDocument(string folderId, string name, string content)
{
- Properties properties = new Properties();
+ DotCMIS.Data.Impl.Properties properties = new DotCMIS.Data.Impl.Properties();
PropertyData objectTypeIdProperty = new PropertyData(PropertyType.Id);
objectTypeIdProperty.Id = PropertyIds.ObjectTypeId;
@@ -185,7 +215,7 @@
public IObjectData CreateFolder(string folderId, string name)
{
- Properties properties = new Properties();
+ DotCMIS.Data.Impl.Properties properties = new DotCMIS.Data.Impl.Properties();
PropertyData objectTypeIdProperty = new PropertyData(PropertyType.Id);
objectTypeIdProperty.Id = PropertyIds.ObjectTypeId;
diff --git a/DotCMISUnitTest/app.config b/DotCMISUnitTest/app.config
new file mode 100644
index 0000000..de735fa
--- /dev/null
+++ b/DotCMISUnitTest/app.config
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<configuration>
+ <appSettings>
+ <add key="org.apache.chemistry.dotcmis.binding.spi.type" value="atompub" />
+ <add key="org.apache.chemistry.dotcmis.binding.atompub.url" value="http://localhost:8080/alfresco/cmisatom" />
+
+ <!--
+ <add key="org.apache.chemistry.dotcmis.binding.spi.type" value="webservices" />
+ <add key="org.apache.chemistry.dotcmis.binding.webservices.RepositoryService" value="https://localhost:8443/alfresco/cmisws/RepositoryService?wsdl" />
+ <add key="org.apache.chemistry.dotcmis.binding.webservices.NavigationService" value="https://localhost:8443/alfresco/cmisws/NavigationService?wsdl" />
+ <add key="org.apache.chemistry.dotcmis.binding.webservices.ObjectService" value="https://localhost:8443/alfresco/cmisws/ObjectService?wsdl" />
+ <add key="org.apache.chemistry.dotcmis.binding.webservices.VersioningService" value="https://localhost:8443/alfresco/cmisws/VersioningService?wsdl" />
+ <add key="org.apache.chemistry.dotcmis.binding.webservices.DiscoveryService" value="https://localhost:8443/alfresco/cmisws/DiscoveryService?wsdl" />
+ <add key="org.apache.chemistry.dotcmis.binding.webservices.RelationshipService" value="https://localhost:8443/alfresco/cmisws/RelationshipService?wsdl" />
+ <add key="org.apache.chemistry.dotcmis.binding.webservices.MultiFilingService" value="https://localhost:8443/alfresco/cmisws/MultiFilingService?wsdl" />
+ <add key="org.apache.chemistry.dotcmis.binding.webservices.PolicyService" value="https://localhost:8443/alfresco/cmisws/PolicyService?wsdl" />
+ <add key="org.apache.chemistry.dotcmis.binding.webservices.ACLService" value="https://localhost:8443/alfresco/cmisws/ACLService?wsdl" />
+ -->
+
+ <add key="org.apache.chemistry.dotcmis.user" value="admin" />
+ <add key="org.apache.chemistry.dotcmis.password" value="admin" />
+ </appSettings>
+</configuration>
\ No newline at end of file