From 47ffedd3a7ce9d30ff8c351a58ee1ec18d01f520 Mon Sep 17 00:00:00 2001 From: Alistair Deneys Date: Fri, 7 Aug 2020 09:57:42 +1000 Subject: [PATCH 1/4] Added build configs for Sitecore 10 --- Directory.Build.props | 82 +-- Sitecore.Modules.WeBlog.sln | 66 ++ .../CreateComment/AkismetSpamCheckFixture.cs | 4 +- deploy.props.sample | 47 +- .../Sitecore.Modules.WeBlog.Mvc.csproj | 4 + .../Data/Items/BlogHomeItem.cs | 582 +++++++++--------- .../Data/Items/EntryItem.cs | 4 +- .../Extensions/BaseLinkManagerExtensions.cs | 54 +- .../Sitecore.Modules.WeBlog.csproj | 11 + .../web/WeBlog/MetaBlogApi.ashx.cs | 10 +- .../sitecore modules/web/WeBlog/rsd.ashx.cs | 51 +- test/UnitTest/UnitTest.csproj | 38 +- .../web/WeBlog/MetaBlogApiFixture.cs | 12 +- 13 files changed, 531 insertions(+), 434 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 8deb5fb1..13f39dd6 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,39 +1,43 @@ - - - - net471 - Library - WeBlog Community - WeTeam Community - WeBlog - Copyright © 2011 - 2020 - 4.1.0 - Debug sc9.0;Debug sc9.1;Debug sc9.2;Debug sc9.3;Release sc9.0;Release sc9.1;Release sc9.2;Release sc9.3 - - - $(DefineConstants);DEBUG;TRACE - - - $(DefineConstants);TRACE - - - v4.6.2 - $(DefineConstants) - bin\sc90\ - - - v4.7.1 - $(DefineConstants);SC91 - bin\sc91\ - - - v4.7.1 - $(DefineConstants);FEATURE_JOB_ABSTRACTIONS - bin\sc92\ - - - v4.7.1 - $(DefineConstants);FEATURE_JOB_ABSTRACTIONS;SC93 - bin\sc93\ - - + + + + Library + WeBlog Community + WeTeam Community + WeBlog + Copyright © 2011 - 2020 + 4.1.0 + Debug sc9.0;Debug sc9.1;Debug sc9.2;Debug sc9.3;Debug sc10.0;Release sc9.0;Release sc9.1;Release sc9.2;Release sc9.3;Release sc10.0 + + + $(DefineConstants);DEBUG;TRACE + + + $(DefineConstants);TRACE + + + net462 + $(DefineConstants) + bin\sc90\ + + + net471 + $(DefineConstants);SC91 + bin\sc91\ + + + net471 + $(DefineConstants);FEATURE_JOB_ABSTRACTIONS + bin\sc92\ + + + net471 + $(DefineConstants);FEATURE_JOB_ABSTRACTIONS;FEATURE_URL_BUILDERS + bin\sc93\ + + + net48 + $(DefineConstants);FEATURE_JOB_ABSTRACTIONS;FEATURE_URL_BUILDERS + bin\sc100\ + + diff --git a/Sitecore.Modules.WeBlog.sln b/Sitecore.Modules.WeBlog.sln index e2958ef5..30d9c2f1 100644 --- a/Sitecore.Modules.WeBlog.sln +++ b/Sitecore.Modules.WeBlog.sln @@ -20,6 +20,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug sc10.0|Any CPU = Debug sc10.0|Any CPU + Debug sc10.0|x64 = Debug sc10.0|x64 + Debug sc10.0|x86 = Debug sc10.0|x86 Debug sc9.0|Any CPU = Debug sc9.0|Any CPU Debug sc9.0|x64 = Debug sc9.0|x64 Debug sc9.0|x86 = Debug sc9.0|x86 @@ -35,6 +38,9 @@ Global Debug|Any CPU = Debug|Any CPU Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 + Release sc10.0|Any CPU = Release sc10.0|Any CPU + Release sc10.0|x64 = Release sc10.0|x64 + Release sc10.0|x86 = Release sc10.0|x86 Release sc9.0|Any CPU = Release sc9.0|Any CPU Release sc9.0|x64 = Release sc9.0|x64 Release sc9.0|x86 = Release sc9.0|x86 @@ -52,6 +58,12 @@ Global Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug sc10.0|Any CPU.ActiveCfg = Debug sc10.0|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug sc10.0|Any CPU.Build.0 = Debug sc10.0|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug sc10.0|x64.ActiveCfg = Debug sc10.0|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug sc10.0|x64.Build.0 = Debug sc10.0|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug sc10.0|x86.ActiveCfg = Debug sc10.0|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug sc10.0|x86.Build.0 = Debug sc10.0|Any CPU {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug sc9.0|Any CPU.ActiveCfg = Debug sc9.0|Any CPU {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug sc9.0|Any CPU.Build.0 = Debug sc9.0|Any CPU {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug sc9.0|x64.ActiveCfg = Debug sc9.0|Any CPU @@ -82,6 +94,12 @@ Global {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug|x64.Build.0 = Debug sc9.1|Any CPU {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug|x86.ActiveCfg = Debug sc9.1|Any CPU {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Debug|x86.Build.0 = Debug sc9.1|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release sc10.0|Any CPU.ActiveCfg = Release sc10.0|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release sc10.0|Any CPU.Build.0 = Release sc10.0|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release sc10.0|x64.ActiveCfg = Release sc10.0|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release sc10.0|x64.Build.0 = Release sc10.0|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release sc10.0|x86.ActiveCfg = Release sc10.0|Any CPU + {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release sc10.0|x86.Build.0 = Release sc10.0|Any CPU {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release sc9.0|Any CPU.ActiveCfg = Release sc9.0|Any CPU {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release sc9.0|Any CPU.Build.0 = Release sc9.0|Any CPU {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release sc9.0|x64.ActiveCfg = Release sc9.0|Any CPU @@ -112,6 +130,12 @@ Global {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release|x64.Build.0 = Release sc9.1|Any CPU {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release|x86.ActiveCfg = Release sc9.1|Any CPU {747B5430-6DED-4127-96E7-E4E9CCAF9645}.Release|x86.Build.0 = Release sc9.1|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug sc10.0|Any CPU.ActiveCfg = Debug sc10.0|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug sc10.0|Any CPU.Build.0 = Debug sc10.0|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug sc10.0|x64.ActiveCfg = Debug sc10.0|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug sc10.0|x64.Build.0 = Debug sc10.0|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug sc10.0|x86.ActiveCfg = Debug sc10.0|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug sc10.0|x86.Build.0 = Debug sc10.0|Any CPU {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug sc9.0|Any CPU.ActiveCfg = Debug sc9.0|Any CPU {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug sc9.0|Any CPU.Build.0 = Debug sc9.0|Any CPU {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug sc9.0|x64.ActiveCfg = Debug sc9.0|Any CPU @@ -142,6 +166,12 @@ Global {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug|x64.Build.0 = Debug sc9.1|Any CPU {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug|x86.ActiveCfg = Debug sc9.1|Any CPU {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Debug|x86.Build.0 = Debug sc9.1|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release sc10.0|Any CPU.ActiveCfg = Release sc10.0|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release sc10.0|Any CPU.Build.0 = Release sc10.0|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release sc10.0|x64.ActiveCfg = Release sc10.0|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release sc10.0|x64.Build.0 = Release sc10.0|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release sc10.0|x86.ActiveCfg = Release sc10.0|Any CPU + {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release sc10.0|x86.Build.0 = Release sc10.0|Any CPU {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release sc9.0|Any CPU.ActiveCfg = Release sc9.0|Any CPU {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release sc9.0|Any CPU.Build.0 = Release sc9.0|Any CPU {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release sc9.0|x64.ActiveCfg = Release sc9.0|Any CPU @@ -172,6 +202,12 @@ Global {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release|x64.Build.0 = Release sc9.1|Any CPU {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release|x86.ActiveCfg = Release sc9.1|Any CPU {B0C7A560-7D61-4BBA-9F16-EEF57BEE7E89}.Release|x86.Build.0 = Release sc9.1|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug sc10.0|Any CPU.ActiveCfg = Debug sc10.0|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug sc10.0|Any CPU.Build.0 = Debug sc10.0|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug sc10.0|x64.ActiveCfg = Debug sc10.0|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug sc10.0|x64.Build.0 = Debug sc10.0|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug sc10.0|x86.ActiveCfg = Debug sc10.0|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug sc10.0|x86.Build.0 = Debug sc10.0|Any CPU {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug sc9.0|Any CPU.ActiveCfg = Debug sc9.0|Any CPU {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug sc9.0|Any CPU.Build.0 = Debug sc9.0|Any CPU {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug sc9.0|x64.ActiveCfg = Debug sc9.0|Any CPU @@ -202,6 +238,12 @@ Global {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug|x64.Build.0 = Debug sc9.1|Any CPU {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug|x86.ActiveCfg = Debug sc9.1|Any CPU {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Debug|x86.Build.0 = Debug sc9.1|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release sc10.0|Any CPU.ActiveCfg = Release sc10.0|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release sc10.0|Any CPU.Build.0 = Release sc10.0|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release sc10.0|x64.ActiveCfg = Release sc10.0|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release sc10.0|x64.Build.0 = Release sc10.0|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release sc10.0|x86.ActiveCfg = Release sc10.0|Any CPU + {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release sc10.0|x86.Build.0 = Release sc10.0|Any CPU {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release sc9.0|Any CPU.ActiveCfg = Release sc9.0|Any CPU {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release sc9.0|Any CPU.Build.0 = Release sc9.0|Any CPU {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release sc9.0|x64.ActiveCfg = Release sc9.0|Any CPU @@ -232,6 +274,12 @@ Global {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release|x64.Build.0 = Release sc9.1|Any CPU {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release|x86.ActiveCfg = Release sc9.1|Any CPU {93BE1BA0-A0FF-4819-A735-63CB9192C7B1}.Release|x86.Build.0 = Release sc9.1|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug sc10.0|Any CPU.ActiveCfg = Debug sc10.0|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug sc10.0|Any CPU.Build.0 = Debug sc10.0|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug sc10.0|x64.ActiveCfg = Debug sc10.0|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug sc10.0|x64.Build.0 = Debug sc10.0|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug sc10.0|x86.ActiveCfg = Debug sc10.0|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug sc10.0|x86.Build.0 = Debug sc10.0|Any CPU {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug sc9.0|Any CPU.ActiveCfg = Debug sc9.0|Any CPU {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug sc9.0|Any CPU.Build.0 = Debug sc9.0|Any CPU {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug sc9.0|x64.ActiveCfg = Debug sc9.0|Any CPU @@ -262,6 +310,12 @@ Global {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug|x64.Build.0 = Debug sc9.1|Any CPU {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug|x86.ActiveCfg = Debug sc9.1|Any CPU {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Debug|x86.Build.0 = Debug sc9.1|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release sc10.0|Any CPU.ActiveCfg = Release sc10.0|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release sc10.0|Any CPU.Build.0 = Release sc10.0|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release sc10.0|x64.ActiveCfg = Release sc10.0|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release sc10.0|x64.Build.0 = Release sc10.0|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release sc10.0|x86.ActiveCfg = Release sc10.0|Any CPU + {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release sc10.0|x86.Build.0 = Release sc10.0|Any CPU {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release sc9.0|Any CPU.ActiveCfg = Release sc9.0|Any CPU {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release sc9.0|Any CPU.Build.0 = Release sc9.0|Any CPU {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release sc9.0|x64.ActiveCfg = Release sc9.0|Any CPU @@ -292,6 +346,12 @@ Global {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release|x64.Build.0 = Release sc9.1|Any CPU {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release|x86.ActiveCfg = Release sc9.1|Any CPU {EEB688C3-67F2-4F13-B525-7B577E998FA9}.Release|x86.Build.0 = Release sc9.1|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug sc10.0|Any CPU.ActiveCfg = Debug sc10.0|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug sc10.0|Any CPU.Build.0 = Debug sc10.0|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug sc10.0|x64.ActiveCfg = Debug sc10.0|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug sc10.0|x64.Build.0 = Debug sc10.0|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug sc10.0|x86.ActiveCfg = Debug sc10.0|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug sc10.0|x86.Build.0 = Debug sc10.0|Any CPU {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug sc9.0|Any CPU.ActiveCfg = Debug sc9.0|Any CPU {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug sc9.0|Any CPU.Build.0 = Debug sc9.0|Any CPU {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug sc9.0|x64.ActiveCfg = Debug sc9.0|Any CPU @@ -322,6 +382,12 @@ Global {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug|x64.Build.0 = Debug sc9.1|Any CPU {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug|x86.ActiveCfg = Debug sc9.1|Any CPU {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Debug|x86.Build.0 = Debug sc9.1|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Release sc10.0|Any CPU.ActiveCfg = Release sc10.0|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Release sc10.0|Any CPU.Build.0 = Release sc10.0|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Release sc10.0|x64.ActiveCfg = Release sc10.0|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Release sc10.0|x64.Build.0 = Release sc10.0|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Release sc10.0|x86.ActiveCfg = Release sc10.0|Any CPU + {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Release sc10.0|x86.Build.0 = Release sc10.0|Any CPU {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Release sc9.0|Any CPU.ActiveCfg = Release sc9.0|Any CPU {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Release sc9.0|Any CPU.Build.0 = Release sc9.0|Any CPU {D1D6021C-B84F-47BA-B7B3-4D97132219BE}.Release sc9.0|x64.ActiveCfg = Release sc9.0|Any CPU diff --git a/Test/UnitTest/Pipelines/CreateComment/AkismetSpamCheckFixture.cs b/Test/UnitTest/Pipelines/CreateComment/AkismetSpamCheckFixture.cs index 39ff53bc..93d9596a 100644 --- a/Test/UnitTest/Pipelines/CreateComment/AkismetSpamCheckFixture.cs +++ b/Test/UnitTest/Pipelines/CreateComment/AkismetSpamCheckFixture.cs @@ -12,7 +12,7 @@ using Sitecore.Modules.WeBlog.Pipelines.CreateComment; using Sitecore.Workflows; -#if SC93 +#if FEATURE_URL_BUILDERS using Sitecore.Links.UrlBuilders; #endif @@ -145,7 +145,7 @@ public void Process_CommentIsSpam_AbortsPipeline() private (AkismetSpamCheck processor, CreateCommentArgs args, Mock akismetApiMock) CreateAkismetSpamCheck(IWeBlogSettings settings, IWorkflowProvider workflowProvider) { var linkManager = Mock.Of(x => -#if SC93 +#if FEATURE_URL_BUILDERS x.GetItemUrl(It.IsAny(), It.Is(y => y.AlwaysIncludeServerUrl == true)) == "link" #else x.GetItemUrl(It.IsAny(), It.Is(y => y.AlwaysIncludeServerUrl == true)) == "link" diff --git a/deploy.props.sample b/deploy.props.sample index 0a99b58d..c43e898e 100644 --- a/deploy.props.sample +++ b/deploy.props.sample @@ -1,22 +1,27 @@ - - - - C:\inetpub\WeBlog\Sitecore 9.0\cm\Website - C:\inetpub\WeBlog\Sitecore 9.0\cd\Website - - - - C:\inetpub\WeBlog\Sitecore 9.1\cm\Website - C:\inetpub\WeBlog\Sitecore 9.1\cd\Website - - - - C:\inetpub\WeBlog\Sitecore 9.2\cm\Website - C:\inetpub\WeBlog\Sitecore 9.2\cd\Website - - - - C:\inetpub\WeBlog\Sitecore 9.3\cm\Website - C:\inetpub\WeBlog\Sitecore 9.3\cd\Website - + + + + C:\inetpub\WeBlog\Sitecore 9.0\cm\Website + C:\inetpub\WeBlog\Sitecore 9.0\cd\Website + + + + C:\inetpub\WeBlog\Sitecore 9.1\cm\Website + C:\inetpub\WeBlog\Sitecore 9.1\cd\Website + + + + C:\inetpub\WeBlog\Sitecore 9.2\cm\Website + C:\inetpub\WeBlog\Sitecore 9.2\cd\Website + + + + C:\inetpub\WeBlog\Sitecore 9.3\cm\Website + C:\inetpub\WeBlog\Sitecore 9.3\cd\Website + + + + C:\inetpub\WeBlog\Sitecore 10.0\cm\Website + C:\inetpub\WeBlog\Sitecore 10.0\cd\Website + \ No newline at end of file diff --git a/src/Sitecore.Modules.WeBlog.Mvc/Sitecore.Modules.WeBlog.Mvc.csproj b/src/Sitecore.Modules.WeBlog.Mvc/Sitecore.Modules.WeBlog.Mvc.csproj index c56ea1fc..938023df 100644 --- a/src/Sitecore.Modules.WeBlog.Mvc/Sitecore.Modules.WeBlog.Mvc.csproj +++ b/src/Sitecore.Modules.WeBlog.Mvc/Sitecore.Modules.WeBlog.Mvc.csproj @@ -15,6 +15,10 @@ + + + + diff --git a/src/Sitecore.Modules.WeBlog/Data/Items/BlogHomeItem.cs b/src/Sitecore.Modules.WeBlog/Data/Items/BlogHomeItem.cs index 3566fc48..fae35183 100644 --- a/src/Sitecore.Modules.WeBlog/Data/Items/BlogHomeItem.cs +++ b/src/Sitecore.Modules.WeBlog/Data/Items/BlogHomeItem.cs @@ -1,292 +1,292 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using Sitecore.Abstractions; -using Sitecore.Data.Items; -using Sitecore.DependencyInjection; -using Sitecore.Links; -using Sitecore.Modules.WeBlog.Data.Fields; -using Sitecore.Modules.WeBlog.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Sitecore.Modules.WeBlog.Managers; - -#if SC93 -using Sitecore.Links.UrlBuilders; -#endif - -namespace Sitecore.Modules.WeBlog.Data.Items -{ - public class BlogHomeItem : CustomItem - { - [Obsolete("No longer used. If required, resolve this member from the service provider.")] - protected IWeBlogSettings Settings { get; } - - public BlogHomeItem(Item innerItem) - : base(innerItem) - { - } - - [Obsolete("Use ctor(Item) instead.")] - public BlogHomeItem(Item innerItem, IWeBlogSettings settings = null) - : base(innerItem) - { - Settings = settings; - } - - [Obsolete("Use ctor() instead.")] - public BlogHomeItem(Item innerItem, BaseLinkManager linkManager, IWeBlogSettings settings = null) - : base(innerItem) - { - Settings = settings; - } - - public static implicit operator BlogHomeItem(Item innerItem) - { - return innerItem != null ? new BlogHomeItem(innerItem) : null; - } - - public static implicit operator Item(BlogHomeItem customItem) - { - return customItem != null ? customItem.InnerItem : null; - } - - public CustomLookupField DefinedCategoryTemplate - { - get { return new CustomLookupField(InnerItem, InnerItem.Fields["Defined Category Template"]); } - } - - - public CustomCheckboxField EnableRss - { - get { return new CustomCheckboxField(InnerItem, InnerItem.Fields["Enable RSS"]); } - } - - - public CustomTextField Title - { - get { return new CustomTextField(InnerItem, InnerItem.Fields["Title"]); } - } - - - public CustomLookupField DefinedEntryTemplate - { - get { return new CustomLookupField(InnerItem, InnerItem.Fields["Defined Entry Template"]); } - } - - - public CustomTextField Email - { - get { return new CustomTextField(InnerItem, InnerItem.Fields["Email"]); } - } - - - public CustomCheckboxField EnableComments - { - get { return new CustomCheckboxField(InnerItem, InnerItem.Fields["Enable Comments"]); } - } - - - public CustomLookupField DefinedCommentTemplate - { - get { return new CustomLookupField(InnerItem, InnerItem.Fields["Defined Comment Template"]); } - } - - - public CustomCheckboxField ShowEmailWithinComments - { - get { return new CustomCheckboxField(InnerItem, InnerItem.Fields["Show Email Within Comments"]); } - } - - - public CustomLookupField Theme - { - get { return new CustomLookupField(InnerItem, InnerItem.Fields["Theme"]); } - } - - - public CustomTextField DisplayItemCount - { - get { return new CustomTextField(InnerItem, InnerItem.Fields["DisplayItemCount"]); } - } - - - public CustomCheckboxField EnableLiveWriter - { - get { return new CustomCheckboxField(InnerItem, InnerItem.Fields["EnableLiveWriter"]); } - } - - - public CustomTextField DisplayCommentSidebarCount - { - get { return new CustomTextField(InnerItem, InnerItem.Fields["DisplayCommentSidebarCount"]); } - } - - - public CustomCheckboxField EnableGravatar - { - get { return new CustomCheckboxField(InnerItem, InnerItem.Fields["Enable Gravatar"]); } - } - - - public CustomTextField GravatarSize - { - get { return new CustomTextField(InnerItem, InnerItem.Fields["Gravatar Size"]); } - } - - - public CustomMultiListField DefaultGravatarStyle - { - get { return new CustomMultiListField(InnerItem, InnerItem.Fields["Default Gravatar Style"]); } - } - - - public CustomTextField MaximumEntryImageSize - { - get { return new CustomTextField(InnerItem, InnerItem.Fields["Maximum Entry Image Size"]); } - } - - - public CustomMultiListField GravatarRating - { - get { return new CustomMultiListField(InnerItem, InnerItem.Fields["Gravatar Rating"]); } - } - - - public CustomTextField MaximumThumbnailImageSize - { - get { return new CustomTextField(InnerItem, InnerItem.Fields["Maximum Thumbnail Image Size"]); } - } - - - public CustomLookupField CustomDictionaryFolder - { - get { return new CustomLookupField(InnerItem, InnerItem.Fields["Custom Dictionary Folder"]); } - } - - public int DisplayItemCountNumeric - { - get - { - var count = 0; - Int32.TryParse(DisplayItemCount.Raw, out count); - return count; - } - } - - public int DisplayCommentSidebarCountNumeric - { - get - { - var count = 0; - Int32.TryParse(DisplayCommentSidebarCount.Raw, out count); - return count; - } - } - - public int GravatarSizeNumeric - { - get - { - var size = 50; - int.TryParse(GravatarSize.Raw, out size); - return size; - } - } - - public Size MaximumEntryImageSizeDimension - { - get - { - var size = ParseDimension(MaximumEntryImageSize.Raw); - return size != Size.Empty ? size : new Size(300, 300); - } - } - - public Size MaximumThumbnailImageSizeDimension - { - get - { - var size = ParseDimension(MaximumThumbnailImageSize.Raw); - return size != Size.Empty ? size : new Size(50, 50); - } - } - - protected Size ParseDimension(string fieldValue) - { - if (string.IsNullOrEmpty(fieldValue)) return Size.Empty; - - var numbers = fieldValue.Split(new char[] { ',', 'x', ' ' }, StringSplitOptions.RemoveEmptyEntries); - - if (numbers.Length < 2) return Size.Empty; - - var width = 0; - int.TryParse(numbers[0], out width); - - var height = 0; - int.TryParse(numbers[1], out height); - - return new Size(width, height); - } - - /// - /// Gets the URL of the blog item - /// - [Obsolete("Use the Sitecore LinkManager instead.")] - public string Url - { - get - { - return LinkManager.GetItemUrl(InnerItem); - } - } - - /// - /// Gets the absolute URL of the blog item including the server - /// - [Obsolete("Use BaseLinkManager.GetItemUrl() with this item instead.")] - public string AbsoluteUrl - { - get - { -#if SC93 - var urlOptions = new ItemUrlBuilderOptions(); -#else - var urlOptions = UrlOptions.DefaultOptions; -#endif - - urlOptions.AlwaysIncludeServerUrl = true; - return LinkManager.GetItemUrl(InnerItem, urlOptions); - } - } - - [Obsolete("Use Sitecore.Modules.WeBlog.Data.IFeedResolver instead.")] - public IEnumerable SyndicationFeeds - { - get - { - var resolver = ServiceLocator.ServiceProvider.GetRequiredService(); - return resolver.Resolve(this); - } - } - - [Obsolete("Use Sitecore.Modules.WeBlog.Managers.BlogManager.GetDictionaryItem() instead.")] - public Item DictionaryItem - { - get - { - var manager = ServiceLocator.ServiceProvider.GetRequiredService(); - return manager.GetDictionaryItem(); - } - } - - [Obsolete("Use Sitecore.Modules.WeBlog.Configuration.IBlogSettingsResolver instead.")] - public BlogSettings BlogSettings - { - get - { - var resolver = ServiceLocator.ServiceProvider.GetRequiredService(); - return resolver.Resolve(this); - } - } - } +using System; +using System.Collections.Generic; +using System.Drawing; +using Sitecore.Abstractions; +using Sitecore.Data.Items; +using Sitecore.DependencyInjection; +using Sitecore.Links; +using Sitecore.Modules.WeBlog.Data.Fields; +using Sitecore.Modules.WeBlog.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Sitecore.Modules.WeBlog.Managers; + +#if FEATURE_URL_BUILDERS +using Sitecore.Links.UrlBuilders; +#endif + +namespace Sitecore.Modules.WeBlog.Data.Items +{ + public class BlogHomeItem : CustomItem + { + [Obsolete("No longer used. If required, resolve this member from the service provider.")] + protected IWeBlogSettings Settings { get; } + + public BlogHomeItem(Item innerItem) + : base(innerItem) + { + } + + [Obsolete("Use ctor(Item) instead.")] + public BlogHomeItem(Item innerItem, IWeBlogSettings settings = null) + : base(innerItem) + { + Settings = settings; + } + + [Obsolete("Use ctor() instead.")] + public BlogHomeItem(Item innerItem, BaseLinkManager linkManager, IWeBlogSettings settings = null) + : base(innerItem) + { + Settings = settings; + } + + public static implicit operator BlogHomeItem(Item innerItem) + { + return innerItem != null ? new BlogHomeItem(innerItem) : null; + } + + public static implicit operator Item(BlogHomeItem customItem) + { + return customItem != null ? customItem.InnerItem : null; + } + + public CustomLookupField DefinedCategoryTemplate + { + get { return new CustomLookupField(InnerItem, InnerItem.Fields["Defined Category Template"]); } + } + + + public CustomCheckboxField EnableRss + { + get { return new CustomCheckboxField(InnerItem, InnerItem.Fields["Enable RSS"]); } + } + + + public CustomTextField Title + { + get { return new CustomTextField(InnerItem, InnerItem.Fields["Title"]); } + } + + + public CustomLookupField DefinedEntryTemplate + { + get { return new CustomLookupField(InnerItem, InnerItem.Fields["Defined Entry Template"]); } + } + + + public CustomTextField Email + { + get { return new CustomTextField(InnerItem, InnerItem.Fields["Email"]); } + } + + + public CustomCheckboxField EnableComments + { + get { return new CustomCheckboxField(InnerItem, InnerItem.Fields["Enable Comments"]); } + } + + + public CustomLookupField DefinedCommentTemplate + { + get { return new CustomLookupField(InnerItem, InnerItem.Fields["Defined Comment Template"]); } + } + + + public CustomCheckboxField ShowEmailWithinComments + { + get { return new CustomCheckboxField(InnerItem, InnerItem.Fields["Show Email Within Comments"]); } + } + + + public CustomLookupField Theme + { + get { return new CustomLookupField(InnerItem, InnerItem.Fields["Theme"]); } + } + + + public CustomTextField DisplayItemCount + { + get { return new CustomTextField(InnerItem, InnerItem.Fields["DisplayItemCount"]); } + } + + + public CustomCheckboxField EnableLiveWriter + { + get { return new CustomCheckboxField(InnerItem, InnerItem.Fields["EnableLiveWriter"]); } + } + + + public CustomTextField DisplayCommentSidebarCount + { + get { return new CustomTextField(InnerItem, InnerItem.Fields["DisplayCommentSidebarCount"]); } + } + + + public CustomCheckboxField EnableGravatar + { + get { return new CustomCheckboxField(InnerItem, InnerItem.Fields["Enable Gravatar"]); } + } + + + public CustomTextField GravatarSize + { + get { return new CustomTextField(InnerItem, InnerItem.Fields["Gravatar Size"]); } + } + + + public CustomMultiListField DefaultGravatarStyle + { + get { return new CustomMultiListField(InnerItem, InnerItem.Fields["Default Gravatar Style"]); } + } + + + public CustomTextField MaximumEntryImageSize + { + get { return new CustomTextField(InnerItem, InnerItem.Fields["Maximum Entry Image Size"]); } + } + + + public CustomMultiListField GravatarRating + { + get { return new CustomMultiListField(InnerItem, InnerItem.Fields["Gravatar Rating"]); } + } + + + public CustomTextField MaximumThumbnailImageSize + { + get { return new CustomTextField(InnerItem, InnerItem.Fields["Maximum Thumbnail Image Size"]); } + } + + + public CustomLookupField CustomDictionaryFolder + { + get { return new CustomLookupField(InnerItem, InnerItem.Fields["Custom Dictionary Folder"]); } + } + + public int DisplayItemCountNumeric + { + get + { + var count = 0; + Int32.TryParse(DisplayItemCount.Raw, out count); + return count; + } + } + + public int DisplayCommentSidebarCountNumeric + { + get + { + var count = 0; + Int32.TryParse(DisplayCommentSidebarCount.Raw, out count); + return count; + } + } + + public int GravatarSizeNumeric + { + get + { + var size = 50; + int.TryParse(GravatarSize.Raw, out size); + return size; + } + } + + public Size MaximumEntryImageSizeDimension + { + get + { + var size = ParseDimension(MaximumEntryImageSize.Raw); + return size != Size.Empty ? size : new Size(300, 300); + } + } + + public Size MaximumThumbnailImageSizeDimension + { + get + { + var size = ParseDimension(MaximumThumbnailImageSize.Raw); + return size != Size.Empty ? size : new Size(50, 50); + } + } + + protected Size ParseDimension(string fieldValue) + { + if (string.IsNullOrEmpty(fieldValue)) return Size.Empty; + + var numbers = fieldValue.Split(new char[] { ',', 'x', ' ' }, StringSplitOptions.RemoveEmptyEntries); + + if (numbers.Length < 2) return Size.Empty; + + var width = 0; + int.TryParse(numbers[0], out width); + + var height = 0; + int.TryParse(numbers[1], out height); + + return new Size(width, height); + } + + /// + /// Gets the URL of the blog item + /// + [Obsolete("Use the Sitecore LinkManager instead.")] + public string Url + { + get + { + return LinkManager.GetItemUrl(InnerItem); + } + } + + /// + /// Gets the absolute URL of the blog item including the server + /// + [Obsolete("Use BaseLinkManager.GetItemUrl() with this item instead.")] + public string AbsoluteUrl + { + get + { +#if FEATURE_URL_BUILDERS + var urlOptions = new ItemUrlBuilderOptions(); +#else + var urlOptions = UrlOptions.DefaultOptions; +#endif + + urlOptions.AlwaysIncludeServerUrl = true; + return LinkManager.GetItemUrl(InnerItem, urlOptions); + } + } + + [Obsolete("Use Sitecore.Modules.WeBlog.Data.IFeedResolver instead.")] + public IEnumerable SyndicationFeeds + { + get + { + var resolver = ServiceLocator.ServiceProvider.GetRequiredService(); + return resolver.Resolve(this); + } + } + + [Obsolete("Use Sitecore.Modules.WeBlog.Managers.BlogManager.GetDictionaryItem() instead.")] + public Item DictionaryItem + { + get + { + var manager = ServiceLocator.ServiceProvider.GetRequiredService(); + return manager.GetDictionaryItem(); + } + } + + [Obsolete("Use Sitecore.Modules.WeBlog.Configuration.IBlogSettingsResolver instead.")] + public BlogSettings BlogSettings + { + get + { + var resolver = ServiceLocator.ServiceProvider.GetRequiredService(); + return resolver.Resolve(this); + } + } + } } \ No newline at end of file diff --git a/src/Sitecore.Modules.WeBlog/Data/Items/EntryItem.cs b/src/Sitecore.Modules.WeBlog/Data/Items/EntryItem.cs index 405a67b4..3b799852 100644 --- a/src/Sitecore.Modules.WeBlog/Data/Items/EntryItem.cs +++ b/src/Sitecore.Modules.WeBlog/Data/Items/EntryItem.cs @@ -9,7 +9,7 @@ using Sitecore.Modules.WeBlog.Model; using Sitecore.Security.Accounts; -#if SC93 +#if FEATURE_URL_BUILDERS using Sitecore.Links.UrlBuilders; #endif @@ -125,7 +125,7 @@ public string AbsoluteUrl { get { -#if SC93 +#if FEATURE_URL_BUILDERS var urlOptions = new ItemUrlBuilderOptions(); #else var urlOptions = UrlOptions.DefaultOptions; diff --git a/src/Sitecore.Modules.WeBlog/Extensions/BaseLinkManagerExtensions.cs b/src/Sitecore.Modules.WeBlog/Extensions/BaseLinkManagerExtensions.cs index bac40ea3..a6b5049e 100644 --- a/src/Sitecore.Modules.WeBlog/Extensions/BaseLinkManagerExtensions.cs +++ b/src/Sitecore.Modules.WeBlog/Extensions/BaseLinkManagerExtensions.cs @@ -1,27 +1,27 @@ -using Sitecore.Abstractions; -using Sitecore.Data.Items; -using Sitecore.Links; - -#if SC93 -using Sitecore.Links.UrlBuilders; -#endif - -namespace Sitecore.Modules.WeBlog.Extensions -{ - public static class BaseLinkManagerExtensions - { - public static string GetAbsoluteItemUrl(this BaseLinkManager linkManager, Item item) - { -#if SC93 - var options = new ItemUrlBuilderOptions -#else - var options = new UrlOptions -#endif - { - AlwaysIncludeServerUrl = true - }; - - return linkManager.GetItemUrl(item, options); - } - } -} +using Sitecore.Abstractions; +using Sitecore.Data.Items; +using Sitecore.Links; + +#if FEATURE_URL_BUILDERS +using Sitecore.Links.UrlBuilders; +#endif + +namespace Sitecore.Modules.WeBlog.Extensions +{ + public static class BaseLinkManagerExtensions + { + public static string GetAbsoluteItemUrl(this BaseLinkManager linkManager, Item item) + { +#if FEATURE_URL_BUILDERS + var options = new ItemUrlBuilderOptions +#else + var options = new UrlOptions +#endif + { + AlwaysIncludeServerUrl = true + }; + + return linkManager.GetItemUrl(item, options); + } + } +} diff --git a/src/Sitecore.Modules.WeBlog/Sitecore.Modules.WeBlog.csproj b/src/Sitecore.Modules.WeBlog/Sitecore.Modules.WeBlog.csproj index 1bb38d66..9d7b9769 100644 --- a/src/Sitecore.Modules.WeBlog/Sitecore.Modules.WeBlog.csproj +++ b/src/Sitecore.Modules.WeBlog/Sitecore.Modules.WeBlog.csproj @@ -17,6 +17,17 @@ + + + + + + + + + + + diff --git a/src/Sitecore.Modules.WeBlog/sitecore modules/web/WeBlog/MetaBlogApi.ashx.cs b/src/Sitecore.Modules.WeBlog/sitecore modules/web/WeBlog/MetaBlogApi.ashx.cs index c594fa20..bcf7d289 100644 --- a/src/Sitecore.Modules.WeBlog/sitecore modules/web/WeBlog/MetaBlogApi.ashx.cs +++ b/src/Sitecore.Modules.WeBlog/sitecore modules/web/WeBlog/MetaBlogApi.ashx.cs @@ -19,8 +19,10 @@ using Sitecore.Security.Authentication; using Microsoft.Extensions.DependencyInjection; -#if SC93 +#if FEATURE_URL_BUILDERS using Sitecore.Links.UrlBuilders; +#else +using Sitecore.Links; #endif namespace Sitecore.Modules.WeBlog @@ -118,7 +120,7 @@ public XmlRpcStruct[] getUsersBlogs(string appKey, string username, string passw //Create structure for blog list var blogs = new List(); -#if SC93 +#if FEATURE_URL_BUILDERS var urlOptions = new ItemUrlBuilderOptions(); #else var urlOptions = UrlOptions.DefaultOptions; @@ -528,7 +530,7 @@ public XmlRpcStruct newMediaObject(string blogid, string username, string passwo // Get the mediaitem url and return it var rstruct = new XmlRpcStruct(); -#if SC93 +#if FEATURE_URL_BUILDERS var options = new MediaUrlBuilderOptions() #else var options = new MediaUrlOptions() @@ -691,7 +693,7 @@ protected virtual string GetCategoriesAsString(Item postItem, XmlRpcStruct rpcst /// The item URL. protected string GetItemAbsoluteUrl(Item item) { -#if SC93 +#if FEATURE_URL_BUILDERS var urlOptions = new ItemUrlBuilderOptions(); #else var urlOptions = UrlOptions.DefaultOptions; diff --git a/src/Sitecore.Modules.WeBlog/sitecore modules/web/WeBlog/rsd.ashx.cs b/src/Sitecore.Modules.WeBlog/sitecore modules/web/WeBlog/rsd.ashx.cs index 76dda37d..ee40f739 100644 --- a/src/Sitecore.Modules.WeBlog/sitecore modules/web/WeBlog/rsd.ashx.cs +++ b/src/Sitecore.Modules.WeBlog/sitecore modules/web/WeBlog/rsd.ashx.cs @@ -1,15 +1,20 @@ using System.Text; using System.Web; using System.Xml; -using Microsoft.Extensions.DependencyInjection; -using Sitecore.Abstractions; +using Microsoft.Extensions.DependencyInjection; +using Sitecore.Abstractions; using Sitecore.Configuration; using Sitecore.Data; using Sitecore.Data.Items; -using Sitecore.DependencyInjection; -using Sitecore.Links.UrlBuilders; +using Sitecore.DependencyInjection; using Sitecore.Modules.WeBlog.Data.Items; -using Sitecore.Web; +using Sitecore.Web; + +#if FEATURE_URL_BUILDERS +using Sitecore.Links.UrlBuilders; +#else +using Sitecore.Links; +#endif namespace Sitecore.Modules.WeBlog { @@ -21,7 +26,7 @@ public class RsdHandler : IHttpHandler { protected BaseLinkManager LinkManager { get; } - #region IHttpHandler Members +#region IHttpHandler Members /// /// IsReusable implmentation for IHttpHandler /// @@ -30,14 +35,14 @@ public bool IsReusable get { return false; } } - public RsdHandler(BaseLinkManager linkManager) - { - LinkManager = linkManager ?? ServiceLocator.ServiceProvider.GetRequiredService(); + public RsdHandler(BaseLinkManager linkManager) + { + LinkManager = linkManager ?? ServiceLocator.ServiceProvider.GetRequiredService(); } - public RsdHandler() - : this(null) - { + public RsdHandler() + : this(null) + { } /// @@ -59,16 +64,16 @@ public void ProcessRequest(HttpContext context) // Rsd tag rsd.WriteStartElement("rsd"); - rsd.WriteAttributeString("version", "1.0"); - - // Service -#if SC93 - var urlOptions = new ItemUrlBuilderOptions(); -#else - var urlOptions = UrlOptions.DefaultOptions; -#endif - - urlOptions.AlwaysIncludeServerUrl = true; + rsd.WriteAttributeString("version", "1.0"); + + // Service +#if FEATURE_URL_BUILDERS + var urlOptions = new ItemUrlBuilderOptions(); +#else + var urlOptions = UrlOptions.DefaultOptions; +#endif + + urlOptions.AlwaysIncludeServerUrl = true; var url = LinkManager.GetItemUrl(currentBlog, urlOptions); rsd.WriteStartElement("service"); @@ -100,6 +105,6 @@ public void ProcessRequest(HttpContext context) } } - #endregion +#endregion } } diff --git a/test/UnitTest/UnitTest.csproj b/test/UnitTest/UnitTest.csproj index 6e6b3149..ed2b179a 100644 --- a/test/UnitTest/UnitTest.csproj +++ b/test/UnitTest/UnitTest.csproj @@ -1,20 +1,20 @@ - - - - Sitecore.Modules.WeBlog.UnitTest - Sitecore.Modules.WeBlog.UnitTest - - - - - - - - - - - - - - + + + + Sitecore.Modules.WeBlog.UnitTest + Sitecore.Modules.WeBlog.UnitTest + + + + + + + + + + + + + + \ No newline at end of file diff --git a/test/UnitTest/sitecore modules/web/WeBlog/MetaBlogApiFixture.cs b/test/UnitTest/sitecore modules/web/WeBlog/MetaBlogApiFixture.cs index aecf00ec..8316e936 100644 --- a/test/UnitTest/sitecore modules/web/WeBlog/MetaBlogApiFixture.cs +++ b/test/UnitTest/sitecore modules/web/WeBlog/MetaBlogApiFixture.cs @@ -18,7 +18,7 @@ using Sitecore.Modules.WeBlog.Model; using Sitecore.Links; -#if SC93 +#if FEATURE_URL_BUILDERS using Sitecore.Links.UrlBuilders; #endif @@ -66,7 +66,7 @@ public void getUsersBlogs_SingleBlog() { var blog1 = db.GetItem("/sitecore/content/blog1"); -#if SC93 +#if FEATURE_URL_BUILDERS var linkManager = Mock.Of(x => x.GetItemUrl(It.IsAny(), It.IsAny()) == "link" ); @@ -120,7 +120,7 @@ public void getUsersBlogs_MultipleBlogs() var blog1 = db.GetItem("/sitecore/content/blog1"); var blog2 = db.GetItem("/sitecore/content/blog2"); -#if SC93 +#if FEATURE_URL_BUILDERS var linkManager = Mock.Of(x => x.GetItemUrl(It.Is(y => y.Name == "blog1"), It.IsAny()) == "link1" && x.GetItemUrl(It.Is(y => y.Name == "blog2"), It.IsAny()) == "link2" @@ -364,7 +364,7 @@ public void getRecentPosts_Multiple() var entryManager = MockEntryManager(entry1, entry2); -#if SC93 +#if FEATURE_URL_BUILDERS var linkManager = Mock.Of(x => x.GetItemUrl(It.Is(y => y.Name == "entry1"), It.IsAny()) == "link1" && x.GetItemUrl(It.Is(y => y.Name == "entry2"), It.IsAny()) == "link2" @@ -819,7 +819,7 @@ public void getPost_ExistingPost() var entryManager = MockEntryManager(entry1); -#if SC93 +#if FEATURE_URL_BUILDERS var linkManager = Mock.Of(x => x.GetItemUrl(It.IsAny(), It.IsAny()) == "the-link" ); @@ -997,7 +997,7 @@ public void newMediaObject_Valid() var mediaManager = Mock.Of(x => x.Creator == mediaCreator.Object && -#if SC93 +#if FEATURE_URL_BUILDERS x.GetMediaUrl(It.IsAny(), It.IsAny()) == "fake-url" #else x.GetMediaUrl(It.IsAny(), It.IsAny()) == "fake-url" From f89cada15efbfe9be39f93ab6aaefa5df3c0fa27 Mon Sep 17 00:00:00 2001 From: Alistair Deneys Date: Sat, 8 Aug 2020 16:10:13 +1000 Subject: [PATCH 2/4] Updates for build instructions to include Sitecore 10.0 support --- deploy.props.sample | 20 ++--- how to build.md | 53 +++++++------ src/Themes/Gruntfile.js | 168 ++++++++++++++++++++-------------------- 3 files changed, 120 insertions(+), 121 deletions(-) diff --git a/deploy.props.sample b/deploy.props.sample index c43e898e..74a6a226 100644 --- a/deploy.props.sample +++ b/deploy.props.sample @@ -1,27 +1,27 @@ - C:\inetpub\WeBlog\Sitecore 9.0\cm\Website - C:\inetpub\WeBlog\Sitecore 9.0\cd\Website + C:\inetpub\WeBlog\Sitecore 9.0\cm + C:\inetpub\WeBlog\Sitecore 9.0\cd - C:\inetpub\WeBlog\Sitecore 9.1\cm\Website - C:\inetpub\WeBlog\Sitecore 9.1\cd\Website + C:\inetpub\WeBlog\Sitecore 9.1\cm + C:\inetpub\WeBlog\Sitecore 9.1\cd - C:\inetpub\WeBlog\Sitecore 9.2\cm\Website - C:\inetpub\WeBlog\Sitecore 9.2\cd\Website + C:\inetpub\WeBlog\Sitecore 9.2\cm + C:\inetpub\WeBlog\Sitecore 9.2\cd - C:\inetpub\WeBlog\Sitecore 9.3\cm\Website - C:\inetpub\WeBlog\Sitecore 9.3\cd\Website + C:\inetpub\WeBlog\Sitecore 9.3\cm + C:\inetpub\WeBlog\Sitecore 9.3\cd - C:\inetpub\WeBlog\Sitecore 10.0\cm\Website - C:\inetpub\WeBlog\Sitecore 10.0\cd\Website + C:\inetpub\WeBlog\Sitecore 10.0\cm + C:\inetpub\WeBlog\Sitecore 10.0\cd \ No newline at end of file diff --git a/how to build.md b/how to build.md index 3bb96c1b..e5088a88 100644 --- a/how to build.md +++ b/how to build.md @@ -1,6 +1,6 @@ # How to build WeBlog # -WeBlog builds against and deploys to a local Sitecore instance on your machine. The Sitecore instance can be located anywhere on the local machine including in the same folder as the WeBlog source files. As WeBlog includes build configurations for several different Sitecore versions it is not possible to setup Sitecore in the same folder as the WeBlog project if you want to build against more than one Sitecore version. +WeBlog builds using the public Sitecore NuGet feeds, and optionally deploys to a local Sitecore instance on your machine. The Sitecore instance can be located anywhere on the local machine including in the same folder as the WeBlog source files. As WeBlog includes build configurations for several different Sitecore versions it is not possible to setup Sitecore in the same folder as the WeBlog project if you want to build against more than one Sitecore version. If you only need to build against a single Sitecore version and like to work in the web root, then you just need to clone the WeBlog repository into your web root folder. No additional setup is required. @@ -9,26 +9,23 @@ If you only need to build against a single Sitecore version and like to work in Perform the following before opening the solution in Visual Studio. 1. Ensure you have the desired Sitecore version already installed and working on the local machine. -1. Copy the `deploy.targets.sample` file to `deploy.targets`. - 1. The `deploy.targets` file is a local only file. It's already been added to the `.gitignore` file. -1. Edit the `deploy.targets` file to update the paths to the Sitecore instances. +1. Copy the `deploy.props.sample` file to `deploy.props`. + 1. The `deploy.props` file is a local only file. It's already been added to the `.gitignore` file. +1. Edit the `deploy.props` file to update the paths to the Sitecore instances. 1. For each of the Sitecore versions you want to build against, update the `SitecorePath` property to reference the web root of the Sitecore instance. 1. Each `SitecorePath` property includes a `Condition` defining which Sitecore version the property is used for. 1. Open Visual Studio and select the appropriate build configuration. 1. The numbers of a build configuration refers to the Sitecore version the project will be built for. -1. Rebuild the solution +1. Rebuild the solution. 1. The project will automatically deploy the WeBlog files to the Sitecore instance you build against. ## Restore Sitecore Items ## In addition to building the project and deploying the files, you must also restore the WeBlog Sitecore items. -1. Copy the `data\serialization` folder to the `data` folder of the Sitecore instance. -1. If using Sitecore version 8.2 or higher: -11. Copy the folders from inside the `master sc8.2+` folder into the `master` folder. -11. Delete the following `item` file from the serialization folder: `master\sitecore\system\Workflows\WeBlog Comments\Created\Submit\Email Entry Author.item` -1. Access the Serialization utility page `/sitecore/admin/serialization.aspx`. -1. Select the `core` and `master` databases +1. Copy the `data\serialization` folder to the `App_Data` folder of the Sitecore instance. +1. Access the Serialization utility page of the Sitecore instance: `/sitecore/admin/serialization.aspx`. +1. Select the `core` and `master` databases. 1. Click the `Update {core, master} databasees` button. 1. Log into the Sitecore desktop. 1. Perform a full publish. @@ -42,28 +39,30 @@ The WeBlog themes use Grunt as a toolchain and are not included in the Visual St npm install -g grunt npm install -g bower -1. Execute `npm install` in the `Themes` directory to restore the node packages. -1. Execute `bower install` in the `Themes` directory to restore the bower packages. -1. Execute `grunt` in the `Themes` directory to build the themes and deploy to the default (Sitecore 8.0) Sitecore instance - 1. Paths for Sitecore instaces are read from the `deploy.targets` file. +1. Execute `npm install` in the `src/Themes` directory to restore the node packages. +1. Execute `bower install` in the `src/Themes` directory to restore the bower packages. +1. Execute `grunt` in the `src/Themes` directory to build the themes and deploy to the default (Sitecore 10.0) Sitecore instance. + 1. Paths for Sitecore instaces are read from the `deploy.props` file above. 1. To deploy the themes to a different target instance, pass the `--scversion` parameter to `grunt`: - grunt --scversion=sc9.0 + grunt --scversion=sc9.3 ## Create Solr Cores ## -If you're using Sitecore 9.x you must configure the weblog cores in Solr. +Cores must be created in Solr for the WeBlog content search indexes. -1. Open a command prompt -1. Navigate to the Solr `bin` folder -1. Create the cores using the `solr create` command. - * `solr create -c weblog-master` - * `solr create -c weblog-web` -1. Update the Content Search config files to match the names of the cores created above -1. Deploy weblog code (rebuild the solution in VS) to ensure index configs are available -1. Use indexing manager to populate managed schema +1. Open a command prompt. +1. Navigate to the Solr `bin` folder. +1. Create the cores using the `solr create` command: + + solr create -c weblog-master + solr create -c weblog-web + +1. Update the `WeBlog.ContentSearch.Solr.Master.config` and `WeBlog.ContentSearch.Solr.Web.config` files in the `src/Sitecore.Modules.WeBlog/App_Config/Include/` folder to match the names of the cores created above. +1. Deploy weblog code (rebuild the solution in VS) to ensure index configs are available. +1. Use the indexing manager in the Sitecore control panel to populate the managed schema. * If that doesn't work, copy the `managed-schema` file from the `conf` folder of an existing Sitecore core. -1. rebuild indexes +1. Rebuild the indexes. ## Packaging ## @@ -71,4 +70,4 @@ WeBlog uses Sitecore packages. A separate package is built for each minor versio Before creating the package, ensure the code has been built and deployed as per above instructions, and ensure the themes have been build as well. All unit and integration tests should be run. -To create the package, copy the relevant `xml` file from the `data\packages` folder over to the `data\packages` folder of the Sitecore instance you'll be building from. The `WeBlog sc8.x.xml` file is for all Sitecore 8.x versions. The `WeBlog.xml` file is for all other versions. +To create the package, copy the `WeBlog.xml` file from the `data\packages` folder over to the `App_Data\packages` folder of the Sitecore instance you'll be building from. diff --git a/src/Themes/Gruntfile.js b/src/Themes/Gruntfile.js index 32f11cc9..126d8c12 100644 --- a/src/Themes/Gruntfile.js +++ b/src/Themes/Gruntfile.js @@ -1,84 +1,84 @@ -const xpath = require("xpath"); -const dom = require("xmldom").DOMParser; - -module.exports = function(grunt) { - - grunt.loadNpmTasks("grunt-contrib-less"); - grunt.loadNpmTasks("grunt-contrib-copy"); - - grunt.initConfig({ - pkg: grunt.file.readJSON("package.json"), - less: { - dev: { - files: [{ - expand: true, - cwd: ".", - src: ["**/*.less", "!node_modules/**/*.*", "!import_*.less"], - dest: "build", - ext: ".css" - }] - } - }, - copy: { - dev: { - files: [{ - expand: true, - cwd: "build", - src: ["**/*.*"], - dest: "", - timestamp: true - }, { - expand: true, - cwd: ".", - src: ["**/*.png", "**/*.gif", "**/*.js", "!node_modules/**/*.*", "!bower_components/**/*.*", "!Gruntfile.js"], - dest: "", - timestamp: true - }, { - expand: true, - flatten: true, - cwd: ".", - src: ["**/jquery/dist/jquery.js", "**/jsurl/url.min.js"], - dest: "common\\lib", - timestamp: true - }] - } - } - }); - - var version = grunt.option("scversion") || "sc9.3"; - - grunt.registerTask("default", ["less", "deploy:" + version]); - - grunt.registerTask("deploy", "desc", function(version) { - if (!version) { - grunt.fail.warn("Missing 'version' parameter."); - } - - var targetPath = resolveSitecorePath(version); - if (!targetPath) { - grunt.fail.warn("Failed to resolve path for version '" + version + "'."); - } - - var fileConfigs = grunt.config.get("copy.dev.files"); - - fileConfigs.forEach(function(config, index) { - var path = targetPath + "\\sitecore modules\\Web\\WeBlog\\Themes\\" + config.dest; - grunt.config.set("copy.dev.files." + index + ".dest", path); - }); - - grunt.task.run("copy:dev"); - }); - - function resolveSitecorePath(version) { - var file = grunt.file.read("../../deploy.props").toLowerCase(); - var doc = new dom().parseFromString(file); - - var select = xpath.useNamespaces({ - "msb": "http://schemas.microsoft.com/developer/msbuild/2003" - }); - - var nodes = select("/msb:project/msb:propertygroup[contains(@condition, '" + version + "')]/msb:sitecorepath/text()", doc); - - return nodes[0].toString(); - }; -}; +const xpath = require("xpath"); +const dom = require("xmldom").DOMParser; + +module.exports = function(grunt) { + + grunt.loadNpmTasks("grunt-contrib-less"); + grunt.loadNpmTasks("grunt-contrib-copy"); + + grunt.initConfig({ + pkg: grunt.file.readJSON("package.json"), + less: { + dev: { + files: [{ + expand: true, + cwd: ".", + src: ["**/*.less", "!node_modules/**/*.*", "!import_*.less"], + dest: "build", + ext: ".css" + }] + } + }, + copy: { + dev: { + files: [{ + expand: true, + cwd: "build", + src: ["**/*.*"], + dest: "", + timestamp: true + }, { + expand: true, + cwd: ".", + src: ["**/*.png", "**/*.gif", "**/*.js", "!node_modules/**/*.*", "!bower_components/**/*.*", "!Gruntfile.js"], + dest: "", + timestamp: true + }, { + expand: true, + flatten: true, + cwd: ".", + src: ["**/jquery/dist/jquery.js", "**/jsurl/url.min.js"], + dest: "common\\lib", + timestamp: true + }] + } + } + }); + + var version = grunt.option("scversion") || "sc10.0"; + + grunt.registerTask("default", ["less", "deploy:" + version]); + + grunt.registerTask("deploy", "desc", function(version) { + if (!version) { + grunt.fail.warn("Missing 'version' parameter."); + } + + var targetPath = resolveSitecorePath(version); + if (!targetPath) { + grunt.fail.warn("Failed to resolve path for version '" + version + "'."); + } + + var fileConfigs = grunt.config.get("copy.dev.files"); + + fileConfigs.forEach(function(config, index) { + var path = targetPath + "\\sitecore modules\\Web\\WeBlog\\Themes\\" + config.dest; + grunt.config.set("copy.dev.files." + index + ".dest", path); + }); + + grunt.task.run("copy:dev"); + }); + + function resolveSitecorePath(version) { + var file = grunt.file.read("../../deploy.props").toLowerCase(); + var doc = new dom().parseFromString(file); + + var select = xpath.useNamespaces({ + "msb": "http://schemas.microsoft.com/developer/msbuild/2003" + }); + + var nodes = select("/msb:project/msb:propertygroup[contains(@condition, '" + version + "')]/msb:sitecorepath/text()", doc); + + return nodes[0].toString(); + }; +}; From aea9a2da920207e2da94657c3374218eba12331d Mon Sep 17 00:00:00 2001 From: Alistair Deneys Date: Sun, 9 Aug 2020 22:34:54 +1000 Subject: [PATCH 3/4] Move entry search result fields inline so query analyzer can see them properly. --- .../Managers/EntryManagerFixture.cs | 44 +++++++++++++++---- .../Managers/EntryManager.cs | 40 +++++++++++------ .../Search/SearchTypes/EntryResultItem.cs | 7 +-- 3 files changed, 64 insertions(+), 27 deletions(-) diff --git a/Test/IntegrationTest/Managers/EntryManagerFixture.cs b/Test/IntegrationTest/Managers/EntryManagerFixture.cs index a5fe5fff..e618b809 100644 --- a/Test/IntegrationTest/Managers/EntryManagerFixture.cs +++ b/Test/IntegrationTest/Managers/EntryManagerFixture.cs @@ -1,14 +1,13 @@ -using System.Collections.Generic; -using System.Data; -using System; -using System.Linq; +using Moq; using NUnit.Framework; -using Sitecore.Data.Items; -using Moq; using Sitecore.Data; using Sitecore.Modules.WeBlog.Managers; using Sitecore.Modules.WeBlog.Search; using Sitecore.Xdb.Reporting; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; namespace Sitecore.Modules.WeBlog.IntegrationTest.Managers { @@ -35,7 +34,7 @@ public void GetBlogEntries_NoEntries() } [Test] - public void GetBlogEntries_WithEntries() + public void GetBlogEntries_EntriesExist_ReturnsEntries() { var blog = TestUtil.CreateNewBlog(TestContentRoot); var entryLuna = TestUtil.CreateNewEntry(blog, "Luna", entryDate: new DateTime(2012, 3, 1)); @@ -50,6 +49,33 @@ public void GetBlogEntries_WithEntries() Assert.That(ids, Is.EqualTo(new[] { entryPhobos.ID, entryDeimos.ID, entryLuna.ID })); } + [Test] + public void GetBlogEntries_EntriesExist_FieldsRehydratedProperly() + { + // arrange + var entryDate = new DateTime(2012, 3, 1, 13, 42, 10, DateTimeKind.Utc); + var blog = TestUtil.CreateNewBlog(TestContentRoot); + var entryLuna = TestUtil.CreateNewEntry( + blog, + name: "Luna", + tags: "tag", + entryDate: entryDate); + + TestUtil.UpdateIndex(); + + var manager = new EntryManager(); + + // act + var results = manager.GetBlogEntries(blog, EntryCriteria.AllEntries, ListOrder.Descending); + + // assert + var ids = from result in results.Results select result.Uri.ItemID; + + Assert.That(results.Results[0].Title, Is.EqualTo("Luna")); + Assert.That(results.Results[0].Tags, Is.EquivalentTo(new[] { "tag" })); + Assert.That(results.Results[0].EntryDate, Is.EqualTo(entryDate)); + } + [Test] public void GetBlogEntries_WithEntriesAscending() { @@ -591,6 +617,8 @@ public void GetPopularEntriesByView_NullItem() Assert.That(entries, Is.Empty); } + + // TODO: Write tests for methods accepting language private void VerifyAnalyticsSetup() @@ -614,7 +642,7 @@ private ReportDataProviderBase CreateMockReportDataProvider(IEnumerable ids) var visitCount = ids.Count(); foreach (var id in ids) { - var dataTable = new DataTable(); + var dataTable = new System.Data.DataTable(); dataTable.Columns.AddRange(new[] { new DataColumn("Visits", typeof(long)) diff --git a/src/Sitecore.Modules.WeBlog/Managers/EntryManager.cs b/src/Sitecore.Modules.WeBlog/Managers/EntryManager.cs index 1d795552..21b07d82 100644 --- a/src/Sitecore.Modules.WeBlog/Managers/EntryManager.cs +++ b/src/Sitecore.Modules.WeBlog/Managers/EntryManager.cs @@ -1,25 +1,25 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Sitecore.Data; -using Sitecore.Data.Items; -using Sitecore.Diagnostics; -using Sitecore.Modules.WeBlog.Data.Items; -using Sitecore.Modules.WeBlog.Extensions; +using Microsoft.Extensions.DependencyInjection; +using Sitecore.Abstractions; using Sitecore.ContentSearch; using Sitecore.ContentSearch.Linq.Utilities; using Sitecore.ContentSearch.Security; +using Sitecore.Data; +using Sitecore.Data.Items; +using Sitecore.DependencyInjection; +using Sitecore.Diagnostics; +using Sitecore.Modules.WeBlog.Analytics.Reporting; +using Sitecore.Modules.WeBlog.Caching; using Sitecore.Modules.WeBlog.Configuration; +using Sitecore.Modules.WeBlog.Data.Items; using Sitecore.Modules.WeBlog.Diagnostics; +using Sitecore.Modules.WeBlog.Extensions; using Sitecore.Modules.WeBlog.Model; using Sitecore.Modules.WeBlog.Search; using Sitecore.Modules.WeBlog.Search.SearchTypes; -using Sitecore.Modules.WeBlog.Caching; -using Sitecore.Modules.WeBlog.Analytics.Reporting; using Sitecore.Xdb.Reporting; -using Sitecore.Abstractions; -using Sitecore.DependencyInjection; -using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Linq; namespace Sitecore.Modules.WeBlog.Managers { @@ -204,7 +204,18 @@ where TemplateManager.TemplateIsOrBasedOn(blogRootItem, templateId) indexresults = indexresults.Skip(criteria.PageSize * (criteria.PageNumber - 1)) .Take(criteria.PageSize < int.MaxValue ? criteria.PageSize + 1 : criteria.PageSize); - var entries = indexresults.Select(x => CreateEntry(x)).ToList(); + var entries = indexresults.Select(resultItem => + // Keep field access inline so the query analyzer can see which fields will be used. + new Entry + { + Uri = resultItem.Uri, + Title = string.IsNullOrWhiteSpace(resultItem.Title) ? resultItem.Name : resultItem.Title, + Tags = resultItem.Tags != null ? resultItem.Tags : Enumerable.Empty(), + EntryDate = resultItem.EntryDate + } + ).ToList(); + + var hasMore = entries.Count > criteria.PageSize; var entriesPage = entries.Take(criteria.PageSize).ToList(); @@ -216,6 +227,7 @@ where TemplateManager.TemplateIsOrBasedOn(blogRootItem, templateId) } } + [Obsolete("No longer used. Index field access must be inline so the query analyzer can see the fields used.")] protected virtual Entry CreateEntry(EntryResultItem resultItem) { return new Entry diff --git a/src/Sitecore.Modules.WeBlog/Search/SearchTypes/EntryResultItem.cs b/src/Sitecore.Modules.WeBlog/Search/SearchTypes/EntryResultItem.cs index 17d5bbab..6a6d45d0 100644 --- a/src/Sitecore.Modules.WeBlog/Search/SearchTypes/EntryResultItem.cs +++ b/src/Sitecore.Modules.WeBlog/Search/SearchTypes/EntryResultItem.cs @@ -1,10 +1,7 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using Sitecore.ContentSearch; -using Sitecore.ContentSearch.Converters; +using Sitecore.ContentSearch; using Sitecore.ContentSearch.SearchTypes; using Sitecore.Data; +using System; namespace Sitecore.Modules.WeBlog.Search.SearchTypes { From 898d988a802c0f327cbb546161e021a41cdad310 Mon Sep 17 00:00:00 2001 From: Alistair Deneys Date: Mon, 10 Aug 2020 09:40:28 +1000 Subject: [PATCH 4/4] Tweaks for SC9.0 build --- Test/UnitTest/App.config.FakeDBLegacy.xslt | 15 ------------ .../Text/ContextTokenReplacerFixture.cs | 3 +-- .../Pipelines/CaptchaProcessor.cs | 4 ++-- test/UnitTest/Managers/BlogManagerFixture.cs | 3 +-- test/UnitTest/UnitTest.csproj | 24 ++++++++++++++++--- 5 files changed, 25 insertions(+), 24 deletions(-) delete mode 100644 Test/UnitTest/App.config.FakeDBLegacy.xslt diff --git a/Test/UnitTest/App.config.FakeDBLegacy.xslt b/Test/UnitTest/App.config.FakeDBLegacy.xslt deleted file mode 100644 index 4dff5b55..00000000 --- a/Test/UnitTest/App.config.FakeDBLegacy.xslt +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - Sitecore.Data.Database, Sitecore.Kernel - - - - - - - - \ No newline at end of file diff --git a/Test/UnitTest/Text/ContextTokenReplacerFixture.cs b/Test/UnitTest/Text/ContextTokenReplacerFixture.cs index 608fd90f..fd52cc72 100644 --- a/Test/UnitTest/Text/ContextTokenReplacerFixture.cs +++ b/Test/UnitTest/Text/ContextTokenReplacerFixture.cs @@ -1,5 +1,4 @@ -using DocumentFormat.OpenXml.Office.CustomUI; -using Moq; +using Moq; using NUnit.Framework; using Sitecore.Modules.WeBlog.Managers; using Sitecore.Modules.WeBlog.Text; diff --git a/src/Sitecore.Modules.WeBlog/Pipelines/CaptchaProcessor.cs b/src/Sitecore.Modules.WeBlog/Pipelines/CaptchaProcessor.cs index 9fa67bf6..5b727a97 100644 --- a/src/Sitecore.Modules.WeBlog/Pipelines/CaptchaProcessor.cs +++ b/src/Sitecore.Modules.WeBlog/Pipelines/CaptchaProcessor.cs @@ -4,9 +4,9 @@ namespace Sitecore.Modules.WeBlog.Pipelines { - public class CaptchaProcessor : PreprocessRequestProcessor + [Obsolete] + public class CaptchaProcessor : PreprocessRequestProcessor { - [Obsolete] public override void Process(PreprocessRequestArgs args) { if (HttpContext.Current.Request.RawUrl.Contains("CaptchaImage.axd")) diff --git a/test/UnitTest/Managers/BlogManagerFixture.cs b/test/UnitTest/Managers/BlogManagerFixture.cs index 3a6e20ea..5f88d0af 100644 --- a/test/UnitTest/Managers/BlogManagerFixture.cs +++ b/test/UnitTest/Managers/BlogManagerFixture.cs @@ -1,5 +1,4 @@ -using DocumentFormat.OpenXml.Presentation; -using Moq; +using Moq; using NUnit.Framework; using Sitecore.Abstractions; using Sitecore.Data; diff --git a/test/UnitTest/UnitTest.csproj b/test/UnitTest/UnitTest.csproj index ed2b179a..53046aaa 100644 --- a/test/UnitTest/UnitTest.csproj +++ b/test/UnitTest/UnitTest.csproj @@ -12,9 +12,27 @@ - - - + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file