Merge branch '6.2.0' of https://github.com/umbraco/Umbraco-CMS into 6.2.0

This commit is contained in:
Shannon
2014-05-01 11:36:33 +10:00
33 changed files with 107 additions and 155 deletions

View File

@@ -11,7 +11,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
class PublishedFragment : PublishedContentBase
{
private readonly PublishedContentType _contentType;
private readonly IPublishedProperty[] _properties;
private readonly IPublishedContentProperty[] _properties;
public PublishedFragment(string contentTypeAlias, IDictionary<string, object> dataValues,
bool isPreviewing, bool managed)
@@ -35,7 +35,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
? new PublishedFragmentProperty(x, this, dataValue)
: new PublishedFragmentProperty(x, this);
})
.Cast<IPublishedProperty>()
.Cast<IPublishedContentProperty>()
.ToArray();
}
@@ -142,12 +142,12 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
get { throw new NotImplementedException(); }
}
public override ICollection<IPublishedProperty> Properties
public override ICollection<IPublishedContentProperty> Properties
{
get { return _properties; }
}
public override IPublishedProperty GetProperty(string alias)
public override IPublishedContentProperty GetProperty(string alias)
{
return _properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias));
}

View File

@@ -323,7 +323,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
/// <param name="dd"> </param>
/// <param name="alias"></param>
/// <returns></returns>
private IPublishedProperty GetProperty(DictionaryPublishedContent dd, string alias)
private IPublishedContentProperty GetProperty(DictionaryPublishedContent dd, string alias)
{
//lets check if the alias does not exist on the document.
//NOTE: Examine will not index empty values and we do not output empty XML Elements to the cache - either of these situations
@@ -468,7 +468,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
IDictionary<string, string> valueDictionary,
Func<DictionaryPublishedContent, IPublishedContent> getParent,
Func<DictionaryPublishedContent, IEnumerable<IPublishedContent>> getChildren,
Func<DictionaryPublishedContent, string, IPublishedProperty> getProperty,
Func<DictionaryPublishedContent, string, IPublishedContentProperty> getProperty,
bool fromExamine)
{
if (valueDictionary == null) throw new ArgumentNullException("valueDictionary");
@@ -507,12 +507,12 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
}, "parentID");
_contentType = PublishedContentType.Get(PublishedItemType.Media, _documentTypeAlias);
_properties = new Collection<IPublishedProperty>();
_properties = new Collection<IPublishedContentProperty>();
//loop through remaining values that haven't been applied
foreach (var i in valueDictionary.Where(x => !_keysAdded.Contains(x.Key)))
{
IPublishedProperty property;
IPublishedContentProperty property;
// must ignore that one
if (i.Key == "version" || i.Key == "isDoc") continue;
@@ -578,7 +578,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
private readonly Func<DictionaryPublishedContent, IPublishedContent> _getParent;
private readonly Func<DictionaryPublishedContent, IEnumerable<IPublishedContent>> _getChildren;
private readonly Func<DictionaryPublishedContent, string, IPublishedProperty> _getProperty;
private readonly Func<DictionaryPublishedContent, string, IPublishedContentProperty> _getProperty;
/// <summary>
/// Returns 'Media' as the item type
@@ -683,7 +683,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
get { return false; }
}
public override ICollection<IPublishedProperty> Properties
public override ICollection<IPublishedContentProperty> Properties
{
get { return _properties; }
}
@@ -693,7 +693,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
get { return _getChildren(this); }
}
public override IPublishedProperty GetProperty(string alias)
public override IPublishedContentProperty GetProperty(string alias)
{
return _getProperty(this, alias);
}
@@ -706,11 +706,11 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
// override to implement cache
// cache at context level, ie once for the whole request
// but cache is not shared by requests because we wouldn't know how to clear it
public override IPublishedProperty GetProperty(string alias, bool recurse)
public override IPublishedContentProperty GetProperty(string alias, bool recurse)
{
if (recurse == false) return GetProperty(alias);
IPublishedProperty property;
IPublishedContentProperty property;
string key = null;
var cache = UmbracoContextCache.Current;
@@ -720,7 +720,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
object o;
if (cache.TryGetValue(key, out o))
{
property = o as IPublishedProperty;
property = o as IPublishedContentProperty;
if (property == null)
throw new InvalidOperationException("Corrupted cache.");
return property;
@@ -753,7 +753,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
private DateTime _updateDate;
private Guid _version;
private int _level;
private readonly ICollection<IPublishedProperty> _properties;
private readonly ICollection<IPublishedContentProperty> _properties;
private readonly PublishedContentType _contentType;
private void ValidateAndSetProperty(IDictionary<string, string> valueDictionary, Action<string> setProperty, params string[] potentialKeys)

View File

@@ -77,7 +77,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
private DateTime _createDate;
private DateTime _updateDate;
private Guid _version;
private IPublishedProperty[] _properties;
private IPublishedContentProperty[] _properties;
private int _sortOrder;
private int _level;
private bool _isDraft;
@@ -96,7 +96,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
}
}
public override IPublishedProperty GetProperty(string alias)
public override IPublishedContentProperty GetProperty(string alias)
{
return Properties.FirstOrDefault(x => x.PropertyTypeAlias.InvariantEquals(alias));
}
@@ -104,7 +104,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
// override to implement cache
// cache at context level, ie once for the whole request
// but cache is not shared by requests because we wouldn't know how to clear it
public override IPublishedProperty GetProperty(string alias, bool recurse)
public override IPublishedContentProperty GetProperty(string alias, bool recurse)
{
if (recurse == false) return GetProperty(alias);
@@ -118,7 +118,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
if (value == null)
return null;
var property = value as IPublishedProperty;
var property = value as IPublishedContentProperty;
if (property == null)
throw new InvalidOperationException("Corrupted cache.");
@@ -310,7 +310,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
}
}
public override ICollection<IPublishedProperty> Properties
public override ICollection<IPublishedContentProperty> Properties
{
get
{
@@ -422,7 +422,7 @@ namespace Umbraco.Web.PublishedCache.XmlPublishedCache
return propertyNodes.TryGetValue(p.PropertyTypeAlias.ToLowerInvariant(), out n)
? new XmlPublishedProperty(p, _isPreviewing, n)
: new XmlPublishedProperty(p, _isPreviewing);
}).Cast<IPublishedProperty>().ToArray();
}).Cast<IPublishedContentProperty>().ToArray();
// warn: this is not thread-safe...
_initialized = true;