public OptionSetController( IContentDefinitionManager contentDefinitionManager, IOptionSetService optionSetService) { _contentDefinitionManager = contentDefinitionManager; _optionSetService = optionSetService; }
public TermsFilterForms( IShapeFactory shapeFactory, IOptionSetService optionSetService) { _optionSetService = optionSetService; Shape = shapeFactory; T = NullLocalizer.Instance; }
public EditModel(ITicketService ticketRepository, IUserService userRepository, IOptionSetService optionSetService, ILogger <EditModel> logger) { _ticketRepository = ticketRepository; _userRepository = userRepository; _optionSetService = optionSetService; _logger = logger; }
public OptionSetFieldEditorEvents( IContentManager contentManager, IOptionSetService optionSetService) { _optionSetService = optionSetService; _contentManager = contentManager; T = NullLocalizer.Instance; }
public OptionItemContainerPartHandler( IContentDefinitionManager contentDefinitionManager, IRepository <OptionItemContainerPartRecord> repository, IOptionSetService optionSetService, IContentManager contentManager) { _contentDefinitionManager = contentDefinitionManager; _contentManager = contentManager; Filters.Add(StorageFilter.For(repository)); // Tells how to load the field terms on demand, when a content item it loaded or when it has been created OnLoaded <OptionItemContainerPart>((context, part) => InitializerTermsLoader(part)); OnCreated <OptionItemContainerPart>((context, part) => InitializerTermsLoader(part)); OnIndexing <OptionItemContainerPart>( (context, part) => { foreach (var term in part.OptionItems) { var optionContentItem = context.ContentManager.Get(term.OptionItemRecord.Id); context.DocumentIndex.Add(term.Field, optionContentItem.As <TitlePart>().Title).Analyze(); context.DocumentIndex.Add(term.Field + "-id", optionContentItem.Id).Store(); } }); }
public OptionItemController( IOptionSetService optionSetService, IOrchardServices orchardServices) { _optionSetService = optionSetService; Services = orchardServices; T = NullLocalizer.Instance; }
public OptionSetFieldDriver( IOrchardServices services, IOptionSetService optionSetService, IRepository <OptionItemContentItem> repository) { _optionSetService = optionSetService; Services = services; T = NullLocalizer.Instance; }
public OptionItemPartDriver( IOptionSetService optionSetService, ISiteService siteService, IHttpContextAccessor httpContextAccessor, IFeedManager feedManager, IContentManager contentManager) { _optionSetService = optionSetService; _siteService = siteService; _httpContextAccessor = httpContextAccessor; _feedManager = feedManager; _contentManager = contentManager; T = NullLocalizer.Instance; }
public OptionSetPartHandler( IRepository <OptionSetPartRecord> repository, IOptionSetService optionSetService, IContentDefinitionManager contentDefinitionManager) { int?previousId = null; Filters.Add(StorageFilter.For(repository)); OnPublished <OptionSetPart>((context, part) => { var previousTermTypeName = part.TermTypeName; if (previousId != null && part.Id != previousId) { // remove previous term type contentDefinitionManager.DeleteTypeDefinition(previousTermTypeName); // update existing fields foreach (var partDefinition in contentDefinitionManager.ListPartDefinitions()) { foreach (var field in partDefinition.Fields) { if (field.FieldDefinition.Name == typeof(OptionSetField).Name) { if (field.Settings.GetModel <OptionSetFieldSettings>().OptionSetId == previousId) { contentDefinitionManager.AlterPartDefinition(partDefinition.Name, cfg => cfg.WithField(field.Name, builder => builder.WithSetting("TaxonomyFieldSettings.TaxonomyId", part.Id.ToString()))); } } } } } }); OnLoading <OptionSetPart>((context, part) => part.OptionItemsField.Loader(x => optionSetService.GetOptionItems(part.Id))); OnUpdating <TitlePart>((context, part) => { // if altering the title of a taxonomy, save the name if (part.As <OptionSetPart>() != null) { previousId = part.Id; } }); }
public OptionSetPartHandler( IRepository<OptionSetPartRecord> repository, IOptionSetService optionSetService, IContentDefinitionManager contentDefinitionManager) { int? previousId = null; Filters.Add(StorageFilter.For(repository)); OnPublished<OptionSetPart>((context, part) => { var previousTermTypeName = part.TermTypeName; if (previousId != null && part.Id != previousId) { // remove previous term type contentDefinitionManager.DeleteTypeDefinition(previousTermTypeName); // update existing fields foreach (var partDefinition in contentDefinitionManager.ListPartDefinitions()) { foreach (var field in partDefinition.Fields) { if (field.FieldDefinition.Name == typeof (OptionSetField).Name) { if (field.Settings.GetModel<OptionSetFieldSettings>().OptionSetId == previousId) { contentDefinitionManager.AlterPartDefinition(partDefinition.Name, cfg => cfg.WithField(field.Name, builder => builder.WithSetting("TaxonomyFieldSettings.TaxonomyId", part.Id.ToString()))); } } } } } }); OnLoading<OptionSetPart>((context, part) => part.OptionItemsField.Loader(x => optionSetService.GetOptionItems(part.Id))); OnUpdating<TitlePart>((context, part) => { // if altering the title of a taxonomy, save the name if (part.As<OptionSetPart>() != null) { previousId = part.Id; } }); }
public OptionItemContainerPartHandler( IContentDefinitionManager contentDefinitionManager, IRepository<OptionItemContainerPartRecord> repository, IOptionSetService optionSetService, IContentManager contentManager) { _contentDefinitionManager = contentDefinitionManager; _contentManager = contentManager; Filters.Add(StorageFilter.For(repository)); // Tells how to load the field terms on demand, when a content item it loaded or when it has been created OnLoaded<OptionItemContainerPart>((context, part) => InitializerTermsLoader(part)); OnCreated<OptionItemContainerPart>((context, part) => InitializerTermsLoader(part)); OnIndexing<OptionItemContainerPart>( (context, part) => { foreach (var term in part.OptionItems) { var optionContentItem = context.ContentManager.Get(term.OptionItemRecord.Id); context.DocumentIndex.Add(term.Field, optionContentItem.As<TitlePart>().Title).Analyze(); context.DocumentIndex.Add(term.Field + "-id", optionContentItem.Id).Store(); } }); }
public TermFeedQuery(IContentManager contentManager, IOptionSetService optionSetService) { _contentManager = contentManager; _optionSetService = optionSetService; }
public OptionSetController( IContentDefinitionManager contentDefinitionManager, IOptionSetService optionSetService){ _contentDefinitionManager = contentDefinitionManager; _optionSetService = optionSetService; }
public TermsFilter(IOptionSetService optionSetService) { _optionSetService = optionSetService; T = NullLocalizer.Instance; }
public OptionSetFieldValueProvider(IOptionSetService optionSetService) { _optionSetService = optionSetService; }
public DynamicsHealthCheck(IOptionSetService optionSetService, ILogger <DynamicsHealthCheck> logger) { _optionSetService = optionSetService; _logger = logger; }
public OptionSetPartDriver(IOptionSetService optionSetService) { _optionSetService = optionSetService; }