Refactor OrchardException classes

All constructors now take a"LocalizedString" as the error message.

--HG--
branch : dev
This commit is contained in:
Renaud Paquay
2010-06-22 10:21:24 -07:00
parent 3725b84b20
commit 1290ea7d6e
15 changed files with 145 additions and 47 deletions

View File

@@ -10,6 +10,7 @@ using Lucene.Net.Store;
using Orchard.Environment.Configuration;
using Orchard.FileSystems.AppData;
using Orchard.Indexing.Models;
using Orchard.Localization;
using Orchard.Logging;
using System.Xml.Linq;
using Directory = Lucene.Net.Store.Directory;
@@ -29,8 +30,6 @@ namespace Orchard.Indexing.Services {
public static readonly string Settings = "Settings";
public static readonly string LastIndexUtc = "LastIndexedUtc";
public ILogger Logger { get; set; }
public LuceneIndexProvider(IAppDataFolder appDataFolder, ShellSettings shellSettings) {
_appDataFolder = appDataFolder;
_shellSettings = shellSettings;
@@ -43,8 +42,14 @@ namespace Orchard.Indexing.Services {
// Ensures the directory exists
EnsureDirectoryExists();
T = NullLocalizer.Instance;
Logger = NullLogger.Instance;
}
public Localizer T { get; set; }
public ILogger Logger { get; set; }
public static Analyzer CreateAnalyzer() {
// StandardAnalyzer does lower-case and stop-word filtering. It also removes punctuation
return new StandardAnalyzer(LuceneVersion);
@@ -189,7 +194,7 @@ namespace Orchard.Indexing.Services {
}
public IDocumentIndex New(int documentId) {
return new LuceneDocumentIndex(documentId);
return new LuceneDocumentIndex(documentId, T);
}
public ISearchBuilder CreateSearchBuilder(string indexName) {