mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Compare commits
186 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48685b3ed7 | ||
|
|
cd9bccef96 | ||
|
|
358c57464e | ||
|
|
5d892feceb | ||
|
|
a200e35923 | ||
|
|
d384110253 | ||
|
|
d17930395c | ||
|
|
5eef9c654c | ||
|
|
54575ab513 | ||
|
|
55c43ad236 | ||
|
|
1870e3eb04 | ||
|
|
d8079dec26 | ||
|
|
ac4f7c05c9 | ||
|
|
98e0b43c26 | ||
|
|
17c7c77e3c | ||
|
|
185ad6b1eb | ||
|
|
dbb5668d49 | ||
|
|
d686d688a4 | ||
|
|
5361b29a9c | ||
|
|
86ec07007f | ||
|
|
2eeef52077 | ||
|
|
c228421051 | ||
|
|
a23e9ea764 | ||
|
|
e41e9079d3 | ||
|
|
d85954fa6d | ||
|
|
a709e37ddc | ||
|
|
87bdf9c413 | ||
|
|
d2889e46e3 | ||
|
|
134bac44c3 | ||
|
|
9ec312a1c3 | ||
|
|
097119466a | ||
|
|
9f98d3151b | ||
|
|
234d5214dd | ||
|
|
33bdfd0551 | ||
|
|
ac978b665b | ||
|
|
8dde994bde | ||
|
|
f28da9894a | ||
|
|
8c1ffe2564 | ||
|
|
5a0fe4e105 | ||
|
|
2c26c65f63 | ||
|
|
654a9e1884 | ||
|
|
149346ce68 | ||
|
|
9b6c2315de | ||
|
|
68c10bce60 | ||
|
|
8615422e27 | ||
|
|
06a2e0d6b1 | ||
|
|
6e476243c6 | ||
|
|
eff27ec05e | ||
|
|
0869f957bd | ||
|
|
c795cdb871 | ||
|
|
8bd74c947e | ||
|
|
b7dd2f6055 | ||
|
|
3b7ec4cb89 | ||
|
|
acb93df3ec | ||
|
|
3ac09df891 | ||
|
|
863d2e4e6b | ||
|
|
ddfcfd7379 | ||
|
|
8456716d8b | ||
|
|
fe4a116cb4 | ||
|
|
4f57ecb487 | ||
|
|
7a9f86dac6 | ||
|
|
6df57dd098 | ||
|
|
cccb358ce1 | ||
|
|
db7832db37 | ||
|
|
48e2a6a1b4 | ||
|
|
8425fb4829 | ||
|
|
923646c27f | ||
|
|
27a9bae394 | ||
|
|
3bda4acee1 | ||
|
|
bc66cdb36c | ||
|
|
9f60edc7f5 | ||
|
|
e35b71e1dc | ||
|
|
6ab9ffc7da | ||
|
|
5c6dd3e34f | ||
|
|
d0b65cb60b | ||
|
|
6f3193e52b | ||
|
|
a7f51c13d4 | ||
|
|
4b2e1ca19d | ||
|
|
8a328902fd | ||
|
|
83f47ac148 | ||
|
|
750824b197 | ||
|
|
7045c40406 | ||
|
|
eed3ee6871 | ||
|
|
e6d4d0c9d4 | ||
|
|
0ea47a5554 | ||
|
|
d8f423888a | ||
|
|
4299239482 | ||
|
|
7e859f2ccf | ||
|
|
4584da9214 | ||
|
|
f697fbb06a | ||
|
|
1254a11b8d | ||
|
|
203fd95079 | ||
|
|
fab73d7157 | ||
|
|
c48635540b | ||
|
|
8f2411dbf9 | ||
|
|
68acf2694d | ||
|
|
b160dc731d | ||
|
|
d59f5b511b | ||
|
|
85326ead8c | ||
|
|
d91aa41be3 | ||
|
|
7a16cf527c | ||
|
|
fef68ad7ae | ||
|
|
4a5ed9790a | ||
|
|
9be38010b0 | ||
|
|
30312ad6b0 | ||
|
|
429889b36e | ||
|
|
59a9f0bf03 | ||
|
|
bd222908d6 | ||
|
|
7c95b53807 | ||
|
|
794f30af39 | ||
|
|
210aebcbe9 | ||
|
|
5cc0acae44 | ||
|
|
8a80daa9b7 | ||
|
|
99b0fd6ca7 | ||
|
|
b8bd587a9f | ||
|
|
03d5a375d3 | ||
|
|
3e275f3f22 | ||
|
|
951c36a59b | ||
|
|
cf81574552 | ||
|
|
0ae205c987 | ||
|
|
2a8d091e07 | ||
|
|
7171244044 | ||
|
|
004f35900d | ||
|
|
bd195cbb04 | ||
|
|
37e8696fe0 | ||
|
|
ed94ba11e7 | ||
|
|
a46b86b243 | ||
|
|
ec0a0998da | ||
|
|
e5e84c0e1b | ||
|
|
8ddfb0ed73 | ||
|
|
8218535d27 | ||
|
|
a7c4dfbf7c | ||
|
|
bc74aec232 | ||
|
|
84a95e3cb9 | ||
|
|
50224d5ebe | ||
|
|
357f1aa166 | ||
|
|
27d5c6658a | ||
|
|
8ec6e8a724 | ||
|
|
e3c0c97b66 | ||
|
|
be31746c4e | ||
|
|
0cac0ac601 | ||
|
|
01fa02bd90 | ||
|
|
94ddb257e1 | ||
|
|
1c1e9e4c97 | ||
|
|
84288aeff6 | ||
|
|
0deab6bd0d | ||
|
|
4c1254e128 | ||
|
|
dcc63228e5 | ||
|
|
35c379191e | ||
|
|
dbbeb175a6 | ||
|
|
a5b1aa5d2a | ||
|
|
e04b12d177 | ||
|
|
74011e659b | ||
|
|
7aa6371ec1 | ||
|
|
c004545eeb | ||
|
|
31f07a44e4 | ||
|
|
13f3473868 | ||
|
|
0a06a788b2 | ||
|
|
a5ac956b6a | ||
|
|
3e2b5d5b82 | ||
|
|
a8d4440c2e | ||
|
|
af35f1387c | ||
|
|
161a2e3204 | ||
|
|
50c8a2631d | ||
|
|
fbe5945ea6 | ||
|
|
03bac9222b | ||
|
|
897687e4b3 | ||
|
|
0f155827fd | ||
|
|
bcd66f39d1 | ||
|
|
86b4ff4e65 | ||
|
|
3cb63d80af | ||
|
|
e90f114a8b | ||
|
|
8fadee4a49 | ||
|
|
9e57d016df | ||
|
|
e477328c39 | ||
|
|
5ef753ef2d | ||
|
|
280de4e6fc | ||
|
|
c251665dfe | ||
|
|
ed13ac2802 | ||
|
|
0ed5198cb3 | ||
|
|
018a3faa2e | ||
|
|
91488f31da | ||
|
|
dfa22687b5 | ||
|
|
34bd78a487 | ||
|
|
b292269f2b | ||
|
|
b0393a0780 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -68,6 +68,9 @@ ipch/
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
|
||||
# CodeRush is a .NET coding add-in
|
||||
.cr*/
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
|
||||
@@ -1,22 +1,29 @@
|
||||
@echo off
|
||||
|
||||
for /f "usebackq tokens=1* delims=: " %%i in (`lib\vswhere\vswhere -latest -version "[15.0,16.0)" -requires Microsoft.Component.MSBuild`) do (
|
||||
if /i "%%i"=="installationPath" (
|
||||
set InstallDir=%%j
|
||||
if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (
|
||||
echo "Using MSBuild from Visual Studio 2017"
|
||||
set msbuild="%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe"
|
||||
goto build
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
FOR %%b in (
|
||||
"%VS140COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
|
||||
"%ProgramFiles%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"
|
||||
|
||||
"%VS120COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
|
||||
"%ProgramFiles%\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"
|
||||
|
||||
"%VS110COMNTOOLS%..\..\VC\vcvarsall.bat"
|
||||
"%ProgramFiles(x86)%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
|
||||
"%ProgramFiles%\Microsoft Visual Studio 11.0\VC\vcvarsall.bat"
|
||||
"%VS140COMNTOOLS%\vsvars32.bat"
|
||||
"%VS120COMNTOOLS%\vsvars32.bat"
|
||||
"%VS110COMNTOOLS%\vsvars32.bat"
|
||||
) do (
|
||||
if exist %%b (
|
||||
call %%b x86
|
||||
goto build
|
||||
echo "Using MSBuild from %%b"
|
||||
call %%b
|
||||
set msbuild="msbuild"
|
||||
goto build
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
echo "Unable to detect suitable environment. Build may not succeed."
|
||||
|
||||
:build
|
||||
@@ -31,6 +38,8 @@ IF "%solution%" == "" SET solution=src\Orchard.sln
|
||||
|
||||
lib\nuget\nuget.exe restore %solution%
|
||||
|
||||
msbuild /t:%target% %project% /p:Solution=%solution%
|
||||
%msbuild% /t:%target% %project% /p:Solution=%solution% /m
|
||||
|
||||
:end
|
||||
|
||||
pause
|
||||
@@ -167,11 +167,12 @@
|
||||
</Target>
|
||||
|
||||
<Target Name="Spec" DependsOnTargets="Package-Stage">
|
||||
|
||||
<CreateItem Include="$(CompileFolder)\*.Specs.dll">
|
||||
<!-- Running SpecFlow tests -->
|
||||
<CreateItem Include="$(CompileFolder)\*.Specs.*dll">
|
||||
<Output TaskParameter="Include" ItemName="SpecAssemblies" />
|
||||
</CreateItem>
|
||||
<NUnit Assemblies="@(SpecAssemblies)" ToolPath="$(NUnitPackageToolsFolder)" />
|
||||
|
||||
<NUnit Assemblies="@(SpecAssemblies)" ToolPath="@(NUnitPackageToolsFolder)" WorkingDirectory="$(CompileFolder)" OutputXmlFile="$(BuildFolder)\Orchard.Specs.xml" />
|
||||
</Target>
|
||||
|
||||
<!-- Packaging (Stage) -->
|
||||
|
||||
10
README.md
10
README.md
@@ -6,7 +6,7 @@ Orchard is a free, open source, community-focused Content Management System buil
|
||||
|
||||
You can try it for free on [DotNest.com](https://dotnest.com) or on Microsoft Azure by clicking on this button.
|
||||
|
||||
[](https://portal.azure.com/#create/OutercurveFoundation.OrchardCMS.1.0.4)
|
||||
[](https://portal.azure.com/#create/OutercurveFoundation.OrchardCMS)
|
||||
|
||||
## About The Orchard Project
|
||||
|
||||
@@ -22,8 +22,10 @@ Our mission is to empower our users and foster a dedicated and diverse community
|
||||
|
||||
## Project Status
|
||||
|
||||
Orchard is currently in version 1.9.2. We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach.
|
||||
Our 1.9.2 release is available from our Downloads page, and is easy to [Install Orchard using the Web Platform Installer](http://docs.orchardproject.net/Documentation/Installing-Orchard). We encourage interested developers to check out the source code on the Orchard Github site and get involved with the project.
|
||||
Orchard is currently in version **[1.10.2](https://github.com/OrchardCMS/Orchard/releases/tag/1.10.2)**: It contains bugfixes and the more impactful changes and new features added in the latest major version (*1.10*).
|
||||
|
||||
We invite participation by the developer community in shaping the project’s direction, so that we can publicly validate our designs and development approach.
|
||||
All our releases are available on our [Releases](https://github.com/OrchardCMS/Orchard/releases) page, and it's easy to [Install Orchard using the Web Platform Installer](http://docs.orchardproject.net/Documentation/Installing-Orchard) as well. We encourage interested developers to check out the source code on the Orchard GitHub site and get involved with the project.
|
||||
|
||||
* [Download the latest release](https://github.com/OrchardCMS/Orchard/releases)
|
||||
* [Feature roadmap](http://docs.orchardproject.net/Documentation/feature-roadmap)
|
||||
@@ -51,4 +53,4 @@ There are many ways you can [contribute to Orchard](http://orchardproject.net/co
|
||||
|
||||
## The Future Of Orchard CMS: Orchard 2
|
||||
|
||||
As the underlying frameworks (.NET, ASP.NET and ASP.NET MVC) are constantly evolving, Orchard of course keeps track of the changes and improvements of these: Orchard 2 is the next generation of Orchard releases that is based on [ASP.NET vNext](http://www.asp.net/vnext). Just like the current Orchard project, it's fully [open-source and is publicly available on GitHub](https://github.com/OrchardCMS/Orchard2). Orchard 2 (as a framework) is being built from scratch: it's still in development and does not share any of its code base (at least directly) with the current versions of Orchard.
|
||||
As the underlying frameworks (.NET, ASP.NET and ASP.NET MVC) are constantly evolving, Orchard of course keeps track of the changes and improvements of these: Orchard 2 is the next generation of Orchard releases that is based on [ASP.NET Core](http://www.asp.net/core). Just like the current Orchard project, it's fully [open-source and is publicly available on GitHub](https://github.com/OrchardCMS/Orchard2). Orchard 2 (as a framework) is being built from scratch: it's still in development and does not share any of its code base (at least directly) with the current versions of Orchard.
|
||||
|
||||
@@ -72,7 +72,7 @@ call :ExecuteCmd nuget restore "%DEPLOYMENT_SOURCE%\src\Orchard.sln"
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
:: 2. Build to the temporary path
|
||||
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /t:Precompiled /v:m
|
||||
call :ExecuteCmd "%MSBUILD_PATH%" "%DEPLOYMENT_SOURCE%\Orchard.proj" /t:Precompiled /v:m /m
|
||||
IF !ERRORLEVEL! NEQ 0 goto error
|
||||
|
||||
:: 3. KuduSync
|
||||
|
||||
BIN
lib/vswhere/vswhere.exe
Normal file
BIN
lib/vswhere/vswhere.exe
Normal file
Binary file not shown.
@@ -8,6 +8,7 @@ var fs = require("fs"),
|
||||
plumber = require("gulp-plumber"),
|
||||
sourcemaps = require("gulp-sourcemaps"),
|
||||
less = require("gulp-less"),
|
||||
sass = require("gulp-sass"),
|
||||
autoprefixer = require("gulp-autoprefixer"),
|
||||
minify = require("gulp-minify-css"),
|
||||
typescript = require("gulp-typescript"),
|
||||
@@ -123,7 +124,7 @@ function createAssetGroupTask(assetGroup, doRebuild) {
|
||||
function buildCssPipeline(assetGroup, doConcat, doRebuild) {
|
||||
assetGroup.inputPaths.forEach(function (inputPath) {
|
||||
var ext = path.extname(inputPath).toLowerCase();
|
||||
if (ext !== ".less" && ext !== ".css")
|
||||
if (ext !== ".less" && ext !== ".scss" && ext !== ".css")
|
||||
throw "Input file '" + inputPath + "' is not of a valid type for output file '" + assetGroup.outputPath + "'.";
|
||||
});
|
||||
var generateSourceMaps = assetGroup.hasOwnProperty("generateSourceMaps") ? assetGroup.generateSourceMaps : true;
|
||||
@@ -138,9 +139,11 @@ function buildCssPipeline(assetGroup, doConcat, doRebuild) {
|
||||
.pipe(plumber())
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.init()))
|
||||
.pipe(gulpif("*.less", less()))
|
||||
.pipe(gulpif("*.scss", sass({
|
||||
precision: 10
|
||||
})))
|
||||
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
|
||||
.pipe(autoprefixer({ browsers: ["last 2 versions"] }))
|
||||
// TODO: Start using below whenever gulp-header supports sourcemaps.
|
||||
.pipe(header(
|
||||
"/*\n" +
|
||||
"** NOTE: This file is generated by Gulp and should not be edited directly!\n" +
|
||||
@@ -179,8 +182,7 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
|
||||
noEmitOnError: true,
|
||||
sortOutput: true,
|
||||
}).js))
|
||||
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
|
||||
// TODO: Start using below whenever gulp-header supports sourcemaps.
|
||||
.pipe(gulpif(doConcat, concat(assetGroup.outputFileName)))
|
||||
.pipe(header(
|
||||
"/*\n" +
|
||||
"** NOTE: This file is generated by Gulp and should not be edited directly!\n" +
|
||||
@@ -189,9 +191,9 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) {
|
||||
"*/\n\n"))
|
||||
.pipe(gulpif(generateSourceMaps, sourcemaps.write()))
|
||||
.pipe(gulp.dest(assetGroup.outputDir))
|
||||
.pipe(uglify())
|
||||
.pipe(rename({
|
||||
suffix: ".min"
|
||||
}))
|
||||
.pipe(gulp.dest(assetGroup.outputDir));
|
||||
.pipe(uglify())
|
||||
.pipe(rename({
|
||||
suffix: ".min"
|
||||
}))
|
||||
.pipe(gulp.dest(assetGroup.outputDir));
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -51,6 +52,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.WindowsAzure.ServiceRuntime, Version=1.8.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -47,6 +48,7 @@
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -55,14 +56,15 @@
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Autofac.3.5.2\lib\net40\Autofac.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="FluentNHibernate, Version=1.4.0.0, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentNHibernate.1.4.0.0\lib\net35\FluentNHibernate.dll</HintPath>
|
||||
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
|
||||
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Autofac" version="3.5.2" targetFramework="net452" />
|
||||
<package id="FluentNHibernate" version="1.4.0.0" targetFramework="net452" />
|
||||
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net452" />
|
||||
<package id="Iesi.Collections" version="4.0.1.4000" targetFramework="net452" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net452" />
|
||||
<package id="Microsoft.AspNet.Razor" version="3.2.3" targetFramework="net452" />
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -54,6 +55,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="nunit.framework, Version=2.5.10.11092, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
|
||||
|
||||
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -55,6 +56,7 @@
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
@@ -65,8 +67,8 @@
|
||||
<HintPath>..\packages\Castle.Core.3.3.1\lib\net45\Castle.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="FluentNHibernate, Version=1.4.0.0, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentNHibernate.1.4.0.0\lib\net35\FluentNHibernate.dll</HintPath>
|
||||
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="FluentPath, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
|
||||
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<packages>
|
||||
<package id="Autofac" version="3.5.2" targetFramework="net452" />
|
||||
<package id="Castle.Core" version="3.3.1" targetFramework="net452" />
|
||||
<package id="FluentNHibernate" version="1.4.0.0" targetFramework="net452" />
|
||||
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net452" />
|
||||
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net452" />
|
||||
<package id="Iesi.Collections" version="4.0.1.4000" targetFramework="net452" />
|
||||
<package id="log4net" version="2.0.3" targetFramework="net452" />
|
||||
|
||||
@@ -14,7 +14,6 @@ using Orchard.ContentManagement.MetaData.Builders;
|
||||
using Orchard.ContentManagement.Records;
|
||||
using Orchard.Core.Common.Handlers;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Data;
|
||||
using Orchard.Environment;
|
||||
using Orchard.Environment.Configuration;
|
||||
using Orchard.Environment.Extensions;
|
||||
@@ -69,6 +68,7 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
builder.RegisterType<IndexingTaskManager>().As<IIndexingTaskManager>();
|
||||
builder.RegisterType<DefaultContentManager>().As<IContentManager>();
|
||||
builder.RegisterType<StubCacheManager>().As<ICacheManager>();
|
||||
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
|
||||
builder.RegisterType<Signals>().As<ISignals>();
|
||||
builder.RegisterType<DefaultContentManagerSession>().As<IContentManagerSession>();
|
||||
builder.RegisterInstance(_contentDefinitionManager.Object);
|
||||
|
||||
@@ -9,6 +9,7 @@ using Orchard.Environment.Configuration;
|
||||
using Orchard.FileSystems.AppData;
|
||||
using Orchard.Indexing;
|
||||
using Orchard.Tests.FileSystems.AppData;
|
||||
using Orchard.Tests.Stubs;
|
||||
|
||||
namespace Orchard.Tests.Modules.Indexing {
|
||||
public class LuceneIndexProviderTests {
|
||||
@@ -35,6 +36,7 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath);
|
||||
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
|
||||
builder.RegisterType<DefaultLuceneAnalyzerProvider>().As<ILuceneAnalyzerProvider>();
|
||||
builder.RegisterType<DefaultLuceneAnalyzerSelector>().As<ILuceneAnalyzerSelector>();
|
||||
builder.RegisterType<LuceneIndexProvider>().As<IIndexProvider>();
|
||||
|
||||
@@ -8,6 +8,7 @@ using Orchard.Environment.Configuration;
|
||||
using Orchard.FileSystems.AppData;
|
||||
using Orchard.Indexing;
|
||||
using Orchard.Tests.FileSystems.AppData;
|
||||
using Orchard.Tests.Stubs;
|
||||
|
||||
namespace Orchard.Tests.Modules.Indexing {
|
||||
public class LuceneSearchBuilderTests {
|
||||
@@ -34,6 +35,7 @@ namespace Orchard.Tests.Modules.Indexing {
|
||||
_appDataFolder = AppDataFolderTests.CreateAppDataFolder(_basePath);
|
||||
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
|
||||
builder.RegisterType<DefaultLuceneAnalyzerProvider>().As<ILuceneAnalyzerProvider>();
|
||||
builder.RegisterType<DefaultLuceneAnalyzerSelector>().As<ILuceneAnalyzerSelector>();
|
||||
builder.RegisterType<LuceneIndexProvider>().As<IIndexProvider>();
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -55,6 +56,7 @@
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
@@ -65,8 +67,8 @@
|
||||
<HintPath>..\packages\Castle.Core.3.3.1\lib\net45\Castle.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="FluentNHibernate, Version=1.4.0.0, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentNHibernate.1.4.0.0\lib\net35\FluentNHibernate.dll</HintPath>
|
||||
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="FluentPath, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
|
||||
@@ -30,5 +30,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
@@ -17,8 +17,9 @@ namespace Orchard.Tests.Modules.Recipes.RecipeHandlers {
|
||||
builder.RegisterType<RecipeExecutionLogger>().AsSelf();
|
||||
builder.RegisterType<StubRecipeExecutionStep>().As<IRecipeExecutionStep>().AsSelf().SingleInstance();
|
||||
builder.RegisterType<RecipeExecutionStepHandler>().SingleInstance();
|
||||
builder.RegisterType<RecipeExecutionStepResolver>().As<IRecipeExecutionStepResolver>().SingleInstance();
|
||||
|
||||
_container = builder.Build();
|
||||
_container = builder.Build();
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -205,7 +205,8 @@ namespace Orchard.Tests.Modules.Users.Controllers {
|
||||
@"Ima.Fool@example.com",
|
||||
@"""Ima.Fool""@example.com",
|
||||
@"""Ima Fool""@example.com",
|
||||
"2xxx1414@i.ua"
|
||||
"2xxx1414@i.ua",
|
||||
"Dreißig-öffentliche-Ämter-in-Übersee@Beispiel.de"
|
||||
)]
|
||||
string email)
|
||||
{
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<package id="Autofac" version="3.5.2" targetFramework="net452" />
|
||||
<package id="Castle.Core" version="3.3.1" targetFramework="net452" />
|
||||
<package id="DotNetZip" version="1.9.1.8" targetFramework="net452" />
|
||||
<package id="FluentNHibernate" version="1.4.0.0" targetFramework="net452" />
|
||||
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net452" />
|
||||
<package id="Iesi.Collections" version="4.0.1.4000" targetFramework="net452" />
|
||||
<package id="IronRuby" version="1.1.3" targetFramework="net452" />
|
||||
<package id="Lucene.Net" version="3.0.3" targetFramework="net452" />
|
||||
|
||||
@@ -3,6 +3,7 @@ using Autofac;
|
||||
using NUnit.Framework;
|
||||
using Orchard.Localization.Models;
|
||||
using Orchard.Localization.Services;
|
||||
using Orchard.Tests.Stubs;
|
||||
|
||||
namespace Orchard.Tests.Localization {
|
||||
|
||||
@@ -303,10 +304,11 @@ namespace Orchard.Tests.Localization {
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Description("DST date and time are not properly round-tripped when date is ignored.")]
|
||||
[Description("DST is ignored when date is ignored (non-DST date).")]
|
||||
public void ConvertToLocalizedTimeStringTest03() {
|
||||
var timeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
|
||||
var container = TestHelpers.InitializeContainer("en-US", null, timeZone);
|
||||
var clock = new StubClock(new DateTime(2012, 1, 1, 12, 0, 0, DateTimeKind.Utc));
|
||||
var container = TestHelpers.InitializeContainer("en-US", null, timeZone, clock);
|
||||
var target = container.Resolve<IDateLocalizationServices>();
|
||||
|
||||
var dateString = "3/10/2012";
|
||||
@@ -318,7 +320,27 @@ namespace Orchard.Tests.Localization {
|
||||
var timeString2 = target.ConvertToLocalizedTimeString(dateTimeUtc, new DateLocalizationOptions() { IgnoreDate = true });
|
||||
|
||||
Assert.AreEqual(dateString, dateString2);
|
||||
Assert.AreNotEqual(timeString, timeString2);
|
||||
Assert.AreEqual(timeString, timeString2);
|
||||
}
|
||||
|
||||
[Test]
|
||||
[Description("DST is ignored when date is ignored (DST date).")]
|
||||
public void ConvertToLocalizedTimeStringTest04() {
|
||||
var timeZone = TimeZoneInfo.FindSystemTimeZoneById("Pacific Standard Time");
|
||||
var clock = new StubClock(new DateTime(2012, 10, 3, 12, 0, 0, DateTimeKind.Utc));
|
||||
var container = TestHelpers.InitializeContainer("en-US", null, timeZone, clock);
|
||||
var target = container.Resolve<IDateLocalizationServices>();
|
||||
|
||||
var dateString = "3/10/2012";
|
||||
var timeString = "12:00:00 PM";
|
||||
|
||||
var dateTimeUtc = target.ConvertFromLocalizedString(dateString, timeString);
|
||||
|
||||
var dateString2 = target.ConvertToLocalizedDateString(dateTimeUtc);
|
||||
var timeString2 = target.ConvertToLocalizedTimeString(dateTimeUtc, new DateLocalizationOptions() { IgnoreDate = true });
|
||||
|
||||
Assert.AreEqual(dateString, dateString2);
|
||||
Assert.AreEqual(timeString, timeString2);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -39,5 +39,21 @@ namespace Orchard.Tests.Localization {
|
||||
|
||||
Assert.AreEqual("Foo \"{0}\"", translations["~/themes/mytheme/views/myview.cshtml|foo \"{0}\""]);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ShouldHandleUnclosedQuote() {
|
||||
var parser = new LocalizationStreamParser();
|
||||
|
||||
var text = new StringBuilder();
|
||||
text.AppendLine("#: ~/Themes/MyTheme/Views/MyView.cshtml");
|
||||
text.AppendLine("msgctxt \"");
|
||||
text.AppendLine("msgid \"Foo \\\"{0}\\\"\"");
|
||||
text.AppendLine("msgstr \"Foo \\\"{0}\\\"\"");
|
||||
|
||||
var translations = new Dictionary<string, string>();
|
||||
parser.ParseLocalizationStream(text.ToString(), translations, false);
|
||||
|
||||
Assert.AreEqual("Foo \"{0}\"", translations["|foo \"{0}\""]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,9 +9,12 @@ using Orchard.Tests.Stubs;
|
||||
namespace Orchard.Tests.Localization {
|
||||
|
||||
internal class TestHelpers {
|
||||
public static IContainer InitializeContainer(string cultureName, string calendarName, TimeZoneInfo timeZone) {
|
||||
public static IContainer InitializeContainer(string cultureName, string calendarName, TimeZoneInfo timeZone, IClock clock = null) {
|
||||
var builder = new ContainerBuilder();
|
||||
builder.RegisterType<StubClock>().As<IClock>();
|
||||
if (clock != null)
|
||||
builder.RegisterInstance(clock);
|
||||
else
|
||||
builder.RegisterType<StubClock>().As<IClock>();
|
||||
builder.RegisterInstance<WorkContext>(new StubWorkContext(cultureName, calendarName, timeZone));
|
||||
builder.RegisterType<StubWorkContextAccessor>().As<IWorkContextAccessor>();
|
||||
builder.RegisterType<CultureDateTimeFormatProvider>().As<IDateTimeFormatProvider>();
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -55,6 +56,7 @@
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
@@ -69,8 +71,8 @@
|
||||
<HintPath>..\packages\Castle.Core.3.3.1\lib\net45\Castle.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="FluentNHibernate, Version=1.4.0.0, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentNHibernate.1.4.0.0\lib\net35\FluentNHibernate.dll</HintPath>
|
||||
<Reference Include="FluentNHibernate, Version=2.0.3.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
|
||||
@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
@@ -4,8 +4,13 @@ using Orchard.Services;
|
||||
|
||||
namespace Orchard.Tests.Stubs {
|
||||
public class StubClock : IClock {
|
||||
public StubClock() {
|
||||
UtcNow = new DateTime(2009, 10, 14, 12, 34, 56, DateTimeKind.Utc);
|
||||
|
||||
public StubClock()
|
||||
: this(new DateTime(2009, 10, 14, 12, 34, 56, DateTimeKind.Utc)) {
|
||||
}
|
||||
|
||||
public StubClock(DateTime utcNow) {
|
||||
UtcNow = utcNow;
|
||||
}
|
||||
|
||||
public DateTime UtcNow { get; private set; }
|
||||
@@ -18,7 +23,6 @@ namespace Orchard.Tests.Stubs {
|
||||
return UtcNow.Add(span);
|
||||
}
|
||||
|
||||
|
||||
public IVolatileToken When(TimeSpan duration) {
|
||||
return new Clock.AbsoluteExpirationToken(this, duration);
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ using Orchard.Utility.Extensions;
|
||||
namespace Orchard.Tests.Utility.Extensions {
|
||||
[TestFixture]
|
||||
public class HttpRequestExtensionsTests {
|
||||
|
||||
|
||||
[Test]
|
||||
public void IsLocalUrlShouldReturnFalseWhenUrlIsNullOrEmpty() {
|
||||
var request = new StubHttpRequest();
|
||||
@@ -21,6 +21,7 @@ namespace Orchard.Tests.Utility.Extensions {
|
||||
var request = new StubHttpRequest();
|
||||
|
||||
Assert.That(request.IsLocalUrl("//"), Is.False);
|
||||
Assert.That(request.IsLocalUrl(" //"), Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -28,6 +29,7 @@ namespace Orchard.Tests.Utility.Extensions {
|
||||
var request = new StubHttpRequest();
|
||||
|
||||
Assert.That(request.IsLocalUrl("/\\"), Is.False);
|
||||
Assert.That(request.IsLocalUrl(" /\\"), Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
@@ -35,6 +37,7 @@ namespace Orchard.Tests.Utility.Extensions {
|
||||
var request = new StubHttpRequest();
|
||||
|
||||
Assert.That(request.IsLocalUrl("/"), Is.True);
|
||||
Assert.That(request.IsLocalUrl("\t/"), Is.True);
|
||||
Assert.That(request.IsLocalUrl("/контакты"), Is.True);
|
||||
Assert.That(request.IsLocalUrl("/ "), Is.True);
|
||||
Assert.That(request.IsLocalUrl("/abc-def"), Is.True);
|
||||
@@ -46,6 +49,18 @@ namespace Orchard.Tests.Utility.Extensions {
|
||||
request.Headers.Add("Host", "localhost");
|
||||
|
||||
Assert.That(request.IsLocalUrl("http://localhost"), Is.True);
|
||||
Assert.That(request.IsLocalUrl("https://localhost"), Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void IsLocalUrlShouldReturnFalseForNonHttpSchemes() {
|
||||
var request = new StubHttpRequest();
|
||||
request.Headers.Add("Host", "localhost");
|
||||
|
||||
Assert.That(request.IsLocalUrl("httpx://localhost"), Is.False);
|
||||
Assert.That(request.IsLocalUrl("foo://localhost"), Is.False);
|
||||
Assert.That(request.IsLocalUrl("data://localhost"), Is.False);
|
||||
Assert.That(request.IsLocalUrl("mailto://localhost"), Is.False);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<package id="Autofac" version="3.5.2" targetFramework="net452" />
|
||||
<package id="Autofac.Web" version="3.2.0" targetFramework="net452" />
|
||||
<package id="Castle.Core" version="3.3.1" targetFramework="net452" />
|
||||
<package id="FluentNHibernate" version="1.4.0.0" targetFramework="net452" />
|
||||
<package id="FluentNHibernate" version="2.0.3.0" targetFramework="net452" />
|
||||
<package id="Iesi.Collections" version="4.0.1.4000" targetFramework="net452" />
|
||||
<package id="IronRuby" version="1.1.3" targetFramework="net452" />
|
||||
<package id="log4net" version="2.0.3" targetFramework="net452" />
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
@@ -34,6 +35,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
|
||||
@@ -32,8 +32,8 @@ using System.Security;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
// Enable web application to call this assembly in Full Trust
|
||||
[assembly: AllowPartiallyTrustedCallers]
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<CodeAnalysisRuleSet>..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -54,6 +55,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Autofac, Version=3.5.0.0, Culture=neutral, PublicKeyToken=17863af14b0044da, processorArchitecture=MSIL">
|
||||
|
||||
@@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
-->
|
||||
<!--
|
||||
<component instance-scope="per-lifetime-scope"
|
||||
type="Orchard.Data.SessionLocator, Orchard.Framework"
|
||||
service="Orchard.Data.ISessionLocator">
|
||||
type="Orchard.Data.TransactionManager, Orchard.Framework"
|
||||
service="Orchard.Data.ITransactionManager">
|
||||
<properties>
|
||||
<property name="IsolationLevel" value="ReadUncommitted" />
|
||||
</properties>
|
||||
|
||||
@@ -1,9 +1,18 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
<log4net xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
|
||||
<root>
|
||||
<priority value="ERROR" xdt:Transform="SetAttributes(value)" />
|
||||
<appender-ref ref="debug-file" xdt:Locator="Match(ref)" xdt:Transform="Remove" />
|
||||
</root>
|
||||
|
||||
<logger name="Orchard" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<appender name="debugger" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
<appender name="debug-file" xdt:Locator="Match(name)" xdt:Transform="Remove" />
|
||||
|
||||
<appender>
|
||||
<immediateFlush value="false" xdt:Transform="SetAttributes(value)" />
|
||||
</appender>
|
||||
|
||||
</log4net>
|
||||
@@ -46,7 +46,7 @@ namespace Orchard.Core.Common.Drivers {
|
||||
return ContentShape("Fields_Common_Text_Edit", GetDifferentiator(field, part),
|
||||
() => {
|
||||
var settings = field.PartFieldDefinition.Settings.GetModel<TextFieldSettings>();
|
||||
var text = part.IsNew() ? settings.DefaultValue : field.Value;
|
||||
var text = part.IsNew() && String.IsNullOrEmpty(field.Value) ? settings.DefaultValue : field.Value;
|
||||
|
||||
var viewModel = new TextFieldDriverViewModel {
|
||||
Field = field,
|
||||
@@ -84,8 +84,7 @@ namespace Orchard.Core.Common.Drivers {
|
||||
}
|
||||
|
||||
protected override void Exporting(ContentPart part, TextField field, ExportContentContext context) {
|
||||
if (!String.IsNullOrEmpty(field.Value))
|
||||
context.Element(field.FieldDefinition.Name + "." + field.Name).SetAttributeValue("Text", field.Value);
|
||||
context.Element(field.FieldDefinition.Name + "." + field.Name).SetAttributeValue("Text", field.Value);
|
||||
}
|
||||
|
||||
protected override void Describe(DescribeMembersContext context) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The common module introduces content parts that are going to be used by most content types (common, body, identity).
|
||||
FeatureDescription: Core content parts.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The containers module introduces container and containable behaviors for content items.
|
||||
FeatureDescription: Container and containable parts to enable parent-child relationships between content items.
|
||||
|
||||
@@ -3,16 +3,19 @@ using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.Core.Contents.Settings;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Security;
|
||||
using Orchard.UI.Navigation;
|
||||
|
||||
namespace Orchard.Core.Contents {
|
||||
public class AdminMenu : INavigationProvider {
|
||||
private readonly IContentDefinitionManager _contentDefinitionManager;
|
||||
private readonly IContentManager _contentManager;
|
||||
private readonly IAuthorizer _authorizer;
|
||||
|
||||
public AdminMenu(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager) {
|
||||
public AdminMenu(IContentDefinitionManager contentDefinitionManager, IContentManager contentManager, IAuthorizer authorizer) {
|
||||
_contentDefinitionManager = contentDefinitionManager;
|
||||
_contentManager = contentManager;
|
||||
_authorizer = authorizer;
|
||||
}
|
||||
|
||||
public Localizer T { get; set; }
|
||||
@@ -20,10 +23,17 @@ namespace Orchard.Core.Contents {
|
||||
|
||||
public void GetNavigation(NavigationBuilder builder) {
|
||||
var contentTypeDefinitions = _contentDefinitionManager.ListTypeDefinitions().OrderBy(d => d.Name);
|
||||
builder.AddImageSet("content")
|
||||
.Add(T("Content"), "1.4", menu => menu
|
||||
.Permission(Permissions.EditOwnContent)
|
||||
.Add(T("Content Items"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }).LocalNav()));
|
||||
var listableContentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Listable);
|
||||
ContentItem listableCi = null;
|
||||
foreach(var contentTypeDefinition in listableContentTypes) {
|
||||
listableCi = _contentManager.New(contentTypeDefinition.Name);
|
||||
if(_authorizer.Authorize(Permissions.EditContent, listableCi)) {
|
||||
builder.AddImageSet("content")
|
||||
.Add(T("Content"), "1.4", menu => menu
|
||||
.Add(T("Content Items"), "1", item => item.Action("List", "Admin", new { area = "Contents", id = "" }).LocalNav()));
|
||||
break;
|
||||
}
|
||||
}
|
||||
var contentTypes = contentTypeDefinitions.Where(ctd => ctd.Settings.GetModel<ContentTypeSettings>().Creatable).OrderBy(ctd => ctd.DisplayName);
|
||||
if (contentTypes.Any()) {
|
||||
builder.Add(T("New"), "-1", menu => {
|
||||
|
||||
@@ -241,6 +241,10 @@ namespace Orchard.Core.Contents.Controllers {
|
||||
if (string.IsNullOrEmpty(id))
|
||||
return CreatableTypeList(containerId);
|
||||
|
||||
if (_contentDefinitionManager.GetTypeDefinition(id) == null) {
|
||||
return RedirectToAction("Create", new { id = "" });
|
||||
}
|
||||
|
||||
var contentItem = _contentManager.New(id);
|
||||
|
||||
if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Cannot create content")))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The contents module enables the creation of custom content types.
|
||||
Features:
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
@using Orchard.Utility.Extensions;
|
||||
@{
|
||||
var contentTypeClassName = ((string)Model.ContentItem.ContentType).HtmlClassify();
|
||||
Model.Classes.Add(contentTypeClassName);
|
||||
Model.Classes.Add("content-item");
|
||||
|
||||
var tag = Tag(Model, "article");
|
||||
}
|
||||
<article class="content-item @contentTypeClassName">
|
||||
@tag.StartElement
|
||||
<header>
|
||||
@Display(Model.Header)
|
||||
@if (Model.Meta != null) {
|
||||
@@ -17,4 +21,4 @@
|
||||
@Display(Model.Footer)
|
||||
</footer>
|
||||
}
|
||||
</article>
|
||||
@tag.EndElement
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The dashboard module is providing the dashboard screen of the admininstration UI of the application.
|
||||
FeatureDescription: Standard admin dashboard.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The Feeds module is providing RSS feeds to content items.
|
||||
FeatureDescription: RSS feeds for content items.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The navigation module creates and manages a simple navigation menu for the front-end of the application and allows you to add content items to the admin menu.
|
||||
FeatureDescription: Menu management.
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
@@ -48,6 +49,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
@@ -397,7 +399,6 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="Views\Gamma\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Contents\Views\Content.cshtml" />
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The dashboard module is providing the reports screen of the application.
|
||||
FeatureDescription: Reports management.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The scheduling module enables background task scheduling.
|
||||
FeatureDescription: Scheduled background tasks.
|
||||
|
||||
@@ -189,7 +189,7 @@ namespace Orchard.Core.Settings.Metadata {
|
||||
|
||||
private void Apply(ContentTypeDefinition model, ContentTypeDefinitionRecord record) {
|
||||
record.DisplayName = model.DisplayName;
|
||||
record.Settings = _settingsFormatter.Map(model.Settings).ToString();
|
||||
record.Settings = Compose(_settingsFormatter.Map(model.Settings));
|
||||
|
||||
var toRemove = record.ContentTypePartDefinitionRecords
|
||||
.Where(partDefinitionRecord => model.Parts.All(part => partDefinitionRecord.ContentPartDefinitionRecord.Name != part.PartDefinition.Name))
|
||||
@@ -215,7 +215,7 @@ namespace Orchard.Core.Settings.Metadata {
|
||||
}
|
||||
|
||||
private void Apply(ContentPartDefinition model, ContentPartDefinitionRecord record) {
|
||||
record.Settings = _settingsFormatter.Map(model.Settings).ToString();
|
||||
record.Settings = Compose(_settingsFormatter.Map(model.Settings));
|
||||
|
||||
var toRemove = record.ContentPartFieldDefinitionRecords
|
||||
.Where(partFieldDefinitionRecord => model.Fields.All(partField => partFieldDefinitionRecord.Name != partField.Name))
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The settings module creates site settings that other modules can contribute to.
|
||||
FeatureDescription: Site settings.
|
||||
|
||||
@@ -63,8 +63,8 @@
|
||||
<span class="hint">@T("Determines whether scripts and stylesheets load in their debuggable or minified form.")</span>
|
||||
</div>
|
||||
<div>
|
||||
@Html.LabelFor(m => m.UseCdn, T("Use CDN"))
|
||||
@Html.CheckBoxFor(m => m.UseCdn)
|
||||
@Html.LabelFor(m => m.UseCdn, T("Use CDN").Text, new { @class = "forcheckbox" })
|
||||
<span class="hint">@T("Determines whether the defined CDN value is used for scripts and stylesheets, or their local version")</span>
|
||||
</div>
|
||||
<div>
|
||||
@@ -84,4 +84,4 @@
|
||||
<span class="hint">@T("Determines the last element of the database that can be displayed. Leave 0 for unlimited.")</span>
|
||||
</div>
|
||||
}
|
||||
</fieldset>
|
||||
</fieldset>
|
||||
|
||||
@@ -283,7 +283,7 @@ namespace Orchard.Core.Shapes {
|
||||
[Shape]
|
||||
public void ContentZone(dynamic Display, dynamic Shape, TextWriter Output) {
|
||||
var unordered = ((IEnumerable<dynamic>)Shape).ToArray();
|
||||
var tabbed = unordered.GroupBy(x => (string)x.Metadata.Tab);
|
||||
var tabbed = unordered.GroupBy(x => (string)x.Metadata.Tab ?? "");
|
||||
|
||||
if (tabbed.Count() > 1) {
|
||||
foreach (var tab in tabbed) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The shapes module contains core shape templates and display hooks.
|
||||
FeatureDescription: Core shape templates and display hooks.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The title module enables content items to have titles.
|
||||
FeatureDescription: Title content part.
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The XmlRpc module enables creation of contents from client applications such as LiveWriter.
|
||||
FeatureDescription: XML-RPC opt-in implementation.
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
using Lucene.Models;
|
||||
using Lucene.Services;
|
||||
using Lucene.ViewModels;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.Indexing;
|
||||
using Orchard.Localization;
|
||||
using Orchard.UI.Notify;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Lucene.Drivers {
|
||||
public class LuceneSettingsPartDriver : ContentPartDriver<LuceneSettingsPart> {
|
||||
private readonly IIndexManager _indexManager;
|
||||
private readonly IEnumerable<ILuceneAnalyzerSelector> _analyzerSelectors;
|
||||
private readonly INotifier _notifier;
|
||||
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public LuceneSettingsPartDriver(IIndexManager indexManager, IEnumerable<ILuceneAnalyzerSelector> analyzerSelectors, INotifier notifier) {
|
||||
_indexManager = indexManager;
|
||||
_analyzerSelectors = analyzerSelectors;
|
||||
_notifier = notifier;
|
||||
T = NullLocalizer.Instance;
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(LuceneSettingsPart part, dynamic shapeHelper) {
|
||||
return ContentShape("Parts_LuceneSettings_Edit", () => {
|
||||
MaintainMappings(part);
|
||||
return shapeHelper.EditorTemplate(
|
||||
TemplateName: "Parts.LuceneSettings",
|
||||
Model: new LuceneSettingsPartEditViewModel {
|
||||
LuceneAnalyzerSelectorMappings = part.LuceneAnalyzerSelectorMappings.ToArray(),
|
||||
LuceneAnalyzerSelectors = _analyzerSelectors.Select(analyzerSelector =>
|
||||
new SelectListItem { Text = T(analyzerSelector.Name).Text, Value = analyzerSelector.Name })
|
||||
},
|
||||
Prefix: Prefix);
|
||||
});
|
||||
}
|
||||
|
||||
protected override DriverResult Editor(LuceneSettingsPart part, IUpdateModel updater, dynamic shapeHelper) {
|
||||
var viewModel = new LuceneSettingsPartEditViewModel();
|
||||
if (updater.TryUpdateModel(viewModel, Prefix, null, null)) {
|
||||
_notifier.Warning(T("Don't forget to rebuild your index in case you have changed its analyzer."));
|
||||
part.LuceneAnalyzerSelectorMappings = viewModel.LuceneAnalyzerSelectorMappings;
|
||||
MaintainMappings(part);
|
||||
}
|
||||
|
||||
return Editor(part, shapeHelper);
|
||||
}
|
||||
|
||||
private void MaintainMappings(LuceneSettingsPart part) {
|
||||
var analyzerProviderNames = _analyzerSelectors.Select(analyzerProvider => analyzerProvider.Name);
|
||||
var indexNames = _indexManager.GetSearchIndexProvider().List();
|
||||
var maintainedMappings = part.LuceneAnalyzerSelectorMappings.ToList();
|
||||
// Removing mappings which contain a removed/invalid index or analyzer provider.
|
||||
maintainedMappings.RemoveAll(mapping => !indexNames.Contains(mapping.IndexName) || !analyzerProviderNames.Contains(mapping.AnalyzerName));
|
||||
// Adding new mappings for the new indexes.
|
||||
foreach (var indexName in indexNames) {
|
||||
if (!maintainedMappings.Any(mapping => mapping.IndexName == indexName)) {
|
||||
maintainedMappings.Add(new LuceneAnalyzerSelectorMapping { IndexName = indexName, AnalyzerName = "Default" });
|
||||
}
|
||||
}
|
||||
|
||||
part.LuceneAnalyzerSelectorMappings = maintainedMappings;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
using Lucene.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Localization;
|
||||
using Orchard.Services;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Lucene.Handlers {
|
||||
public class LuceneSettingsPartHandler : ContentHandler {
|
||||
public Localizer T { get; set; }
|
||||
|
||||
public LuceneSettingsPartHandler(IJsonConverter jsonConverter) {
|
||||
T = NullLocalizer.Instance;
|
||||
|
||||
Filters.Add(new ActivatingFilter<LuceneSettingsPart>("Site"));
|
||||
|
||||
OnActivated<LuceneSettingsPart>((context, part) => {
|
||||
part.LuceneAnalyzerSelectorMappingsField.Loader(() => {
|
||||
return string.IsNullOrEmpty(part.LuceneAnalyzerSelectorMappingsSerialized)
|
||||
? new List<LuceneAnalyzerSelectorMapping>()
|
||||
: jsonConverter.Deserialize<List<LuceneAnalyzerSelectorMapping>>(part.LuceneAnalyzerSelectorMappingsSerialized);
|
||||
});
|
||||
|
||||
part.LuceneAnalyzerSelectorMappingsField.Setter((value) => {
|
||||
part.LuceneAnalyzerSelectorMappingsSerialized = value == null ? "[]" : jsonConverter.Serialize(value);
|
||||
return value;
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
|
||||
if (context.ContentItem.ContentType != "Site") return;
|
||||
|
||||
base.GetItemMetadata(context);
|
||||
|
||||
context.Metadata.EditorGroupInfo.Add(new GroupInfo(T("Lucene Settings")) { Id = "LuceneSettings" });
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -38,6 +38,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -47,6 +48,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="ICSharpCode.SharpZipLib, Version=0.86.0.518, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||
@@ -97,8 +99,12 @@
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Drivers\LuceneSettingsPartDriver.cs" />
|
||||
<Compile Include="Handlers\LuceneSettingsPartHandler.cs" />
|
||||
<Compile Include="Models\LuceneAnalyzerSelectorMapping.cs" />
|
||||
<Compile Include="Models\LuceneDocumentIndex.cs" />
|
||||
<Compile Include="Models\LuceneSearchHit.cs" />
|
||||
<Compile Include="Models\LuceneSettingsPart.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Services\DefaultLuceneAnalyzerSelector.cs" />
|
||||
<Compile Include="Services\DefaultLuceneAnalyzerProvider.cs" />
|
||||
@@ -108,6 +114,7 @@
|
||||
<Compile Include="Services\LuceneIndexProvider.cs" />
|
||||
<Compile Include="Services\LuceneSearchBuilder.cs" />
|
||||
<Compile Include="Services\SearchBits.cs" />
|
||||
<Compile Include="ViewModels\LuceneSettingsPartEditViewModel.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Module.txt" />
|
||||
@@ -127,6 +134,13 @@
|
||||
<ItemGroup>
|
||||
<Content Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Placement.info" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Views\EditorTemplates\Parts.LuceneSettings.cshtml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
namespace Lucene.Models {
|
||||
public class LuceneAnalyzerSelectorMapping {
|
||||
public string IndexName { get; set; }
|
||||
public string AnalyzerName { get; set; }
|
||||
}
|
||||
}
|
||||
21
src/Orchard.Web/Modules/Lucene/Models/LuceneSettingsPart.cs
Normal file
21
src/Orchard.Web/Modules/Lucene/Models/LuceneSettingsPart.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Lucene.Models;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Utilities;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Lucene.Models {
|
||||
public class LuceneSettingsPart : ContentPart {
|
||||
public string LuceneAnalyzerSelectorMappingsSerialized {
|
||||
get { return this.Retrieve(x => x.LuceneAnalyzerSelectorMappingsSerialized); }
|
||||
set { this.Store(x => x.LuceneAnalyzerSelectorMappingsSerialized, value); }
|
||||
}
|
||||
|
||||
private readonly LazyField<IEnumerable<LuceneAnalyzerSelectorMapping>> _luceneAnalyzerSelectorMappings = new LazyField<IEnumerable<LuceneAnalyzerSelectorMapping>>();
|
||||
internal LazyField<IEnumerable<LuceneAnalyzerSelectorMapping>> LuceneAnalyzerSelectorMappingsField { get { return _luceneAnalyzerSelectorMappings; }
|
||||
}
|
||||
public IEnumerable<LuceneAnalyzerSelectorMapping> LuceneAnalyzerSelectorMappings {
|
||||
get { return _luceneAnalyzerSelectorMappings.Value; }
|
||||
set { _luceneAnalyzerSelectorMappings.Value = value; }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The Lucene module enables the site to be indexed using Lucene.NET. The index generated by this module can then be used by the search module to provide an integrated full-text search experience to a web site.
|
||||
FeatureDescription: Lucene indexing services.
|
||||
|
||||
5
src/Orchard.Web/Modules/Lucene/Placement.info
Normal file
5
src/Orchard.Web/Modules/Lucene/Placement.info
Normal file
@@ -0,0 +1,5 @@
|
||||
<Placement>
|
||||
<Match ContentType="Site">
|
||||
<Place Parts_LuceneSettings_Edit="Content: 1@LuceneSettings" />
|
||||
</Match>
|
||||
</Placement>
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
|
||||
@@ -1,34 +1,46 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Lucene.Models;
|
||||
using Lucene.Net.Analysis;
|
||||
using Lucene.Net.Analysis.Standard;
|
||||
using Orchard;
|
||||
using Orchard.ContentManagement;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace Lucene.Services {
|
||||
public class DefaultLuceneAnalyzerProvider : ILuceneAnalyzerProvider {
|
||||
|
||||
private readonly IWorkContextAccessor _wca;
|
||||
private IEnumerable<ILuceneAnalyzerSelector> _analyzerSelectors;
|
||||
|
||||
public DefaultLuceneAnalyzerProvider(IEnumerable<ILuceneAnalyzerSelector> analyzerSelectors) {
|
||||
public DefaultLuceneAnalyzerProvider(IEnumerable<ILuceneAnalyzerSelector> analyzerSelectors, IWorkContextAccessor wca) {
|
||||
_analyzerSelectors = analyzerSelectors;
|
||||
_wca = wca;
|
||||
}
|
||||
|
||||
public Analyzer GetAnalyzer(string indexName) {
|
||||
var luceneSettingsPart = _wca
|
||||
.GetContext()
|
||||
.CurrentSite
|
||||
.As<LuceneSettingsPart>();
|
||||
if (luceneSettingsPart == null) {
|
||||
return new StandardAnalyzer(LuceneIndexProvider.LuceneVersion);
|
||||
}
|
||||
|
||||
var currentIndexMapping = luceneSettingsPart
|
||||
.LuceneAnalyzerSelectorMappings
|
||||
.FirstOrDefault(mapping => mapping.IndexName == indexName);
|
||||
if (currentIndexMapping == null) {
|
||||
return new StandardAnalyzer(LuceneIndexProvider.LuceneVersion);
|
||||
}
|
||||
|
||||
var analyzer = _analyzerSelectors
|
||||
.Where(x => x.Name == currentIndexMapping.AnalyzerName)
|
||||
.Select(x => x.GetLuceneAnalyzer(indexName))
|
||||
.Where(x => x != null)
|
||||
.OrderByDescending(x => x.Priority)
|
||||
.Select(x => x.Analyzer)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (analyzer != null) {
|
||||
return analyzer;
|
||||
}
|
||||
|
||||
return new StandardAnalyzer(LuceneIndexProvider.LuceneVersion);
|
||||
return analyzer != null ? analyzer : new StandardAnalyzer(LuceneIndexProvider.LuceneVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,5 +12,7 @@ namespace Lucene.Services {
|
||||
Analyzer = new StandardAnalyzer(LuceneIndexProvider.LuceneVersion)
|
||||
};
|
||||
}
|
||||
|
||||
public string Name { get { return "Default"; } }
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using Orchard;
|
||||
using Orchard;
|
||||
|
||||
namespace Lucene.Services {
|
||||
public interface ILuceneAnalyzerSelector : IDependency {
|
||||
LuceneAnalyzerSelectorResult GetLuceneAnalyzer(string indexName);
|
||||
string Name { get; }
|
||||
}
|
||||
}
|
||||
@@ -168,7 +168,7 @@ namespace Lucene.Services {
|
||||
writer.DeleteDocuments(query);
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Logger.Error(ex, "An unexpected error occured while removing the documents [{0}] from the index [{1}].", String.Join(", ", documentIds), indexName);
|
||||
Logger.Error(ex, "An unexpected error occurred while removing the documents [{0}] from the index [{1}].", String.Join(", ", documentIds), indexName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
using Lucene.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Mvc;
|
||||
|
||||
namespace Lucene.ViewModels {
|
||||
public class LuceneSettingsPartEditViewModel {
|
||||
public LuceneAnalyzerSelectorMapping[] LuceneAnalyzerSelectorMappings { get; set; }
|
||||
|
||||
public IEnumerable<SelectListItem> LuceneAnalyzerSelectors { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
@model Lucene.ViewModels.LuceneSettingsPartEditViewModel
|
||||
|
||||
@using System.Linq
|
||||
|
||||
<fieldset>
|
||||
<legend>@T("Lucene Settings")</legend>
|
||||
@if (!Model.LuceneAnalyzerSelectorMappings.Any()) {
|
||||
@T("There is currently no mapping. Create an index first.")
|
||||
}
|
||||
else {
|
||||
<ul>
|
||||
@for (int i = 0; i < Model.LuceneAnalyzerSelectorMappings.Length; i++) {
|
||||
<li>
|
||||
@Html.HiddenFor(m => Model.LuceneAnalyzerSelectorMappings[i].IndexName)
|
||||
@Html.LabelFor(m => Model.LuceneAnalyzerSelectorMappings[i].AnalyzerName, T("Analyzer name for the \"{0}\" index", Model.LuceneAnalyzerSelectorMappings[i].IndexName))
|
||||
@Html.DropDownListFor(m => Model.LuceneAnalyzerSelectorMappings[i].AnalyzerName, new SelectList(
|
||||
Model.LuceneAnalyzerSelectors,
|
||||
"Text",
|
||||
"Value",
|
||||
Model.LuceneAnalyzerSelectorMappings[i].AnalyzerName
|
||||
))
|
||||
</li>
|
||||
}
|
||||
</ul>
|
||||
}
|
||||
</fieldset>
|
||||
@@ -37,6 +37,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -47,6 +48,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="MarkdownSharp, Version=1.5.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The Markdown module enables rich text contents to be created using the Markdown syntax.
|
||||
FeatureDescription: Markdown editor.
|
||||
|
||||
@@ -26,6 +26,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
|
||||
@@ -172,8 +172,8 @@ namespace Orchard.Alias.Controllers {
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Services.TransactionManager.Cancel();
|
||||
Services.Notifier.Error(T("An error occured while creating the alias {0}: {1}. Please check the values are correct.", aliasPath, ex.Message));
|
||||
Logger.Error(ex, T("An error occured while creating the alias {0}", aliasPath).Text);
|
||||
Services.Notifier.Error(T("An error occurred while creating the alias {0}: {1}. Please check the values are correct.", aliasPath, ex.Message));
|
||||
Logger.Error(ex, T("An error occurred while creating the alias {0}", aliasPath).Text);
|
||||
|
||||
ViewBag.Path = aliasPath;
|
||||
ViewBag.Route = routePath;
|
||||
@@ -236,8 +236,8 @@ namespace Orchard.Alias.Controllers {
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Services.TransactionManager.Cancel();
|
||||
Services.Notifier.Error(T("An error occured while editing the alias '{0}': {1}. Please check the values are correct.", aliasPath, ex.Message));
|
||||
Logger.Error(ex, T("An error occured while creating the alias '{0}'", aliasPath).Text);
|
||||
Services.Notifier.Error(T("An error occurred while editing the alias '{0}': {1}. Please check the values are correct.", aliasPath, ex.Message));
|
||||
Logger.Error(ex, T("An error occurred while creating the alias '{0}'", aliasPath).Text);
|
||||
|
||||
ViewBag.Path = aliasPath;
|
||||
ViewBag.Route = routePath;
|
||||
|
||||
@@ -3,14 +3,26 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Collections.Concurrent;
|
||||
using Orchard.Alias.Implementation.Map;
|
||||
using Orchard.Alias.Implementation.Updater;
|
||||
|
||||
namespace Orchard.Alias.Implementation.Holder {
|
||||
public class AliasHolder : IAliasHolder {
|
||||
public AliasHolder() {
|
||||
private readonly Lazy<IAliasHolderUpdater> _aliasHolderUpdater;
|
||||
private readonly ConcurrentDictionary<string, AliasMap> _aliasMaps;
|
||||
|
||||
public AliasHolder(Lazy<IAliasHolderUpdater> aliasHolderUpdater) {
|
||||
_aliasHolderUpdater = aliasHolderUpdater;
|
||||
_aliasMaps = new ConcurrentDictionary<string, AliasMap>(StringComparer.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private readonly ConcurrentDictionary<string, AliasMap> _aliasMaps;
|
||||
private ConcurrentDictionary<string, AliasMap> GetOrRefreshAliasMaps() {
|
||||
lock (_aliasMaps) {
|
||||
if (_aliasMaps.Count == 0)
|
||||
_aliasHolderUpdater.Value.Refresh();
|
||||
}
|
||||
|
||||
return _aliasMaps;
|
||||
}
|
||||
|
||||
public void SetAliases(IEnumerable<AliasInfo> aliases) {
|
||||
var grouped = aliases.GroupBy(alias => alias.Area ?? String.Empty, StringComparer.InvariantCultureIgnoreCase);
|
||||
@@ -25,7 +37,7 @@ namespace Orchard.Alias.Implementation.Holder {
|
||||
}
|
||||
|
||||
public void SetAlias(AliasInfo alias) {
|
||||
foreach (var map in _aliasMaps.Values) {
|
||||
foreach (var map in GetOrRefreshAliasMaps().Values) {
|
||||
map.Remove(alias);
|
||||
}
|
||||
|
||||
@@ -33,11 +45,11 @@ namespace Orchard.Alias.Implementation.Holder {
|
||||
}
|
||||
|
||||
public IEnumerable<AliasMap> GetMaps() {
|
||||
return _aliasMaps.Values;
|
||||
return GetOrRefreshAliasMaps().Values;
|
||||
}
|
||||
|
||||
public AliasMap GetMap(string areaName) {
|
||||
return _aliasMaps.GetOrAdd(areaName ?? String.Empty, key => new AliasMap(key));
|
||||
return GetOrRefreshAliasMaps().GetOrAdd(areaName ?? String.Empty, key => new AliasMap(key));
|
||||
}
|
||||
|
||||
public void RemoveAlias(AliasInfo aliasInfo) {
|
||||
|
||||
@@ -2,7 +2,7 @@ Name: Alias
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: Maps friendly urls to specific module actions.
|
||||
FeatureDescription: Maps friendly urls to specific module actions.
|
||||
|
||||
@@ -41,14 +41,14 @@ namespace Orchard.Alias.Navigation {
|
||||
var urlLevel = endsWithSlash ? requestUrl.Count(l => l == '/') - 1 : requestUrl.Count(l => l == '/');
|
||||
var menuLevel = menuPosition.Count(l => l == '.');
|
||||
|
||||
// Checking menu item if it's the leaf element or it's an intermediate element
|
||||
// Checking the menu item whether it's the leaf element or it's an intermediate element
|
||||
// or it's an unneccessary element according to the url.
|
||||
RouteValueDictionary contentRoute;
|
||||
if (menuLevel == urlLevel) {
|
||||
contentRoute = request.RequestContext.RouteData.Values;
|
||||
}
|
||||
else {
|
||||
// If menuLevel doesn't equal with urlLevel it can mean that this menu item is
|
||||
// If menuLevel doesn't equal to urlLevel it can mean that this menu item is
|
||||
// an intermediate element (the difference is a positive value) or this menu
|
||||
// item is lower in the navigation hierarchy according to the url (negative
|
||||
// value). If the value is negative, removing the menu item, if the value
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -47,6 +48,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
<tr>
|
||||
<th scope="col">@T("Alias")</th>
|
||||
<th scope="col">@T("Route")</th>
|
||||
<th scope="col"> </th>
|
||||
</tr>
|
||||
</thead>
|
||||
@foreach (var aliasEntry in Model.AliasEntries) {
|
||||
|
||||
@@ -2,7 +2,7 @@ Name: AntiSpam
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides anti-spam services to protect your content from malicious submissions.
|
||||
Features:
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -47,6 +48,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
|
||||
@@ -29,6 +29,6 @@ using System.Runtime.InteropServices;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Orchard.AntiSpam.Services {
|
||||
return SpamStatus.Ham;
|
||||
}
|
||||
catch(Exception e) {
|
||||
Logger.Error(e, "An error occured while checking for spam");
|
||||
Logger.Error(e, "An error occurred while checking for spam");
|
||||
return SpamStatus.Spam;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ namespace Orchard.AntiSpam.Services {
|
||||
var result = ExecuteValidateRequest(context, "submit-spam");
|
||||
}
|
||||
catch (Exception e) {
|
||||
Logger.Error(e, "An error occured while reporting spam");
|
||||
Logger.Error(e, "An error occurred while reporting spam");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace Orchard.AntiSpam.Services {
|
||||
var result = ExecuteValidateRequest(context, "submit-ham");
|
||||
}
|
||||
catch (Exception e) {
|
||||
Logger.Error(e, "An error occured while reporting ham");
|
||||
Logger.Error(e, "An error occurred while reporting ham");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ Path: ArchiveLater
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: The ArchiveLater module introduces scheduled archiving functionality.
|
||||
FeatureDescription: Scheduled archiving.
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -47,6 +48,7 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
|
||||
@@ -30,6 +30,6 @@ using System.Security;
|
||||
//
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
|
||||
@@ -2,21 +2,63 @@
|
||||
using Orchard.Data.Conventions;
|
||||
|
||||
namespace Orchard.AuditTrail.Models {
|
||||
|
||||
/// <summary>
|
||||
/// Audit Trail Event Record in the database.
|
||||
/// </summary>
|
||||
public class AuditTrailEventRecord {
|
||||
public virtual int Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The time when the event occurred.
|
||||
/// </summary>
|
||||
public virtual DateTime CreatedUtc { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The user name of the user who caused the event to occur.
|
||||
/// </summary>
|
||||
public virtual string UserName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The name of the event.
|
||||
/// </summary>
|
||||
public virtual string EventName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The full name of the event.
|
||||
/// </summary>
|
||||
public virtual string FullEventName { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The category the event belongs to.
|
||||
/// </summary>
|
||||
public virtual string Category { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The data of the event.
|
||||
/// </summary>
|
||||
[StringLengthMax]
|
||||
public virtual string EventData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The filter key of the event.
|
||||
/// </summary>
|
||||
public virtual string EventFilterKey { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The filter data of the event.
|
||||
/// </summary>
|
||||
public virtual string EventFilterData { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The comment of the event.
|
||||
/// </summary>
|
||||
[StringLengthMax]
|
||||
public virtual string Comment { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// The IP address of the user who caused the event to occur.
|
||||
/// </summary>
|
||||
public virtual string ClientIpAddress { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,18 @@
|
||||
namespace Orchard.AuditTrail.Models {
|
||||
|
||||
/// <summary>
|
||||
/// The created audit trail event result
|
||||
/// </summary>
|
||||
public class AuditTrailEventRecordResult {
|
||||
|
||||
/// <summary>
|
||||
/// The created <see cref="AuditTrailEventRecord"/>
|
||||
/// </summary>
|
||||
public AuditTrailEventRecord Record { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether AuditTrailEventRecordResult is disabled for <see cref="AuditTrailEventRecord"/> .
|
||||
/// </summary>
|
||||
public bool IsDisabled { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
AntiForgery: enabled
|
||||
Author: The Orchard Team
|
||||
Website: http://orchardproject.net
|
||||
Version: 1.10.1
|
||||
Version: 1.10.2
|
||||
OrchardVersion: 1.9
|
||||
Description: Provides a log for recording and viewing back-end changes.
|
||||
Features:
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>..\..\..\OrchardBasicCorrectness.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
@@ -46,6 +47,7 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
|
||||
<Prefer32Bit>false</Prefer32Bit>
|
||||
<LangVersion>5</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Iesi.Collections, Version=4.0.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
|
||||
@@ -32,6 +32,6 @@ using System.Security;
|
||||
// You can specify all the values or you can default the Revision and Build Numbers
|
||||
// by using the '*' as shown below:
|
||||
|
||||
[assembly: AssemblyVersion("1.10.1")]
|
||||
[assembly: AssemblyFileVersion("1.10.1")]
|
||||
[assembly: AssemblyVersion("1.10.2")]
|
||||
[assembly: AssemblyFileVersion("1.10.2")]
|
||||
|
||||
|
||||
@@ -16,6 +16,10 @@ using Orchard.Services;
|
||||
using Orchard.Settings;
|
||||
|
||||
namespace Orchard.AuditTrail.Services {
|
||||
|
||||
/// <summary>
|
||||
/// Manage the audit trail.
|
||||
/// </summary>
|
||||
public class AuditTrailManager : Component, IAuditTrailManager {
|
||||
private readonly IRepository<AuditTrailEventRecord> _auditTrailRepository;
|
||||
private readonly IAuditTrailEventProvider _providers;
|
||||
@@ -52,6 +56,14 @@ namespace Orchard.AuditTrail.Services {
|
||||
_clientHostAddressAccessor = clientHostAddressAccessor;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a page of event records from the audit trail.
|
||||
/// </summary>
|
||||
/// <param name="page">The page number to get records from.</param>
|
||||
/// <param name="pageSize">The number of records to get.</param>
|
||||
/// <param name="orderBy">The value to order by.</param>
|
||||
/// <param name="filters">Optional. An object to filter the records on.</param>
|
||||
/// <returns>A page of event records.</returns>
|
||||
public IPageOfItems<AuditTrailEventRecord> GetRecords(
|
||||
int page,
|
||||
int pageSize,
|
||||
@@ -102,10 +114,20 @@ namespace Orchard.AuditTrail.Services {
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a single event record from the audit trail by ID.
|
||||
/// </summary>
|
||||
/// <param name="id">The event record ID.</param>
|
||||
/// <returns>A single event record.</returns>
|
||||
public AuditTrailEventRecord GetRecord(int id) {
|
||||
return _auditTrailRepository.Get(id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Builds a shape tree of filter displays.
|
||||
/// </summary>
|
||||
/// <param name="filters">Input for each filter builder.</param>
|
||||
/// <returns>A tree of shapes.</returns>
|
||||
public dynamic BuildFilterDisplay(Filters filters) {
|
||||
var filterDisplay = (dynamic)_shapeFactory.Create("AuditTrailFilter");
|
||||
var filterDisplayContext = new DisplayFilterContext(_shapeFactory, filters, filterDisplay);
|
||||
@@ -123,6 +145,17 @@ namespace Orchard.AuditTrail.Services {
|
||||
return filterDisplay;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Records an audit trail event.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The audit trail event provider type to determine the scope of the event name.</typeparam>
|
||||
/// <param name="eventName">The shorthand name of the event</param>
|
||||
/// <param name="user">The user to associate with the event. This is typically the currently loggedin user.</param>
|
||||
/// <param name="properties">A property bag of custom event data that could be useful for <see cref="IAuditTrailEventHandler"/> implementations. These values aren't stored. Use the eventData parameter to persist additional data with the event.</param>
|
||||
/// <param name="eventData">A property bag of custom event data that will be stored with the event record.</param>
|
||||
/// <param name="eventFilterKey">The name of a custom key to use when filtering events.</param>
|
||||
/// <param name="eventFilterData">The value of a custom filter key to filter on.</param>
|
||||
/// <returns>The created audit trail event record if the specified event was not disabled.</returns>
|
||||
public AuditTrailEventRecordResult CreateRecord<T>(string eventName, IUser user, IDictionary<string, object> properties = null, IDictionary<string, object> eventData = null, string eventFilterKey = null, string eventFilterData = null) where T : IAuditTrailEventProvider {
|
||||
var eventDescriptor = DescribeEvent<T>(eventName);
|
||||
if (!IsEventEnabled(eventDescriptor))
|
||||
@@ -165,26 +198,49 @@ namespace Orchard.AuditTrail.Services {
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes all audit trail events provided by the system.
|
||||
/// </summary>
|
||||
/// <returns>A list of audit trail category descriptors.</returns>
|
||||
public IEnumerable<AuditTrailCategoryDescriptor> DescribeCategories() {
|
||||
var context = DescribeProviders();
|
||||
return context.Describe();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes all audit trail event providers.
|
||||
/// </summary>
|
||||
public DescribeContext DescribeProviders() {
|
||||
var context = new DescribeContext();
|
||||
_providers.Describe(context);
|
||||
return context;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a single audit trail event.
|
||||
/// </summary>
|
||||
/// <param name="record">The audit trail event record for which to find its descriptor.</param>
|
||||
/// <returns>A single audit trail event descriptor.</returns>
|
||||
public AuditTrailEventDescriptor DescribeEvent(AuditTrailEventRecord record) {
|
||||
return DescribeEvent(record.FullEventName) ?? AuditTrailEventDescriptor.Basic(record);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a single audit trail event.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The scope of the specified event name.</typeparam>
|
||||
/// <param name="eventName">The shorthand name of the event.</param>
|
||||
/// <returns>A single audit trail event descriptor.</returns>
|
||||
public AuditTrailEventDescriptor DescribeEvent<T>(string eventName) where T : IAuditTrailEventProvider {
|
||||
var fullyQualifiedEventName = EventNameExtensions.GetFullyQualifiedEventName<T>(eventName);
|
||||
return DescribeEvent(fullyQualifiedEventName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Describes a single audit trail event.
|
||||
/// </summary>
|
||||
/// <param name="fullyQualifiedEventName">The fully qualified event name to describe.</param>
|
||||
/// <returns>A single audit trail event descriptor.</returns>
|
||||
public AuditTrailEventDescriptor DescribeEvent(string fullyQualifiedEventName) {
|
||||
var categoryDescriptors = DescribeCategories();
|
||||
var eventDescriptorQuery =
|
||||
|
||||
@@ -5,7 +5,17 @@ using Newtonsoft.Json;
|
||||
using Orchard.Logging;
|
||||
|
||||
namespace Orchard.AuditTrail.Services {
|
||||
|
||||
/// <summary>
|
||||
/// A service responsible for serializing and deserializing audit trail event data.
|
||||
/// </summary>
|
||||
public class EventDataSerializer : Component, IEventDataSerializer {
|
||||
|
||||
/// <summary>
|
||||
/// Serialize event data.
|
||||
/// </summary>
|
||||
/// <param name="eventData">eventData to be serialized.</param>
|
||||
/// <returns>The serialized data.</returns>
|
||||
public string Serialize(IDictionary<string, object> eventData) {
|
||||
try {
|
||||
var json = JsonConvert.SerializeObject(eventData, Formatting.None);
|
||||
@@ -18,6 +28,11 @@ namespace Orchard.AuditTrail.Services {
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize event data.
|
||||
/// </summary>
|
||||
/// <param name="eventData">eventData to be deserialized.</param>
|
||||
/// <returns>The deserialized generic dictionary</returns>
|
||||
public IDictionary<string, object> Deserialize(string eventData) {
|
||||
if (String.IsNullOrWhiteSpace(eventData))
|
||||
return new Dictionary<string, object>();
|
||||
|
||||
@@ -6,7 +6,12 @@ using Orchard.Collections;
|
||||
using Orchard.Security;
|
||||
|
||||
namespace Orchard.AuditTrail.Services {
|
||||
|
||||
/// <summary>
|
||||
/// Manage the audit trail.
|
||||
/// </summary>
|
||||
public interface IAuditTrailManager : IDependency {
|
||||
|
||||
/// <summary>
|
||||
/// Gets a page of event records from the audit trail.
|
||||
/// </summary>
|
||||
|
||||
@@ -1,8 +1,24 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.AuditTrail.Services {
|
||||
|
||||
/// <summary>
|
||||
/// A service responsible for serializing and deserializing audit trail event data.
|
||||
/// </summary>
|
||||
public interface IEventDataSerializer : IDependency {
|
||||
|
||||
/// <summary>
|
||||
/// Serialize event data.
|
||||
/// </summary>
|
||||
/// <param name="eventData">eventData to be serialized.</param>
|
||||
/// <returns>The serialized data.</returns>
|
||||
string Serialize(IDictionary<string, object> eventData);
|
||||
|
||||
/// <summary>
|
||||
/// Deserialize event data.
|
||||
/// </summary>
|
||||
/// <param name="eventData">eventData to be deserialized.</param>
|
||||
/// <returns>The deserialized generic dictionary</returns>
|
||||
IDictionary<string, object> Deserialize(string eventData);
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user