Added GetTemplateNode and FindTemplateInTree to the IFileService

This commit is contained in:
Shannon
2013-11-13 11:05:08 +11:00
parent 6224d02989
commit c52e0cbb65
2 changed files with 42 additions and 0 deletions

View File

@@ -233,6 +233,33 @@ namespace Umbraco.Core.Services
}
}
/// <summary>
/// Returns a template as a template node which can be traversed (parent, children)
/// </summary>
/// <param name="alias"></param>
/// <returns></returns>
public TemplateNode GetTemplateNode(string alias)
{
using (var repository = _repositoryFactory.CreateTemplateRepository(_dataUowProvider.GetUnitOfWork()))
{
return repository.GetTemplateNode(alias);
}
}
/// <summary>
/// Given a template node in a tree, this will find the template node with the given alias if it is found in the hierarchy, otherwise null
/// </summary>
/// <param name="anyNode"></param>
/// <param name="alias"></param>
/// <returns></returns>
public TemplateNode FindTemplateInTree(TemplateNode anyNode, string alias)
{
using (var repository = _repositoryFactory.CreateTemplateRepository(_dataUowProvider.GetUnitOfWork()))
{
return repository.FindTemplateInTree(anyNode, alias);
}
}
/// <summary>
/// Saves a <see cref="Template"/>
/// </summary>

View File

@@ -96,6 +96,21 @@ namespace Umbraco.Core.Services
/// <returns>A <see cref="ITemplate"/> object</returns>
ITemplate GetTemplate(int id);
/// <summary>
/// Returns a template as a template node which can be traversed (parent, children)
/// </summary>
/// <param name="alias"></param>
/// <returns></returns>
TemplateNode GetTemplateNode(string alias);
/// <summary>
/// Given a template node in a tree, this will find the template node with the given alias if it is found in the hierarchy, otherwise null
/// </summary>
/// <param name="anyNode"></param>
/// <param name="alias"></param>
/// <returns></returns>
TemplateNode FindTemplateInTree(TemplateNode anyNode, string alias);
/// <summary>
/// Saves a <see cref="ITemplate"/>
/// </summary>