makes SystemDirectories and SystemFiles public.

moves ResolveUrlsFromTextString to TemplateUtilities class and obsoletes other ones.
Fixes an issue if content cache is stored in codegen folder and not in med trust.
Updates the XmlDocument (IDocumentProperty) to always return a value with parsed {localLink} and resolved Urls and cache them so the parsing only happens once.
This commit is contained in:
Shannon Deminick
2012-09-29 11:11:48 +07:00
parent 11fd6553e9
commit 1aebce7ad6
13 changed files with 158 additions and 169 deletions

View File

@@ -5,6 +5,7 @@ using Umbraco.Core;
using Umbraco.Core.Configuration;
using Umbraco.Core.IO;
using Umbraco.Core.Models;
using Umbraco.Web.Templates;
namespace Umbraco.Web.Models
{
@@ -25,9 +26,27 @@ namespace Umbraco.Web.Models
get { return _alias; }
}
private string _parsedValue;
/// <summary>
/// Returns the value of a property from the XML cache
/// </summary>
/// <remarks>
/// This ensures that the result has any {localLink} syntax parsed and that urls are resolved correctly.
/// This also ensures that the parsing is only done once as the result is cached in a private field of this object.
/// </remarks>
public object Value
{
get { return IOHelper.ResolveUrlsFromTextString(_value); }
get
{
if (_parsedValue == null)
{
_parsedValue = TemplateUtilities.ResolveUrlsFromTextString(
TemplateUtilities.ParseInternalLinks(
_value));
}
return _parsedValue;
}
}
public Guid Version