merge with 6.1.0

This commit is contained in:
Stephan
2013-04-10 13:56:39 -02:00
37 changed files with 848 additions and 235 deletions

View File

@@ -11,8 +11,6 @@ namespace Umbraco.Web.PublishedCache
/// </summary>
public class ContextualPublishedContentCache : ContextualPublishedCache
{
private readonly IPublishedContentCache _cache;
/// <summary>
/// Initializes a new instance of the <see cref="ContextualPublishedContentCache"/> class with a published content cache and a context.
/// </summary>
@@ -20,15 +18,7 @@ namespace Umbraco.Web.PublishedCache
/// <param name="umbracoContext">A context.</param>
internal ContextualPublishedContentCache(IPublishedContentCache cache, UmbracoContext umbracoContext)
: base(umbracoContext, cache)
{
_cache = cache;
}
/// <summary>
/// Gets the inner IPublishedContentCache.
/// </summary>
/// <remarks>For unit tests.</remarks>
internal IPublishedContentCache InnerCache { get { return _cache; } }
{ }
/// <summary>
/// Gets content identified by a route.
@@ -36,10 +26,26 @@ namespace Umbraco.Web.PublishedCache
/// <param name="route">The route</param>
/// <param name="hideTopLevelNode">A value forcing the HideTopLevelNode setting.</param>
/// <returns>The content, or null.</returns>
/// <remarks>A valid route is either a simple path eg <c>/foo/bar/nil</c> or a root node id and a path, eg <c>123/foo/bar/nil</c>.</remarks>
/// <remarks>
/// <para>A valid route is either a simple path eg <c>/foo/bar/nil</c> or a root node id and a path, eg <c>123/foo/bar/nil</c>.</para>
/// <para>Considers published or unpublished content depending on context.</para>
/// </remarks>
public IPublishedContent GetByRoute(string route, bool? hideTopLevelNode = null)
{
return _cache.GetByRoute(UmbracoContext, route, hideTopLevelNode);
return GetByRoute(UmbracoContext.InPreviewMode, route, hideTopLevelNode);
}
/// <summary>
/// Gets content identified by a route.
/// </summary>
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
/// <param name="route">The route</param>
/// <param name="hideTopLevelNode">A value forcing the HideTopLevelNode setting.</param>
/// <returns>The content, or null.</returns>
/// <remarks>A valid route is either a simple path eg <c>/foo/bar/nil</c> or a root node id and a path, eg <c>123/foo/bar/nil</c>.</remarks>
public IPublishedContent GetByRoute(bool preview, string route, bool? hideTopLevelNode = null)
{
return InnerCache.GetByRoute(UmbracoContext, preview, route, hideTopLevelNode);
}
/// <summary>
@@ -47,9 +53,22 @@ namespace Umbraco.Web.PublishedCache
/// </summary>
/// <param name="contentId">The content unique identifier.</param>
/// <returns>The route.</returns>
/// <remarks>Considers published or unpublished content depending on context.</remarks>
public string GetRouteById(int contentId)
{
return _cache.GetRouteById(UmbracoContext, contentId);
return GetRouteById(UmbracoContext.InPreviewMode, contentId);
}
/// <summary>
/// Gets the route for a content identified by its unique identifier.
/// </summary>
/// <param name="preview">A value indicating whether to consider unpublished content.</param>
/// <param name="contentId">The content unique identifier.</param>
/// <returns>The route.</returns>
/// <remarks>Considers published or unpublished content depending on context.</remarks>
public string GetRouteById(bool preview, int contentId)
{
return InnerCache.GetRouteById(UmbracoContext, preview, contentId);
}
}
}