Class SmartSearchManager
- Namespace
- Dynamicweb.SmartSearch
- Assembly
- Dynamicweb.Core.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
SmartSearchRuleFieldThe first object to compare
y
SmartSearchRuleFieldThe second object to compare
Returns
DeleteSmartSearch(Guid)
Deletes the smart search.
public static void DeleteSmartSearch(Guid id)
Parameters
id
GuidThe ID.
GetAllDataProvidersInfo(bool)
Gets all data providers info.
public static Dictionary<string, string> GetAllDataProvidersInfo(bool isAutoTranslate = true)
Parameters
isAutoTranslate
boolif 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
stringName of the provider type.
Returns
GetDataProviderInstanceObject(string)
Gets the data provider instance object.
public static object? GetDataProviderInstanceObject(string providerTypeName)
Parameters
providerTypeName
stringName 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
stringName of the provider type.
Returns
Type Parameters
T
GetDefaultConditionOptions(SmartSearchRuleControlType)
Get default operators for control type
public static List<SmartSearchRuleOperator> GetDefaultConditionOptions(SmartSearchRuleControlType controlType)
Parameters
controlType
SmartSearchRuleControlTypeThe control type
Returns
GetRulesConditionOptions(string)
Get the conditions for the provider
public static List<SmartSearchOperator> GetRulesConditionOptions(string dataProviderTypeName)
Parameters
dataProviderTypeName
stringData provider type name
Returns
GetRulesDataField(string, string)
Get the rules data field for the provider by id
public static SmartSearchRuleField? GetRulesDataField(string dataProviderTypeName, string fieldId)
Parameters
Returns
GetRulesDataFields(string)
Get the rules data fields for the provider
public static List<SmartSearchRuleField> GetRulesDataFields(string dataProviderTypeName)
Parameters
dataProviderTypeName
stringData provider type name
Returns
GetSmartSearchById(Guid)
Gets the smart search by id.
public static SmartSearch? GetSmartSearchById(Guid id)
Parameters
id
GuidThe smart search ID.
Returns
GetSmartSearchFileName(SmartSearch)
Gets the name of the smart search file.
public static string GetSmartSearchFileName(SmartSearch smartSearch)
Parameters
smartSearch
SmartSearchThe smart search.
Returns
GetSmartSearchFileName(string)
Gets the name of the smart search file.
public static string GetSmartSearchFileName(string smartSearchName)
Parameters
smartSearchName
stringName of the smart search.
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
stringName of the data provider.
hidden
boolif set to
true
returns hidden smart searches.userId
intThe user ID.
Returns
GetSortingDataFields(string)
Get data fields for sorting
public static List<SmartSearchRuleField> GetSortingDataFields(string dataProviderTypeName)
Parameters
dataProviderTypeName
stringData 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
SmartSearchThe 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
SmartSearchThe smart search.
folderPath
stringThe 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
stringName of the file.
Returns
SaveSmartSearch(SmartSearch)
Saves the smart search.
public static void SaveSmartSearch(SmartSearch smartSearch)
Parameters
smartSearch
SmartSearchThe smart search instance.
SaveSmartSearch(SmartSearch, string)
Saves the smart search.
public static void SaveSmartSearch(SmartSearch smartSearch, string path)
Parameters
smartSearch
SmartSearchThe smart search instance.
path
stringThe path