Skip to content

Commit

Permalink
Initial
Browse files Browse the repository at this point in the history
  • Loading branch information
AFI authored and AFI committed May 12, 2017
1 parent 0dc440c commit 1e16ad5
Show file tree
Hide file tree
Showing 12 changed files with 218 additions and 0 deletions.
Binary file added lib/Sitecore.Abstractions.dll
Binary file not shown.
Binary file not shown.
Binary file added lib/Sitecore.Kernel.dll
Binary file not shown.
Binary file not shown.
Binary file added lib/Sitecore.Publishing.Service.dll
Binary file not shown.
22 changes: 22 additions & 0 deletions src/Sitecore.Support.27341.sln
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
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>
6 changes: 6 additions & 0 deletions src/Sitecore.Support.27341/Properties/AssemblyInfo.cs
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)]
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 src/Sitecore.Support.27341/Sitecore.Support.27341.csproj
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>
4 changes: 4 additions & 0 deletions src/Sitecore.Support.27341/packages.config
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>
4 changes: 4 additions & 0 deletions src/Sitecore.Support.27341/web.config
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>

0 comments on commit 1e16ad5

Please sign in to comment.