コード例 #1
0
        public override void Refresh(JsonPayload[] payloads)
        {
            //we need to clear the ContentType runtime cache since that is what caches the
            // db data type to store the value against and anytime a datatype changes, this also might change
            // we basically need to clear all sorts of runtime caches here because so many things depend upon a data type

            ClearAllIsolatedCacheByEntityType <IContent>();
            ClearAllIsolatedCacheByEntityType <IContentType>();
            ClearAllIsolatedCacheByEntityType <IMedia>();
            ClearAllIsolatedCacheByEntityType <IMediaType>();
            ClearAllIsolatedCacheByEntityType <IMember>();
            ClearAllIsolatedCacheByEntityType <IMemberType>();

            var dataTypeCache = CacheHelper.IsolatedRuntimeCache.GetCache <IDataType>();

            foreach (var payload in payloads)
            {
                _idkMap.ClearCache(payload.Id);
            }

            // fixme - not sure I like these?
            TagsValueConverter.ClearCaches();
            SliderValueConverter.ClearCaches();

            // notify
            _publishedSnapshotService.Notify(payloads);

            base.Refresh(payloads);
        }
コード例 #2
0
        public override void Refresh(JsonPayload[] payloads)
        {
            //we need to clear the ContentType runtime cache since that is what caches the
            // db data type to store the value against and anytime a datatype changes, this also might change
            // we basically need to clear all sorts of runtime caches here because so many things depend upon a data type

            ClearAllIsolatedCacheByEntityType <IContent>();
            ClearAllIsolatedCacheByEntityType <IContentType>();
            ClearAllIsolatedCacheByEntityType <IMedia>();
            ClearAllIsolatedCacheByEntityType <IMediaType>();
            ClearAllIsolatedCacheByEntityType <IMember>();
            ClearAllIsolatedCacheByEntityType <IMemberType>();

            var dataTypeCache = AppCaches.IsolatedCaches.Get <IDataType>();

            foreach (var payload in payloads)
            {
                _idkMap.ClearCache(payload.Id);
            }

            // TODO: not sure I like these?
            TagsValueConverter.ClearCaches();
            SliderValueConverter.ClearCaches();

            // we have to refresh models before we notify the published snapshot
            // service of changes, else factories may try to rebuild models while
            // we are using the database to load content into caches

            _publishedModelFactory.WithSafeLiveFactory(() =>
                                                       _publishedSnapshotService.Notify(payloads));

            base.Refresh(payloads);
        }
コード例 #3
0
    public override void Refresh(JsonPayload[] payloads)
    {
        // we need to clear the ContentType runtime cache since that is what caches the
        // db data type to store the value against and anytime a datatype changes, this also might change
        // we basically need to clear all sorts of runtime caches here because so many things depend upon a data type
        ClearAllIsolatedCacheByEntityType <IContent>();
        ClearAllIsolatedCacheByEntityType <IContentType>();
        ClearAllIsolatedCacheByEntityType <IMedia>();
        ClearAllIsolatedCacheByEntityType <IMediaType>();
        ClearAllIsolatedCacheByEntityType <IMember>();
        ClearAllIsolatedCacheByEntityType <IMemberType>();

        Attempt <IAppPolicyCache?> dataTypeCache = AppCaches.IsolatedCaches.Get <IDataType>();

        foreach (JsonPayload payload in payloads)
        {
            _idKeyMap.ClearCache(payload.Id);

            if (dataTypeCache.Success)
            {
                dataTypeCache.Result?.Clear(RepositoryCacheKeys.GetKey <IDataType, int>(payload.Id));
            }
        }

        // TODO: not sure I like these?
        TagsValueConverter.ClearCaches();
        SliderValueConverter.ClearCaches();

        // refresh the models and cache
        _publishedModelFactory.WithSafeLiveFactoryReset(() =>
                                                        _publishedSnapshotService.Notify(payloads));

        base.Refresh(payloads);
    }
コード例 #4
0
        public override void Refresh(string jsonPayload)
        {
            var payloads = DeserializeFromJsonPayload(jsonPayload);

            //we need to clear the ContentType runtime cache since that is what caches the
            // db data type to store the value against and anytime a datatype changes, this also might change
            // we basically need to clear all sorts of runtime caches here because so many things depend upon a data type

            ClearAllIsolatedCacheByEntityType <IContent>();
            ClearAllIsolatedCacheByEntityType <IContentType>();
            ClearAllIsolatedCacheByEntityType <IMedia>();
            ClearAllIsolatedCacheByEntityType <IMediaType>();
            ClearAllIsolatedCacheByEntityType <IMember>();
            ClearAllIsolatedCacheByEntityType <IMemberType>();

            var dataTypeCache = ApplicationContext.Current.ApplicationCache.IsolatedRuntimeCache.GetCache <IDataTypeDefinition>();

            foreach (var payload in payloads)
            {
                //clears the prevalue cache
                if (dataTypeCache)
                {
                    dataTypeCache.Result.ClearCacheByKeySearch(string.Format("{0}_{1}", CacheKeys.DataTypePreValuesCacheKey, payload.Id));
                }

                ApplicationContext.Current.Services.IdkMap.ClearCache(payload.Id);
                PublishedContentType.ClearDataType(payload.Id);
                NestedContentHelper.ClearCache(payload.Id);
            }

            TagsValueConverter.ClearCaches();
            LegacyMediaPickerPropertyConverter.ClearCaches();
            SliderValueConverter.ClearCaches();
            MediaPickerPropertyConverter.ClearCaches();
            MultiUrlPickerPropertyConverter.ClearCaches();


            base.Refresh(jsonPayload);
        }