public NewProjectViewmodel(IShellService shellService, IProjectManager projectManager, IRuleManager ruleManager) : base(shellService) { _projectManager = projectManager; _ruleManager = ruleManager; Init(); }
public WidgetFilter(IContentManager contentManager, IWorkContextAccessor workContextAccessor, IRuleManager ruleManager, IWidgetsService widgetsService) { _contentManager = contentManager; _workContextAccessor = workContextAccessor; _ruleManager = ruleManager; _widgetsService = widgetsService; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
public CVKController(IKeyManagerFactory factory, ILogger <CVKController> logger, OrkConfig config, Settings settings) { _managerCvk = factory.BuildManagerCvk(); _ruleManager = factory.BuildRuleManager(); _keyIdManager = factory.BuildKeyIdManager(); _logger = new LoggerPipe(logger, settings, new LoggerConfig()); _config = config; _features = settings.Features; }
public LayerPartDriver( IRuleManager ruleManager, IWidgetsService widgetsService) { _ruleManager = ruleManager; _widgetsService = widgetsService; T = NullLocalizer.Instance; }
public GlimpseLayerEvaluationService(IRuleManager ruleManager, IPerformanceMonitor performanceMonitor, IOrchardServices orchardServices) { _ruleManager = ruleManager; _performanceMonitor = performanceMonitor; _orchardServices = orchardServices; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
public DefaultLayerEvaluationService(IRuleManager ruleManager, IOrchardServices orchardServices) { _ruleManager = ruleManager; _orchardServices = orchardServices; Logger = NullLogger.Instance; T = NullLocalizer.Instance; _activeLayerIDs = new LazyField<int[]>(); _activeLayerIDs.Loader(PopulateActiveLayers); }
public RuleService(IApplicationContext applicationContext, IWidgetBasePartService widgetBasePartService, IWidgetActivator widgetActivator, IRuleManager ruleManager, CMSDbContext dbContext) : base(applicationContext, dbContext) { _widgetBasePartService = widgetBasePartService; _widgetActivator = widgetActivator; _ruleManager = ruleManager; }
public EditListBaseServices(IEditPropertyValueManager <T> registeredPropertyManager, ISendReceivePortalChild <I> sendReceivePortalChild, ISendReceivePortal <T> sendReceivePortal, IRuleManager <T> ruleManager) : base(registeredPropertyManager, sendReceivePortalChild, ruleManager) { EditPropertyValueManager = registeredPropertyManager; SendReceivePortalChild = sendReceivePortalChild; SendReceivePortal = sendReceivePortal; }
public void Init() { var builder = new ContainerBuilder(); builder.RegisterType<ScriptExpressionEvaluator>().As<IScriptExpressionEvaluator>(); builder.RegisterType<AlwaysTrueRuleProvider>().As<IRuleProvider>(); builder.RegisterType<RuleManager>().As<IRuleManager>(); builder.RegisterType<StubCacheManager>().As<ICacheManager>(); _container = builder.Build(); _ruleManager = _container.Resolve<IRuleManager>(); }
public DefaultLayerEvaluationService(IRuleManager ruleManager, IOrchardServices orchardServices) { _ruleManager = ruleManager; _orchardServices = orchardServices; Logger = NullLogger.Instance; T = NullLocalizer.Instance; _activeLayerIDs = new LazyField <int[]>(); _activeLayerIDs.Loader(PopulateActiveLayers); }
public TemplateManager( IFileManagerFactory fileManagerFactory, IRuleManager ruleManager, IErrorCollectorManager errorCollectorManager, string folderPath, string ruleName) { _ruleName = ruleName; _errorCollectorManager = errorCollectorManager; _ruleManager = ruleManager; _fileManager = fileManagerFactory.GetFileManager(folderPath); }
public WidgetFilter( IWorkContextAccessor workContextAccessor, IRuleManager ruleManager, IWidgetsService widgetsService, IOrchardServices orchardServices) { _workContextAccessor = workContextAccessor; _ruleManager = ruleManager; _widgetsService = widgetsService; _orchardServices = orchardServices; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
/// <summary> /// Constructor /// </summary> public TestViewModel(IRuleManager ruleManager) : base(Guid.NewGuid().ToString()) { this.ruleManager = ruleManager; this.TestObject = new TestModel(); var ruleSet = this.ruleManager.RuleSetDictionary["RuleSet1"]; foreach (var rule in ruleSet.RuleList) { rule.ApplyRule(this); } }
public void TestValidationManyRulesOneCondition() { var container = GetConfiguredContainer(); IRuleManager ruleManager = container.Resolve <IRuleManager>(); // Rule created to Item 1 RuleDefinition rule_1 = new RuleDefinition(null, null, 1, "My Rule 1"); ruleManager.AddRule(rule_1); RuleConditionDefinition condition_1 = new RuleConditionDefinition(null, "Division", "=", "BTL", rule_1.Id); ruleManager.AddCondition(condition_1); RuleDefinition rule_2 = new RuleDefinition(null, null, 1, "My Rule 2"); ruleManager.AddRule(rule_2); RuleConditionDefinition condition_2 = new RuleConditionDefinition(null, "Entity", "=", "ENT_1", rule_2.Id); ruleManager.AddCondition(condition_2); MyDummyDtObject myDummyDtObject = new MyDummyDtObject(); RuleContext ruleContext = new RuleContext(myDummyDtObject, RuleConstants.EmptyRuleConstants); //The division and entity field are null here bool isValid = ruleManager.IsRuleValid(1, ruleContext); //The rule should NOT be valid here. Assert.IsFalse(isValid); //The division is set to "BTL" here myDummyDtObject.Division = "BTL"; ruleContext = new RuleContext(myDummyDtObject, RuleConstants.EmptyRuleConstants); //The rule should be valid as it match 1 rule isValid = ruleManager.IsRuleValid(1, ruleContext); Assert.IsTrue(isValid); //The entity is set to "ENT_1" here myDummyDtObject.Entity = "ENT_1"; ruleContext = new RuleContext(myDummyDtObject, RuleConstants.EmptyRuleConstants); //The rule should be valid now (2 rules valid) isValid = ruleManager.IsRuleValid(1, ruleContext); Assert.IsTrue(isValid); //The division is set to "UNKNOWN_ENT" here myDummyDtObject.Entity = "UNKNOWN_ENT"; myDummyDtObject.Division = "DIV"; ruleContext = new RuleContext(myDummyDtObject, RuleConstants.EmptyRuleConstants); //The rule should NOT be valid anymore isValid = ruleManager.IsRuleValid(1, ruleContext); Assert.IsFalse(isValid); }
public ManageRuleViewmodel(IShellService shellService, IRuleManager ruleManager) : base(shellService) { _ruleManager = ruleManager; Rules = new ObservableCollection<Rule>(); foreach (var i in _ruleManager.DefaultRuleSet) { Rules.Add(i); } }
public void Init() { var builder = new ContainerBuilder(); builder.RegisterType <ScriptExpressionEvaluator>().As <IScriptExpressionEvaluator>(); builder.RegisterType <AlwaysTrueRuleProvider>().As <IRuleProvider>(); builder.RegisterType <RuleManager>().As <IRuleManager>(); builder.RegisterType <StubCacheManager>().As <ICacheManager>(); _container = builder.Build(); _ruleManager = _container.Resolve <IRuleManager>(); }
public CachedLayerEvaluationService(IPerformanceMonitor performanceMonitor, IRuleManager ruleManager, ILayerRetrievalService layerRetrievalService) { _performanceMonitor = performanceMonitor; _ruleManager = ruleManager; _layerRetrievalService = layerRetrievalService; Logger = NullLogger.Instance; T = NullLocalizer.Instance; _activeLayerIds = new LazyField<int[]>(); _activeLayerIds.Loader(PopulateActiveLayers); }
public CachedLayerEvaluationService(IPerformanceMonitor performanceMonitor, IRuleManager ruleManager, ILayerRetrievalService layerRetrievalService) { _performanceMonitor = performanceMonitor; _ruleManager = ruleManager; _layerRetrievalService = layerRetrievalService; Logger = NullLogger.Instance; T = NullLocalizer.Instance; _activeLayerIds = new LazyField <int[]>(); _activeLayerIds.Loader(PopulateActiveLayers); }
public WidgetFilter( IWorkContextAccessor workContextAccessor, IRuleManager ruleManager, IWidgetsService widgetsService, IOrchardServices orchardServices) { _workContextAccessor = workContextAccessor; _ruleManager = ruleManager; _widgetsService = widgetsService; _orchardServices = orchardServices; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
private static BaseRule GetRuleToApplyFromUser(IRuleManager ruleManager) { while (true) { var applyRule = GetApplyRuleFromUser(); var ruleToApply = ruleManager.GetRule(applyRule); if (ruleToApply == null) { continue; } return(ruleToApply); } }
public ResourceManagerController( IResourceRepository resourceRepository, IRuleManager ruleManager, IActionCatalog actionCatalog, IInputOutputController inputOutputController ) { _resourceRepository = resourceRepository; _ruleManager = ruleManager; _actionCatalog = actionCatalog; _inputOutputController = inputOutputController; _isRunning = false; }
public void TestAddUpdateDelete() { int item1 = 10000; int item2 = 20000; var container = GetConfiguredContainer(); IRuleManager ruleManager = container.Resolve <IRuleManager>(); // Rule created to Item 1 SelectorDefinition selector = new SelectorDefinition(null, DateTime.Now, item1, "1"); ruleManager.AddSelector(selector); IList <SelectorDefinition> rulesFetch_1_1 = ruleManager.GetSelectorsForItemId(item1); Assert.IsNotNull(rulesFetch_1_1); Assert.AreEqual(rulesFetch_1_1.Count, 1); Assert.IsTrue(rulesFetch_1_1.SequenceEqual(new List <SelectorDefinition>() { selector }, new SelectorEqualityComparer())); // Update rule. This is now associated with Item 2 selector.ItemId = item2; ruleManager.UpdateSelector(selector); // The rule is not associated to item 1 anymore IList <SelectorDefinition> rulesFetch_1_0 = ruleManager.GetSelectorsForItemId(item1); Assert.IsNotNull(rulesFetch_1_0); Assert.AreEqual(rulesFetch_1_0.Count, 0); // The rule should be associated with item 2 IList <SelectorDefinition> rulesFetch_2_1 = ruleManager.GetSelectorsForItemId(item2); Assert.IsNotNull(rulesFetch_2_1); Assert.AreEqual(rulesFetch_2_1.Count, 1); Assert.IsTrue(rulesFetch_2_1.SequenceEqual(new List <SelectorDefinition>() { selector }, new SelectorEqualityComparer())); // Update rule. This is now associated with Item 2 ruleManager.RemoveSelector(selector); // No rule should be associated with item 2 IList <RuleDefinition> rulesFetch_2_0 = ruleManager.GetRulesForItemId(item2); Assert.IsNotNull(rulesFetch_2_0); Assert.AreEqual(rulesFetch_2_0.Count, 0); }
public void TestAddUpdateDelete() { int item1 = 10000; int item2 = 20000; var container = GetConfiguredContainer(); IRuleManager ruleManager = container.Resolve <IRuleManager>(); // Rule created to Item 1 RuleDefinition rule = new RuleDefinition(null, null, item1, "My Rule 1"); ruleManager.AddRule(rule); IList <RuleDefinition> rulesFetch_1_1 = ruleManager.GetRulesForItemId(item1); Assert.IsNotNull(rulesFetch_1_1); Assert.AreEqual(1, rulesFetch_1_1.Count); Assert.IsTrue(rulesFetch_1_1.SequenceEqual(new List <RuleDefinition>() { rule }, new RuleEqualityComparer())); // Update rule. This is now associated with Item 2 rule.ItemId = item2; ruleManager.UpdateRule(rule); // The rule is not associated to item 1 anymore IList <RuleDefinition> rulesFetch_1_0 = ruleManager.GetRulesForItemId(item1); Assert.IsNotNull(rulesFetch_1_0); Assert.AreEqual(0, rulesFetch_1_0.Count); // The rule should be associated with item 2 IList <RuleDefinition> rulesFetch_2_1 = ruleManager.GetRulesForItemId(item2); Assert.IsNotNull(rulesFetch_2_1); Assert.AreEqual(1, rulesFetch_2_1.Count); Assert.IsTrue(rulesFetch_2_1.SequenceEqual(new List <RuleDefinition>() { rule }, new RuleEqualityComparer())); // Update rule. This is now associated with Item 2 ruleManager.RemoveRule(rule); // No rule should be associated with item 2 IList <RuleDefinition> rulesFetch_2_0 = ruleManager.GetRulesForItemId(item2); Assert.IsNotNull(rulesFetch_2_0); Assert.AreEqual(0, rulesFetch_2_0.Count); }
public static bool createInPlan(string jobName, string special_spec = "") { bool res = false; ruleManager = app.RuleManager(); flowRunner = ruleManager.FlowRunner("PostJobHook", "PostJobHook:PostJobMain"); flowRunner.AddInterfaceParameter("CurrentJob", theJob); flowRunner.Run(); checkStatus(flowRunner, "Job"); string cust_code = ""; if (jobName.Length >= 12) { cust_code = jobName.Substring(4, 3); } else { cust_code = "000"; } ISpecManager specManager = app.SpecManager(); Array specInfos = specManager.SpecInfos(); for (int i = 0; i < specInfos.Length; i++) { ISpecInfo specInfo = (ISpecInfo)specInfos.GetValue(i); string spec_name = specInfo.Name(); if (special_spec != "") { if (spec_name == special_spec) { jobManager.AttachSpecToJob(theJob, specInfo); break; } } else if (spec_name.Contains(cust_code)) { jobManager.AttachSpecToJob(theJob, specInfo); break; } } jobManager.SetJobBySpecs(theJob); jobManager.SaveJob(theJob); res = true; return(res); }
public ShapePastingFilter( IContentManager contentManager, IWorkContextAccessor workContextAccessor, IRuleManager ruleManager, IWidgetsService widgetsService, IEnumerable <IShapeCutter> shapeCutters, IEnumerable <IShapePaster> shapePasters) { _contentManager = contentManager; _workContextAccessor = workContextAccessor; _ruleManager = ruleManager; _widgetsService = widgetsService; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
public GlimpseWidgetFilter( IWorkContextAccessor workContextAccessor, IRuleManager ruleManager, IWidgetsService widgetsService, IOrchardServices orchardServices, IPerformanceMonitor performanceMonitor) { _workContextAccessor = workContextAccessor; _ruleManager = ruleManager; _widgetsService = widgetsService; _orchardServices = orchardServices; _performanceMonitor = performanceMonitor; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
public GlimpseWidgetFilter( IWorkContextAccessor workContextAccessor, IRuleManager ruleManager, IWidgetsService widgetsService, IOrchardServices orchardServices, IPerformanceMonitor performanceMonitor) { _workContextAccessor = workContextAccessor; _ruleManager = ruleManager; _widgetsService = widgetsService; _orchardServices = orchardServices; _performanceMonitor = performanceMonitor; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
public ShapePastingFilter( IContentManager contentManager, IWorkContextAccessor workContextAccessor, IRuleManager ruleManager, IWidgetsService widgetsService, IEnumerable<IShapeCutter> shapeCutters, IEnumerable<IShapePaster> shapePasters) { _contentManager = contentManager; _workContextAccessor = workContextAccessor; _ruleManager = ruleManager; _widgetsService = widgetsService; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
public RuleExecutionContext(string subscriptionName, string ruleName, IRuleManager ruleManager) { if (string.IsNullOrEmpty(subscriptionName)) { throw new ArgumentNullException("subscriptionName"); } if (string.IsNullOrEmpty(ruleName)) { throw new ArgumentNullException("subscriptionName"); } if (ruleManager == null) { throw new ArgumentNullException("ruleManager"); } this.SubscriptionName = subscriptionName; this.RuleName = ruleName; this.ruleManager = ruleManager; }
public DeviceGroupService( IContentManager contentManager, ISignals signals, ICacheManager cacheManager, IExtensionManager extensionManager, ShellDescriptor shellDescriptor, IRuleManager ruleManager, INotifier notifier ) { _contentManager = contentManager; _signals = signals; _cacheManager = cacheManager; _extensionManager = extensionManager; _shellDescriptor = shellDescriptor; _ruleManager = ruleManager; _notifier = notifier; T = NullLocalizer.Instance; }
public DeviceGroupService( IContentManager contentManager, ISignals signals, ICacheManager cacheManager, IExtensionManager extensionManager, ShellDescriptor shellDescriptor, IRuleManager ruleManager, INotifier notifier ) { _contentManager = contentManager; _signals = signals; _cacheManager = cacheManager; _extensionManager = extensionManager; _shellDescriptor = shellDescriptor; _ruleManager = ruleManager; _notifier = notifier; T = NullLocalizer.Instance; }
public void TestValidationOneSelectorOneFilter() { var container = GetConfiguredContainer(); IRuleManager ruleManager = container.Resolve <IRuleManager>(); IAccountManager accountManager = container.Resolve <IAccountManager>(); int actId1 = 10000; AccountGroup accountGroup = new AccountGroup("1", "Group activity 1"); AccountUser account = new AccountUserBuilder("0").WithDisplayName("User 1") .WithEmail("*****@*****.**") .Build(); accountManager.GetStore().SaveGroup(accountGroup); accountManager.GetStore().SaveAccounts(new List <AccountUser>() { account }); accountManager.GetStore().Attach(account.Id, accountGroup.Id); // Selector created to Item 1 SelectorDefinition selector = new SelectorDefinition(null, DateTime.Now, actId1, accountGroup.Id); ruleManager.AddSelector(selector); RuleFilterDefinition filterDefinition = new RuleFilterDefinition(null, "Division", "=", "BTL", selector.Id); ruleManager.AddFilter(filterDefinition); MyDummyDtObject myDummyDtObject = new MyDummyDtObject(); myDummyDtObject.Division = "BTL"; RuleContext ruleContext = new RuleContext(myDummyDtObject, RuleConstants.EmptyRuleConstants); IList <AccountUser> selectedAccounts = ruleManager.SelectAccounts(actId1, ruleContext); Assert.IsNotNull(selectedAccounts); Assert.AreEqual(1, selectedAccounts.Count); Assert.IsTrue(selectedAccounts.SequenceEqual(new List <AccountUser>() { account }, new AccountEqualityComparer())); }
public void TestAddRule() { int item1 = 10000; int item2 = 20000; var container = GetConfiguredContainer(); IRuleManager ruleManager = container.Resolve <IRuleManager>(); DateTime now = DateTime.Now; RuleDefinition rule1 = new RuleDefinition(null, now, item1, "My Rule 1"); RuleDefinition rule2 = new RuleDefinition(null, now, item2, "My Rule 2"); RuleDefinition rule3 = new RuleDefinition(null, now, item2, "My Rule 3"); ruleManager.AddRule(rule1); ruleManager.AddRule(rule2); ruleManager.AddRule(rule3); // Only 1 rule IList <RuleDefinition> rulesFetch1 = ruleManager.GetRulesForItemId(item1); Assert.IsNotNull(rulesFetch1); Assert.AreEqual(rulesFetch1.Count, 1); Assert.IsTrue(rulesFetch1.SequenceEqual(new List <RuleDefinition>() { rule1 }, new RuleEqualityComparer())); // 2 rules IList <RuleDefinition> rulesFetch2 = ruleManager.GetRulesForItemId(item2); Assert.IsNotNull(rulesFetch2); Assert.AreEqual(rulesFetch2.Count, 2); Assert.IsTrue(rulesFetch2.SequenceEqual(new List <RuleDefinition>() { rule2, rule3 }, new RuleEqualityComparer())); }
public WidgetFilter( IWorkContextAccessor workContextAccessor, IRuleManager ruleManager, IWidgetsService widgetsService, IOrchardServices orchardServices, IShapeDisplay shapeDisplay, ICacheManager cacheManager, ISignals signals, IThemeManager themeManager, ShellSettings shellSettings) { _workContextAccessor = workContextAccessor; _ruleManager = ruleManager; _widgetsService = widgetsService; _orchardServices = orchardServices; _shapeDisplay = shapeDisplay; _cacheManager = cacheManager; _signals = signals; _themeManager = themeManager; _shellSettings = shellSettings; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
public WorkflowManager(IWorkflowStorePlugin workflowStorePlugin, IItemStorePlugin itemStorePlugin, IRuleManager ruleManager) { _workflowStorePlugin = workflowStorePlugin; _itemStorePlugin = itemStorePlugin; _ruleManager = ruleManager; }
public ValidateExistingDecisionsRecalculationPlugin(IRuleManager ruleManager, IWorkflowStorePlugin workflowStorePlugin) { _ruleManager = ruleManager; _workflowStorePlugin = workflowStorePlugin; }
public CacheRuleManager(IMemoryCache cache, IRuleManager manager) : base(cache, manager) { _manager = manager; }
public WidgetFilter(IContentManager contentManager, IWorkContextAccessor workContextAccessor, IRuleManager ruleManager, IWidgetsService widgetsService) { _contentManager = contentManager; _workContextAccessor = workContextAccessor; _ruleManager = ruleManager; _widgetsService = widgetsService; Logger = NullLogger.Instance; T = NullLocalizer.Instance; }
public PageWidgetProvider(IWidgetService widgetService, IRuleManager ruleManager) : base(widgetService, ruleManager) { this.widgetService = widgetService; }
public ElementRuleCoordinator(IRuleManager ruleManager) { _ruleManager = ruleManager; }
public ValidateBase(IValidateBaseServices <T> services) : base(services) { this.RuleManager = services.RuleManager; ((ISetTarget)this.RuleManager).SetTarget(this); }
public RuleController(IKeyManagerFactory factory, ILogger <RuleController> logger) { _manager = factory.BuildRuleManager(); _logger = logger; }
public DataService(IXmlParser xmlParser, IRuleManager ruleManager) { _xmlParser = xmlParser; _ruleManager = ruleManager; }
public RuleManagerValidationService(IRuleManager ruleManager, IFileData fileData) { _ruleManager = ruleManager; _fileData = fileData; }