2010-01-20 01:19:16 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using Orchard.Core.Common.Models;
|
2010-01-15 23:44:22 +00:00
|
|
|
|
|
|
|
|
|
namespace Orchard.Core.Common.Services {
|
|
|
|
|
public interface IRoutableService : IDependency {
|
2010-01-20 01:19:16 +00:00
|
|
|
|
void FillSlug<TModel>(TModel model) where TModel : RoutableAspect;
|
|
|
|
|
void FillSlug<TModel>(TModel model, Func<string, string> generateSlug) where TModel : RoutableAspect;
|
2010-01-15 23:44:22 +00:00
|
|
|
|
string GenerateUniqueSlug(string slugCandidate, IEnumerable<string> existingSlugs);
|
2010-04-20 16:09:13 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns any content item of the specified content type with similar slugs
|
|
|
|
|
/// </summary>
|
2010-05-13 13:01:58 -07:00
|
|
|
|
IEnumerable<RoutableAspect> GetSimilarSlugs(string contentType, string slug);
|
2010-04-20 16:09:13 -07:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Validates the given slug
|
|
|
|
|
/// </summary>
|
|
|
|
|
bool IsSlugValid(string slug);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Defines the slug of a RoutableAspect and validate its unicity
|
|
|
|
|
/// </summary>
|
2010-04-20 17:59:09 -07:00
|
|
|
|
/// <returns>True if the slug has been created, False if a conflict occured</returns>
|
|
|
|
|
bool ProcessSlug(RoutableAspect part);
|
2010-04-20 16:09:13 -07:00
|
|
|
|
|
2010-01-15 23:44:22 +00:00
|
|
|
|
}
|
|
|
|
|
}
|