/// <summary> /// Initializes a new instance of the <see cref="ContactFormHandler"/> class. /// </summary> /// <param name="repository">The repository.</param> public ContactFormHandler(IRepository <ContactFormRecord> repository) { // Tell this handler to use ContactFormRecord for storage. Filters.Add(StorageFilter.For(repository)); }
public PaymentGestPaySettingsPartHandler(IRepository <PaymentGestPaySettingsPartRecord> repository) { Filters.Add(new ActivatingFilter <PaymentGestPaySettingsPart>("Site")); Filters.Add(StorageFilter.For(repository)); }
public FollowMeHandler(IRepository <FollowMeRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public DeviceGroupHandler(IRepository <DeviceGroupRecord> repository, IContentManager contentManager) { Filters.Add(StorageFilter.For(repository)); }
public MapHandler(IRepository <BingMapRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public ContentPermissionsPartHandler(IRepository <ContentPermissionsPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public UserPersonalInformationHandler(IRepository <UserPersonalInformationRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public CookieCulturePickerPartHandler(IRepository <CookieCulturePickerPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); T = NullLocalizer.Instance; }
public TaxonomyPartHandler( IRepository <TaxonomyPartRecord> repository, ITaxonomyService taxonomyService, IContentDefinitionManager contentDefinitionManager, ILocalizationService localizationService = null) //Localization feature may not be active { string previousName = null; Filters.Add(StorageFilter.For(repository)); OnPublished <TaxonomyPart>((context, part) => { if (string.IsNullOrWhiteSpace(part.TermTypeName)) { // is it a new taxonomy ? taxonomyService.CreateTermContentType(part); } else { // update existing fields foreach (var partDefinition in contentDefinitionManager.ListPartDefinitions()) { foreach (var field in partDefinition.Fields) { if (field.FieldDefinition.Name == typeof(TaxonomyField).Name) { if (field.Settings.GetModel <TaxonomyFieldSettings>().Taxonomy == previousName) { //could either be a name change, or we could be publishing a translation if (localizationService != null) //Localization feature may not be active { var locPart = part.ContentItem.As <LocalizationPart>(); if (locPart != null) { var localizedTaxonomies = localizationService .GetLocalizations(part.ContentItem) //versions in all cultures .Where(pa => pa.ContentItem.Id != part.ContentItem.Id) //but not the one we are publishing .Select(pa => { var tax = pa.ContentItem.As <TaxonomyPart>(); //the TaxonomyPart return(tax == null ? string.Empty : tax.Name); //get its name (with sanity check) }); if (localizedTaxonomies.Contains(previousName)) { continue; //this is a new localization, so move along } } } contentDefinitionManager.AlterPartDefinition(partDefinition.Name, cfg => cfg.WithField(field.Name, builder => builder.WithSetting("TaxonomyFieldSettings.Taxonomy", part.Name))); } } } } } }); OnLoading <TaxonomyPart>((context, part) => part.TermsField.Loader(() => taxonomyService.GetTerms(part.Id))); OnUpdating <TitlePart>((context, part) => { // if altering the title of a taxonomy, save the name if (part.As <TaxonomyPart>() != null) { previousName = part.Title; } }); }
public BlogArchivesPartHandler(IRepository <BlogArchivesPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public CupHandler(IContentManager contentManager, IRepository <CupPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); OnRemoved <CupPart>((context, part) => repository.Delete(part.Record)); }
public CustomersPartHandler(IRepository <CustomersPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); Filters.Add(new ActivatingFilter <CustomersPart>("CustomersPartRecord")); }
public BasketPartHandler(IRepository <BasketPartRecord> repository) { this.Filters.Add(StorageFilter.For(repository)); }
public ImageGalleryHandler(IRepository <ImageGalleryRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public MetaHandler(IRepository <MetaRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public TenantContentPartHandler(IRepository <TenantContentPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public ListNewsTypeHandler(IRepository <ListNewsTypeRecord> repository) { Filters.Add(StorageFilter.For(repository)); OnRemoved <ListNewsTypePart>((context, part) => repository.Delete(part.Record)); }
public BaiduSettingsPartHandler(IRepository <BaiduSettingsPartRecord> repository) { Filters.Add(new ActivatingFilter <BaiduSettingsPart>("Site")); Filters.Add(StorageFilter.For(repository)); T = NullLocalizer.Instance; }
public StubLayerPartHandler(IRepository <LayerPartRecord> layersRepository) { Filters.Add(new ActivatingFilter <LayerPart>("Layer")); Filters.Add(new ActivatingFilter <CommonPart>("Layer")); Filters.Add(StorageFilter.For(layersRepository)); }
public FidelityUserHandler(IRepository <FidelityUserPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public OrderHandler(IRepository <OrderPartRecord> orderPartRepository) { Filters.Add(StorageFilter.For(orderPartRepository)); }
public CountryPartHandler(IRepository <CountryPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public GoogleAnalyticsSettingsPartHandler(IRepository <GoogleAnalyticsSettingsPartRecord> repository) { Filters.Add(new ActivatingFilter <GoogleAnalyticsSettingsPart>("Site")); Filters.Add(StorageFilter.For(repository)); }
public LayerPartHandler(IRepository <LayerPartRecord> layersRepository) { Filters.Add(StorageFilter.For(layersRepository)); }
public LayoutSelectorPartHandler(IRepository <LayoutSelectorPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public FaqWidgetHandler(IRepository <FaqWidgetPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public RemoteRssPartHandler(IRepository <RemoteRssPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public ProjectionPartHandler(IRepository <ProjectionPartRecord> projecRepository) { Filters.Add(StorageFilter.For(projecRepository)); }
public LikeHandler(IRepository <LikePartRecord> repository) { Filters.Add(StorageFilter.For(repository)); }
public FeaturedItemPartHandler(IRepository <FeaturedItemPartRecord> repository) { Filters.Add(StorageFilter.For(repository)); }