Пример #1
0
        protected static async Task StartProcessingWaitForSpecifiedTimeAndWaitForEnd(IProcessingEngine engine, int milliseconds)
        {
            var task = engine.Start();

            Thread.Sleep(milliseconds);
            await engine.Stop();
        }
Пример #2
0
        public DefaultOrchardHost(
            IShellSettingsManager shellSettingsManager,
            IShellContextFactory shellContextFactory,
            IRunningShellTable runningShellTable,
            IProcessingEngine processingEngine,
            IExtensionLoaderCoordinator extensionLoaderCoordinator,
            IExtensionMonitoringCoordinator extensionMonitoringCoordinator,
            ICacheManager cacheManager,
            IHostLocalRestart hostLocalRestart,
            IHttpContextAccessor httpContextAccessor)
        {
            _shellSettingsManager           = shellSettingsManager;
            _shellContextFactory            = shellContextFactory;
            _runningShellTable              = runningShellTable;
            _processingEngine               = processingEngine;
            _extensionLoaderCoordinator     = extensionLoaderCoordinator;
            _extensionMonitoringCoordinator = extensionMonitoringCoordinator;
            _cacheManager        = cacheManager;
            _hostLocalRestart    = hostLocalRestart;
            _httpContextAccessor = httpContextAccessor;

            _tenantsToRestart = new ContextState <IList <ShellSettings> >("DefaultOrchardHost.TenantsToRestart", () => new List <ShellSettings>());

            T      = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
Пример #3
0
        public CommentService(
            IOrchardServices orchardServices,
            IClock clock,
            IEncryptionService encryptionService,
            IProcessingEngine processingEngine,
            ShellSettings shellSettings,
            IShellDescriptorManager shellDescriptorManager,
            IShapeFactory shapeFactory,
            IShapeDisplay shapeDisplay,
            IMessageService messageService
            )
        {
            _orchardServices        = orchardServices;
            _clock                  = clock;
            _encryptionService      = encryptionService;
            _processingEngine       = processingEngine;
            _shellSettings          = shellSettings;
            _shellDescriptorManager = shellDescriptorManager;
            _shapeFactory           = shapeFactory;
            _shapeDisplay           = shapeDisplay;
            _messageService         = messageService;

            T      = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
Пример #4
0
        public CommandConverter(
            IRestApplication application,
            IObjectFactory objectFactory,
            IProcessingEngine processingEngine,
            IWireSerialization serialization,
            ISerialization <Stream> protobuf,
            ISerialization <XElement> xml,
            ISerialization <StreamReader> json)
        {
            Contract.Requires(application != null);
            Contract.Requires(objectFactory != null);
            Contract.Requires(processingEngine != null);
            Contract.Requires(serialization != null);
            Contract.Requires(protobuf != null);
            Contract.Requires(xml != null);
            Contract.Requires(json != null);

            this.Application      = application;
            this.ObjectFactory    = objectFactory;
            this.ProcessingEngine = processingEngine;
            this.Serialization    = serialization;
            this.Protobuf         = protobuf;
            this.Xml  = xml;
            this.Json = json;
        }
        public TermsPartHandler(
            IContentDefinitionManager contentDefinitionManager,
            IRepository<TermsPartRecord> repository,
            ITaxonomyService taxonomyService,
            IContentManager contentManager,
            IProcessingEngine processingEngine,
            ShellSettings shellSettings,
            IShellDescriptorManager shellDescriptorManager) {
            _contentDefinitionManager = contentDefinitionManager;
            _contentManager = contentManager;

            Filters.Add(StorageFilter.For(repository));
            OnPublished<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
            OnUnpublished<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));
            OnRemoved<TermsPart>((context, part) => RecalculateCount(processingEngine, shellSettings, shellDescriptorManager, part));

            // Tells how to load the field terms on demand, when a content item it loaded or when it has been created
            OnInitialized<TermsPart>((context, part) => InitializerTermsLoader(part));
            OnLoading<TermsPart>((context, part) => InitializerTermsLoader(part));
            OnUpdating<TermsPart>((context, part) => InitializerTermsLoader(part));

            OnIndexing<TermsPart>(
                (context, part) => {

                    foreach (var term in part.Terms) {
                        var termContentItem = context.ContentManager.Get(term.TermRecord.Id);
                        context.DocumentIndex.Add(term.Field, termContentItem.As<TitlePart>().Title).Analyze();
                        context.DocumentIndex.Add(term.Field + "-id", termContentItem.Id).Store();
                        // tag the current content item with all parent terms
                        foreach (var parent in taxonomyService.GetParents(termContentItem.As<TermPart>())) {
                            context.DocumentIndex.Add(term.Field + "-id", parent.Id).Store();
                        }
                    }
                });
        }
 public TaxonomyServiceDraftable(
     IRepository <TermContentItem> termContentItemRepository,
     IContentManager contentManager,
     INotifier notifier,
     IContentDefinitionManager contentDefinitionManager,
     IAuthorizationService authorizationService,
     IOrchardServices services,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager) : base(
         termContentItemRepository,
         contentManager,
         notifier,
         contentDefinitionManager,
         authorizationService,
         services,
         processingEngine,
         shellSettings,
         shellDescriptorManager)
 {
     _termContentItemRepository = termContentItemRepository;
     _contentManager            = contentManager;
     _notifier                 = notifier;
     _authorizationService     = authorizationService;
     _contentDefinitionManager = contentDefinitionManager;
     _services                 = services;
     _processingEngine         = processingEngine;
     _shellSettings            = shellSettings;
     _shellDescriptorManager   = shellDescriptorManager;
 }
Пример #7
0
        // Fires off a processing engine task to run the count processing after the request so it's non-blocking.
        private void RecalculateCount(IProcessingEngine processingEngine, ShellSettings shellSettings, IShellDescriptorManager shellDescriptorManager, TermsPart part)
        {
            var termPartRecordIds = part.Terms.Select(t => t.TermRecord.Id).ToArray();

            processingEngine.AddTask(shellSettings, shellDescriptorManager.GetShellDescriptor(), "ITermCountProcessor.Process", new Dictionary <string, object> {
                { "termPartRecordIds", termPartRecordIds }
            });
        }
Пример #8
0
 public RestApplication(
     IProcessingEngine processingEngine,
     IObjectFactory objectFactory,
     IWireSerialization serialization)
 {
     this.ProcessingEngine = processingEngine;
     this.ObjectFactory    = objectFactory;
     this.Serialization    = serialization;
 }
Пример #9
0
 public WarmupScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy<IWarmupUpdater> warmupUpdater ) {
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _warmupUpdater = warmupUpdater;
 }
Пример #10
0
 public BlogService(
     IContentManager contentManager,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager) {
     _contentManager = contentManager;
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
 }
Пример #11
0
        public SoapApplication(
            IProcessingEngine processingEngine,
            IPluginRepository <IServerCommand> serverCommandsRepository)
        {
            Contract.Requires(processingEngine != null);
            Contract.Requires(serverCommandsRepository != null);

            this.ProcessingEngine = processingEngine;
            this.ServerCommands   = serverCommandsRepository;
        }
Пример #12
0
 public RecipeScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy<IRecipeStepExecutor> recipeStepExecutor) {
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _recipeStepExecutor = recipeStepExecutor;
 }
Пример #13
0
        public SoapApplication(
            IProcessingEngine processingEngine,
            IPluginRepository<IServerCommand> serverCommandsRepository)
        {
            Contract.Requires(processingEngine != null);
            Contract.Requires(serverCommandsRepository != null);

            this.ProcessingEngine = processingEngine;
            this.ServerCommands = serverCommandsRepository;
        }
Пример #14
0
 public RestApplication(
     IProcessingEngine processingEngine,
     IObjectFactory objectFactory,
     IWireSerialization serialization,
     IPluginRepository <IServerCommand> commandsRepository)
 {
     this.ProcessingEngine   = processingEngine;
     this.ObjectFactory      = objectFactory;
     this.Serialization      = serialization;
     this.CommandsRepository = commandsRepository;
 }
 public UpdateIndexScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy<IIndexingTaskExecutor> indexingTaskExecutor
     ) {
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _indexingTaskExecutor = indexingTaskExecutor;
 }
Пример #16
0
 public WarmupScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy <IWarmupUpdater> warmupUpdater)
 {
     _processingEngine       = processingEngine;
     _shellSettings          = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _warmupUpdater          = warmupUpdater;
 }
Пример #17
0
 public RecipeScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy <IRecipeStepExecutor> recipeStepExecutor)
 {
     _processingEngine       = processingEngine;
     _shellSettings          = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _recipeStepExecutor     = recipeStepExecutor;
 }
Пример #18
0
 public CommandConverter(
     RestApplication application,
     IObjectFactory objectFactory,
     IProcessingEngine processingEngine,
     IWireSerialization serialization)
 {
     this.Application      = application;
     this.ObjectFactory    = objectFactory;
     this.ProcessingEngine = processingEngine;
     this.Serialization    = serialization;
 }
Пример #19
0
 public RhetosService(
     IProcessingEngine processingEngine,
     IEnumerable<ICommandInfo> commands,
     ILogProvider logProvider,
     XmlUtility xmlUtility)
 {
     _processingEngine = processingEngine;
     _commands = commands;
     _performanceLogger = logProvider.GetLogger("Performance");
     _xmlUtility = xmlUtility;
 }
Пример #20
0
 public BlogService(
     IContentManager contentManager,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager)
 {
     _contentManager         = contentManager;
     _processingEngine       = processingEngine;
     _shellSettings          = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
 }
Пример #21
0
 public RhetosService(
     IProcessingEngine processingEngine,
     IEnumerable <ICommandInfo> commands,
     ILogProvider logProvider,
     XmlUtility xmlUtility)
 {
     _processingEngine  = processingEngine;
     _commands          = commands;
     _performanceLogger = logProvider.GetLogger("Performance");
     _xmlUtility        = xmlUtility;
 }
 public UpdateIndexScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy <IIndexingTaskExecutor> indexingTaskExecutor
     )
 {
     _processingEngine       = processingEngine;
     _shellSettings          = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _indexingTaskExecutor   = indexingTaskExecutor;
 }
 public ServiceUtility(
     IProcessingEngine processingEngine,
     ILogProvider logProvider,
     IDomainObjectModel domainObjectModel)
 {
     _processingEngine  = processingEngine;
     _logger            = logProvider.GetLogger("RestService");
     _commandsLogger    = logProvider.GetLogger("RestService Commands");
     _performanceLogger = logProvider.GetLogger("Performance");
     _logger.Trace("Rest Service loader initialized.");
     _domainObjectModel = domainObjectModel;
 }
Пример #24
0
 public RecipeScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy<IRecipeStepExecutor> recipeStepExecutor,
     IShellDescriptorManagerEventHandler events) {
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _recipeStepExecutor = recipeStepExecutor;
     _events = events;
     Logger = NullLogger.Instance;
 }
Пример #25
0
 public DomainCommands(
     IServiceLocator locator,
     ICommandConverter converter,
     IProcessingEngine processing,
     IDomainModel domainModel,
     IWireSerialization serialization)
 {
     this.Locator = locator;
     this.Converter = converter;
     this.Processing = processing;
     this.DomainModel = domainModel;
     this.Serialization = serialization;
 }
Пример #26
0
 public ShellStateCoordinator(
     ShellSettings settings,
     IShellStateManager stateManager,
     IExtensionManager extensionManager,
     IProcessingEngine processingEngine,
     IFeatureEventHandler featureEvents) {
     _settings = settings;
     _stateManager = stateManager;
     _extensionManager = extensionManager;
     _processingEngine = processingEngine;
     _featureEvents = featureEvents;
     Logger = NullLogger.Instance;
 }
Пример #27
0
 public DomainCommands(
     IServiceProvider locator,
     ICommandConverter converter,
     IProcessingEngine processing,
     IDomainModel domainModel,
     IWireSerialization serialization)
 {
     this.Locator       = locator;
     this.Converter     = converter;
     this.Processing    = processing;
     this.DomainModel   = domainModel;
     this.Serialization = serialization;
 }
Пример #28
0
 public CaseService(
     IContentManager contentManager,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     IPathResolutionService pathResolutionService)
 {
     _contentManager         = contentManager;
     _processingEngine       = processingEngine;
     _shellSettings          = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _pathResolutionService  = pathResolutionService;
 }
 public PackageUninstallHandler(
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     IProcessingEngine processingEngine,
     IHostEnvironment hostEnvironment,
     IPackageInstaller packageInstaller)
 {
     _shellSettings          = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _processingEngine       = processingEngine;
     _hostEnvironment        = hostEnvironment;
     _packageInstaller       = packageInstaller;
 }
Пример #30
0
        private static ExecuteResult Execute <TInput>(
            IProcessingEngine engine,
            IServerCommandDescription <TInput>[] commands,
            IRequestContext request,
            IResponseContext response)
        {
            var result = engine.Execute <TInput, object>(commands, request.Principal);
            var first  = result.ExecutedCommandResults != null?result.ExecutedCommandResults.FirstOrDefault() : null;

            response.StatusCode = first != null && first.Result != null
                                ? first.Result.Status
                                : result.Status;

            if (result.Status == HttpStatusCode.ServiceUnavailable)
            {
                HttpRuntime.UnloadAppDomain();
            }

            var noResult = first == null || first.Result == null || first.Result.Data == null;

            if ((int)result.Status >= 300 && noResult)
            {
                return new ExecuteResult {
                           Error = response.ReturnError(result.Message, result.Status)
                }
            }
            ;
            if (first == null)
            {
                return new ExecuteResult {
                           Error = response.ReturnError("Missing result", HttpStatusCode.InternalServerError)
                }
            }
            ;
            if ((int)first.Result.Status >= 300 && noResult)
            {
                return new ExecuteResult {
                           Error = response.ReturnError(first.Result.Message, first.Result.Status)
                }
            }
            ;

            foreach (var ar in result.ExecutedCommandResults.Skip(1))
            {
                response.AddHeader(ar.RequestID, ar.Result.Data.ToString());
            }

            return(new ExecuteResult {
                Result = first.Result.Data
            });
        }
Пример #31
0
 public RhetosService(
     IProcessingEngine processingEngine,
     IEnumerable<ICommandInfo> commands,
     ILogProvider logProvider,
     IDomainObjectModel domainObjectModel)
 {
     _processingEngine = processingEngine;
     _commands = commands;
     _logger = logProvider.GetLogger("IServerApplication.RhetosService.Execute");
     _commandsLogger = logProvider.GetLogger("IServerApplication Commands");
     _commandResultsLogger = logProvider.GetLogger("IServerApplication CommandResults");
     _performanceLogger = logProvider.GetLogger("Performance");
     _domainObjectModel = domainObjectModel;
 }
 public UserNotificationsUpdaterFilter(
     IWorkContextAccessor wca,
     IClock clock,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     INotificationsToUserDispatcher notificationsDispatcher)
 {
     _wca = wca;
     _clock = clock;
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
 }
Пример #33
0
 public ShellStateCoordinator(
     ShellSettings settings,
     IShellStateManager stateManager,
     IExtensionManager extensionManager,
     IProcessingEngine processingEngine,
     IFeatureEventHandler featureEvents)
 {
     _settings         = settings;
     _stateManager     = stateManager;
     _extensionManager = extensionManager;
     _processingEngine = processingEngine;
     _featureEvents    = featureEvents;
     Logger            = NullLogger.Instance;
 }
Пример #34
0
 public UserNotificationsUpdaterFilter(
     IWorkContextAccessor wca,
     IClock clock,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     INotificationsToUserDispatcher notificationsDispatcher)
 {
     _wca                    = wca;
     _clock                  = clock;
     _processingEngine       = processingEngine;
     _shellSettings          = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
 }
Пример #35
0
 public RecipeScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy <IRecipeStepExecutor> recipeStepExecutor,
     IShellDescriptorManagerEventHandler events)
 {
     _processingEngine       = processingEngine;
     _shellSettings          = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _recipeStepExecutor     = recipeStepExecutor;
     _events = events;
     Logger  = NullLogger.Instance;
 }
Пример #36
0
        public AtomicJobQueue(
            IProcessingEngine processingEngine,
            ShellSettings shellSettings,
            IShellDescriptorManager shellDescriptorManager,
            IResolve <IJobManager> jobManagerResolve,
            IWorkContextAccessor wca)
        {
            _processingEngine       = processingEngine;
            _shellSettings          = shellSettings;
            _shellDescriptorManager = shellDescriptorManager;
            _jobManagerResolve      = jobManagerResolve;
            _wca = wca;

            Logger = NullLogger.Instance;
        }
Пример #37
0
 public CommentService(
     IOrchardServices orchardServices, 
     IClock clock, 
     IEncryptionService encryptionService,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager) {
     _orchardServices = orchardServices;
     _clock = clock;
     _encryptionService = encryptionService;
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     Logger = NullLogger.Instance;
 }
Пример #38
0
 public SetupService(
     ShellSettings shellSettings,
     IOrchardHost orchardHost,
     IShellSettingsManager shellSettingsManager,
     IShellContainerFactory shellContainerFactory,
     ICompositionStrategy compositionStrategy,
     IProcessingEngine processingEngine)
 {
     _shellSettings         = shellSettings;
     _orchardHost           = orchardHost;
     _shellSettingsManager  = shellSettingsManager;
     _shellContainerFactory = shellContainerFactory;
     _compositionStrategy   = compositionStrategy;
     _processingEngine      = processingEngine;
 }
Пример #39
0
 public LdapDirectoryCache(
     IOrchardServices orchardServices,
     ICacheManager cacheManager,
     ISignals signals,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager)
 {
     this.orchardServices = orchardServices;
     this.cacheManager = cacheManager;
     this.signals = signals;
     this.processingEngine = processingEngine;
     this.shellSettings = shellSettings;
     this.shellDescriptorManager = shellDescriptorManager;
 }
Пример #40
0
        private static async Task <ExecuteResult> Execute <TInput>(
            IProcessingEngine engine,
            IServerCommandDescription <TInput>[] commands,
            IPrincipal principal,
            HttpResponse response)
        {
            //TODO: make it truly async. as a temporary workaroung just call engine in a thread
            var result = await Task.Run(() => engine.Execute <TInput, object>(commands, principal));

            var first = result.ExecutedCommandResults != null?result.ExecutedCommandResults.FirstOrDefault() : null;

            response.StatusCode = (int)(first != null && first.Result != null
                                ? first.Result.Status
                                : result.Status);

            var noResult = first == null || first.Result == null || first.Result.Data == null;

            if ((int)result.Status >= 300 && noResult)
            {
                return new ExecuteResult {
                           Error = result.Message
                }
            }
            ;
            if (first == null)
            {
                return new ExecuteResult {
                           Error = "Missing result"
                }
            }
            ;
            if ((int)first.Result.Status >= 300 && noResult)
            {
                return new ExecuteResult {
                           Error = first.Result.Message
                }
            }
            ;

            foreach (var ar in result.ExecutedCommandResults.Skip(1))
            {
                response.Headers.Add(ar.RequestID, ar.Result.Data.ToString());
            }

            return(new ExecuteResult {
                Result = first.Result.Data
            });
        }
Пример #41
0
        public RestApplication(
            IProcessingEngine processingEngine,
            IObjectFactory objectFactory,
            IWireSerialization serialization,
            IPluginRepository <IServerCommand> commandsRepository)
        {
            Contract.Requires(processingEngine != null);
            Contract.Requires(objectFactory != null);
            Contract.Requires(serialization != null);
            Contract.Requires(commandsRepository != null);

            this.ProcessingEngine   = processingEngine;
            this.ObjectFactory      = objectFactory;
            this.Serialization      = serialization;
            this.CommandsRepository = commandsRepository;
        }
Пример #42
0
        public CommandConverter(
            IRestApplication application,
            IObjectFactory objectFactory,
            IProcessingEngine processingEngine,
            IWireSerialization serialization)
        {
            Contract.Requires(application != null);
            Contract.Requires(objectFactory != null);
            Contract.Requires(processingEngine != null);
            Contract.Requires(serialization != null);

            this.Application      = application;
            this.ObjectFactory    = objectFactory;
            this.ProcessingEngine = processingEngine;
            this.Serialization    = serialization;
        }
Пример #43
0
 public CommentService(
     IOrchardServices orchardServices,
     IClock clock,
     IEncryptionService encryptionService,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager)
 {
     _orchardServices        = orchardServices;
     _clock                  = clock;
     _encryptionService      = encryptionService;
     _processingEngine       = processingEngine;
     _shellSettings          = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     Logger                  = NullLogger.Instance;
 }
Пример #44
0
        private static ExecuteResult Execute <TInput>(
            IProcessingEngine engine,
            IServerCommandDescription <TInput>[] commands,
            IPrincipal principal,
            HttpResponse response)
        {
            var result = engine.Execute <TInput, object>(commands, principal);
            var first  = result.ExecutedCommandResults != null?result.ExecutedCommandResults.FirstOrDefault() : null;

            response.StatusCode = (int)(first != null && first.Result != null
                                ? first.Result.Status
                                : result.Status);

            //if (result.Status == HttpStatusCode.ServiceUnavailable)
            //HttpRuntime.UnloadAppDomain();

            if ((int)result.Status >= 300)
            {
                return new ExecuteResult {
                           Error = result.Message
                }
            }
            ;
            else if (first == null)
            {
                return new ExecuteResult {
                           Error = "Missing result"
                }
            }
            ;
            else if ((int)first.Result.Status >= 300)
            {
                return new ExecuteResult {
                           Error = first.Result.Message
                }
            }
            ;

            foreach (var ar in result.ExecutedCommandResults.Skip(1))
            {
                response.Headers.Add(ar.RequestID, ar.Result.Data.ToString());
            }

            return(new ExecuteResult {
                Result = first.Result.Data
            });
        }
 //private readonly IEnumerable<Recipe> _recipes;
 public SetupService(
     ShellSettings shellSettings,
     ICoeveryHost coeveryHost,
     IShellSettingsManager shellSettingsManager,
     IShellContainerFactory shellContainerFactory,
     ICompositionStrategy compositionStrategy,
     IProcessingEngine processingEngine)
 {
     _shellSettings = shellSettings;
     _coeveryHost = coeveryHost;
     _shellSettingsManager = shellSettingsManager;
     _shellContainerFactory = shellContainerFactory;
     _compositionStrategy = compositionStrategy;
     _processingEngine = processingEngine;
     //_recipes = recipeHarvester.HarvestRecipes("Coevery.Setup");
     T = NullLocalizer.Instance;
 }
Пример #46
0
 public SetupService(
  ShellSettings shellSettings,
  IOrchardHost orchardHost,
  IShellSettingsManager shellSettingsManager,
  IShellContainerFactory shellContainerFactory,
  ICompositionStrategy compositionStrategy,
  IProcessingEngine processingEngine,
  IExtensionManager extensionManager)
 {
     _shellSettings = shellSettings;
     _orchardHost = orchardHost;
     _shellSettingsManager = shellSettingsManager;
     _shellContainerFactory = shellContainerFactory;
     _compositionStrategy = compositionStrategy;
     _processingEngine = processingEngine;
     _extensionManager = extensionManager;
 }
Пример #47
0
 public SetupService(
     ShellSettings shellSettings,
     IOrchardHost orchardHost,
     IShellSettingsManager shellSettingsManager,
     IShellContainerFactory shellContainerFactory,
     ICompositionStrategy compositionStrategy,
     IProcessingEngine processingEngine,
     IRecipeHarvester recipeHarvester) {
     _shellSettings = shellSettings;
     _orchardHost = orchardHost;
     _shellSettingsManager = shellSettingsManager;
     _shellContainerFactory = shellContainerFactory;
     _compositionStrategy = compositionStrategy;
     _processingEngine = processingEngine;
     _recipeHarvester = recipeHarvester;
     _recipes = _recipeHarvester.HarvestRecipes("Orchard.Setup");
     T = NullLocalizer.Instance;
 }
Пример #48
0
 public ScheduledTaskExecutor(
     IClock clock,
     IRepository<ScheduledTaskRecord> repository,
     IEnumerable<IScheduledTaskHandler> handlers,
     ISessionLocator sessionLocator,
     ITransactionManager transactionManager, 
     ShellSettings shellSettings, IWorkContextAccessor workContextAccessor, IRunningShellTable runningShellTable,
      IProcessingEngine processingEngine,           
     IShellDescriptorManager shellDescriptorManager,
     IOrchardServices orchardServices,
     IContentManager contentManager) {
     _clock = clock;
     _orchardServices = orchardServices;
     _repository = repository;
     _transactionManager = transactionManager;
     _handlers = handlers;
     _contentManager = contentManager;
     _sessionLocator = sessionLocator;
     Logger = NullLogger.Instance;
 }
Пример #49
0
        public DefaultOrchardHost(
            IShellSettingsManager shellSettingsManager,
            IShellContextFactory shellContextFactory,
            IRunningShellTable runningShellTable,
            IProcessingEngine processingEngine,
            IExtensionLoaderCoordinator extensionLoaderCoordinator,
            IExtensionMonitoringCoordinator extensionMonitoringCoordinator,
            ICacheManager cacheManager,
            IHostLocalRestart hostLocalRestart ) {
            _shellSettingsManager = shellSettingsManager;
            _shellContextFactory = shellContextFactory;
            _runningShellTable = runningShellTable;
            _processingEngine = processingEngine;
            _extensionLoaderCoordinator = extensionLoaderCoordinator;
            _extensionMonitoringCoordinator = extensionMonitoringCoordinator;
            _cacheManager = cacheManager;
            _hostLocalRestart = hostLocalRestart;
            _tenantsToRestart = Enumerable.Empty<ShellSettings>();

            T = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
        public TaxonomyService(
            IRepository<TermContentItem> termContentItemRepository,
            IContentManager contentManager,
            INotifier notifier,
            IContentDefinitionManager contentDefinitionManager,
            IAuthorizationService authorizationService,
            IOrchardServices services,
            IProcessingEngine processingEngine,
            ShellSettings shellSettings,
            IShellDescriptorManager shellDescriptorManager) {
            _termContentItemRepository = termContentItemRepository;
            _contentManager = contentManager;
            _notifier = notifier;
            _authorizationService = authorizationService;
            _contentDefinitionManager = contentDefinitionManager;
            _services = services;
            _processingEngine = processingEngine;
            _shellSettings = shellSettings;
            _shellDescriptorManager = shellDescriptorManager;

            Logger = NullLogger.Instance;
            T = NullLocalizer.Instance;
        }
        public DefaultCoeveryHost(
            IShellSettingsManager shellSettingsManager,
            IShellContextFactory shellContextFactory,
            IRunningShellTable runningShellTable,
            IProcessingEngine processingEngine,
            IExtensionLoaderCoordinator extensionLoaderCoordinator,
            IExtensionMonitoringCoordinator extensionMonitoringCoordinator,
            ICacheManager cacheManager,
            IHostLocalRestart hostLocalRestart )
        {
            _shellSettingsManager = shellSettingsManager;
            _shellContextFactory = shellContextFactory;
            _runningShellTable = runningShellTable;
            _processingEngine = processingEngine;
            _extensionLoaderCoordinator = extensionLoaderCoordinator;
            _extensionMonitoringCoordinator = extensionMonitoringCoordinator;
            _cacheManager = cacheManager;
            _hostLocalRestart = hostLocalRestart;

            _tenantsToRestart = new ContextState<IList<ShellSettings>>("DefaultCoeveryHost.TenantsToRestart", () => new List<ShellSettings>());

            T = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
Пример #52
0
        public CommentService(
            IOrchardServices orchardServices, 
            IClock clock, 
            IEncryptionService encryptionService,
            IProcessingEngine processingEngine,
            ShellSettings shellSettings,
            IShellDescriptorManager shellDescriptorManager,
            IShapeFactory shapeFactory,
            IShapeDisplay shapeDisplay,
            IMessageService messageService
            ) {
            _orchardServices = orchardServices;
            _clock = clock;
            _encryptionService = encryptionService;
            _processingEngine = processingEngine;
            _shellSettings = shellSettings;
            _shellDescriptorManager = shellDescriptorManager;
            _shapeFactory = shapeFactory;
            _shapeDisplay = shapeDisplay;
            _messageService = messageService;

            T = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
Пример #53
0
         // Fires off a processing engine task to run the count processing after the request so it's non-blocking.
 private void RecalculateCount(IProcessingEngine processingEngine, ShellSettings shellSettings, IShellDescriptorManager shellDescriptorManager, TermsPart part) {
     var termPartRecordIds = part.Terms.Select(t => t.TermRecord.Id).ToArray();
     if (termPartRecordIds.Any()) {
         if (!_processedTermParts.Any()) {
             processingEngine.AddTask(shellSettings, shellDescriptorManager.GetShellDescriptor(), "ITermCountProcessor.Process", new Dictionary<string, object> { { "termPartRecordIds", _processedTermParts } });
         }
         foreach (var termPartRecordId in termPartRecordIds) {
             _processedTermParts.Add(termPartRecordId);                    
         }
     }
 }
        // Fires off a processing engine task to run the count processing after the request so it's non-blocking.
        private void RecalculateCount(IProcessingEngine processingEngine, ShellSettings shellSettings, IShellDescriptorManager shellDescriptorManager, TermsPart part) {
            var termPartRecordIds = part.Terms.Select(t => t.TermRecord.Id).ToArray();
            processingEngine.AddTask(shellSettings, shellDescriptorManager.GetShellDescriptor(), "ITermCountProcessor.Process", new Dictionary<string, object> { { "termPartRecordIds", termPartRecordIds } });

        }
Пример #55
-1
 public PackageUninstallHandler(
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     IProcessingEngine processingEngine,
     IHostEnvironment hostEnvironment,
     IPackageInstaller packageInstaller) {
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _processingEngine = processingEngine;
     _hostEnvironment = hostEnvironment;
     _packageInstaller = packageInstaller;
 }