Пример #1
0
 public ModuleService(IOrchardServices orchardServices, IExtensionManager extensionManager,
                      IShellDescriptorManager shellDescriptorManager) {
     Services = orchardServices;
     _extensionManager = extensionManager;
     _shellDescriptorManager = shellDescriptorManager;
     T = NullLocalizer.Instance;
 }
Пример #2
0
 public ShellStateManager(
     IRepository<ShellStateRecord> shellStateRepository,
     IShellDescriptorManager shellDescriptorManager)
 {
     _shellStateRepository = shellStateRepository;
     _shellDescriptorManager = shellDescriptorManager;
 }
        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();
                        }
                    }
                });
        }
Пример #4
0
 public RecipeExecutor(
     IRecipeParser recipeParser,
     IRecipeManager recipeManager,
     IShellDescriptorManager shellDescriptorManager)
 {
     _recipeManager = recipeManager;
     _shellDescriptorManager = shellDescriptorManager;
 }
Пример #5
0
        public FeatureManager(
            IExtensionManager extensionManager,
            IShellDescriptorManager shellDescriptorManager) {
            _extensionManager = extensionManager;
            _shellDescriptorManager = shellDescriptorManager;

            T = NullLocalizer.Instance;
            Logger = NullLogger.Instance;
        }
Пример #6
0
 public BlogService(
     IContentManager contentManager,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager) {
     _contentManager = contentManager;
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
 }
Пример #7
0
 public RecipeScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy<IRecipeStepExecutor> recipeStepExecutor) {
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _recipeStepExecutor = recipeStepExecutor;
 }
Пример #8
0
 public WarmupScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy<IWarmupUpdater> warmupUpdater ) {
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _warmupUpdater = warmupUpdater;
 }
 public UpdateIndexScheduler(
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     Lazy<IIndexingTaskExecutor> indexingTaskExecutor
     ) {
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _indexingTaskExecutor = indexingTaskExecutor;
 }
Пример #10
0
        public FeatureManager(
            IExtensionManager extensionManager,
            IShellDescriptorManager shellDescriptorManager,
            ILoggerFactory loggerFactory)
        {
            _extensionManager = extensionManager;
            _shellDescriptorManager = shellDescriptorManager;
            _logger = loggerFactory.CreateLogger<FeatureManager>();

            T = NullLocalizer.Instance;
        }
Пример #11
0
        public ConcurrentTaskService(
            ShellSettings shellSettings,
            IShellDescriptorManager shellDescriptorManager,
            IShellContextFactory shellContextFactory
            )
        {
            T = NullLocalizer.Instance;
            Logger = NullLogger.Instance;

            _shellSettings = shellSettings;
            _shellDescriptorManager = shellDescriptorManager;
            _shellContextFactory = shellContextFactory;
        }
Пример #12
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;
 }
 public UserNotificationsUpdaterFilter(
     IWorkContextAccessor wca,
     IClock clock,
     IProcessingEngine processingEngine,
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     INotificationsToUserDispatcher notificationsDispatcher)
 {
     _wca = wca;
     _clock = clock;
     _processingEngine = processingEngine;
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
 }
Пример #14
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;
 }
Пример #15
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;
 }
Пример #16
0
 public ShellFeatureManager(
     IShellDescriptorManager shellDescriptorManager,
     IShellDescriptorStore shellDescriptorStore,
     IHttpContextAccessor httpContextAccessor,
     IShellContextFactory shellContextFactory,
     IRunningShellTable runningShellTable,
     ILogger <ShellFeatureManager> logger,
     IPlatoHost platoHost)
 {
     _shellDescriptorManager = shellDescriptorManager;
     _shellDescriptorStore   = shellDescriptorStore;
     _httpContextAccessor    = httpContextAccessor;
     _shellContextFactory    = shellContextFactory;
     _runningShellTable      = runningShellTable;
     _platoHost = platoHost;
     _logger    = logger;
 }
Пример #17
0
 public ImportExportService(
     IOrchardServices orchardServices,
     IContentDefinitionManager contentDefinitionManager,
     IContentDefinitionWriter contentDefinitionWriter,
     IAppDataFolder appDataFolder,
     IRecipeParser recipeParser, 
     IRecipeManager recipeManager, 
     IShellDescriptorManager shellDescriptorManager) {
     _orchardServices = orchardServices;
     _contentDefinitionManager = contentDefinitionManager;
     _contentDefinitionWriter = contentDefinitionWriter;
     _appDataFolder = appDataFolder;
     _recipeParser = recipeParser;
     _recipeManager = recipeManager;
     _shellDescriptorManager = shellDescriptorManager;
     Logger = NullLogger.Instance;
     T = NullLocalizer.Instance;
 }
Пример #18
0
        public AdminController(
            IModuleService moduleService,
            IExtensionManager extensionManager,
            IFeatureManager featureManager,
            IHtmlLocalizer <AdminController> localizer,
            IShellDescriptorManager shellDescriptorManager,
            IAuthorizationService authorizationService,
            INotifier notifier)
        {
            _moduleService          = moduleService;
            _extensionManager       = extensionManager;
            _featureManager         = featureManager;
            _shellDescriptorManager = shellDescriptorManager;
            _authorizationService   = authorizationService;
            _notifier = notifier;

            T = localizer;
        }
Пример #19
0
        public AdminController(

            IExtensionManager extensionManager,
            IHtmlLocalizer <AdminController> localizer,
            IShellDescriptorManager shellDescriptorManager,
            IShellFeaturesManager shellFeaturesManager,
            IAuthorizationService authorizationService,
            ShellSettings shellSettings,
            INotifier notifier)
        {
            _extensionManager     = extensionManager;
            _shellFeaturesManager = shellFeaturesManager;
            _authorizationService = authorizationService;
            _shellSettings        = shellSettings;
            _notifier             = notifier;

            T = localizer;
        }
Пример #20
0
        public ShellContextFactory(
            IShellDescriptorCache shellDescriptorCache,
            IShellDescriptorManager shellDescriptorManager,
            ICompositionStrategy compositionStrategy,
            IOptions <SchubertOptions> options,
            ILoggerFactory loggerFactory)
        {
            Guard.ArgumentNotNull(shellDescriptorManager, nameof(shellDescriptorManager));
            Guard.ArgumentNotNull(shellDescriptorCache, nameof(shellDescriptorCache));
            Guard.ArgumentNotNull(compositionStrategy, nameof(compositionStrategy));
            Guard.ArgumentNotNull(options, nameof(options));

            _options                = options.Value;
            _compositionStrategy    = compositionStrategy;
            _shellDescriptorManager = shellDescriptorManager;
            _shellDescriptorCache   = shellDescriptorCache;
            _logger = loggerFactory?.CreateLogger <ShellContextFactory>() ?? (ILogger)NullLogger.Instance;
        }
Пример #21
0
        //private readonly INotifier _notifier;

        public AdminController(
            IModuleService moduleService,
            IExtensionManager extensionManager,
            //IHtmlLocalizer<AdminController> localizer,
            IShellDescriptorManager shellDescriptorManager,
            IShellFeaturesManager shellFeaturesManager,
            IAuthorizationService authorizationService
            /*   ,INotifier notifier*/)
        {
            _moduleService          = moduleService;
            _extensionManager       = extensionManager;
            _shellDescriptorManager = shellDescriptorManager;
            _shellFeaturesManager   = shellFeaturesManager;
            _authorizationService   = authorizationService;
            //_notifier = notifier;

            //T = localizer;
        }
Пример #22
0
        public ModuleService(
            IFeatureManager featureManager,
            IExtensionManager extensionManager,
            IShellDescriptorManager shellDescriptorManager,
            IHtmlLocalizer <AdminMenu> htmlLocalizer,
            INotifier notifier)
        {
            _notifier               = notifier;
            _featureManager         = featureManager;
            _extensionManager       = extensionManager;
            _shellDescriptorManager = shellDescriptorManager;

            //if (_featureManager.FeatureDependencyNotification == null) {
            //    _featureManager.FeatureDependencyNotification = GenerateWarning;
            //}

            T = htmlLocalizer;
        }
 public ImportExportService(
     IOrchardServices orchardServices,
     IContentDefinitionManager contentDefinitionManager,
     IContentDefinitionWriter contentDefinitionWriter,
     IAppDataFolder appDataFolder,
     IRecipeParser recipeParser,
     IRecipeManager recipeManager,
     IShellDescriptorManager shellDescriptorManager)
 {
     _orchardServices          = orchardServices;
     _contentDefinitionManager = contentDefinitionManager;
     _contentDefinitionWriter  = contentDefinitionWriter;
     _appDataFolder            = appDataFolder;
     _recipeParser             = recipeParser;
     _recipeManager            = recipeManager;
     _shellDescriptorManager   = shellDescriptorManager;
     Logger = NullLogger.Instance;
     T      = NullLocalizer.Instance;
 }
Пример #24
0
 public LenientImportExportService(IOrchardServices orchardServices,
                                   IContentDefinitionManager contentDefinitionManager,
                                   IContentDefinitionWriter contentDefinitionWriter,
                                   IAppDataFolder appDataFolder,
                                   IRecipeParser recipeParser,
                                   IRecipeManager recipeManager,
                                   IShellDescriptorManager shellDescriptorManager,
                                   IClock clock,
                                   IEnumerable <IExportEventHandler> exportEventHandlers,
                                   IEnumerable <IExportAction> exportActions,
                                   IEnumerable <IImportAction> importActions)
     : base(orchardServices, appDataFolder, clock, exportActions, importActions)
 {
     _orchardServices          = orchardServices;
     _contentDefinitionManager = contentDefinitionManager;
     _contentDefinitionWriter  = contentDefinitionWriter;
     _appDataFolder            = appDataFolder;
     _clock = clock;
     _exportEventHandlers = exportEventHandlers;
 }
Пример #25
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;
 }
Пример #26
0
 public BlogImportStrategy(IContentManager contentManager,
                           IEnumerable <IMultipleImportStrategy> importStratagies,
                           IBackgroundTask backgroundTask,
                           IMembershipService membershipService,
                           ISiteService siteService,
                           IBlogService blogService,
                           IProcessingEngine processingEngine,
                           ShellSettings shellSettings,
                           IShellDescriptorManager shellDescriptorManager)
 {
     _contentManager         = contentManager;
     _importStratagies       = importStratagies;
     _backgroundTask         = backgroundTask;
     _membershipService      = membershipService;
     _siteService            = siteService;
     _blogService            = blogService;
     _processingEngine       = processingEngine;
     _shellSettings          = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
 }
        public void ExecuteRecipeStepTest()
        {
            _folders.Manifests.Add("SuperWiki", @"
Name: SuperWiki
Version: 1.0.3
OrchardVersion: 1
Features:
    SuperWiki: 
        Description: My super wiki module for Orchard.
");

            IShellDescriptorManager shellDescriptorManager = _container.Resolve <IShellDescriptorManager>();

            // No features enabled
            shellDescriptorManager.UpdateShellDescriptor(0,
                                                         Enumerable.Empty <ShellFeature>(),
                                                         Enumerable.Empty <ShellParameter>());

            ModuleRecipeHandler moduleRecipeHandler = _container.Resolve <ModuleRecipeHandler>();

            RecipeContext recipeContext = new RecipeContext {
                RecipeStep = new RecipeStep {
                    Name = "Module", Step = new XElement("SuperWiki")
                }
            };

            recipeContext.RecipeStep.Step.Add(new XAttribute("packageId", "Orchard.Module.SuperWiki"));
            recipeContext.RecipeStep.Step.Add(new XAttribute("repository", "test"));

            IFeatureManager featureManager = _container.Resolve <IFeatureManager>();
            IEnumerable <FeatureDescriptor> enabledFeatures = featureManager.GetEnabledFeatures();

            Assert.That(enabledFeatures.Count(), Is.EqualTo(0));
            moduleRecipeHandler.ExecuteRecipeStep(recipeContext);


            var availableFeatures = featureManager.GetAvailableFeatures().Where(x => x.Id == "SuperWiki").FirstOrDefault();

            Assert.That(availableFeatures.Id, Is.EqualTo("SuperWiki"));
            Assert.That(recipeContext.Executed, Is.True);
        }
Пример #28
0
        public AdminController(
            ISiteThemeService siteThemeService,
            IAdminThemeService adminThemeService,
            IThemeService themeService,
            ShellSettings shellSettings,
            IExtensionManager extensionManager,
            IHtmlLocalizer <AdminController> localizer,
            IShellDescriptorManager shellDescriptorManager,
            IShellFeaturesManager shellFeaturesManager,
            IAuthorizationService authorizationService,
            INotifier notifier)
        {
            _siteThemeService     = siteThemeService;
            _adminThemeService    = adminThemeService;
            _extensionManager     = extensionManager;
            _shellFeaturesManager = shellFeaturesManager;
            _authorizationService = authorizationService;
            _notifier             = notifier;

            H = localizer;
        }
Пример #29
0
        public ModuleService(
                IFeatureManager featureManager,
                IOrchardServices OrchardServices,
                IVirtualPathProvider virtualPathProvider,
                IExtensionManager extensionManager,
                IShellDescriptorManager shellDescriptorManager,
                ICacheManager cacheManager)
        {
            Services = OrchardServices;

            _featureManager = featureManager;
            _virtualPathProvider = virtualPathProvider;
            _extensionManager = extensionManager;
            _shellDescriptorManager = shellDescriptorManager;
            _cacheManager = cacheManager;

            if (_featureManager.FeatureDependencyNotification == null)
            {
                _featureManager.FeatureDependencyNotification = GenerateWarning;
            }
        }
Пример #30
0
        public ModuleService(
            IFeatureManager featureManager,
            IOrchardServices OrchardServices,
            IVirtualPathProvider virtualPathProvider,
            IExtensionManager extensionManager,
            IShellDescriptorManager shellDescriptorManager,
            ICacheManager cacheManager)
        {
            Services = OrchardServices;

            _featureManager         = featureManager;
            _virtualPathProvider    = virtualPathProvider;
            _extensionManager       = extensionManager;
            _shellDescriptorManager = shellDescriptorManager;
            _cacheManager           = cacheManager;

            if (_featureManager.FeatureDependencyNotification == null)
            {
                _featureManager.FeatureDependencyNotification = GenerateWarning;
            }
        }
Пример #31
0
        public HiddenStringFieldUpdateProcessor(
            IContentManager contentManager,
            IProcessingEngine processingEngine,
            ShellSettings shellSettings,
            IShellDescriptorManager shellDescriptionManager,
            IContentDefinitionManager contentDefinitionManager,
            IFieldIndexService fieldIndexService,
            ITokenizer tokenizer)
        {
            _contentManager           = contentManager;
            _processingEngine         = processingEngine;
            _shellSettings            = shellSettings;
            _shellDescriptorManager   = shellDescriptionManager;
            _contentDefinitionManager = contentDefinitionManager;
            _fieldIndexService        = fieldIndexService;
            _tokenizer = tokenizer;

            T = NullLocalizer.Instance;

            //dictionaries to handle task definitions
            _variantDescriptions = new Dictionary <HiddenStringFieldUpdateProcessVariant, string>()
            {
                { HiddenStringFieldUpdateProcessVariant.None, T("None").Text },
                { HiddenStringFieldUpdateProcessVariant.All, T("All fields").Text },
                { HiddenStringFieldUpdateProcessVariant.Empty, T("Empty fields").Text }
            };
            _partsEnumerableFilters = new Dictionary <HiddenStringFieldUpdateProcessVariant,
                                                      Func <ContentPartFieldDefinitionBuilder, Func <ContentPart, bool> > >()
            {
                { HiddenStringFieldUpdateProcessVariant.None, (builder) => pa => false },
                { HiddenStringFieldUpdateProcessVariant.All, (builder) => {
                      return(pa => pa.PartDefinition.Name == builder.PartName);
                  } },
                { HiddenStringFieldUpdateProcessVariant.Empty, (builder) => {
                      return(pa => pa.PartDefinition.Name == builder.PartName &&
                             string.IsNullOrWhiteSpace(
                                 (pa.Fields.First(fi => fi.Name == builder.Name) as HiddenStringField).Value));
                  } }
            };
        }
 public ImportExportService(
     IOrchardServices orchardServices,
     IContentDefinitionManager contentDefinitionManager,
     IContentDefinitionWriter contentDefinitionWriter,
     IAppDataFolder appDataFolder,
     IRecipeParser recipeParser, 
     IRecipeManager recipeManager,
     IShellDescriptorManager shellDescriptorManager,
     IClock clock,
     IEnumerable<IExportEventHandler> exportEventHandlers) {
     _orchardServices = orchardServices;
     _contentDefinitionManager = contentDefinitionManager;
     _contentDefinitionWriter = contentDefinitionWriter;
     _appDataFolder = appDataFolder;
     _recipeParser = recipeParser;
     _recipeManager = recipeManager;
     _shellDescriptorManager = shellDescriptorManager;
     _clock = clock;
     _exportEventHandlers = exportEventHandlers;
     Logger = NullLogger.Instance;
     T = NullLocalizer.Instance;
 }
Пример #33
0
        public AdminController(
            IHtmlLocalizer htmlLocalizer,
            IStringLocalizer stringLocalizer,
            IShellFeatureManager shellFeatureManager,
            IViewProviderManager <FeaturesIndexViewModel> viewProvider,
            IBreadCrumbManager breadCrumbManager,
            IAuthorizationService authorizationService,
            IShellDescriptorManager shellDescriptorManager,
            IPageTitleBuilder pageTitleBuilder,
            IAlerter alerter)
        {
            _shellFeatureManager    = shellFeatureManager;
            _viewProvider           = viewProvider;
            _breadCrumbManager      = breadCrumbManager;
            _authorizationService   = authorizationService;
            _shellDescriptorManager = shellDescriptorManager;
            _pageTitleBuilder       = pageTitleBuilder;
            _alerter = alerter;

            T = htmlLocalizer;
            S = stringLocalizer;
        }
        public void DisableFeaturesWithDependenciesTest()
        {
            _folders.Manifests.Add("SuperWiki", @"
Name: SuperWiki
Version: 1.0.3
OrchardVersion: 1
Features:
    SuperWiki: 
        Description: My super wiki module for Orchard.
        Dependencies: SuperWikiDep
    SuperWikiDep:
        Description: My super wiki module for Orchard dependency.
");

            // Initialize the shell descriptor with 0 features
            IShellDescriptorManager shellDescriptorManager = _container.Resolve <IShellDescriptorManager>();
            IFeatureManager         featureManager         = _container.Resolve <IFeatureManager>();

            shellDescriptorManager.UpdateShellDescriptor(0,
                                                         Enumerable.Empty <ShellFeature>(),
                                                         Enumerable.Empty <ShellParameter>());

            // Enable both features by relying on the dependency
            Assert.That(featureManager.EnableFeatures(new [] { "SuperWiki" }, true).Count(), Is.EqualTo(2));

            IEnumerable <string> featuresToDisable = new[] { "SuperWikiDep" };

            // Try to enable without forcing dependencies should fail
            IEnumerable <string> disabledFeatures = featureManager.DisableFeatures(featuresToDisable, false);

            Assert.That(disabledFeatures.Count(), Is.EqualTo(0));
            Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(2));

            // Enabling while forcing dependencies should succeed.
            disabledFeatures = featureManager.DisableFeatures(featuresToDisable, true);
            Assert.That(disabledFeatures.Contains("SuperWiki"), Is.True);
            Assert.That(disabledFeatures.Contains("SuperWikiDep"), Is.True);
            Assert.That(featureManager.GetEnabledFeatures().Count(), Is.EqualTo(0));
        }
        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;
        }
Пример #36
0
        public ModuleService(
            IFeatureManager featureManager,
            IBoyingServices BoyingServices,
            IVirtualPathProvider virtualPathProvider,
            IExtensionManager extensionManager,
            IShellDescriptorManager shellDescriptorManager,
            ICacheManager cacheManager)
        {
            Services = BoyingServices;

            _featureManager         = featureManager;
            _virtualPathProvider    = virtualPathProvider;
            _extensionManager       = extensionManager;
            _shellDescriptorManager = shellDescriptorManager;
            _cacheManager           = cacheManager;

            if (_featureManager.FeatureDependencyNotification == null)
            {
                _featureManager.FeatureDependencyNotification = GenerateWarning;
            }

            T = NullLocalizer.Instance;
        }
Пример #37
0
 public ImportExportService(
     IOrchardServices orchardServices,
     IContentDefinitionManager contentDefinitionManager,
     IContentDefinitionWriter contentDefinitionWriter,
     IAppDataFolder appDataFolder,
     IRecipeParser recipeParser,
     IRecipeManager recipeManager,
     IShellDescriptorManager shellDescriptorManager,
     IClock clock,
     IEnumerable <IExportEventHandler> exportEventHandlers)
 {
     _orchardServices          = orchardServices;
     _contentDefinitionManager = contentDefinitionManager;
     _contentDefinitionWriter  = contentDefinitionWriter;
     _appDataFolder            = appDataFolder;
     _recipeParser             = recipeParser;
     _recipeManager            = recipeManager;
     _shellDescriptorManager   = shellDescriptorManager;
     _clock = clock;
     _exportEventHandlers = exportEventHandlers;
     Logger = NullLogger.Instance;
     T      = NullLocalizer.Instance;
 }
Пример #38
0
 public ShellFeatureUpdater(
     IShellFeatureStore <ShellFeature> shellFeatureStore,
     IShellDescriptorManager shellDescriptorManager,
     IShellDescriptorStore shellDescriptorStore,
     IShellContextFactory shellContextFactory,
     IDataMigrationBuilder migrationBuilder,
     IOptions <PlatoOptions> platoOptions,
     ILogger <ShellFeatureUpdater> logger,
     IFeatureFacade featureFacade,
     IShellSettings shellSettings,
     IPlatoHost platoHost)
 {
     _shellDescriptorManager = shellDescriptorManager;
     _shellDescriptorStore   = shellDescriptorStore;
     _shellContextFactory    = shellContextFactory;
     _shellFeatureStore      = shellFeatureStore;
     _migrationBuilder       = migrationBuilder;
     _shellSettings          = shellSettings;
     _featureFacade          = featureFacade;
     _platoOptions           = platoOptions;
     _platoHost = platoHost;
     _logger    = logger;
 }
Пример #39
0
        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();
                    }
                }
            });
        }
Пример #40
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;
        }
Пример #41
0
        public BidService(
            IOrchardServices orchardServices,
            IClock clock,
            IEncryptionService encryptionService,
            IProcessingEngine processingEngine,
            ShellSettings shellSettings,
            IShellDescriptorManager shellDescriptorManager,
            IShapeFactory shapeFactory,
            IMessageService messageService,
            IShapeDisplay shapeDisplay)
        {
            _orchardServices        = orchardServices;
            _clock                  = clock;
            _encryptionService      = encryptionService;
            _processingEngine       = processingEngine;
            _shellSettings          = shellSettings;
            _shellDescriptorManager = shellDescriptorManager;
            _shapeFactory           = shapeFactory;
            _messageService         = messageService;
            _shapeDisplay           = shapeDisplay;

            Logger = NullLogger.Instance;
            T      = NullLocalizer.Instance;
        }
Пример #42
0
        public AdminController(
            IHtmlLocalizer htmlLocalizer,
            IStringLocalizer stringLocalizer,
            IViewProviderManager <FeaturesIndexViewModel> viewProvider,
            IShellDescriptorManager shellDescriptorManager,
            IAuthorizationService authorizationService,
            ITourDescriptorStore tourDescriptorStore,
            IShellFeatureManager shellFeatureManager,
            IShellSettings shellSettings,
            IPlatoHost platoHost,
            IAlerter alerter)
        {
            _shellDescriptorManager = shellDescriptorManager;
            _authorizationService   = authorizationService;
            _shellFeatureManager    = shellFeatureManager;
            _tourDescriptorStore    = tourDescriptorStore;
            _shellSettings          = shellSettings;
            _viewProvider           = viewProvider;
            _platoHost = platoHost;
            _alerter   = alerter;

            T = htmlLocalizer;
            S = stringLocalizer;
        }
        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;
        }
Пример #44
0
 public TaxonomyServiceExtension(IRepository <TermContentItem> termContentItemRepository, IContentManager contentManager, INotifier notifier, IContentDefinitionManager contentDefinitionManager, IAuthorizationService authorizationService, IOrchardServices services, IProcessingEngine processingEngine, ShellSettings shellSettings, IShellDescriptorManager shellDescriptorManager, TaxonomyService taxonomyService) : base(termContentItemRepository, contentManager, notifier, contentDefinitionManager, authorizationService, services, processingEngine, shellSettings, shellDescriptorManager)
 {
     _taxonomyService = taxonomyService;
 }
Пример #45
0
 public ShellFeatureEntityService(IShellDescriptorManager shellDescriptorManager, IExtensionManager extensions)
 {
     _shellDescriptorManager = shellDescriptorManager;
     _extensions             = extensions;
 }
Пример #46
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 } });

        }
Пример #48
0
 public AdminController(IExtensionManager extensionManager, IFeatureManager featureManager, IShellDescriptorManager shellDescriptorManager, ShellDescriptor shellDescriptor)
 {
     _extensionManager       = extensionManager;
     _featureManager         = featureManager;
     _shellDescriptorManager = shellDescriptorManager;
     _shellDescriptor        = shellDescriptor;
 }
Пример #49
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 }
            });
        }
Пример #50
0
 public ShellDescriptorFeaturesManager(IExtensionManager extensionManager, IEnumerable <ShellFeature> shellFeatures, IShellDescriptorManager shellDescriptorManager, ILogger <ShellFeaturesManager> logger)
 {
     base();
     this._extensionManager = extensionManager;
     stackVariable4         = shellFeatures;
     stackVariable5         = ShellDescriptorFeaturesManager.u003cu003ec.u003cu003e9__8_0;
     if (stackVariable5 == null)
     {
         dummyVar0      = stackVariable5;
         stackVariable5 = new Func <ShellFeature, bool>(ShellDescriptorFeaturesManager.u003cu003ec.u003cu003e9.u003cu002ectoru003eb__8_0);
         ShellDescriptorFeaturesManager.u003cu003ec.u003cu003e9__8_0 = stackVariable5;
     }
     this._alwaysEnabledFeatures  = stackVariable4.Where <ShellFeature>(stackVariable5).ToArray <ShellFeature>();
     this._shellDescriptorManager = shellDescriptorManager;
     this._logger = logger;
     return;
 }
Пример #51
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);
                }
            }
        }
Пример #52
-1
 public PackageUninstallHandler(
     ShellSettings shellSettings,
     IShellDescriptorManager shellDescriptorManager,
     IProcessingEngine processingEngine,
     IHostEnvironment hostEnvironment,
     IPackageInstaller packageInstaller) {
     _shellSettings = shellSettings;
     _shellDescriptorManager = shellDescriptorManager;
     _processingEngine = processingEngine;
     _hostEnvironment = hostEnvironment;
     _packageInstaller = packageInstaller;
 }