Class SmartSearchManager
- Namespace
- Dynamicweb.SmartSearch
- Assembly
- Dynamicweb.SmartSearch.dll
Represents smart search manager
public class SmartSearchManager
- Inheritance
-
SmartSearchManager
- Inherited Members
Methods
CompareDataFields(SmartSearchRuleField, SmartSearchRuleField)
Compare data fields for sorting
public static int CompareDataFields(SmartSearchRuleField x, SmartSearchRuleField y)
Parameters
x
SmartSearchRuleField- The first object to compare
y
SmartSearchRuleField- The second object to compare
Returns
DeleteSmartSearch(Guid)
Deletes the smart search.
public static void DeleteSmartSearch(Guid id)
Parameters
id
Guid- The ID.
GetAllDataProvidersInfo(bool)
Gets all data providers info.
public static Dictionary<string, string> GetAllDataProvidersInfo(bool isAutoTranslate = true)
Parameters
isAutoTranslate
bool- if set to
true
is auto translate.
Returns
GetAllSmartSearches(bool, int)
Gets all smart searches.
public static SmartSearchCollection GetAllSmartSearches(bool hidden = false, int userId = -1)
Parameters
Returns
GetDataProviderDescription(string)
Gets the data provider description.
public static string GetDataProviderDescription(string providerTypeName)
Parameters
providerTypeName
string- Name of the provider type.
Returns
GetDataProviderInstance<T>(string)
Gets the data provider instance.
public static SmartSearchDataProvider<T> GetDataProviderInstance<T>(string providerTypeName) where T : class
Parameters
providerTypeName
string- Name of the provider type.
Returns
Type Parameters
T
GetDataProviderInstanceObject(string)
Gets the data provider instance object.
public static object GetDataProviderInstanceObject(string providerTypeName)
Parameters
providerTypeName
string- Name of the provider type.
Returns
GetRulesConditionOptions(string)
Get the conditions for the provider
public static List<SmartSearchOperator> GetRulesConditionOptions(string dataProviderTypeName)
Parameters
dataProviderTypeName
string- Data provider type name
Returns
GetSmartSearchById(Guid)
Gets the smart search by id.
public static SmartSearch GetSmartSearchById(Guid id)
Parameters
id
Guid- The smart search ID.
Returns
GetSmartSearchesByDataProvider(string, bool, int)
Gets the smart searches by data provider.
public static SmartSearchCollection GetSmartSearchesByDataProvider(string dataProviderName, bool hidden = false, int userId = -1)
Parameters
dataProviderName
string- Name of the data provider.
hidden
bool- if set to
true
returns hidden smart searches. userId
int- The user ID.
Returns
GetSmartSearchFileName(SmartSearch)
Gets the name of the smart search file.
public static string GetSmartSearchFileName(SmartSearch smartSearch)
Parameters
smartSearch
SmartSearch- The smart search.
Returns
GetSmartSearchFileName(string)
Gets the name of the smart search file.
public static string GetSmartSearchFileName(string smartSearchName)
Parameters
smartSearchName
string- Name of the smart search.
Returns
GetSortingDataFields(string)
Get data fields for sorting
public static List<SmartSearchRuleField> GetSortingDataFields(string dataProviderTypeName)
Parameters
dataProviderTypeName
string- Data provider type name
Returns
GetUserProviderType()
Gets the type of the user provider.
public static Type GetUserProviderType()
Returns
InitCaches()
Initialize the caches for smart searches and data providers
public static void InitCaches()
IsUniqueSmartSearchFile(SmartSearch)
Determines whether is unique smart search file.
public static bool IsUniqueSmartSearchFile(SmartSearch smartSearch)
Parameters
smartSearch
SmartSearch- The smart search.
Returns
- bool
true
is unique smart search file otherwise,false
.
IsUniqueSmartSearchFile(SmartSearch, string)
Determines whether is unique smart search file.
public static bool IsUniqueSmartSearchFile(SmartSearch smartSearch, string folderPath)
Parameters
smartSearch
SmartSearch- The smart search.
folderPath
string- The path to the folder to look, relative to the provider folder
Returns
- bool
true
is unique smart search file otherwise,false
.
RemoveIllegalCharacters(string)
Removes illegal characters.
public static string RemoveIllegalCharacters(string fileName)
Parameters
fileName
string- Name of the file.
Returns
SaveSmartSearch(SmartSearch)
Saves the smart search.
public static void SaveSmartSearch(SmartSearch smartSearch)
Parameters
smartSearch
SmartSearch- The smart search instance.
SaveSmartSearch(SmartSearch, string)
Saves the smart search.
public static void SaveSmartSearch(SmartSearch smartSearch, string path)
Parameters
smartSearch
SmartSearch- The smart search instance.
path
string- The path