Updated the published content stores so that content doesn't inherit from media, instead there is a base

interface IPublishedDataStore.
Simplified the interface structure and removed the GetDocumentProperty method as it is not needed and i think existed
before we updated the codebase to not rely on xml.
This commit is contained in:
Shannon Deminick
2012-09-11 05:58:16 +07:00
parent d5ca5e32b4
commit f2a7b3b255
13 changed files with 76 additions and 100 deletions

View File

@@ -21,32 +21,6 @@ namespace Umbraco.Web
return GetUmbracoMedia(nodeId);
}
public virtual string GetDocumentProperty(UmbracoContext umbracoContext, IDocument node, string propertyAlias)
{
if (umbracoContext == null) throw new ArgumentNullException("umbracoContext");
if (node == null) throw new ArgumentNullException("node");
if (propertyAlias == null) throw new ArgumentNullException("propertyAlias");
if (propertyAlias.StartsWith("@"))
{
//if it starts with an @ then its a property of the object, not a user defined property
var propName = propertyAlias.TrimStart('@');
var prop = TypeHelper.GetProperty(typeof(IDocument), propName, true, false, false, false);
if (prop == null)
throw new ArgumentException("The property name " + propertyAlias + " was not found on type " + typeof(IDocument));
var val = prop.GetValue(node, null);
var valAsString = val == null ? "" : val.ToString();
return valAsString;
}
else
{
var prop = node.GetProperty(propertyAlias);
return prop == null ? null : Convert.ToString(prop.Value);
//var propertyNode = node.SelectSingleNode("./" + propertyAlias);
//return propertyNode == null ? null : propertyNode.InnerText;
}
}
private IDocument GetUmbracoMedia(int id)
{