private void RunItemDeleted(Item item) { var rulesEngine = new RulesEngine(item.Database); try { using (new SecurityDisabler()) { if (item.IsInboundRuleItem() || item.IsSimpleRedirectItem() || item.IsInboundRuleItemChild()) { Log.Info(this, item.Database, "Refreshing inbound rules cache after delete event", item.Paths.FullPath); rulesEngine.GetCachedInboundRules(); } else if (item.IsOutboundRuleItem() || item.IsOutboundRuleItemChild()) { Log.Info(this, item.Database, "Refreshing outbound rules cache after delete event", item.Parent.Paths.FullPath); rulesEngine.GetCachedOutboundRules(); } } } catch (Exception ex) { Log.Error(this, ex, item.Database, "Exception occured which deleting item after publish Item ID: {0} Item Path: {1}", item.ID, item.Paths.FullPath); } }
private List<OutboundRule> GetOutboundRules(Database db) { var cache = RulesCacheManager.GetCache(db); var outboundRules = cache.GetOutboundRules(); if (outboundRules != null) return outboundRules; Log.Info(this, db, "Initializing Outbound Rules."); using (new SecurityDisabler()) { var rulesEngine = new RulesEngine(db); outboundRules = rulesEngine.GetCachedOutboundRules(); } return outboundRules; }
private List <OutboundRule> GetOutboundRules(Database db) { var cache = RulesCacheManager.GetCache(db); var outboundRules = cache.GetOutboundRules(); if (outboundRules != null) { return(outboundRules); } Log.Info(this, db, "Initializing Outbound Rules."); using (new SecurityDisabler()) { var rulesEngine = new RulesEngine(db); outboundRules = rulesEngine.GetCachedOutboundRules(); } return(outboundRules); }