-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
AFI
authored and
AFI
committed
May 12, 2017
1 parent
0dc440c
commit 1e16ad5
Showing
12 changed files
with
218 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
|
||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio 14 | ||
VisualStudioVersion = 14.0.25123.0 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{519E443A-E914-4325-89E2-DC6F12DDC3C0}") = "Sitecore.Support.27341", "Sitecore.Support.27341\Sitecore.Support.27341.csproj", "{DCAAA99C-CFA7-48EE-9C08-2ED5BFD44CDD}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{DCAAA99C-CFA7-48EE-9C08-2ED5BFD44CDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{DCAAA99C-CFA7-48EE-9C08-2ED5BFD44CDD}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{DCAAA99C-CFA7-48EE-9C08-2ED5BFD44CDD}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{DCAAA99C-CFA7-48EE-9C08-2ED5BFD44CDD}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
EndGlobal |
9 changes: 9 additions & 0 deletions
9
src/Sitecore.Support.27341/App_Config/Include/zzz/Sitecore.Support.27341.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/"> | ||
<sitecore> | ||
<events> | ||
<event name="publishingservice:publishend"> | ||
<handler type="Sitecore.Support.Publishing.Service.Events.PublishEndHandler, Sitecore.Support" patch:instead="*[@type='Sitecore.Publishing.Service.Events.PublishEndHandler, Sitecore.Publishing.Service']" method="TriggerPublishEnd" /> | ||
</event> | ||
</events> | ||
</sitecore> | ||
</configuration> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using System.Reflection; | ||
using System.Runtime.InteropServices; | ||
|
||
[assembly: AssemblyTitle("Sitecore.Support.27341")] | ||
[assembly: AssemblyProduct("Sitecore.Support.27341")] | ||
[assembly: ComVisible(false)] |
72 changes: 72 additions & 0 deletions
72
src/Sitecore.Support.27341/Publishing/Service/Events/PublishEndHandler.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
namespace Sitecore.Support.Publishing.Service.Events | ||
{ | ||
using Eventing; | ||
using Eventing.Remote; | ||
using Framework.Publishing.Eventing.Remote; | ||
using Framework.Publishing.PublishJobQueue; | ||
using Sitecore.Abstractions; | ||
using Sitecore.Events; | ||
using Sitecore.Publishing; | ||
using Sitecore.Publishing.Service.Events; | ||
using Sitecore.Publishing.Service.SitecoreAbstractions; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
public class PublishEndHandler : Sitecore.Publishing.Service.Events.PublishEventHandlerBase | ||
{ | ||
|
||
private readonly PublishingLogWrapper _logger; | ||
|
||
public PublishEndHandler() : base(new EventWrapper(), new DatabaseFactoryWrapper(new PublishingLogWrapper())) | ||
{ | ||
this._logger = new PublishingLogWrapper(); | ||
} | ||
|
||
public PublishEndHandler(IEvent eventing, IDatabaseFactory factory) : base(eventing, factory) | ||
{ | ||
this._logger = new PublishingLogWrapper(); | ||
} | ||
|
||
|
||
public void TriggerPublishEnd(object sender, EventArgs args) | ||
{ | ||
SitecoreEventArgs args2 = args as SitecoreEventArgs; | ||
if (((args2 != null) && (args2.Parameters != null)) && args2.Parameters.Any<object>()) | ||
{ | ||
PublishingJobEndEventArgs args3 = args2.Parameters[0] as PublishingJobEndEventArgs; | ||
if ((args3 != null) && (args3.EventData != null)) | ||
{ | ||
PublishingJobEndEvent eventData = args3.EventData; | ||
List<Sitecore.Publishing.PublishOptions> list = new List<Sitecore.Publishing.PublishOptions>(); | ||
foreach (PublishingJobTargetMetadata metadata in eventData.Targets) | ||
{ | ||
Publisher publisher = base.BuildPublisher(eventData, metadata.TargetDatabaseName, metadata.TargetId); | ||
if (!metadata.Succeeded) | ||
{ | ||
base._eventing.RaiseEvent("publish:fail", new object[] { publisher, new Exception("Publish job for target: " + metadata.TargetName + " (Database:" + metadata.TargetDatabaseName + ") failed. See Publishing Service log for more information.") }); | ||
} | ||
else | ||
{ | ||
list.Add(publisher.Options); | ||
this._logger.Info("Raising : 'publish:end' for '" + metadata.TargetName + "'", null); | ||
base._eventing.RaiseEvent("publish:end", new object[] { publisher }); | ||
publisher.Options.TargetDatabase.RemoteEvents.Queue.QueueEvent<PublishEndRemoteEvent>(new PublishEndRemoteEvent(publisher), true, true); | ||
} | ||
} | ||
bool failed = eventData.Status == PublishJobStatus.Complete; | ||
IEnumerable<DistributedPublishOptions> options = from option in list select new DistributedPublishOptions(option); | ||
this._logger.Info("Raising : 'publish:complete'", null); | ||
Event.RaiseEvent("publish:complete", new object[] { options, 0, failed }); | ||
EventManager.QueueEvent<PublishCompletedRemoteEvent>(new PublishCompletedRemoteEvent(options, 0L, failed)); | ||
if (!failed && (eventData.Targets.Length == 0)) | ||
{ | ||
object[] parameters = new object[2]; | ||
parameters[1] = new Exception("Publish job : " + eventData.JobId + " failed. No Targets found. See Publishing Service log for more information."); | ||
base._eventing.RaiseEvent("publish:fail", parameters); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
src/Sitecore.Support.27341/Sitecore.Support.27341.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" /> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion> | ||
</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{DCAAA99C-CFA7-48EE-9C08-2ED5BFD44CDD}</ProjectGuid> | ||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Sitecore.Support</RootNamespace> | ||
<AssemblyName>Sitecore.Support.27341</AssemblyName> | ||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion> | ||
<UseIISExpress>true</UseIISExpress> | ||
<IISExpressSSLPort /> | ||
<IISExpressAnonymousAuthentication /> | ||
<IISExpressWindowsAuthentication /> | ||
<IISExpressUseClassicPipelineMode /> | ||
<UseGlobalApplicationHostFile /> | ||
<TargetFrameworkProfile /> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Sitecore.Abstractions"> | ||
<HintPath>..\..\lib\Sitecore.Abstractions.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Sitecore.Framework.Publishing.Abstractions"> | ||
<HintPath>..\..\lib\Sitecore.Framework.Publishing.Abstractions.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Sitecore.Kernel"> | ||
<HintPath>..\packages\SC.Sitecore.Kernel.8.2.2\lib\Sitecore.Kernel.dll</HintPath> | ||
<Private>False</Private> | ||
</Reference> | ||
<Reference Include="Sitecore.Publishing.Service"> | ||
<HintPath>..\..\lib\Sitecore.Publishing.Service.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Sitecore.Publishing.Service.Abstractions"> | ||
<HintPath>..\..\lib\Sitecore.Publishing.Service.Abstractions.dll</HintPath> | ||
</Reference> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Drawing" /> | ||
<Reference Include="System.Web" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="System.Configuration" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="Publishing\Service\Events\PublishEndHandler.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="App_Config\Include\zzz\Sitecore.Support.27341.config" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="packages.config" /> | ||
<None Include="web.config" /> | ||
</ItemGroup> | ||
<PropertyGroup> | ||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> | ||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> | ||
</PropertyGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> | ||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" /> | ||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" /> | ||
<ProjectExtensions> | ||
<VisualStudio> | ||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}"> | ||
<WebProjectProperties> | ||
<UseIIS>True</UseIIS> | ||
<AutoAssignPort>True</AutoAssignPort> | ||
<DevelopmentServerPort>0</DevelopmentServerPort> | ||
<DevelopmentServerVPath>/</DevelopmentServerVPath> | ||
<IISUrl>http://localhost:54380/</IISUrl> | ||
<NTLMAuthentication>False</NTLMAuthentication> | ||
<UseCustomServer>False</UseCustomServer> | ||
<CustomServerUrl> | ||
</CustomServerUrl> | ||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile> | ||
</WebProjectProperties> | ||
</FlavorProperties> | ||
</VisualStudio> | ||
</ProjectExtensions> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="SC.Sitecore.Kernel" version="8.2.2" targetFramework="net452" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<configuration> | ||
<!-- Do not change this file - it must be empty, see https://github.com/SitecoreSupport/PatchCreator/issues/13 --> | ||
</configuration> |