Skip to content

Instantly share code, notes, and snippets.

@f1code
Created August 30, 2013 14:39
Show Gist options
  • Select an option

  • Save f1code/6390562 to your computer and use it in GitHub Desktop.

Select an option

Save f1code/6390562 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using log4net;
using Sage.Integration.Web;
using Sage.Platform.Application;
using Sage.Integration.Messaging.Model;
namespace SSSWorld.RFI.BusinessRules.CustomerPortalSecurity
{
/// <summary>
/// Loader for the CustomerPortalGroupSecurityModule.
/// This replaces and extends the default Sage integration handler, so that it gets called on slxdata requests.
///
/// It must be registered in web.config - replace the following line:
/// <add verb="*" path="slxdata.ashx" type="Sage.Integration.Web.SageIntegrationHandler, Sage.Integration.Web"/>
/// with this one:
/// <add verb="*" path="slxdata.ashx" type="SSSWorld.RFI.BusinessRules.CustomerPortalSecurity.CustomerPortalGroupSecurityModuleLoader, SSSWorld.RFI.BusinessRules"/>
/// </summary>
public class CustomerPortalGroupSecurityModuleLoader : SageIntegrationHandler
{
private static readonly ILog LOG = LogManager.GetLogger(typeof(CustomerPortalGroupSecurityModuleLoader));
protected override void PreProcessRequest(IProtocolRequest request)
{
base.PreProcessRequest(request);
try
{
var module = ApplicationContext.Current.BuildTransientItem<RfiCustomerPortalGroupSecurityModule>();
module.Load();
}
catch (ServiceMissingException x)
{
LOG.Error("Failed to initialize CustomerPortalGroupSecurityModule", x);
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment