Removed cache refreshing code from inside of the ascx control as it is now all handled via business logic.

This commit is contained in:
Shannon Deminick
2013-03-20 22:03:35 +06:00
parent e7a6a29e59
commit aa7fd7bb2b
2 changed files with 2 additions and 34 deletions

View File

@@ -84,25 +84,7 @@ namespace Umbraco.Web.Cache
/// <param name="sender"></param>
/// <param name="e"></param>
static void ContentTypeServiceSavedContentType(IContentTypeService sender, Core.Events.SaveEventArgs<IContentType> e)
{
//NOTE: This needs to be put in the Service layer...
//var needsContentRefresh = e.SavedEntities.Any(contentType =>
// {
// //before we send the call to update the cache, we need to determine if we need to refresh the xml content
// //in the database. This is to be done when:
// // - a content type changes it's alias
// // - if a content type has it's property removed
// //here we need to check if the alias of the content type changed or if one of the properties was removed.
// var dirty = contentType as IRememberBeingDirty;
// return dirty != null && (dirty.WasPropertyDirty("Alias") || dirty.WasPropertyDirty("HasPropertyTypeBeenRemoved"));
// });
////if we need to refresh the content cache, we need to re-create the xml content in the database before sending out
////the request to refresh the application cache
//ApplicationContext.Current.Services.ContentService.RePublishAll();
//now send the cache refresh call!
{
e.SavedEntities.ForEach(contentType => DistributedCache.Instance.RemoveContentTypeCache(contentType));
}

View File

@@ -194,11 +194,6 @@ namespace umbraco.controls
// reload content type (due to caching)
LoadContentType();
// Only if the doctype alias changed, cause a regeneration of the xml cache file since
// the xml element names will need to be updated to reflect the new alias
if (docTypeAliasChanged)
RegenerateXmlCaches();
BindDataGenericProperties(true);
// we need to re-bind the alias as the SafeAlias method can have changed it
@@ -236,16 +231,7 @@ namespace umbraco.controls
_contentType = new ContentType(docTypeId);
}
}
/// <summary>
/// Regenerates the XML caches. Used after a document type alias has been changed.
/// </summary>
private void RegenerateXmlCaches()
{
Document.RePublishAll();
library.RefreshContent();
}
/// <summary>
/// Updates the Node in the Tree
/// </summary>