public void Initialize(InitializationEngine context) { _contentTypeRepository = ServiceLocator.Current.GetInstance <IContentTypeRepository>(); _availableSettingsRepository = ServiceLocator.Current.GetInstance <IAvailableSettingsRepository>(); var sysRoot = _contentTypeRepository.Load("SysRoot") as PageType; var setting = new AvailableSetting { Availability = Availability.None, //Availability = Availability.Specific, /*AllowedContentTypeNames = * { * nameof(StartPageType), // can't use custom interfaces with IContentTypeRepository * }*/ }; _availableSettingsRepository.RegisterSetting(sysRoot, setting); // Disallow insertion for all product and article related pages DisallowAll <AboutUsPageType>(); DisallowAll <ContactPageType>(); //DisallowAll<NewsPageContainerType>(); DisallowAll <SearchPageType>(); DisallowAll <NewsPageType>(); DisallowAll <StartPageType>(); // Home Page SetPageRestriction <NewsContainerPageType>(new List <Type> { typeof(NewsPageType) }); }
private void SaveAvailablePageTypes(ContentType contentType) { var pageType = contentType as PageType; if (pageType != null) { IAvailableSettingsRepository availablePageTypeRepository = ServiceLocator.Current.GetInstance <IAvailableSettingsRepository>(); AvailableSetting settings = new AvailableSetting(); settings.Availability = 0; availablePageTypeRepository.RegisterSetting(pageType, settings); } }
public DefaultDataImporterInterceptor(IDataImporter defaultDataImporter , IContentCacheRemover contentCacheRemover , IPrincipalAccessor principalAccessor , IDataImportEvents dataImportEvents , IDataImportEventsRaiser dataImportEventsRaiser , IContentRepository contentRepository , IPermanentLinkMapper permanentLinkMapper , IContentTypeRepository contentTypeRepository , ContentTypeAvailabilityService contentTypeAvailabilityService , IAvailableSettingsRepository availableSettingsRepository , IContentImporter contentImporter , IContentTransferValidator contentTransferValidator , PropertyCategoryTransform propertyCategoryTransform , ContentRootRepository contentRootRepository , ISiteDefinitionRepository siteDefinitionRepository , ContentOptions contentOptions , ISiteDefinitionResolver siteDefinitionResolver) : base(contentCacheRemover, principalAccessor, dataImportEvents , dataImportEventsRaiser, contentRepository , permanentLinkMapper, contentTypeRepository , contentTypeAvailabilityService, availableSettingsRepository , contentImporter, contentTransferValidator , propertyCategoryTransform, contentRootRepository , siteDefinitionRepository, contentOptions, siteDefinitionResolver) { this.defaultDataImporter = defaultDataImporter; this.contentCacheRemover = contentCacheRemover; this.principalAccessor = principalAccessor; this.dataImportEvents = dataImportEvents; this.dataImportEventsRaiser = dataImportEventsRaiser; this.contentRepository = contentRepository; this.permanentLinkMapper = permanentLinkMapper; this.contentTypeRepository = contentTypeRepository; this.contentTypeAvailabilityService = contentTypeAvailabilityService; this.availableSettingsRepository = availableSettingsRepository; this.contentImporter = contentImporter; this.contentTransferValidator = contentTransferValidator; this.propertyCategoryTransform = propertyCategoryTransform; this.contentRootRepository = contentRootRepository; this.siteDefinitionRepository = siteDefinitionRepository; this.contentOptions = contentOptions; this.siteDefinitionResolver = siteDefinitionResolver; }
public DefaultDataExporterInterceptor(IDataExporter defaultDataExporter , ITransferExportOptionsEx transferExportOptionsEx , IContentVersionRepository contentVersionRepository , IRawContentRetriever rawContentRetriever , IContentLoader contentLoader , IPropertyExporter propertyExporter , IDataExportEventsRaiser eventRegister , IDataExportEvents exportEvents , IContentCacheKeyCreator contentCacheKeyCreator , ISynchronizedObjectInstanceCache cacheInstance , IContentRepository contentRepository , IPermanentLinkMapper permanentLinkMapper , IContentTypeRepository contentTypeRepository , IContentProviderManager contentProviderManager , ContentTypeAvailabilityService contentTypeAvailabilityService , IAvailableSettingsRepository availableSettingsRepository , IContentExporter contentExporter , PropertyCategoryTransform categoryTransform , ContentRootRepository contentRootRepository , ISiteDefinitionRepository siteDefinitionRepository , IMimeTypeResolver mimeTypeResolver) : base(eventRegister, exportEvents, contentCacheKeyCreator , cacheInstance, contentRepository , permanentLinkMapper, contentTypeRepository , contentProviderManager, contentTypeAvailabilityService , availableSettingsRepository, contentExporter , categoryTransform, contentRootRepository , siteDefinitionRepository, mimeTypeResolver) { _defaultDataExporter = defaultDataExporter; _transferExportOptionsEx = transferExportOptionsEx; _contentVersionRepository = contentVersionRepository; _contentExporter = contentExporter; _rawContentRetiever = rawContentRetriever; _contentLoader = contentLoader; _propertyExporter = propertyExporter; }