Exemplo n.º 1
0
        public void Execute(IProcessingContext processingContext, ITransactionScopeContext transactionScopeContext)
        {
            KraftModule   loadedModule  = _KraftModuleCollection.GetModule(processingContext.InputModel.Module);
            LoadedNodeSet loadedNodeSet = _NodesSetService.LoadNodeSet(
                processingContext.InputModel.Module,
                processingContext.InputModel.NodeSet,
                processingContext.InputModel.Nodepath);
            StringBuilder sb;

            if (!CheckValidity(processingContext, loadedModule, loadedNodeSet, out sb))
            {
                PluginAccessorImp <IDataLoaderPlugin> externalService = new PluginAccessorImp <IDataLoaderPlugin>(transactionScopeContext, loadedModule.ModuleSettings);
                PluginAccessorImp <INodePlugin>       customService   = new PluginAccessorImp <INodePlugin>(transactionScopeContext, loadedModule.ModuleSettings);
                INodeTaskExecutor taskExecutor = new NodeTaskExecutor(transactionScopeContext, loadedModule.ModuleSettings);
                taskExecutor.Execute(loadedNodeSet, processingContext, externalService, customService);
            }
            else
            {
                processingContext.ReturnModel.Status.IsSuccessful = false;
                processingContext.ReturnModel.Status.StatusResults.Add(new StatusResult()
                {
                    Message = sb.ToString(), StatusResultType = SysPlugins.Interfaces.Packet.StatusResultEnum.EStatusResult.StatusResultError
                });
            }
        }
Exemplo n.º 2
0
 public override void Execute(IProcessingContext processingContext, ITransactionScopeContext transactionScopeContext)
 {
     processingContext.ReturnModel = new ReturnModel();
     processingContext.ReturnModel.Status.IsSuccessful = false;
     processingContext.ReturnModel.Status.StatusResults.Add(new StatusResult {
         Message = "Unknown request type!", StatusResultType = EStatusResult.StatusResultError
     });
 }
Exemplo n.º 3
0
 public override void Execute(IProcessingContext processingContext, ITransactionScopeContext transactionScopeContext)
 {
     foreach (KraftModule kraftModule in _KraftModuleCollection.GetSortedModules())
     {
         BundleCollection.Instance.Profile(kraftModule.Key).KraftScripts().Render();
         BundleCollection.Instance.Profile(kraftModule.Key).KraftStyles().Render();
     }
     foreach (Profile profile in BundleCollection.Instance.Profiles.Values)
     {
         profile.Styles?.Render();
         profile.Scripts?.Render();
     }
 }
Exemplo n.º 4
0
        public override void Execute(IProcessingContext processingContext, ITransactionScopeContext transactionScopeContext)
        {
            KraftModule   loadedModule  = _KraftModuleCollection.GetModule(processingContext.InputModel.Module);
            LoadedNodeSet loadedNodeSet = _NodesSetService.LoadNodeSet(
                processingContext.InputModel.Module,
                processingContext.InputModel.NodeSet,
                processingContext.InputModel.Nodepath);

            if (CheckValidity(processingContext, loadedModule, loadedNodeSet))
            {
                PluginAccessorImp <IDataLoaderPlugin> externalService = new PluginAccessorImp <IDataLoaderPlugin>(transactionScopeContext, loadedModule.ModuleSettings);
                PluginAccessorImp <INodePlugin>       customService   = new PluginAccessorImp <INodePlugin>(transactionScopeContext, loadedModule.ModuleSettings);
                INodeTaskExecutor taskExecutor = new NodeTaskExecutor(transactionScopeContext, loadedModule.ModuleSettings);
                taskExecutor.Execute(loadedNodeSet, processingContext, externalService, customService);
            }
        }
Exemplo n.º 5
0
        public static void Do(ITransactionScopeContext scopeContext, TransactionScopeMethod expression)
        {
            scopeContext.BeginTransaction();
            try
            {
                expression();

                scopeContext.CommitTransaction();
            }
            catch (Exception ex)
            {
                scopeContext.RollbackTransaction();

                throw;
            }
        }
Exemplo n.º 6
0
 public NodeTaskExecutor(ITransactionScopeContext transactionScope, KraftModuleConfigurationSettings moduleSettings)
 {
     _TransactionScope = transactionScope ?? throw new ArgumentNullException(nameof(transactionScope));
     _KraftModuleConfigurationSettings = moduleSettings;
 }
Exemplo n.º 7
0
 public void Execute(ITransactionScopeContext transactionScopeContext)
 {
     ProcessorHandler.Execute(this, transactionScopeContext);
 }
Exemplo n.º 8
0
 public abstract void Execute(IProcessingContext processingContext, ITransactionScopeContext transactionScopeContext);
Exemplo n.º 9
0
 public PluginAccessorImp(ITransactionScopeContext transactionScope, KraftModuleConfigurationSettings moduleSettings)
 {
     _TransactionScope = transactionScope;
     _KraftModuleConfigurationSettings = moduleSettings;
 }