Created
August 30, 2013 14:39
-
-
Save f1code/6390562 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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