Author: fmui
Date: Mon Jul 20 08:48:57 2015
New Revision: 1691890
URL: http://svn.apache.org/r1691890
Log:
initial PortCMIS source code
Added:
chemistry/portcmis/DEPENDENCIES
chemistry/portcmis/LICENSE
chemistry/portcmis/NOTICE
chemistry/portcmis/PortCMIS/
chemistry/portcmis/PortCMIS.sln
chemistry/portcmis/PortCMIS/PortCMIS.csproj
chemistry/portcmis/PortCMIS/PortCMIS.nuspec
chemistry/portcmis/PortCMIS/PortCMIS.shfbproj
chemistry/portcmis/PortCMIS/Properties/
chemistry/portcmis/PortCMIS/Properties/AssemblyInfo.cs
chemistry/portcmis/PortCMIS/binding/
chemistry/portcmis/PortCMIS/binding/BindingCaches.cs
chemistry/portcmis/PortCMIS/binding/BindingImpl.cs
chemistry/portcmis/PortCMIS/binding/BindingIntf.cs
chemistry/portcmis/PortCMIS/binding/BindingsConstants.cs
chemistry/portcmis/PortCMIS/binding/DateTimeHelper.cs
chemistry/portcmis/PortCMIS/binding/Http.cs
chemistry/portcmis/PortCMIS/binding/HttpPortable.cs
chemistry/portcmis/PortCMIS/binding/IOUtils.cs
chemistry/portcmis/PortCMIS/binding/Services.cs
chemistry/portcmis/PortCMIS/binding/Url.cs
chemistry/portcmis/PortCMIS/binding/atompub/
chemistry/portcmis/PortCMIS/binding/atompub/XmlConstants.cs
chemistry/portcmis/PortCMIS/binding/atompub/XmlConverter.cs
chemistry/portcmis/PortCMIS/binding/atompub/XmlUtils.cs
chemistry/portcmis/PortCMIS/binding/atompub/XmlWalker.cs
chemistry/portcmis/PortCMIS/binding/browser/
chemistry/portcmis/PortCMIS/binding/browser/BrowserBinding.cs
chemistry/portcmis/PortCMIS/binding/browser/BrowserConstants.cs
chemistry/portcmis/PortCMIS/binding/browser/BrowserConverter.cs
chemistry/portcmis/PortCMIS/binding/browser/BrowserUtils.cs
chemistry/portcmis/PortCMIS/binding/browser/json/
chemistry/portcmis/PortCMIS/binding/browser/json/Json.cs
chemistry/portcmis/PortCMIS/build.bat
chemistry/portcmis/PortCMIS/client/
chemistry/portcmis/PortCMIS/client/ClientCaches.cs
chemistry/portcmis/PortCMIS/client/ClientImpl.cs
chemistry/portcmis/PortCMIS/client/ClientIntf.cs
chemistry/portcmis/PortCMIS/client/ClientObjectFactory.cs
chemistry/portcmis/PortCMIS/client/ClientObjects.cs
chemistry/portcmis/PortCMIS/client/ClientTypes.cs
chemistry/portcmis/PortCMIS/client/ClientUtils.cs
chemistry/portcmis/PortCMIS/client/SessionParameter.cs
chemistry/portcmis/PortCMIS/client/SessionParameterDefaults.cs
chemistry/portcmis/PortCMIS/const/
chemistry/portcmis/PortCMIS/const/BasicPermissions.cs
chemistry/portcmis/PortCMIS/const/BindingType.cs
chemistry/portcmis/PortCMIS/const/ExtensionFeatures.cs
chemistry/portcmis/PortCMIS/const/PermissionMappingKeys.cs
chemistry/portcmis/PortCMIS/const/PropertyIds.cs
chemistry/portcmis/PortCMIS/data/
chemistry/portcmis/PortCMIS/data/DataImpl.cs
chemistry/portcmis/PortCMIS/data/DataIntf.cs
chemistry/portcmis/PortCMIS/data/Extensions.cs
chemistry/portcmis/PortCMIS/enum/
chemistry/portcmis/PortCMIS/enum/Enums.cs
chemistry/portcmis/PortCMIS/exceptions/
chemistry/portcmis/PortCMIS/exceptions/Exceptions.cs
chemistry/portcmis/PortCMIS/portcmis.snk (with props)
chemistry/portcmis/PortCMIS/utils/
chemistry/portcmis/PortCMIS/utils/Cache.cs
chemistry/portcmis/PortCMIS/utils/Logger.cs
chemistry/portcmis/PortCMISTests/
chemistry/portcmis/PortCMISTests/ContentStreamTest.cs
chemistry/portcmis/PortCMISTests/JsonTest.cs
chemistry/portcmis/PortCMISTests/PortCMISTests.csproj
chemistry/portcmis/PortCMISTests/Properties/
chemistry/portcmis/PortCMISTests/Properties/AssemblyInfo.cs
chemistry/portcmis/PortCMISTests/QueryStatementTest.cs
chemistry/portcmis/PortCMISTests/SimpleCmisTest.cs
chemistry/portcmis/PortCMISTests/framework/
chemistry/portcmis/PortCMISTests/framework/DefaultTestValues.cs
chemistry/portcmis/PortCMISTests/framework/TestFramework.cs
chemistry/portcmis/PortCMISWin/
chemistry/portcmis/PortCMISWin/PortCMISWin.csproj
chemistry/portcmis/PortCMISWin/PortCMISWin.nuspec
chemistry/portcmis/PortCMISWin/Properties/
chemistry/portcmis/PortCMISWin/Properties/AssemblyInfo.cs
chemistry/portcmis/PortCMISWin/binding/
chemistry/portcmis/PortCMISWin/binding/WindowsBindingIntf.cs
chemistry/portcmis/PortCMISWin/binding/WindowsHttp.cs
chemistry/portcmis/PortCMISWin/build.bat
chemistry/portcmis/PortCMISWin/client/
chemistry/portcmis/PortCMISWin/client/ClientImpl.cs
chemistry/portcmis/README
chemistry/portcmis/release.bat
Added: chemistry/portcmis/DEPENDENCIES
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/DEPENDENCIES?rev=1691890&view=auto
==============================================================================
--- chemistry/portcmis/DEPENDENCIES (added)
+++ chemistry/portcmis/DEPENDENCIES Mon Jul 20 08:48:57 2015
@@ -0,0 +1 @@
+Apache Chemistry PortCMIS requires the .NET Framework 4.5 or higher.
Added: chemistry/portcmis/LICENSE
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/LICENSE?rev=1691890&view=auto
==============================================================================
--- chemistry/portcmis/LICENSE (added)
+++ chemistry/portcmis/LICENSE Mon Jul 20 08:48:57 2015
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
Added: chemistry/portcmis/NOTICE
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/NOTICE?rev=1691890&view=auto
==============================================================================
--- chemistry/portcmis/NOTICE (added)
+++ chemistry/portcmis/NOTICE Mon Jul 20 08:48:57 2015
@@ -0,0 +1,2 @@
+Apache Chemistry PortCMIS
+Copyright 2015 The Apache Software Foundation
\ No newline at end of file
Added: chemistry/portcmis/PortCMIS.sln
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/PortCMIS.sln?rev=1691890&view=auto
==============================================================================
--- chemistry/portcmis/PortCMIS.sln (added)
+++ chemistry/portcmis/PortCMIS.sln Mon Jul 20 08:48:57 2015
@@ -0,0 +1,72 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 2013
+VisualStudioVersion = 12.0.31101.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PortCMIS",
"PortCMIS\PortCMIS.csproj", "{A3AB61BE-057D-4DD4-824C-AC174322C5D2}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PortCMISTests",
"PortCMISTests\PortCMISTests.csproj", "{217BE2A3-7F09-49DD-B69C-7D900AAC15F1}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PortCMISWin",
"PortCMISWin\PortCMISWin.csproj", "{C9C05283-55A0-4F84-9476-E0E438927A08}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|ARM = Debug|ARM
+ Debug|Mixed Platforms = Debug|Mixed Platforms
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|ARM = Release|ARM
+ Release|Mixed Platforms = Release|Mixed Platforms
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Debug|Any CPU.ActiveCfg
= Debug|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Debug|Any CPU.Build.0 =
Debug|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Debug|ARM.ActiveCfg =
Debug|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Debug|Mixed
Platforms.ActiveCfg = Debug|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Debug|Mixed
Platforms.Build.0 = Debug|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Debug|x64.ActiveCfg =
Debug|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Debug|x86.ActiveCfg =
Debug|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Release|Any
CPU.ActiveCfg = Release|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Release|Any CPU.Build.0
= Release|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Release|ARM.ActiveCfg =
Release|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Release|Mixed
Platforms.ActiveCfg = Release|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Release|Mixed
Platforms.Build.0 = Release|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Release|x64.ActiveCfg =
Release|Any CPU
+ {A3AB61BE-057D-4DD4-824C-AC174322C5D2}.Release|x86.ActiveCfg =
Release|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Debug|Any CPU.ActiveCfg
= Debug|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Debug|Any CPU.Build.0 =
Debug|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Debug|ARM.ActiveCfg =
Debug|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Debug|Mixed
Platforms.ActiveCfg = Debug|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Debug|Mixed
Platforms.Build.0 = Debug|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Debug|x64.ActiveCfg =
Debug|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Debug|x86.ActiveCfg =
Debug|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Release|Any
CPU.ActiveCfg = Release|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Release|Any CPU.Build.0
= Release|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Release|ARM.ActiveCfg =
Release|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Release|Mixed
Platforms.ActiveCfg = Release|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Release|Mixed
Platforms.Build.0 = Release|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Release|x64.ActiveCfg =
Release|Any CPU
+ {217BE2A3-7F09-49DD-B69C-7D900AAC15F1}.Release|x86.ActiveCfg =
Release|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Debug|Any CPU.ActiveCfg
= Debug|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Debug|Any CPU.Build.0 =
Debug|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Debug|ARM.ActiveCfg =
Debug|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Debug|Mixed
Platforms.ActiveCfg = Debug|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Debug|Mixed
Platforms.Build.0 = Debug|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Debug|x64.ActiveCfg =
Debug|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Debug|x86.ActiveCfg =
Debug|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Release|Any
CPU.ActiveCfg = Release|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Release|Any CPU.Build.0
= Release|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Release|ARM.ActiveCfg =
Release|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Release|Mixed
Platforms.ActiveCfg = Release|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Release|Mixed
Platforms.Build.0 = Release|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Release|x64.ActiveCfg =
Release|Any CPU
+ {C9C05283-55A0-4F84-9476-E0E438927A08}.Release|x86.ActiveCfg =
Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
Added: chemistry/portcmis/PortCMIS/PortCMIS.csproj
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/PortCMIS/PortCMIS.csproj?rev=1691890&view=auto
==============================================================================
--- chemistry/portcmis/PortCMIS/PortCMIS.csproj (added)
+++ chemistry/portcmis/PortCMIS/PortCMIS.csproj Mon Jul 20 08:48:57 2015
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import
Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
+ <PropertyGroup>
+ <MinimumVisualStudioVersion>11.0</MinimumVisualStudioVersion>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{A3AB61BE-057D-4DD4-824C-AC174322C5D2}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>PortCMIS</RootNamespace>
+ <AssemblyName>PortCMIS</AssemblyName>
+ <DefaultLanguage>en-US</DefaultLanguage>
+ <FileAlignment>512</FileAlignment>
+
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <TargetFrameworkProfile>Profile111</TargetFrameworkProfile>
+ <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU'
">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DocumentationFile>
+ </DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' ==
'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ <DocumentationFile>bin\Release\PortCMIS.XML</DocumentationFile>
+ </PropertyGroup>
+ <PropertyGroup>
+ <SignAssembly>true</SignAssembly>
+ </PropertyGroup>
+ <PropertyGroup>
+ <AssemblyOriginatorKeyFile>portcmis.snk</AssemblyOriginatorKeyFile>
+ </PropertyGroup>
+ <ItemGroup>
+ <Compile Include="binding\atompub\XmlConstants.cs" />
+ <Compile Include="binding\atompub\XmlConverter.cs" />
+ <Compile Include="binding\atompub\XmlUtils.cs" />
+ <Compile Include="binding\atompub\XmlWalker.cs" />
+ <Compile Include="binding\BindingCaches.cs" />
+ <Compile Include="binding\BindingImpl.cs" />
+ <Compile Include="binding\BindingIntf.cs" />
+ <Compile Include="binding\BindingsConstants.cs" />
+ <Compile Include="binding\browser\BrowserBinding.cs" />
+ <Compile Include="binding\browser\BrowserConstants.cs" />
+ <Compile Include="binding\browser\BrowserConverter.cs" />
+ <Compile Include="binding\browser\BrowserUtils.cs" />
+ <Compile Include="binding\browser\json\Json.cs" />
+ <Compile Include="binding\DateTimeHelper.cs" />
+ <Compile Include="binding\HttpPortable.cs" />
+ <Compile Include="binding\Http.cs" />
+ <Compile Include="binding\IOUtils.cs" />
+ <Compile Include="binding\Services.cs" />
+ <Compile Include="binding\Url.cs" />
+ <Compile Include="client\ClientCaches.cs" />
+ <Compile Include="client\ClientImpl.cs" />
+ <Compile Include="client\ClientIntf.cs" />
+ <Compile Include="client\ClientObjectFactory.cs" />
+ <Compile Include="client\ClientObjects.cs" />
+ <Compile Include="client\ClientTypes.cs" />
+ <Compile Include="client\ClientUtils.cs" />
+ <Compile Include="const\BasicPermissions.cs" />
+ <Compile Include="const\BindingType.cs" />
+ <Compile Include="const\ExtensionFeatures.cs" />
+ <Compile Include="const\PermissionMappingKeys.cs" />
+ <Compile Include="client\SessionParameterDefaults.cs" />
+ <Compile Include="data\DataImpl.cs" />
+ <Compile Include="data\DataIntf.cs" />
+ <Compile Include="data\Extensions.cs" />
+ <Compile Include="enum\Enums.cs" />
+ <Compile Include="exceptions\Exceptions.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ <Compile Include="const\PropertyIds.cs" />
+ <Compile Include="client\SessionParameter.cs" />
+ <Compile Include="utils\Cache.cs" />
+ <Compile Include="utils\Logger.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="portcmis.snk" />
+ </ItemGroup>
+ <Import
Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.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.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
\ No newline at end of file
Added: chemistry/portcmis/PortCMIS/PortCMIS.nuspec
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/PortCMIS/PortCMIS.nuspec?rev=1691890&view=auto
==============================================================================
--- chemistry/portcmis/PortCMIS/PortCMIS.nuspec (added)
+++ chemistry/portcmis/PortCMIS/PortCMIS.nuspec Mon Jul 20 08:48:57 2015
@@ -0,0 +1,16 @@
+<?xml version="1.0"?>
+<package >
+ <metadata>
+ <id>$id$</id>
+ <version>$version$</version>
+ <title>$title$</title>
+ <authors>$author$</authors>
+ <owners>$author$</owners>
+ <licenseUrl>https://www.apache.org/licenses/LICENSE-2.0.html</licenseUrl>
+ <requireLicenseAcceptance>false</requireLicenseAcceptance>
+ <description>$description$</description>
+ <releaseNotes>Initial release.</releaseNotes>
+ <copyright>Copyright 2015</copyright>
+ <tags>CMIS</tags>
+ </metadata>
+</package>
\ No newline at end of file
Added: chemistry/portcmis/PortCMIS/PortCMIS.shfbproj
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/PortCMIS/PortCMIS.shfbproj?rev=1691890&view=auto
==============================================================================
--- chemistry/portcmis/PortCMIS/PortCMIS.shfbproj (added)
+++ chemistry/portcmis/PortCMIS/PortCMIS.shfbproj Mon Jul 20 08:48:57 2015
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
+ <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>{619c0f41-be9f-46ae-a497-b8cc9d998ad6}</ProjectGuid>
+ <SHFBSchemaVersion>1.9.9.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 -->
+ <FrameworkVersion>.NET Portable Library 4.5</FrameworkVersion>
+ <OutputPath>doc\</OutputPath>
+ <HtmlHelpName>PortCMIS</HtmlHelpName>
+ <Language>en-US</Language>
+ <BuildAssemblerVerbosity>OnlyWarningsAndErrors</BuildAssemblerVerbosity>
+ <HelpFileFormat>HtmlHelp1</HelpFileFormat>
+ <IndentHtml>False</IndentHtml>
+ <KeepLogFile>True</KeepLogFile>
+ <DisableCodeBlockComponent>False</DisableCodeBlockComponent>
+ <CppCommentsFixup>False</CppCommentsFixup>
+ <CleanIntermediates>True</CleanIntermediates>
+ <MaximumGroupParts>2</MaximumGroupParts>
+ <NamespaceGrouping>False</NamespaceGrouping>
+ <SyntaxFilters>C#</SyntaxFilters>
+ <SdkLinkTarget>Blank</SdkLinkTarget>
+ <RootNamespaceContainer>False</RootNamespaceContainer>
+ <PresentationStyle>VS2013</PresentationStyle>
+ <Preliminary>False</Preliminary>
+ <NamingMethod>Guid</NamingMethod>
+ <HelpTitle>Apache Chemistry PortCMIS</HelpTitle>
+ <FeedbackEMailLinkText>Apache Chemistry developer mailing
list</FeedbackEMailLinkText>
+ <FeedbackEMailAddress>dev%40chemistry.apache.org</FeedbackEMailAddress>
+ <CopyrightText>Apache Software Foundation</CopyrightText>
+ <CopyrightHref>http://www.apache.org</CopyrightHref>
+ <ContentPlacement>AboveNamespaces</ContentPlacement>
+ <ComponentConfigurations>
+ <ComponentConfig id="API Token Resolution" enabled="True">
+ <component id="API Token Resolution">{@TokenFiles}
+<replace elements="/*//token" item="string(.)" /></component>
+ </ComponentConfig>
+ <ComponentConfig id="IntelliSense Component" enabled="True">
+ <component id="IntelliSense Component">
+ <!-- Output options (optional)
+ Attributes:
+ Include namespaces (false by default)
+ Namespaces comments filename ("Namespaces" if not specified or empty)
+ Output folder (current folder if not specified or empty) -->
+ <output includeNamespaces="false" namespacesFile="Namespaces"
folder="{@OutputFolder}" />
+ </component>
+ </ComponentConfig>
+ <ComponentConfig id="Syntax Component" enabled="True">
+ <component id="Syntax Component">
+ <syntax input="/document/reference" output="/document/syntax"
renderReferenceLinks="false" />
+ <generators>
+ {@SyntaxFilters}
+</generators>
+ <containerElement name="codeSnippetGroup" addNoExampleTabs="true"
includeOnSingleSnippets="false" groupingEnabled="{@CodeSnippetGrouping}" />
+ <configurations>
+ <generator id="C#" />
+ <generator id="Visual Basic">
+ <includeLineContinuation value="false" />
+ </generator>
+ <generator id="Visual Basic Usage">
+ <includeLineContinuation value="false" />
+ </generator>
+ <generator id="Managed C++" />
+ <generator id="F#" />
+ <generator id="J#" />
+ <generator id="JScript" />
+ <generator id="JavaScript" />
+ <generator id="XAML Usage" />
+ <generator id="ASP.NET" />
+ </configurations>
+ </component>
+ </ComponentConfig>
+ <ComponentConfig id="Code Block Component" enabled="True">
+ <component id="Code Block Component">
+ <basePath value="{@HtmlEncProjectFolder}" />
+ <outputPaths>{@HelpFormatOutputPaths}</outputPaths>
+ <allowMissingSource value="false" />
+ <removeRegionMarkers value="false" />
+ <colorizer
syntaxFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.xml"
styleFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.xsl"
stylesheet="{@SHFBFolder}PresentationStyles\Colorizer\highlight.css"
scriptFile="{@SHFBFolder}PresentationStyles\Colorizer\highlight.js"
disabled="{@DisableCodeBlockComponent}" language="cs" tabSize="0"
numberLines="false" outlining="false" keepSeeTags="false" defaultTitle="true" />
+ </component>
+ </ComponentConfig>
+ </ComponentConfigurations>
+ <DocumentationSources>
+ <DocumentationSource sourceFile="PortCMIS.csproj" xmlns="" />
+ </DocumentationSources>
+ <MissingTags>AutoDocumentCtors, AutoDocumentDispose</MissingTags>
+ <ApiFilter>
+ <Filter entryType="Namespace" fullName="PortCMIS.Binding"
isExposed="False" xmlns="">
+ <Filter entryType="Class"
fullName="PortCMIS.Binding.AbstractAuthenticationProvider"
filterName="AbstractAuthenticationProvider" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Binding.IAuthenticationProvider"
filterName="IAuthenticationProvider" isExposed="True" />
+ <Filter entryType="Class"
fullName="PortCMIS.Binding.StandardAuthenticationProvider"
filterName="StandardAuthenticationProvider" isExposed="True" />
+ </Filter>
+ <Filter entryType="Namespace" fullName="PortCMIS.Binding.Browser"
isExposed="False" xmlns="" />
+ <Filter entryType="Namespace" fullName="PortCMIS.Binding.Browser.Json"
isExposed="False" xmlns="" />
+ <Filter entryType="Namespace" fullName="PortCMIS.Binding.Http"
isExposed="False" xmlns="" />
+ <Filter entryType="Namespace" fullName="PortCMIS.Client"
isExposed="True" xmlns="">
+ <Filter entryType="Class" fullName="PortCMIS.Client.CmisObjectCache"
filterName="CmisObjectCache" isExposed="False" />
+ <Filter entryType="Class" fullName="PortCMIS.Client.NoCache"
filterName="NoCache" isExposed="False" />
+ </Filter>
+ <Filter entryType="Namespace" fullName="PortCMIS.Client.Impl"
isExposed="False" xmlns="" />
+ <Filter entryType="Namespace" fullName="PortCMIS.Data" isExposed="False"
xmlns="">
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IAce"
filterName="IAce" isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IAcl"
filterName="IAcl" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IAclCapabilities" filterName="IAclCapabilities"
isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IAllowableActions" filterName="IAllowableActions"
isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IBulkUpdateObjectIdAndChangeToken"
filterName="IBulkUpdateObjectIdAndChangeToken" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IChangeEventInfo" filterName="IChangeEventInfo"
isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IChoice`1"
filterName="IChoice`1" isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IContentStream"
filterName="IContentStream" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.ICreatablePropertyTypes"
filterName="ICreatablePropertyTypes" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IDocumentTypeDefinition"
filterName="IDocumentTypeDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IExtensionFeature" filterName="IExtensionFeature"
isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IFailedToDeleteData" filterName="IFailedToDeleteData"
isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IFolderTypeDefinition"
filterName="IFolderTypeDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IItemTypeDefinition" filterName="IItemTypeDefinition"
isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.INewTypeSettableAttributes"
filterName="INewTypeSettableAttributes" isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IObjectData"
filterName="IObjectData" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IObjectInFolderContainer"
filterName="IObjectInFolderContainer" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IObjectInFolderData" filterName="IObjectInFolderData"
isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IObjectInFolderList" filterName="IObjectInFolderList"
isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IObjectList"
filterName="IObjectList" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IObjectParentData" filterName="IObjectParentData"
isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPartialContentStream"
filterName="IPartialContentStream" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPermissionDefinition"
filterName="IPermissionDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPermissionMapping" filterName="IPermissionMapping"
isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IPolicyIdList"
filterName="IPolicyIdList" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPolicyTypeDefinition"
filterName="IPolicyTypeDefinition" isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IPrincipal"
filterName="IPrincipal" isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IProperties"
filterName="IProperties" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPropertyBooleanDefinition"
filterName="IPropertyBooleanDefinition" isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IPropertyData"
filterName="IPropertyData" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPropertyDateTimeDefinition"
filterName="IPropertyDateTimeDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPropertyDecimalDefinition"
filterName="IPropertyDecimalDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPropertyDefinition" filterName="IPropertyDefinition"
isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPropertyHtmlDefinition"
filterName="IPropertyHtmlDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPropertyIdDefinition"
filterName="IPropertyIdDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPropertyIntegerDefinition"
filterName="IPropertyIntegerDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPropertyStringDefinition"
filterName="IPropertyStringDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IPropertyUriDefinition"
filterName="IPropertyUriDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IRelationshipTypeDefinition"
filterName="IRelationshipTypeDefinition" isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IRenditionData"
filterName="IRenditionData" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.IRepositoryCapabilities"
filterName="IRepositoryCapabilities" isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.IRepositoryInfo"
filterName="IRepositoryInfo" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.ISecondaryTypeDefinition"
filterName="ISecondaryTypeDefinition" isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.ITypeDefinition"
filterName="ITypeDefinition" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.ITypeDefinitionContainer"
filterName="ITypeDefinitionContainer" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.ITypeDefinitionList" filterName="ITypeDefinitionList"
isExposed="True" />
+ <Filter entryType="Interface" fullName="PortCMIS.Data.ITypeMutability"
filterName="ITypeMutability" isExposed="True" />
+ <Filter entryType="Class"
fullName="PortCMIS.Data.RepositoryCapabilities"
filterName="RepositoryCapabilities" isExposed="True" />
+ </Filter>
+ <Filter entryType="Namespace" fullName="PortCMIS.Data.Extensions"
isExposed="False" xmlns="">
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.Extensions.ICmisExtensionElement"
filterName="ICmisExtensionElement" isExposed="True" />
+ <Filter entryType="Interface"
fullName="PortCMIS.Data.Extensions.IExtensionsData"
filterName="IExtensionsData" isExposed="True" />
+ </Filter>
+ </ApiFilter>
+ <VisibleItems>InheritedMembers, InheritedFrameworkMembers, Protected,
ProtectedInternalAsProtected</VisibleItems>
+ </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
Added: chemistry/portcmis/PortCMIS/Properties/AssemblyInfo.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/PortCMIS/Properties/AssemblyInfo.cs?rev=1691890&view=auto
==============================================================================
--- chemistry/portcmis/PortCMIS/Properties/AssemblyInfo.cs (added)
+++ chemistry/portcmis/PortCMIS/Properties/AssemblyInfo.cs Mon Jul 20 08:48:57
2015
@@ -0,0 +1,30 @@
+using System.Resources;
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("PortCMIS")]
+[assembly: AssemblyDescription("CMIS Client Library for .Net")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Apache Software Foundation")]
+[assembly: AssemblyProduct("PortCMIS")]
+[assembly: AssemblyCopyright("")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+[assembly: NeutralResourcesLanguage("en")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision
Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("0.0.1.0")]
+[assembly: AssemblyFileVersion("0.0.1.0")]
Added: chemistry/portcmis/PortCMIS/binding/BindingCaches.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/PortCMIS/binding/BindingCaches.cs?rev=1691890&view=auto
==============================================================================
--- chemistry/portcmis/PortCMIS/binding/BindingCaches.cs (added)
+++ chemistry/portcmis/PortCMIS/binding/BindingCaches.cs Mon Jul 20 08:48:57
2015
@@ -0,0 +1,626 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* Kind, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+using PortCMIS.Client;
+using PortCMIS.Data;
+using PortCMIS.Utils;
+using System;
+using System.Collections.Generic;
+using System.Diagnostics;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PortCMIS.Binding
+{
+ // --- base cache implementation ---
+
+ internal interface IBindingCache
+ {
+ void Initialize(string[] cacheLevelConfig);
+ void Put(string[] keys, object value);
+ object Get(string[] keys);
+ void Remove(string[] keys);
+ int Check(string[] keys);
+ }
+
+ internal interface IBindingCacheLevel
+ {
+ void Initialize(IDictionary<string, string> cacheLevelConfig);
+ object this[string key] { get; set; }
+ void Remove(string key);
+ }
+
+ internal class Cache : IBindingCache
+ {
+ private IList<Type> cacheLevels;
+ private IList<IDictionary<string, string>> cacheLevelParameters;
+ private IBindingCacheLevel root;
+ private string name;
+ private object cacheLock = new object();
+
+ public Cache()
+ : this("Cache")
+ {
+ }
+
+ public Cache(string name)
+ {
+ this.name = name;
+ }
+
+ public void Initialize(string[] cacheLevelConfig)
+ {
+ lock (cacheLock)
+ {
+ if (cacheLevels != null)
+ {
+ throw new InvalidOperationException("Cache already
initialize!");
+ }
+
+ if (cacheLevelConfig == null || cacheLevelConfig.Length == 0)
+ {
+ throw new ArgumentException("Cache config must not be
empty!", "cacheLevelConfig");
+ }
+ cacheLevels = new List<Type>();
+ cacheLevelParameters = new List<IDictionary<string, string>>();
+
+ // build level lists
+ foreach (string config in cacheLevelConfig)
+ {
+ int x = config.IndexOf(' ');
+ if (x == -1)
+ {
+ AddLevel(config, null);
+ }
+ else
+ {
+ AddLevel(config.Substring(0, x), config.Substring(x +
1));
+ }
+ }
+
+ root = CreateCacheLevel(0);
+ }
+ }
+
+ public void Put(string[] keys, object value)
+ {
+ if (keys == null) { return; }
+
+ if (keys.Length != cacheLevels.Count)
+ {
+ throw new ArgumentException("Wrong number of keys!", "keys");
+ }
+
+ lock (cacheLock)
+ {
+ IBindingCacheLevel cacheLevel = root;
+
+ // follow the branch
+ for (int i = 0; i < keys.Length - 1; i++)
+ {
+ object level = cacheLevel[keys[i]];
+
+ // does the branch exist?
+ if (level == null)
+ {
+ level = CreateCacheLevel(i + 1);
+ cacheLevel[keys[i]] = level;
+ }
+
+ // next level
+ cacheLevel = (IBindingCacheLevel)level;
+ }
+
+ cacheLevel[keys[keys.Length - 1]] = value;
+
+ if (Logger.IsDebugEnabled)
+ {
+ Logger.Debug("Binding Cache: " + name + ": put [" +
GetFormattedKeys(keys) + "] = " + value);
+ }
+ }
+ }
+
+ public object Get(string[] keys)
+ {
+ if (keys == null) { return null; }
+
+ if (keys.Length != cacheLevels.Count)
+ {
+ throw new ArgumentException("Wrong number of keys!", "keys");
+ }
+
+ object result = null;
+
+ lock (cacheLock)
+ {
+ IBindingCacheLevel cacheLevel = root;
+
+ // follow the branch
+ for (int i = 0; i < keys.Length - 1; i++)
+ {
+ object level = cacheLevel[keys[i]];
+
+ // does the branch exist?
+ if (level == null) { return null; }
+
+ // next level
+ cacheLevel = (IBindingCacheLevel)level;
+ }
+
+ // get the value
+ result = cacheLevel[keys[keys.Length - 1]];
+ }
+
+ return result;
+ }
+
+ public void Remove(string[] keys)
+ {
+ if (keys == null) { return; }
+
+ lock (cacheLock)
+ {
+ IBindingCacheLevel cacheLevel = root;
+
+ // follow the branch
+ for (int i = 0; i < keys.Length - 1; i++)
+ {
+ object level = cacheLevel[keys[i]];
+
+ // does the branch exist?
+ if (level == null) { return; }
+
+ // next level
+ cacheLevel = (IBindingCacheLevel)level;
+ }
+
+ cacheLevel.Remove(keys[keys.Length - 1]);
+
+ if (Logger.IsDebugEnabled)
+ {
+ Logger.Debug("Binding Cache: " + name + ": removed [" +
GetFormattedKeys(keys) + "]");
+ }
+ }
+ }
+
+ public int Check(string[] keys)
+ {
+ if (keys == null) { return -1; }
+
+ lock (cacheLock)
+ {
+ IBindingCacheLevel cacheLevel = root;
+
+ // follow the branch
+ for (int i = 0; i < keys.Length - 1; i++)
+ {
+ object level = cacheLevel[keys[i]];
+
+ // does the branch exist?
+ if (level == null) { return i; }
+
+ // next level
+ cacheLevel = (IBindingCacheLevel)level;
+ }
+
+ return keys.Length;
+ }
+ }
+
+ // --- internal ---
+
+ private void AddLevel(string typeName, string parameters)
+ {
+ Type levelType;
+
+ try
+ {
+ levelType = Type.GetType(typeName);
+ }
+ catch (Exception e)
+ {
+ throw new ArgumentException("Class '" + typeName + "' not
found!", "typeName", e);
+ }
+
+ cacheLevels.Add(levelType);
+
+ // process parameters
+ if (parameters == null)
+ {
+ cacheLevelParameters.Add(null);
+ }
+ else
+ {
+ Dictionary<string, string> parameterDict = new
Dictionary<string, string>();
+ cacheLevelParameters.Add(parameterDict);
+
+ foreach (string pair in parameters.Split(','))
+ {
+ string[] keyValue = pair.Split('=');
+ if (keyValue.Length == 1)
+ {
+ parameterDict[keyValue[0]] = "";
+ }
+ else
+ {
+ parameterDict[keyValue[0]] = keyValue[1];
+ }
+ }
+ }
+ }
+
+ private IBindingCacheLevel CreateCacheLevel(int level)
+ {
+ if ((level < 0) || (level >= cacheLevels.Count))
+ {
+ throw new ArgumentException("Cache level doesn't fit the
configuration!", "level");
+ }
+
+ // get the class and create an instance
+ Type levelType = cacheLevels[level];
+ IBindingCacheLevel cacheLevel = null;
+ try
+ {
+ cacheLevel =
(IBindingCacheLevel)Activator.CreateInstance(levelType);
+ }
+ catch (Exception e)
+ {
+ throw new ArgumentException("Cache level problem?!", e);
+ }
+
+ // initialize it
+ cacheLevel.Initialize(cacheLevelParameters[level]);
+
+ return cacheLevel;
+ }
+
+ private string GetFormattedKeys(string[] keys)
+ {
+ StringBuilder sb = new StringBuilder();
+ foreach (string k in keys)
+ {
+ if (sb.Length > 0)
+ {
+ sb.Append(", ");
+ }
+ sb.Append(k);
+ }
+
+ return sb.ToString();
+ }
+ }
+
+ internal abstract class AbstractCacheLevel : IBindingCacheLevel
+ {
+ protected static string NullKey = "";
+
+ private bool fallbackEnabled = false;
+ private string fallbackKey = null;
+ private bool singleValueEnabled = false;
+
+ public abstract void Initialize(IDictionary<string, string>
cacheLevelConfig);
+
+ public virtual object this[string key]
+ {
+ get
+ {
+ object value = GetValue(key == null ? NullKey : key);
+ if (value != null)
+ {
+ return value;
+ }
+
+ if (fallbackEnabled)
+ {
+ value = GetValue(fallbackKey);
+ if (value != null)
+ {
+ return value;
+ }
+ }
+
+ if (singleValueEnabled)
+ {
+ value = GetSingleValue();
+ if (value != null)
+ {
+ return value;
+ }
+ }
+
+ return null;
+ }
+ set
+ {
+ if (value != null)
+ {
+ AddValue(key == null ? NullKey : key, value);
+ }
+ }
+ }
+
+ public abstract void Remove(string key);
+
+ protected abstract object GetValue(string key);
+
+ protected abstract object GetSingleValue();
+
+ protected abstract void AddValue(string key, object value);
+
+ protected void EnableKeyFallback(string key)
+ {
+ fallbackKey = key;
+ fallbackEnabled = true;
+ }
+
+ protected void DisableKeyFallback()
+ {
+ fallbackEnabled = false;
+ }
+
+ protected void EnableSingeValueFallback()
+ {
+ singleValueEnabled = true;
+ }
+
+ protected void DisableSingeValueFallback()
+ {
+ singleValueEnabled = false;
+ }
+
+ protected int GetIntParameter(IDictionary<string, string> parameters,
string name, int defValue)
+ {
+ if (parameters == null)
+ {
+ return defValue;
+ }
+
+ string value;
+ if (!parameters.TryGetValue(name, out value))
+ {
+ return defValue;
+ }
+
+ try
+ {
+ return Int32.Parse(value);
+ }
+ catch (Exception)
+ {
+ return defValue;
+ }
+ }
+
+ protected bool GetBooleanParameter(IDictionary<string, string>
parameters, string name, bool defValue)
+ {
+ if (parameters == null)
+ {
+ return defValue;
+ }
+
+ string value;
+ if (!parameters.TryGetValue(name, out value))
+ {
+ return defValue;
+ }
+
+ try
+ {
+ return Boolean.Parse(value);
+ }
+ catch (Exception)
+ {
+ return defValue;
+ }
+ }
+ }
+
+ internal class DictionaryCacheLevel : AbstractCacheLevel
+ {
+ public const string Capacity = "capacity";
+ public const string SingleValue = "singleValue";
+
+ private IDictionary<string, object> dict;
+
+ public override void Initialize(IDictionary<string, string> parameters)
+ {
+ int initialCapacity = GetIntParameter(parameters, Capacity, 32);
+ bool singleValue = GetBooleanParameter(parameters, SingleValue,
false);
+
+ dict = new Dictionary<string, object>(initialCapacity);
+ if (singleValue)
+ {
+ EnableSingeValueFallback();
+ }
+ }
+
+ public override void Remove(string key)
+ {
+ dict.Remove(key);
+ }
+
+ protected override object GetValue(string key)
+ {
+ object value;
+ if (dict.TryGetValue(key, out value))
+ {
+ return value;
+ }
+
+ return null;
+ }
+
+ protected override object GetSingleValue()
+ {
+ if (dict.Count == 1)
+ {
+ return dict.Values.First();
+ }
+
+ return null;
+ }
+
+ protected override void AddValue(string key, object value)
+ {
+ dict[key] = value;
+ }
+ }
+
+ internal class LruCacheLevel : AbstractCacheLevel
+ {
+ public const string MaxEntries = "maxEntries";
+
+ private LRUCache<string, object> cache;
+
+ public override void Initialize(IDictionary<string, string> parameters)
+ {
+ int maxEntries = GetIntParameter(parameters, MaxEntries, 100);
+
+ cache = new LRUCache<string, object>(maxEntries,
TimeSpan.FromDays(1));
+ }
+
+ public override void Remove(string key)
+ {
+ cache.Remove(key);
+ }
+
+ protected override object GetValue(string key)
+ {
+ return cache.Get(key);
+ }
+
+ protected override object GetSingleValue()
+ {
+ if (cache.Count == 1)
+ {
+ return cache.GetLatest();
+ }
+
+ return null;
+ }
+
+ protected override void AddValue(string key, object value)
+ {
+ cache.Add(key, value);
+ }
+ }
+
+ // ---- Caches ----
+
+ /// <summary>
+ /// Repository Info cache.
+ /// </summary>
+ internal class RepositoryInfoCache
+ {
+ private const int CacheSizeRepositories = 10;
+
+ private IBindingCache cache;
+
+ public RepositoryInfoCache(IBindingSession session)
+ {
+ int repCount =
session.GetValue(SessionParameter.CacheSizeRepositories, CacheSizeRepositories);
+ if (repCount < 1)
+ {
+ repCount = CacheSizeRepositories;
+ }
+
+ cache = new Cache("Repository Info Cache");
+ cache.Initialize(new string[] {
+ typeof(DictionaryCacheLevel).FullName + " " +
DictionaryCacheLevel.Capacity + "=" + repCount.ToString() });
+ }
+
+ public void Put(IRepositoryInfo repositoryInfo)
+ {
+ if ((repositoryInfo == null) || (repositoryInfo.Id == null))
+ {
+ return;
+ }
+
+ cache.Put(new string[] { repositoryInfo.Id }, repositoryInfo);
+ }
+
+ public IRepositoryInfo Get(string repositoryId)
+ {
+ return (IRepositoryInfo)cache.Get(new string[] { repositoryId });
+ }
+
+ public void Remove(string repositoryId)
+ {
+ cache.Remove(new string[] { repositoryId });
+ }
+ }
+
+ /// <summary>
+ /// Type Definition cache.
+ /// </summary>
+ internal class TypeDefinitionCache
+ {
+ private const int CacheSizeRepositories = 10;
+ private const int CacheSizeTypes = 100;
+
+ private IBindingCache cache;
+
+ public TypeDefinitionCache(IBindingSession session)
+ {
+ int repCount =
session.GetValue(SessionParameter.CacheSizeRepositories, CacheSizeRepositories);
+ if (repCount < 1)
+ {
+ repCount = CacheSizeRepositories;
+ }
+
+ int typeCount = session.GetValue(SessionParameter.CacheSizeTypes,
CacheSizeTypes);
+ if (typeCount < 1)
+ {
+ typeCount = CacheSizeTypes;
+ }
+
+ cache = new Cache("Type Definition Cache");
+ cache.Initialize(new string[] {
+ typeof(DictionaryCacheLevel).FullName + " " +
DictionaryCacheLevel.Capacity + "=" + repCount.ToString(), // repository
+ typeof(LruCacheLevel).FullName + " " +
LruCacheLevel.MaxEntries + "=" + typeCount.ToString() // type
+ });
+ }
+
+ public void Put(string repositoryId, ITypeDefinition typeDefinition)
+ {
+ if ((typeDefinition == null) || (typeDefinition.Id == null))
+ {
+ return;
+ }
+
+ cache.Put(new string[] { repositoryId, typeDefinition.Id },
typeDefinition);
+ }
+
+ public ITypeDefinition Get(string repositoryId, string typeId)
+ {
+ return (ITypeDefinition)cache.Get(new string[] { repositoryId,
typeId });
+ }
+
+ public void Remove(string repositoryId, string typeId)
+ {
+ cache.Remove(new string[] { repositoryId, typeId });
+ }
+
+ public void Remove(string repositoryId)
+ {
+ cache.Remove(new string[] { repositoryId });
+ }
+ }
+}
Added: chemistry/portcmis/PortCMIS/binding/BindingImpl.cs
URL:
http://svn.apache.org/viewvc/chemistry/portcmis/PortCMIS/binding/BindingImpl.cs?rev=1691890&view=auto
==============================================================================
--- chemistry/portcmis/PortCMIS/binding/BindingImpl.cs (added)
+++ chemistry/portcmis/PortCMIS/binding/BindingImpl.cs Mon Jul 20 08:48:57 2015
@@ -0,0 +1,640 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements. See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership. The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License. You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* Kind, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+*/
+
+using PortCMIS.Binding.Http;
+using PortCMIS.Binding.Services;
+using PortCMIS.Client;
+using PortCMIS.Data;
+using PortCMIS.Data.Extensions;
+using PortCMIS.Exceptions;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Numerics;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PortCMIS.Binding.Impl
+{
+ /// <summary>
+ /// Binding layer implementation.
+ /// </summary>
+ internal class CmisBinding : ICmisBinding
+ {
+ private BindingSession session;
+ private BindingRepositoryService repositoryServiceWrapper;
+
+ private object bindingLock = new object();
+
+ public CmisBinding(IDictionary<string, string> sessionParameters)
+ : this(sessionParameters, null)
+ {
+ }
+
+ public CmisBinding(IDictionary<string, string> sessionParameters,
IAuthenticationProvider authenticationProvider)
+ {
+ if (sessionParameters == null)
+ {
+ throw new ArgumentNullException("sessionParameters");
+ }
+
+ if
(!sessionParameters.ContainsKey(SessionParameter.BindingSpiClass))
+ {
+ throw new ArgumentException("Session parameters do not contain
a SPI class name!");
+ }
+
+ // initialize session
+ session = new BindingSession();
+ foreach (KeyValuePair<string, string> kv in sessionParameters)
+ {
+ session.PutValue(kv.Key, kv.Value);
+ }
+
+ // set up authentication provider
+ if (authenticationProvider == null)
+ {
+ string authenticationProviderClass;
+ if
(sessionParameters.TryGetValue(SessionParameter.AuthenticationProviderClass,
out authenticationProviderClass))
+ {
+ try
+ {
+ Type authProvType =
Type.GetType(authenticationProviderClass);
+ authenticationProvider =
(IAuthenticationProvider)Activator.CreateInstance(authProvType);
+ authenticationProvider.Session = session;
+
session.PutValue(BindingSession.AuthenticationProvider, authenticationProvider);
+ }
+ catch (Exception e)
+ {
+ throw new CmisRuntimeException("Could not load
authentictaion provider: " + e.Message, e);
+ }
+ }
+ }
+ else
+ {
+ authenticationProvider.Session = session;
+ session.PutValue(BindingSession.AuthenticationProvider,
authenticationProvider);
+ }
+
+ // initialize the SPI
+ GetSpi();
+
+ // set up caches
+ ClearAllCaches();
+
+ // set up repository service
+ repositoryServiceWrapper = new BindingRepositoryService(session);
+ }
+
+ public string BindingType
+ {
+ get
+ {
+ CheckSession();
+
+ string bindingType =
session.GetValue(SessionParameter.BindingType) as string;
+
+ if (bindingType == null)
+ {
+ bindingType = PortCMIS.BindingType.Custom;
+ }
+
+ return bindingType;
+ }
+ }
+
+ public IRepositoryService GetRepositoryService()
+ {
+ CheckSession();
+ return repositoryServiceWrapper;
+ }
+
+ public INavigationService GetNavigationService()
+ {
+ CheckSession();
+ ICmisSpi spi = GetSpi();
+ return spi.GetNavigationService();
+ }
+
+ public IObjectService GetObjectService()
+ {
+ CheckSession();
+ ICmisSpi spi = GetSpi();
+ return spi.GetObjectService();
+ }
+
+ public IVersioningService GetVersioningService()
+ {
+ CheckSession();
+ ICmisSpi spi = GetSpi();
+ return spi.GetVersioningService();
+ }
+
+ public IRelationshipService GetRelationshipService()
+ {
+ CheckSession();
+ ICmisSpi spi = GetSpi();
+ return spi.GetRelationshipService();
+ }
+
+ public IDiscoveryService GetDiscoveryService()
+ {
+ CheckSession();
+ ICmisSpi spi = GetSpi();
+ return spi.GetDiscoveryService();
+ }
+
+ public IMultiFilingService GetMultiFilingService()
+ {
+ CheckSession();
+ ICmisSpi spi = GetSpi();
+ return spi.GetMultiFilingService();
+ }
+
+ public IAclService GetAclService()
+ {
+ CheckSession();
+ ICmisSpi spi = GetSpi();
+ return spi.GetAclService();
+ }
+
+ public IPolicyService GetPolicyService()
+ {
+ CheckSession();
+ ICmisSpi spi = GetSpi();
+ return spi.GetPolicyService();
+ }
+
+ public IAuthenticationProvider GetAuthenticationProvider()
+ {
+ return session.GetAuthenticationProvider();
+ }
+
+ public void ClearAllCaches()
+ {
+ CheckSession();
+
+ lock (bindingLock)
+ {
+ session.PutValue(BindingSession.RepositoryInfoCache, new
RepositoryInfoCache(session));
+ session.PutValue(BindingSession.TypeDefinitionCache, new
TypeDefinitionCache(session));
+
+ ICmisSpi spi = GetSpi();
+ spi.ClearAllCaches();
+ }
+ }
+
+ public void ClearRepositoryCache(string repositoryId)
+ {
+ CheckSession();
+
+ if (repositoryId == null)
+ {
+ return;
+ }
+
+ lock (bindingLock)
+ {
+ RepositoryInfoCache repInfoCache =
session.GetRepositoryInfoCache();
+ repInfoCache.Remove(repositoryId);
+
+ TypeDefinitionCache typeDefCache =
session.GetTypeDefinitionCache();
+ typeDefCache.Remove(repositoryId);
+
+ ICmisSpi spi = GetSpi();
+ spi.ClearRepositoryCache(repositoryId);
+ }
+ }
+
+ public void Dispose()
+ {
+ CheckSession();
+
+ lock (bindingLock)
+ {
+ GetSpi().Dispose();
+ session = null;
+ }
+ }
+
+ private void CheckSession()
+ {
+ if (session == null)
+ {
+ throw new InvalidOperationException("Already closed.");
+ }
+ }
+
+ private ICmisSpi GetSpi()
+ {
+ return session.GetSpi();
+ }
+ }
+
+
+ /// <summary>
+ /// Session object implementation of the binding layer.
+ /// </summary>
+ internal class BindingSession : IBindingSession
+ {
+ public const string RepositoryInfoCache =
"org.apache.chemistry.portcmis.bindings.repositoryInfoCache";
+ public const string TypeDefinitionCache =
"org.apache.chemistry.portcmis.bindings.typeDefintionCache";
+ public const string AuthenticationProvider =
"org.apache.chemistry.portcmis.bindings.authenticationProvider";
+ public const string SpiObject =
"org.apache.chemistry.portcmis.bindings.spi.object";
+ public const string HttpInvokerObject =
"org.apache.chemistry.portcmis.binding.httpinvoker.object";
+
+ private Dictionary<string, object> data;
+ private object sessionLock = new object();
+
+ public BindingSession()
+ {
+ data = new Dictionary<string, object>();
+ }
+
+ public object GetValue(string key)
+ {
+ return GetValue(key, null);
+ }
+
+ public object GetValue(string key, object defValue)
+ {
+ object result = null;
+
+ lock (sessionLock)
+ {
+ if (data.TryGetValue(key, out result))
+ {
+ return result;
+ }
+ else
+ {
+ return defValue;
+ }
+ }
+ }
+
+ public int GetValue(string key, int defValue)
+ {
+ object value = GetValue(key);
+
+ try
+ {
+ if (value is string)
+ {
+ return Int32.Parse((string)value);
+ }
+ else if (value is int)
+ {
+ return (int)value;
+ }
+ }
+ catch (Exception)
+ {
+ }
+
+ return defValue;
+ }
+
+ public bool GetValue(string key, bool defValue)
+ {
+ object value = GetValue(key);
+
+ try
+ {
+ if (value is string)
+ {
+ return Convert.ToBoolean((string)value);
+ }
+ else if (value is bool)
+ {
+ return (bool)value;
+ }
+ }
+ catch (Exception)
+ {
+ }
+
+ return defValue;
+ }
+
+ public void PutValue(string key, object value)
+ {
+ lock (sessionLock)
+ {
+ data[key] = value;
+ }
+ }
+
+ public void RemoveValue(string key)
+ {
+ lock (sessionLock)
+ {
+ data.Remove(key);
+ }
+ }
+
+ public ICmisSpi GetSpi()
+ {
+ lock (sessionLock)
+ {
+ ICmisSpi spi = GetValue(SpiObject) as ICmisSpi;
+ if (spi != null)
+ {
+ return spi;
+ }
+
+ // ok, we have to create it...
+ try
+ {
+ object spiObject;
+ if (data.TryGetValue(SessionParameter.BindingSpiClass, out
spiObject))
+ {
+ string spiClassName = spiObject as string;
+ if (spiClassName != null)
+ {
+ Type spiClass = Type.GetType(spiClassName);
+ spi = (ICmisSpi)Activator.CreateInstance(spiClass);
+ spi.Initialize(this);
+ }
+ else
+ {
+ throw new CmisRuntimeException("SPI class is not
set!");
+ }
+ }
+ else
+ {
+ throw new CmisRuntimeException("SPI class is not
set!");
+ }
+ }
+ catch (CmisBaseException)
+ {
+ throw;
+ }
+ catch (Exception e)
+ {
+ throw new CmisRuntimeException("SPI cannot be initialized:
" + e.Message, e);
+ }
+
+ // we have a SPI object -> put it into the session
+ data[SpiObject] = spi;
+
+ return spi;
+ }
+ }
+
+ public RepositoryInfoCache GetRepositoryInfoCache()
+ {
+ return GetValue(RepositoryInfoCache) as RepositoryInfoCache;
+ }
+
+ public TypeDefinitionCache GetTypeDefinitionCache()
+ {
+ return GetValue(TypeDefinitionCache) as TypeDefinitionCache;
+ }
+
+ public IAuthenticationProvider GetAuthenticationProvider()
+ {
+ return GetValue(AuthenticationProvider) as IAuthenticationProvider;
+ }
+
+ public IHttpInvoker GetHttpInvoker()
+ {
+ lock (sessionLock)
+ {
+ IHttpInvoker invoker = GetValue(HttpInvokerObject) as
IHttpInvoker;
+ if (invoker != null)
+ {
+ return invoker;
+ }
+
+ // ok, we have to create it...
+ try
+ {
+ object invokerObject;
+ if (data.TryGetValue(SessionParameter.HttpInvokerClass,
out invokerObject))
+ {
+ string invokerClassName = invokerObject as string;
+ if (invokerClassName != null)
+ {
+ Type invokerClass = Type.GetType(invokerClassName);
+ invoker =
(IHttpInvoker)Activator.CreateInstance(invokerClass);
+ }
+ else
+ {
+ throw new CmisRuntimeException("HTTP invoker class
is not set!");
+ }
+ }
+ else
+ {
+ throw new CmisRuntimeException("HTTP invoker class is
not set!");
+ }
+ }
+ catch (CmisBaseException)
+ {
+ throw;
+ }
+ catch (Exception e)
+ {
+ throw new CmisRuntimeException("HTTP invoker cannot be
initialized: " + e.Message, e);
+ }
+
+ // we have an invoker object -> put it into the session
+ data[HttpInvokerObject] = invoker;
+
+ return invoker;
+ }
+ }
+
+ public override string ToString()
+ {
+ return data.ToString();
+ }
+ }
+
+ /// <summary>
+ /// Repository service proxy that caches repository infos and type
defintions.
+ /// </summary>
+ internal class BindingRepositoryService : IRepositoryService
+ {
+ private BindingSession session;
+
+ public BindingRepositoryService(BindingSession session)
+ {
+ this.session = session;
+ }
+
+ public IList<IRepositoryInfo> GetRepositoryInfos(IExtensionsData
extension)
+ {
+ IList<IRepositoryInfo> result = null;
+ bool hasExtension = (extension != null) && (extension.Extensions
!= null) && (extension.Extensions.Count > 0);
+
+ // get the SPI and fetch the repository infos
+ ICmisSpi spi = session.GetSpi();
+ result = spi.GetRepositoryService().GetRepositoryInfos(extension);
+
+ // put it into the cache
+ if (!hasExtension && (result != null))
+ {
+ RepositoryInfoCache cache = session.GetRepositoryInfoCache();
+ foreach (IRepositoryInfo rid in result)
+ {
+ cache.Put(rid);
+ }
+ }
+
+ return result;
+ }
+
+ public IRepositoryInfo GetRepositoryInfo(string repositoryId,
IExtensionsData extension)
+ {
+ IRepositoryInfo result = null;
+ bool hasExtension = (extension != null) && (extension.Extensions
!= null) && (extension.Extensions.Count > 0);
+
+ RepositoryInfoCache cache = session.GetRepositoryInfoCache();
+
+ // if extension is not set, check the cache first
+ if (!hasExtension)
+ {
+ result = cache.Get(repositoryId);
+ if (result != null)
+ {
+ return result;
+ }
+ }
+
+ // it was not in the cache -> get the SPI and fetch the repository
info
+ ICmisSpi spi = session.GetSpi();
+ result =
spi.GetRepositoryService().GetRepositoryInfo(repositoryId, extension);
+
+ // put it into the cache
+ if (!hasExtension)
+ {
+ cache.Put(result);
+ }
+
+ return result;
+ }
+
+ public ITypeDefinitionList GetTypeChildren(string repositoryId, string
typeId, bool? includePropertyDefinitions,
+ BigInteger? maxItems, BigInteger? skipCount, IExtensionsData
extension)
+ {
+ ITypeDefinitionList result = null;
+ bool hasExtension = (extension != null) && (extension.Extensions
!= null) && (extension.Extensions.Count > 0);
+
+ // get the SPI and fetch the type definitions
+ ICmisSpi spi = session.GetSpi();
+ result = spi.GetRepositoryService().GetTypeChildren(repositoryId,
typeId, includePropertyDefinitions, maxItems,
+ skipCount, extension);
+
+ // put it into the cache
+ if (!hasExtension && (includePropertyDefinitions ?? false) &&
(result != null) && (result.List != null))
+ {
+ TypeDefinitionCache cache = session.GetTypeDefinitionCache();
+ foreach (ITypeDefinition tdd in result.List)
+ {
+ cache.Put(repositoryId, tdd);
+ }
+ }
+
+ return result;
+ }
+
+ public IList<ITypeDefinitionContainer> GetTypeDescendants(string
repositoryId, string typeId, BigInteger? depth,
+ bool? includePropertyDefinitions, IExtensionsData extension)
+ {
+ IList<ITypeDefinitionContainer> result = null;
+ bool hasExtension = (extension != null) && (extension.Extensions
!= null) && (extension.Extensions.Count > 0);
+
+ // get the SPI and fetch the type definitions
+ ICmisSpi spi = session.GetSpi();
+ result =
spi.GetRepositoryService().GetTypeDescendants(repositoryId, typeId, depth,
includePropertyDefinitions,
+ extension);
+
+ // put it into the cache
+ if (!hasExtension && (includePropertyDefinitions ?? false) &&
(result != null))
+ {
+ TypeDefinitionCache cache = session.GetTypeDefinitionCache();
+ AddToTypeCache(cache, repositoryId, result);
+ }
+
+ return result;
+ }
+
+ private void AddToTypeCache(TypeDefinitionCache cache, string
repositoryId, IList<ITypeDefinitionContainer> containers)
+ {
+ if (containers == null)
+ {
+ return;
+ }
+
+ foreach (ITypeDefinitionContainer container in containers)
+ {
+ cache.Put(repositoryId, container.TypeDefinition);
+ AddToTypeCache(cache, repositoryId, container.Children);
+ }
+ }
+
+ public ITypeDefinition GetTypeDefinition(string repositoryId, string
typeId, IExtensionsData extension)
+ {
+ ITypeDefinition result = null;
+ bool hasExtension = (extension != null) && (extension.Extensions
!= null) && (extension.Extensions.Count > 0);
+
+ TypeDefinitionCache cache = session.GetTypeDefinitionCache();
+
+ // if extension is not set, check the cache first
+ if (!hasExtension)
+ {
+ result = cache.Get(repositoryId, typeId);
+ if (result != null)
+ {
+ return result;
+ }
+ }
+
+ // it was not in the cache -> get the SPI and fetch the type
definition
+ ICmisSpi spi = session.GetSpi();
+ result =
spi.GetRepositoryService().GetTypeDefinition(repositoryId, typeId, extension);
+
+ // put it into the cache
+ if (!hasExtension && (result != null))
+ {
+ cache.Put(repositoryId, result);
+ }
+
+ return result;
+ }
+
+ public ITypeDefinition CreateType(string repositoryId, ITypeDefinition
type, IExtensionsData extension)
+ {
+ ICmisSpi spi = session.GetSpi();
+ return spi.GetRepositoryService().CreateType(repositoryId, type,
extension);
+ }
+
+ public ITypeDefinition UpdateType(string repositoryId, ITypeDefinition
type, IExtensionsData extension)
+ {
+ ICmisSpi spi = session.GetSpi();
+ return spi.GetRepositoryService().UpdateType(repositoryId, type,
extension);
+ }
+
+ public void DeleteType(string repositoryId, string typeId,
IExtensionsData extension)
+ {
+ ICmisSpi spi = session.GetSpi();
+ spi.GetRepositoryService().DeleteType(repositoryId, typeId,
extension);
+ }
+ }
+}